|
|
@@ -178,8 +178,6 @@ func NewCallbackCDecl(fn interface{}) uintptr {
|
|
|
//sys TerminateProcess(handle Handle, exitcode uint32) (err error)
|
|
|
//sys GetExitCodeProcess(handle Handle, exitcode *uint32) (err error)
|
|
|
//sys GetStartupInfo(startupInfo *StartupInfo) (err error) = GetStartupInfoW
|
|
|
-//sys GetCurrentProcess() (pseudoHandle Handle)
|
|
|
-//sys GetCurrentThread() (pseudoHandle Handle)
|
|
|
//sys GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error)
|
|
|
//sys DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error)
|
|
|
//sys WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) [failretval==0xffffffff]
|
|
|
@@ -309,6 +307,18 @@ func NewCallbackCDecl(fn interface{}) uintptr {
|
|
|
|
|
|
// syscall interface implementation for other packages
|
|
|
|
|
|
+// GetCurrentProcess returns the handle for the current process.
|
|
|
+// It is a pseudo handle that does not need to be closed.
|
|
|
+func GetCurrentProcess() Handle {
|
|
|
+ return Handle(^uintptr(1 - 1))
|
|
|
+}
|
|
|
+
|
|
|
+// GetCurrentThread returns the handle for the current thread.
|
|
|
+// It is a pseudo handle that does not need to be closed.
|
|
|
+func GetCurrentThread() Handle {
|
|
|
+ return Handle(^uintptr(2 - 1))
|
|
|
+}
|
|
|
+
|
|
|
// GetProcAddressByOrdinal retrieves the address of the exported
|
|
|
// function from module by ordinal.
|
|
|
func GetProcAddressByOrdinal(module Handle, ordinal uintptr) (proc uintptr, err error) {
|