Skip to content

Commit

Permalink
reference kernel32 alloc from go-windows
Browse files Browse the repository at this point in the history
  • Loading branch information
KnicKnic committed Jan 6, 2020
1 parent 813b2da commit dd59d79
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module github.com/KnicKnic/go-powershell
go 1.12

require (
github.com/KnicKnic/go-windows v0.0.2
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9
k8s.io/klog v1.0.0
)
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
github.com/KnicKnic/go-windows v0.0.2 h1:8979vGZ1dDMbTKR5aTZyluGDAzHnVlWZJ8y68DPTks4=
github.com/KnicKnic/go-windows v0.0.2/go.mod h1:bq9qyrkvAvMH2HPlkix2bE/eDuRz1kzwyoV/ieVhqK0=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6 h1:ZJUmhYTp8GbGC0ViZRc2U+MIYQ8xx9MscsdXnclfIhw=
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 h1:ZBzSG/7F4eNKz2L3GE9o300RX0Az1Bw5HF7PDraD+qU=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
3 changes: 2 additions & 1 deletion pkg/powershell/chelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package powershell

import (
"unsafe"
"github.com/KnicKnic/go-windows/pkg/kernel32"
)

func makeUint64FromPtr(v uintptr) uint64 {
Expand All @@ -16,7 +17,7 @@ func allocWrapper(size uint64) (uintptr, error) {
}

func localAllocWrapper(size uint64) (uintptr, error) {
return localAlloc(size)
return kernel32.LocalAlloc(size)
}

func freeWrapper(v uintptr) {
Expand Down
17 changes: 0 additions & 17 deletions pkg/powershell/zpsh_host.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dd59d79

Please sign in to comment.