Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pullRequestAndMergeMaster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
name: CreateAndPushWindowsExecutable
strategy:
matrix:
go: [ 1.22.7 ]
go: [ 1.24.6 ]
goarch: [ amd64 ]
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/setup-go@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
name: CreateAndPushWindowsExecutable
strategy:
matrix:
go: [ 1.22.7 ]
go: [ 1.24.6 ]
goarch: [ amd64 ]
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/setup-go@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/newrelic/nri-winservices

go 1.22.7
go 1.24.6

require (
github.com/newrelic/infra-integrations-sdk/v4 v4.2.1
Expand All @@ -9,7 +9,7 @@ require (
github.com/prometheus/common v0.55.0
github.com/stretchr/testify v1.9.0
github.com/xeipuuv/gojsonschema v1.2.0
golang.org/x/sys v0.22.0
golang.org/x/sys v0.33.0
gopkg.in/yaml.v2 v2.4.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,8 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
11 changes: 6 additions & 5 deletions src/exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ func (e *Exporter) handle() (windows.Handle, error) {
return processHandle, fmt.Errorf("process cannot be nil pointer")
}

// Using unsafe operation we are using the handle inside os.Process.
processHandle = (*struct {
pid int
handle windows.Handle
})(unsafe.Pointer(e.cmd.Process)).handle
const access = windows.PROCESS_SET_QUOTA | windows.PROCESS_TERMINATE
processHandle, err := windows.OpenProcess(access, false, uint32(e.cmd.Process.Pid)) //nolint:gosec

if err != nil {
return 0, fmt.Errorf("open process failed : %w", err)
}

return processHandle, nil
}
Expand Down
Loading