winevt_c 0.1.0-x86-mingw32 → 0.1.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/ext/winevt/winevt.c +20 -12
- data/lib/winevt/2.4/winevt.so +0 -0
- data/lib/winevt/2.5/winevt.so +0 -0
- data/lib/winevt/2.6/winevt.so +0 -0
- data/lib/winevt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b6b5aad981795315f2447d7a3059ea6b8aa36cf876e928eeb48f8ac07359fae
|
4
|
+
data.tar.gz: 74b530f1abc6a1dd7c5bf8d92589c440a36edbeebefc91867e9ced2043032830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b164bd8437b99a30da71c6b9b30daf702dfee0bb661c217761dc29212af75b8abf5f21489d48460585d6d57cfc92443ca92e45a8e4713452a74418572080b7f7
|
7
|
+
data.tar.gz: '049978f7001c998f7bb4447ab7b677c916cc12dc0be5420da5f6c98b8620af016295049eb7e2ff11042f1fd923a7d1691d52de52dc9e62468c17fae875f961af'
|
data/README.md
CHANGED
data/ext/winevt/winevt.c
CHANGED
@@ -32,7 +32,7 @@ static void subscribe_free(void *ptr);
|
|
32
32
|
static void query_free(void *ptr);
|
33
33
|
static void bookmark_free(void *ptr);
|
34
34
|
static char* render_event(EVT_HANDLE handle, DWORD flags);
|
35
|
-
static
|
35
|
+
static char* wstr_to_mbstr(UINT cp, const WCHAR *wstr, int clen);
|
36
36
|
|
37
37
|
static const rb_data_type_t rb_winevt_channel_type = {
|
38
38
|
"winevt/channel", {
|
@@ -128,7 +128,6 @@ rb_winevt_channel_each(VALUE self)
|
|
128
128
|
DWORD bufferSize = 0;
|
129
129
|
DWORD bufferUsed = 0;
|
130
130
|
DWORD status = ERROR_SUCCESS;
|
131
|
-
ULONG len;
|
132
131
|
|
133
132
|
RETURN_ENUMERATOR(self, 0, 0);
|
134
133
|
|
@@ -166,9 +165,7 @@ rb_winevt_channel_each(VALUE self)
|
|
166
165
|
}
|
167
166
|
}
|
168
167
|
|
169
|
-
|
170
|
-
if (!(result = malloc(len))) return "";
|
171
|
-
WideCharToMultiByte(CP_UTF8, 0, buffer, -1, result, len, NULL, NULL);
|
168
|
+
result = wstr_to_mbstr(CP_UTF8, buffer, -1);
|
172
169
|
|
173
170
|
rb_yield(rb_str_new2(result));
|
174
171
|
}
|
@@ -176,6 +173,18 @@ rb_winevt_channel_each(VALUE self)
|
|
176
173
|
return Qnil;
|
177
174
|
}
|
178
175
|
|
176
|
+
static char *
|
177
|
+
wstr_to_mbstr(UINT cp, const WCHAR *wstr, int clen)
|
178
|
+
{
|
179
|
+
char *ptr;
|
180
|
+
int len = WideCharToMultiByte(cp, 0, wstr, clen, NULL, 0, NULL, NULL);
|
181
|
+
if (!(ptr = malloc(len))) return 0;
|
182
|
+
WideCharToMultiByte(cp, 0, wstr, clen, ptr, len, NULL, NULL);
|
183
|
+
|
184
|
+
return ptr;
|
185
|
+
}
|
186
|
+
|
187
|
+
|
179
188
|
static void
|
180
189
|
subscribe_free(void *ptr)
|
181
190
|
{
|
@@ -568,7 +577,7 @@ static char* render_event(EVT_HANDLE handle, DWORD flags)
|
|
568
577
|
ULONG bufferSize = 0;
|
569
578
|
ULONG bufferSizeNeeded = 0;
|
570
579
|
EVT_HANDLE event;
|
571
|
-
ULONG
|
580
|
+
ULONG status, count;
|
572
581
|
char* errBuf;
|
573
582
|
char* result;
|
574
583
|
LPTSTR msgBuf;
|
@@ -607,16 +616,15 @@ static char* render_event(EVT_HANDLE handle, DWORD flags)
|
|
607
616
|
NULL, status,
|
608
617
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
609
618
|
&msgBuf, 0, NULL);
|
610
|
-
|
611
|
-
if (!(result = malloc(len))) return "";
|
612
|
-
WideCharToMultiByte(CP_UTF8, 0, msgBuf, -1, result, len, NULL, NULL);
|
619
|
+
result = wstr_to_mbstr(CP_ACP, msgBuf, -1);
|
613
620
|
|
614
621
|
rb_raise(rb_eWinevtQueryError, "ErrorCode: %d\nError: %s\n", status, result);
|
615
622
|
}
|
616
623
|
|
617
|
-
|
618
|
-
|
619
|
-
|
624
|
+
result = wstr_to_mbstr(CP_UTF8, buffer, -1);
|
625
|
+
|
626
|
+
if (buffer)
|
627
|
+
free(buffer);
|
620
628
|
|
621
629
|
return result;
|
622
630
|
}
|
data/lib/winevt/2.4/winevt.so
CHANGED
Binary file
|
data/lib/winevt/2.5/winevt.so
CHANGED
Binary file
|
data/lib/winevt/2.6/winevt.so
CHANGED
Binary file
|
data/lib/winevt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: winevt_c
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|