Skip to content

Commit

Permalink
windows: add Global{Alloc,Free}
Browse files Browse the repository at this point in the history
  • Loading branch information
0xced committed Jun 21, 2022
1 parent 4f61da8 commit 70bceee
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions windows/syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ func NewCallbackCDecl(fn interface{}) uintptr {
//sys SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error)
//sys GetActiveProcessorCount(groupNumber uint16) (ret uint32)
//sys GetMaximumProcessorCount(groupNumber uint16) (ret uint32)
//sys GlobalFree(hmem Handle) (handle Handle, err error) [failretval!=0]
//sys GlobalAlloc(flags uint32, length uint32) (ptr uintptr, err error)

// Volume Management Functions
//sys DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) = DefineDosDeviceW
Expand Down
9 changes: 9 additions & 0 deletions windows/types_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -3174,3 +3174,12 @@ type ModuleInfo struct {
}

const ALL_PROCESSOR_GROUPS = 0xFFFF

// Constants for GlobalAlloc flags.
const (
GMEM_FIXED = 0x0
GMEM_MOVEABLE = 0x2
GMEM_ZEROINIT = 0x40
GHND = GMEM_MOVEABLE | GMEM_ZEROINIT
GPTR = GMEM_FIXED | GMEM_ZEROINIT
)
20 changes: 20 additions & 0 deletions windows/zsyscall_windows.go

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

0 comments on commit 70bceee

Please sign in to comment.