winevt_c 0.11.2 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1bd74653021fdb2b8c8ad8b55db339684b7d67bbfebac0bcf10389ff5244ac8
4
- data.tar.gz: b285469c152002ff14dbccb2fefe5e1e8e78ebcb9b939813f8488b4dca258f50
3
+ metadata.gz: bc1b47b4841d2235e4c5629465b47b3eb7c088a6af6c74dfc95dc3962b5dc723
4
+ data.tar.gz: ab99b355b4f111cdfb048106b89f0d9faa649334a816a6b9d850d47c53bf33a5
5
5
  SHA512:
6
- metadata.gz: a97aff89384dc6d98e69851387c236ba933858226bb6aa3e090ad2e874a3733bfd896b7da7508fa159afff6528832c8c772eff16c4f63b55ee4db41928df98c0
7
- data.tar.gz: e9fcd3b436c362d82468f39a4492434792ad2afd59e1ac8b44fc43051d5ebc3554e61489af728984098f89f8fa6b91cc239b8953240910afdf5a0a686d751c45
6
+ metadata.gz: 462bd61a7303bd104bb21162ed074aad9ecce63b7bbfca37d8d5ec66c9f05ed85a326a3408df3b38255782fea782d86590de660b61ca542bed27982d0a5c5bb3
7
+ data.tar.gz: 6091742c0526d238a1e79c35672b3c52775927224bb318c2b9dea13546e5a5e25b1637e2c97dcb09831ea8284ffc026e9c5d88846190194b5048aab37767a16a
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: 'github-actions'
4
+ directory: '/'
5
+ schedule:
6
+ interval: 'monthly'
@@ -1,18 +1,30 @@
1
1
  name: Test
2
2
  on:
3
- - push
4
- - pull_request
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ branches: [master]
7
+ schedule:
8
+ - cron: '0 0 1 * *'
5
9
  jobs:
10
+ ruby-versions:
11
+ uses: ruby/actions/.github/workflows/ruby_versions.yml@master
12
+ with:
13
+ engine: cruby
14
+ min_version: 3.1
6
15
  build:
16
+ needs: ruby-versions
7
17
  runs-on: 'windows-latest'
8
18
  strategy:
9
19
  fail-fast: false
10
20
  matrix:
11
- ruby: [ '3.1', '3.2', '3.3', '3.4' ]
21
+ ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
22
+ exclude:
23
+ - ruby: head
12
24
  name: Ruby ${{ matrix.ruby }}
13
25
  steps:
14
- - uses: actions/checkout@v4
15
- - uses: ruby/setup-ruby@v1
26
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27
+ - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
16
28
  with:
17
29
  ruby-version: ${{ matrix.ruby }}
18
30
  - name: Run tests
@@ -119,6 +119,9 @@ rb_winevt_query_initialize(VALUE argc, VALUE *argv, VALUE self)
119
119
  flags = EvtQueryChannelPath | EvtQueryTolerateQueryErrors;
120
120
  break;
121
121
  default:
122
+ if (hRemoteHandle != NULL) {
123
+ EvtClose(hRemoteHandle);
124
+ }
122
125
  rb_raise(rb_eArgError, "Expected a String, a Symbol, a Fixnum, or a NilClass instance");
123
126
  }
124
127
 
@@ -142,6 +145,9 @@ rb_winevt_query_initialize(VALUE argc, VALUE *argv, VALUE self)
142
145
  hRemoteHandle, evtChannel, evtXPath, flags);
143
146
  err = GetLastError();
144
147
  if (err != ERROR_SUCCESS) {
148
+ if (hRemoteHandle != NULL) {
149
+ EvtClose(hRemoteHandle);
150
+ }
145
151
  if (err == ERROR_EVT_CHANNEL_NOT_FOUND) {
146
152
  raise_channel_not_found_error(channel);
147
153
  }
@@ -562,6 +562,7 @@ get_description(EVT_HANDLE handle, LANGID langID, EVT_HANDLE hRemote)
562
562
  }
563
563
 
564
564
  if (status != ERROR_SUCCESS) {
565
+ EvtClose(renderContext);
565
566
  raise_system_error(rb_eWinevtQueryError, status);
566
567
  }
567
568
 
@@ -602,6 +603,7 @@ static char* convert_wstr(wchar_t *wstr)
602
603
  int len = 0;
603
604
  CHAR *ptr = NULL;
604
605
  DWORD err = ERROR_SUCCESS;
606
+ char *dup_str = NULL;
605
607
 
606
608
  len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);
607
609
  if (len == 0) {
@@ -621,7 +623,10 @@ static char* convert_wstr(wchar_t *wstr)
621
623
  raise_system_error(rb_eRuntimeError, err);
622
624
  }
623
625
 
624
- return strdup(ptr);
626
+ dup_str = strdup(ptr);
627
+ RB_ALLOCV_END(vstr);
628
+
629
+ return dup_str;
625
630
  }
626
631
 
627
632
  static int ExpandSIDWString(PSID sid, CHAR **out_expanded)
@@ -1,3 +1,3 @@
1
1
  module Winevt
2
- VERSION = "0.11.2"
2
+ VERSION = "0.11.3"
3
3
  end
data/winevt_c.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.license = "Apache-2.0"
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4".freeze)
27
27
 
28
- spec.add_development_dependency "bundler", [">= 1.16", "< 3"]
28
+ spec.add_development_dependency "bundler"
29
29
  spec.add_development_dependency "rake", "~> 13.0"
30
30
  spec.add_development_dependency "rake-compiler", "~> 1.0"
31
31
  spec.add_development_dependency "test-unit", "~> 3.2"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winevt_c
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Hatake
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-05-29 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -16,20 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '1.16'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '3'
18
+ version: '0'
23
19
  type: :development
24
20
  prerelease: false
25
21
  version_requirements: !ruby/object:Gem::Requirement
26
22
  requirements:
27
23
  - - ">="
28
24
  - !ruby/object:Gem::Version
29
- version: '1.16'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '3'
25
+ version: '0'
33
26
  - !ruby/object:Gem::Dependency
34
27
  name: rake
35
28
  requirement: !ruby/object:Gem::Requirement
@@ -95,6 +88,7 @@ extensions:
95
88
  extra_rdoc_files: []
96
89
  files:
97
90
  - ".clang-format"
91
+ - ".github/dependabot.yml"
98
92
  - ".github/workflows/test.yml"
99
93
  - ".gitignore"
100
94
  - Gemfile
@@ -131,7 +125,6 @@ homepage: https://github.com/fluent-plugins-nursery/winevt_c
131
125
  licenses:
132
126
  - Apache-2.0
133
127
  metadata: {}
134
- post_install_message:
135
128
  rdoc_options: []
136
129
  require_paths:
137
130
  - lib
@@ -146,8 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
139
  - !ruby/object:Gem::Version
147
140
  version: '0'
148
141
  requirements: []
149
- rubygems_version: 3.5.3
150
- signing_key:
142
+ rubygems_version: 4.0.6
151
143
  specification_version: 4
152
144
  summary: Windows Event Log API bindings from winevt.h.
153
145
  test_files: []