Skip to content

Commit

Permalink
Update mkwinsyscall and make stand alone tool (#248)
Browse files Browse the repository at this point in the history
* Add latest mkwinsyscall file

Copied file from:
https://github.com/golang/sys/blob/bc2c85ada10aa9b6aa9607e9ac9ad0761b95cf1d/windows/mkwinsyscall/mkwinsyscall.go

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>

* Update to match hcsshim mksyscall_windows

Added hr error return type, cmdline flags for winio import, utf16, and
sorting.

Generated file has build constrain comment.

Input files can be specified with a glob pattern.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>

* PR: update comment, use glob

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
  • Loading branch information
helsaawy committed Jun 16, 2022
1 parent bdacbf1 commit 35837cf
Show file tree
Hide file tree
Showing 14 changed files with 178 additions and 2,006 deletions.
2 changes: 1 addition & 1 deletion pkg/etw/etw.go
Expand Up @@ -7,7 +7,7 @@
// set of C macros.
package etw

//go:generate go run mksyscall_windows.go -output zsyscall_windows.go etw.go
//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go etw.go

//sys eventRegister(providerId *windows.GUID, callback uintptr, callbackContext uintptr, providerHandle *providerHandle) (win32err error) = advapi32.EventRegister

Expand Down
4 changes: 3 additions & 1 deletion pkg/etw/zsyscall_windows.go

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

3 changes: 2 additions & 1 deletion pkg/process/syscall.go
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package process
Expand All @@ -6,7 +7,7 @@ import (
"golang.org/x/sys/windows"
)

//go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go syscall.go
//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go syscall.go

//sys enumProcesses(pids *uint32, bufferSize uint32, retBufferSize *uint32) (err error) = kernel32.K32EnumProcesses
//sys getProcessMemoryInfo(process handle, memCounters *ProcessMemoryCountersEx, size uint32) (err error) = kernel32.K32GetProcessMemoryInfo
Expand Down
4 changes: 3 additions & 1 deletion pkg/process/zsyscall_windows.go

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

0 comments on commit 35837cf

Please sign in to comment.