winevt_c 0.3.0-x64-mingw32 → 0.3.1-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/winevt/winevt_c.h +1 -1
- data/ext/winevt/winevt_subscribe.c +1 -1
- data/ext/winevt/winevt_utils.c +6 -9
- 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/query.rb +8 -0
- data/lib/winevt/subscribe.rb +14 -0
- data/lib/winevt/version.rb +1 -1
- data/lib/winevt.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae7b5925121a5db5f4ab4d875ffe914c5cf55a042812b92f144662bdbfb06d71
|
4
|
+
data.tar.gz: 1771d4a956c5865adb8268314748138055f4e28e4c80b3a7cb1d7e0d4aaee741
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fba2b5c8806e5aac8dc0cc3fd2810cce5922f451331ccfa39d38850375c5392eb39f382681d938fbaede35d0a895cbc8dfa1f61982ff75abe6a671823442dad
|
7
|
+
data.tar.gz: af7c0f3bbb32df42d02b447561fdf73202d96351a16a845ef755e8c5178e8aa3f6dc02e09cc213fd9b81f17697f373dcececa520110059c57d10430aff74e0f4
|
data/ext/winevt/winevt_c.h
CHANGED
@@ -69,7 +69,7 @@ rb_winevt_subscribe_tail_p(VALUE self, VALUE rb_flag)
|
|
69
69
|
}
|
70
70
|
|
71
71
|
static VALUE
|
72
|
-
rb_winevt_subscribe_subscribe(int argc, VALUE argv, VALUE self)
|
72
|
+
rb_winevt_subscribe_subscribe(int argc, VALUE *argv, VALUE self)
|
73
73
|
{
|
74
74
|
VALUE rb_path, rb_query, rb_bookmark;
|
75
75
|
EVT_HANDLE hSubscription = NULL, hBookmark = NULL;
|
data/ext/winevt/winevt_utils.c
CHANGED
@@ -57,10 +57,9 @@ char* render_event(EVT_HANDLE handle, DWORD flags)
|
|
57
57
|
FORMAT_MESSAGE_IGNORE_INSERTS,
|
58
58
|
NULL, status,
|
59
59
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
60
|
-
|
61
|
-
result = wstr_to_mbstr(CP_ACP, msgBuf, -1);
|
60
|
+
msgBuf, 0, NULL);
|
62
61
|
|
63
|
-
rb_raise(rb_eWinevtQueryError, "ErrorCode: %d\nError: %s\n", status,
|
62
|
+
rb_raise(rb_eWinevtQueryError, "ErrorCode: %d\nError: %s\n", status, msgBuf);
|
64
63
|
}
|
65
64
|
|
66
65
|
result = wstr_to_mbstr(CP_UTF8, buffer, -1);
|
@@ -121,10 +120,9 @@ VALUE get_values(EVT_HANDLE handle)
|
|
121
120
|
FORMAT_MESSAGE_IGNORE_INSERTS,
|
122
121
|
NULL, status,
|
123
122
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
124
|
-
|
125
|
-
result = wstr_to_mbstr(CP_ACP, msgBuf, -1);
|
123
|
+
msgBuf, 0, NULL);
|
126
124
|
|
127
|
-
rb_raise(rb_eWinevtQueryError, "ErrorCode: %d\nError: %s\n", status,
|
125
|
+
rb_raise(rb_eWinevtQueryError, "ErrorCode: %d\nError: %s\n", status, msgBuf);
|
128
126
|
}
|
129
127
|
|
130
128
|
PEVT_VARIANT pRenderedValues = (PEVT_VARIANT)buffer;
|
@@ -295,10 +293,9 @@ char* get_description(EVT_HANDLE handle)
|
|
295
293
|
FORMAT_MESSAGE_IGNORE_INSERTS,
|
296
294
|
NULL, status,
|
297
295
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
298
|
-
|
299
|
-
result = wstr_to_mbstr(CP_ACP, msgBuf, -1);
|
296
|
+
msgBuf, 0, NULL);
|
300
297
|
|
301
|
-
rb_raise(rb_eWinevtQueryError, "ErrorCode: %d\nError: %s\n", status,
|
298
|
+
rb_raise(rb_eWinevtQueryError, "ErrorCode: %d\nError: %s\n", status, msgBuf);
|
302
299
|
}
|
303
300
|
|
304
301
|
// Obtain buffer as EVT_VARIANT pointer. To avoid ErrorCide 87 in EvtRender.
|
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/query.rb
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
module Winevt
|
2
2
|
class EventLog
|
3
3
|
class Query
|
4
|
+
alias_method :each_raw, :each
|
5
|
+
def each
|
6
|
+
each_raw do |xml, message, string_inserts|
|
7
|
+
message = message.gsub(/(%\d+)/, '\1$s')
|
8
|
+
message = sprintf(message, *string_inserts) rescue message.gsub(/(%\d+)/, "?")
|
9
|
+
yield(xml, message, string_inserts)
|
10
|
+
end
|
11
|
+
end
|
4
12
|
end
|
5
13
|
end
|
6
14
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Winevt
|
2
|
+
class EventLog
|
3
|
+
class Subscribe
|
4
|
+
alias_method :each_raw, :each
|
5
|
+
def each
|
6
|
+
each_raw do |xml, message, string_inserts|
|
7
|
+
message = message.gsub(/(%\d+)/, '\1$s')
|
8
|
+
message = sprintf(message, *string_inserts) rescue message.gsub(/(%\d+)/, "?")
|
9
|
+
yield(xml, message, string_inserts)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/winevt/version.rb
CHANGED
data/lib/winevt.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: winevt_c
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- lib/winevt/2.5/winevt.so
|
118
118
|
- lib/winevt/2.6/winevt.so
|
119
119
|
- lib/winevt/query.rb
|
120
|
+
- lib/winevt/subscribe.rb
|
120
121
|
- lib/winevt/version.rb
|
121
122
|
- winevt_c.gemspec
|
122
123
|
homepage: https://github.com/cosmo0920/winevt_c
|