winevt_c 0.3.7-x86-mingw32 → 0.3.8-x86-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: 8939d729801ab1a729c79d8f235701ed4a0c3dfdc9d7f2a1c051229e02427e6d
4
- data.tar.gz: 258be227456979bf0c7a571242224fa4b9f09c453cc1b8057861300432e9bd9c
3
+ metadata.gz: 1d1fff06b7a5fa0dfc30df81e3fad4e3a7ade856422579b1ac2ae63872598031
4
+ data.tar.gz: c9f526dcd65016aacf6983a556c11bc0c87832e55f15c87be8c9f1df5d14c047
5
5
  SHA512:
6
- metadata.gz: '02779f97d3417bd3f290cb3fe9bafc03ec81d8a14f5594f540c644819e9e000edb2dfd6367d404cbe6a08024b8806d95a396a55642f1a223107dd0f29d321324'
7
- data.tar.gz: 98c1b97da39a08b358e92444da64ceba18b2ce3019e387ff37dd873ca46ec36077b895dcfcd297bb52a3f6aa38b744c9c3b95530786d4fda5feae4d9a4faa3e1
6
+ metadata.gz: ce8e76d3bd5904bf0bebfc3023e92f68cb590351d43a7b890446422bc528a20c477e510dbf001afed6801efaa8cf624213c30f9d6d43845e14d0c1628322ef8c
7
+ data.tar.gz: 80edef433c9fa088c308393debded4cf18a494bcf655be508bc4650b75e1ac960dc6fbfd0aba2870c8405e6515ac03a12c1244e297dea9a4ad22d6fae2844829
@@ -18,9 +18,7 @@ char* render_event(EVT_HANDLE handle, DWORD flags)
18
18
  PWSTR buffer = NULL;
19
19
  ULONG bufferSize = 0;
20
20
  ULONG bufferSizeNeeded = 0;
21
- EVT_HANDLE event;
22
21
  ULONG status, count;
23
- char* errBuf;
24
22
  char* result;
25
23
  LPTSTR msgBuf;
26
24
 
@@ -286,13 +284,12 @@ char* get_description(EVT_HANDLE handle)
286
284
  WCHAR descriptionBuffer[MAX_BUFFER];
287
285
  ULONG bufferSize = 0;
288
286
  ULONG bufferSizeNeeded = 0;
289
- EVT_HANDLE event;
290
287
  ULONG status, count;
291
288
  char* result = "";
292
289
  LPTSTR msgBuf = "";
293
290
  EVT_HANDLE hMetadata = NULL;
294
291
  PEVT_VARIANT values = NULL;
295
- PWSTR pwBuffer = NULL;
292
+ LPVOID lpMsgBuf;
296
293
 
297
294
  static PCWSTR eventProperties[] = {L"Event/System/Provider/@Name"};
298
295
  EVT_HANDLE renderContext = EvtCreateRenderContext(1, eventProperties, EvtRenderContextValues);
@@ -348,8 +345,27 @@ char* get_description(EVT_HANDLE handle)
348
345
  case ERROR_EVT_MESSAGE_LOCALE_NOT_FOUND:
349
346
  case ERROR_RESOURCE_LANG_NOT_FOUND:
350
347
  case ERROR_MUI_FILE_NOT_FOUND:
351
- case ERROR_EVT_UNRESOLVED_PARAMETER_INSERT:
352
- return "";
348
+ case ERROR_EVT_UNRESOLVED_PARAMETER_INSERT: {
349
+ if (FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
350
+ FORMAT_MESSAGE_FROM_SYSTEM |
351
+ FORMAT_MESSAGE_IGNORE_INSERTS,
352
+ NULL,
353
+ status,
354
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
355
+ (WCHAR *) &lpMsgBuf, 0, NULL) == 0)
356
+ FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
357
+ FORMAT_MESSAGE_FROM_SYSTEM |
358
+ FORMAT_MESSAGE_IGNORE_INSERTS,
359
+ NULL,
360
+ status,
361
+ MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
362
+ (WCHAR *) &lpMsgBuf, 0, NULL);
363
+
364
+ result = wstr_to_mbstr(CP_UTF8, (WCHAR *)lpMsgBuf, -1);
365
+
366
+ goto cleanup;
367
+ }
368
+
353
369
  }
354
370
 
355
371
  if (status != ERROR_INSUFFICIENT_BUFFER)
@@ -370,7 +386,24 @@ char* get_description(EVT_HANDLE handle)
370
386
  case ERROR_RESOURCE_LANG_NOT_FOUND:
371
387
  case ERROR_MUI_FILE_NOT_FOUND:
372
388
  case ERROR_EVT_UNRESOLVED_PARAMETER_INSERT:
373
- return "";
389
+ if (FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
390
+ FORMAT_MESSAGE_FROM_SYSTEM |
391
+ FORMAT_MESSAGE_IGNORE_INSERTS,
392
+ NULL,
393
+ status,
394
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
395
+ (WCHAR *) &lpMsgBuf, 0, NULL) == 0)
396
+ FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
397
+ FORMAT_MESSAGE_FROM_SYSTEM |
398
+ FORMAT_MESSAGE_IGNORE_INSERTS,
399
+ NULL,
400
+ status,
401
+ MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
402
+ (WCHAR *) &lpMsgBuf, 0, NULL);
403
+
404
+ result = wstr_to_mbstr(CP_UTF8, (WCHAR *)lpMsgBuf, -1);
405
+
406
+ goto cleanup;
374
407
  }
375
408
 
376
409
  rb_raise(rb_eWinevtQueryError, "ErrorCode: %d", status);
Binary file
Binary file
Binary file
@@ -1,3 +1,3 @@
1
1
  module Winevt
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
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.3.7
4
+ version: 0.3.8
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-26 00:00:00.000000000 Z
11
+ date: 2019-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler