winevt_c 0.3.2-x64-mingw32 → 0.3.3-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 796d07047951ecc8f038dfec2db2bf970da7f8a4f63b6ca9c0c01136fb5cb4cf
4
- data.tar.gz: bad21f43be67c17e8b54721ecb34cfd6c00cd4b51c0f81cf84c5596829931c72
3
+ metadata.gz: d4b225fc8a72ae39edff6f2f16b965a1dd5dcabea9e1410a70db49e2260cd761
4
+ data.tar.gz: 45a7b724b53c3e1c5e13d78b45ec518382a6dad813abfa323783bcb8cff2434e
5
5
  SHA512:
6
- metadata.gz: e15c6bb8b48c107e6534f4d727331ae020aa431cb8f4264bd47dc6455dad37dd9ce658f0a1f1b0314a9f46d46c3b7e2d1562d5d3f6df6b62f184cc25c082b0a0
7
- data.tar.gz: ecc10d8c811200216058dc6072fd43920aafd98903b5d60203a0240531908ca65cb7445e564a94890ca3f9022da9c4722299aea0e27cced890e6f5ab57513164
6
+ metadata.gz: f6fdb7e8d26a4be2b855912d683da673a015374665c0aa567cb3ab8146c20339ed121d4999ef0936938c777187961d06d7fb2bb92cb936f2bd8779f9ff3af513
7
+ data.tar.gz: f4ecd13bc667dfbd7066dc7ecfdfebfdb11a6e01660c2a07bd9b9b5086e8155d85ff9e54920d92be386261bc82069b6eaf4091c8e2e2d76cec7f9cf4b405e5fe
@@ -134,6 +134,9 @@ VALUE get_values(EVT_HANDLE handle)
134
134
 
135
135
  for (int i = 0; i < propCount; i++) {
136
136
  switch (pRenderedValues[i].Type) {
137
+ case EvtVarTypeNull:
138
+ rb_ary_push(userValues, Qnil);
139
+ break;
137
140
  case EvtVarTypeString:
138
141
  if (pRenderedValues[i].StringVal == NULL) {
139
142
  rb_ary_push(userValues, rb_utf8_str_new_cstr("(NULL)"));
@@ -193,16 +196,6 @@ VALUE get_values(EVT_HANDLE handle)
193
196
  result = pRenderedValues[i].BooleanVal ? "true" : "false";
194
197
  rb_ary_push(userValues, rb_utf8_str_new_cstr(result));
195
198
  break;
196
- case EvtVarTypeHexInt32:
197
- rbObj = ULONG2NUM(pRenderedValues[i].UInt32Val);
198
- rbObj = rb_sprintf("%#x", rbObj);
199
- rb_ary_push(userValues, rbObj);
200
- break;
201
- case EvtVarTypeHexInt64:
202
- rbObj = ULONG2NUM(pRenderedValues[i].UInt64Val);
203
- rbObj = rb_sprintf("%#x", rbObj);
204
- rb_ary_push(userValues, rbObj);
205
- break;
206
199
  case EvtVarTypeGuid:
207
200
  if (pRenderedValues[i].GuidVal != NULL) {
208
201
  StringFromCLSID(pRenderedValues[i].GuidVal, &tmpWChar);
@@ -212,13 +205,9 @@ VALUE get_values(EVT_HANDLE handle)
212
205
  rb_ary_push(userValues, rb_utf8_str_new_cstr("?"));
213
206
  }
214
207
  break;
215
- case EvtVarTypeSid:
216
- if (ConvertSidToStringSidW(pRenderedValues[i].SidVal, &tmpWChar)) {
217
- result = wstr_to_mbstr(CP_UTF8, tmpWChar, -1);
218
- rb_ary_push(userValues, rb_utf8_str_new_cstr(result));
219
- } else {
220
- rb_ary_push(userValues, rb_utf8_str_new_cstr("?"));
221
- }
208
+ case EvtVarTypeSizeT:
209
+ rbObj = SIZET2NUM(pRenderedValues[i].SizeTVal);
210
+ rb_ary_push(userValues, rbObj);
222
211
  break;
223
212
  case EvtVarTypeFileTime:
224
213
  timestamp.QuadPart = pRenderedValues[i].FileTimeVal;
@@ -234,6 +223,44 @@ VALUE get_values(EVT_HANDLE handle)
234
223
  rb_ary_push(userValues, rb_utf8_str_new_cstr("?"));
235
224
  }
236
225
  break;
226
+ case EvtVarTypeSysTime:
227
+ if (pRenderedValues[i].SysTimeVal != NULL) {
228
+ st = *pRenderedValues[i].SysTimeVal;
229
+ sprintf(strTime, "%04d-%02d-%02d %02d:%02d:%02d.%dZ",
230
+ st.wYear , st.wMonth , st.wDay ,
231
+ st.wHour , st.wMinute , st.wSecond,
232
+ st.wMilliseconds);
233
+ rb_ary_push(userValues, rb_utf8_str_new_cstr(strTime));
234
+ } else {
235
+ rb_ary_push(userValues, rb_utf8_str_new_cstr("?"));
236
+ }
237
+ break;
238
+ case EvtVarTypeSid:
239
+ if (ConvertSidToStringSidW(pRenderedValues[i].SidVal, &tmpWChar)) {
240
+ result = wstr_to_mbstr(CP_UTF8, tmpWChar, -1);
241
+ rb_ary_push(userValues, rb_utf8_str_new_cstr(result));
242
+ } else {
243
+ rb_ary_push(userValues, rb_utf8_str_new_cstr("?"));
244
+ }
245
+ break;
246
+ case EvtVarTypeHexInt32:
247
+ rbObj = ULONG2NUM(pRenderedValues[i].UInt32Val);
248
+ rbObj = rb_sprintf("%#x", rbObj);
249
+ rb_ary_push(userValues, rbObj);
250
+ break;
251
+ case EvtVarTypeHexInt64:
252
+ rbObj = ULONG2NUM(pRenderedValues[i].UInt64Val);
253
+ rbObj = rb_sprintf("%#x", rbObj);
254
+ rb_ary_push(userValues, rbObj);
255
+ break;
256
+ case EvtVarTypeEvtXml:
257
+ if (pRenderedValues[i].XmlVal == NULL) {
258
+ rb_ary_push(userValues, rb_utf8_str_new_cstr("(NULL)"));
259
+ } else {
260
+ result = wstr_to_mbstr(CP_UTF8, pRenderedValues[i].XmlVal, -1);
261
+ rb_ary_push(userValues, rb_utf8_str_new_cstr(result));
262
+ }
263
+ break;
237
264
  default:
238
265
  rb_ary_push(userValues, rb_utf8_str_new_cstr("?"));
239
266
  break;
Binary file
Binary file
Binary file
data/lib/winevt/query.rb CHANGED
@@ -4,9 +4,9 @@ module Winevt
4
4
  alias_method :each_raw, :each
5
5
  def each
6
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)
7
+ placeholdered_message = message.gsub(/(%\d+)/, '\1$s')
8
+ replaced_message = sprintf(placeholdered_message, *string_inserts) rescue message.gsub(/(%\d+)/, "?")
9
+ yield(xml, replaced_message, string_inserts)
10
10
  end
11
11
  end
12
12
  end
@@ -4,9 +4,9 @@ module Winevt
4
4
  alias_method :each_raw, :each
5
5
  def each
6
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)
7
+ placeholdered_message = message.gsub(/(%\d+)/, '\1$s')
8
+ replaced_message = sprintf(placeholdered_message, *string_inserts) rescue message.gsub(/(%\d+)/, "?")
9
+ yield(xml, replaced_message, string_inserts)
10
10
  end
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module Winevt
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
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.2
4
+ version: 0.3.3
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Hiroshi Hatake