1 // MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT
12 // Do the interface allocations only once for common
15 errnoERROR_IO_PENDING = 997
19 errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
22 // errnoErr returns common boxed Errno values, to prevent
23 // allocations at runtime.
24 func errnoErr(e syscall.Errno) error {
28 case errnoERROR_IO_PENDING:
29 return errERROR_IO_PENDING
31 // TODO: add more here, after collecting data on the common
32 // error values see on Windows. (perhaps when running
38 modadvapi32 = NewLazySystemDLL("advapi32.dll")
39 modkernel32 = NewLazySystemDLL("kernel32.dll")
40 modshell32 = NewLazySystemDLL("shell32.dll")
41 modmswsock = NewLazySystemDLL("mswsock.dll")
42 modcrypt32 = NewLazySystemDLL("crypt32.dll")
43 modws2_32 = NewLazySystemDLL("ws2_32.dll")
44 moddnsapi = NewLazySystemDLL("dnsapi.dll")
45 modiphlpapi = NewLazySystemDLL("iphlpapi.dll")
46 modsecur32 = NewLazySystemDLL("secur32.dll")
47 modnetapi32 = NewLazySystemDLL("netapi32.dll")
48 moduserenv = NewLazySystemDLL("userenv.dll")
50 procRegisterEventSourceW = modadvapi32.NewProc("RegisterEventSourceW")
51 procDeregisterEventSource = modadvapi32.NewProc("DeregisterEventSource")
52 procReportEventW = modadvapi32.NewProc("ReportEventW")
53 procOpenSCManagerW = modadvapi32.NewProc("OpenSCManagerW")
54 procCloseServiceHandle = modadvapi32.NewProc("CloseServiceHandle")
55 procCreateServiceW = modadvapi32.NewProc("CreateServiceW")
56 procOpenServiceW = modadvapi32.NewProc("OpenServiceW")
57 procDeleteService = modadvapi32.NewProc("DeleteService")
58 procStartServiceW = modadvapi32.NewProc("StartServiceW")
59 procQueryServiceStatus = modadvapi32.NewProc("QueryServiceStatus")
60 procControlService = modadvapi32.NewProc("ControlService")
61 procStartServiceCtrlDispatcherW = modadvapi32.NewProc("StartServiceCtrlDispatcherW")
62 procSetServiceStatus = modadvapi32.NewProc("SetServiceStatus")
63 procChangeServiceConfigW = modadvapi32.NewProc("ChangeServiceConfigW")
64 procQueryServiceConfigW = modadvapi32.NewProc("QueryServiceConfigW")
65 procChangeServiceConfig2W = modadvapi32.NewProc("ChangeServiceConfig2W")
66 procQueryServiceConfig2W = modadvapi32.NewProc("QueryServiceConfig2W")
67 procGetLastError = modkernel32.NewProc("GetLastError")
68 procLoadLibraryW = modkernel32.NewProc("LoadLibraryW")
69 procLoadLibraryExW = modkernel32.NewProc("LoadLibraryExW")
70 procFreeLibrary = modkernel32.NewProc("FreeLibrary")
71 procGetProcAddress = modkernel32.NewProc("GetProcAddress")
72 procGetVersion = modkernel32.NewProc("GetVersion")
73 procFormatMessageW = modkernel32.NewProc("FormatMessageW")
74 procExitProcess = modkernel32.NewProc("ExitProcess")
75 procCreateFileW = modkernel32.NewProc("CreateFileW")
76 procReadFile = modkernel32.NewProc("ReadFile")
77 procWriteFile = modkernel32.NewProc("WriteFile")
78 procSetFilePointer = modkernel32.NewProc("SetFilePointer")
79 procCloseHandle = modkernel32.NewProc("CloseHandle")
80 procGetStdHandle = modkernel32.NewProc("GetStdHandle")
81 procFindFirstFileW = modkernel32.NewProc("FindFirstFileW")
82 procFindNextFileW = modkernel32.NewProc("FindNextFileW")
83 procFindClose = modkernel32.NewProc("FindClose")
84 procGetFileInformationByHandle = modkernel32.NewProc("GetFileInformationByHandle")
85 procGetCurrentDirectoryW = modkernel32.NewProc("GetCurrentDirectoryW")
86 procSetCurrentDirectoryW = modkernel32.NewProc("SetCurrentDirectoryW")
87 procCreateDirectoryW = modkernel32.NewProc("CreateDirectoryW")
88 procRemoveDirectoryW = modkernel32.NewProc("RemoveDirectoryW")
89 procDeleteFileW = modkernel32.NewProc("DeleteFileW")
90 procMoveFileW = modkernel32.NewProc("MoveFileW")
91 procMoveFileExW = modkernel32.NewProc("MoveFileExW")
92 procGetComputerNameW = modkernel32.NewProc("GetComputerNameW")
93 procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW")
94 procSetEndOfFile = modkernel32.NewProc("SetEndOfFile")
95 procGetSystemTimeAsFileTime = modkernel32.NewProc("GetSystemTimeAsFileTime")
96 procGetTimeZoneInformation = modkernel32.NewProc("GetTimeZoneInformation")
97 procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort")
98 procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus")
99 procPostQueuedCompletionStatus = modkernel32.NewProc("PostQueuedCompletionStatus")
100 procCancelIo = modkernel32.NewProc("CancelIo")
101 procCancelIoEx = modkernel32.NewProc("CancelIoEx")
102 procCreateProcessW = modkernel32.NewProc("CreateProcessW")
103 procOpenProcess = modkernel32.NewProc("OpenProcess")
104 procTerminateProcess = modkernel32.NewProc("TerminateProcess")
105 procGetExitCodeProcess = modkernel32.NewProc("GetExitCodeProcess")
106 procGetStartupInfoW = modkernel32.NewProc("GetStartupInfoW")
107 procGetCurrentProcess = modkernel32.NewProc("GetCurrentProcess")
108 procGetProcessTimes = modkernel32.NewProc("GetProcessTimes")
109 procDuplicateHandle = modkernel32.NewProc("DuplicateHandle")
110 procWaitForSingleObject = modkernel32.NewProc("WaitForSingleObject")
111 procGetTempPathW = modkernel32.NewProc("GetTempPathW")
112 procCreatePipe = modkernel32.NewProc("CreatePipe")
113 procGetFileType = modkernel32.NewProc("GetFileType")
114 procCryptAcquireContextW = modadvapi32.NewProc("CryptAcquireContextW")
115 procCryptReleaseContext = modadvapi32.NewProc("CryptReleaseContext")
116 procCryptGenRandom = modadvapi32.NewProc("CryptGenRandom")
117 procGetEnvironmentStringsW = modkernel32.NewProc("GetEnvironmentStringsW")
118 procFreeEnvironmentStringsW = modkernel32.NewProc("FreeEnvironmentStringsW")
119 procGetEnvironmentVariableW = modkernel32.NewProc("GetEnvironmentVariableW")
120 procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW")
121 procSetFileTime = modkernel32.NewProc("SetFileTime")
122 procGetFileAttributesW = modkernel32.NewProc("GetFileAttributesW")
123 procSetFileAttributesW = modkernel32.NewProc("SetFileAttributesW")
124 procGetFileAttributesExW = modkernel32.NewProc("GetFileAttributesExW")
125 procGetCommandLineW = modkernel32.NewProc("GetCommandLineW")
126 procCommandLineToArgvW = modshell32.NewProc("CommandLineToArgvW")
127 procLocalFree = modkernel32.NewProc("LocalFree")
128 procSetHandleInformation = modkernel32.NewProc("SetHandleInformation")
129 procFlushFileBuffers = modkernel32.NewProc("FlushFileBuffers")
130 procGetFullPathNameW = modkernel32.NewProc("GetFullPathNameW")
131 procGetLongPathNameW = modkernel32.NewProc("GetLongPathNameW")
132 procGetShortPathNameW = modkernel32.NewProc("GetShortPathNameW")
133 procCreateFileMappingW = modkernel32.NewProc("CreateFileMappingW")
134 procMapViewOfFile = modkernel32.NewProc("MapViewOfFile")
135 procUnmapViewOfFile = modkernel32.NewProc("UnmapViewOfFile")
136 procFlushViewOfFile = modkernel32.NewProc("FlushViewOfFile")
137 procVirtualLock = modkernel32.NewProc("VirtualLock")
138 procVirtualUnlock = modkernel32.NewProc("VirtualUnlock")
139 procTransmitFile = modmswsock.NewProc("TransmitFile")
140 procReadDirectoryChangesW = modkernel32.NewProc("ReadDirectoryChangesW")
141 procCertOpenSystemStoreW = modcrypt32.NewProc("CertOpenSystemStoreW")
142 procCertOpenStore = modcrypt32.NewProc("CertOpenStore")
143 procCertEnumCertificatesInStore = modcrypt32.NewProc("CertEnumCertificatesInStore")
144 procCertAddCertificateContextToStore = modcrypt32.NewProc("CertAddCertificateContextToStore")
145 procCertCloseStore = modcrypt32.NewProc("CertCloseStore")
146 procCertGetCertificateChain = modcrypt32.NewProc("CertGetCertificateChain")
147 procCertFreeCertificateChain = modcrypt32.NewProc("CertFreeCertificateChain")
148 procCertCreateCertificateContext = modcrypt32.NewProc("CertCreateCertificateContext")
149 procCertFreeCertificateContext = modcrypt32.NewProc("CertFreeCertificateContext")
150 procCertVerifyCertificateChainPolicy = modcrypt32.NewProc("CertVerifyCertificateChainPolicy")
151 procRegOpenKeyExW = modadvapi32.NewProc("RegOpenKeyExW")
152 procRegCloseKey = modadvapi32.NewProc("RegCloseKey")
153 procRegQueryInfoKeyW = modadvapi32.NewProc("RegQueryInfoKeyW")
154 procRegEnumKeyExW = modadvapi32.NewProc("RegEnumKeyExW")
155 procRegQueryValueExW = modadvapi32.NewProc("RegQueryValueExW")
156 procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId")
157 procGetConsoleMode = modkernel32.NewProc("GetConsoleMode")
158 procWriteConsoleW = modkernel32.NewProc("WriteConsoleW")
159 procReadConsoleW = modkernel32.NewProc("ReadConsoleW")
160 procCreateToolhelp32Snapshot = modkernel32.NewProc("CreateToolhelp32Snapshot")
161 procProcess32FirstW = modkernel32.NewProc("Process32FirstW")
162 procProcess32NextW = modkernel32.NewProc("Process32NextW")
163 procDeviceIoControl = modkernel32.NewProc("DeviceIoControl")
164 procCreateSymbolicLinkW = modkernel32.NewProc("CreateSymbolicLinkW")
165 procCreateHardLinkW = modkernel32.NewProc("CreateHardLinkW")
166 procGetCurrentThreadId = modkernel32.NewProc("GetCurrentThreadId")
167 procCreateEventW = modkernel32.NewProc("CreateEventW")
168 procSetEvent = modkernel32.NewProc("SetEvent")
169 procWSAStartup = modws2_32.NewProc("WSAStartup")
170 procWSACleanup = modws2_32.NewProc("WSACleanup")
171 procWSAIoctl = modws2_32.NewProc("WSAIoctl")
172 procsocket = modws2_32.NewProc("socket")
173 procsetsockopt = modws2_32.NewProc("setsockopt")
174 procgetsockopt = modws2_32.NewProc("getsockopt")
175 procbind = modws2_32.NewProc("bind")
176 procconnect = modws2_32.NewProc("connect")
177 procgetsockname = modws2_32.NewProc("getsockname")
178 procgetpeername = modws2_32.NewProc("getpeername")
179 proclisten = modws2_32.NewProc("listen")
180 procshutdown = modws2_32.NewProc("shutdown")
181 procclosesocket = modws2_32.NewProc("closesocket")
182 procAcceptEx = modmswsock.NewProc("AcceptEx")
183 procGetAcceptExSockaddrs = modmswsock.NewProc("GetAcceptExSockaddrs")
184 procWSARecv = modws2_32.NewProc("WSARecv")
185 procWSASend = modws2_32.NewProc("WSASend")
186 procWSARecvFrom = modws2_32.NewProc("WSARecvFrom")
187 procWSASendTo = modws2_32.NewProc("WSASendTo")
188 procgethostbyname = modws2_32.NewProc("gethostbyname")
189 procgetservbyname = modws2_32.NewProc("getservbyname")
190 procntohs = modws2_32.NewProc("ntohs")
191 procgetprotobyname = modws2_32.NewProc("getprotobyname")
192 procDnsQuery_W = moddnsapi.NewProc("DnsQuery_W")
193 procDnsRecordListFree = moddnsapi.NewProc("DnsRecordListFree")
194 procDnsNameCompare_W = moddnsapi.NewProc("DnsNameCompare_W")
195 procGetAddrInfoW = modws2_32.NewProc("GetAddrInfoW")
196 procFreeAddrInfoW = modws2_32.NewProc("FreeAddrInfoW")
197 procGetIfEntry = modiphlpapi.NewProc("GetIfEntry")
198 procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo")
199 procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes")
200 procWSAEnumProtocolsW = modws2_32.NewProc("WSAEnumProtocolsW")
201 procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses")
202 procGetACP = modkernel32.NewProc("GetACP")
203 procMultiByteToWideChar = modkernel32.NewProc("MultiByteToWideChar")
204 procTranslateNameW = modsecur32.NewProc("TranslateNameW")
205 procGetUserNameExW = modsecur32.NewProc("GetUserNameExW")
206 procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo")
207 procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation")
208 procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree")
209 procLookupAccountSidW = modadvapi32.NewProc("LookupAccountSidW")
210 procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW")
211 procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW")
212 procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW")
213 procGetLengthSid = modadvapi32.NewProc("GetLengthSid")
214 procCopySid = modadvapi32.NewProc("CopySid")
215 procAllocateAndInitializeSid = modadvapi32.NewProc("AllocateAndInitializeSid")
216 procFreeSid = modadvapi32.NewProc("FreeSid")
217 procEqualSid = modadvapi32.NewProc("EqualSid")
218 procOpenProcessToken = modadvapi32.NewProc("OpenProcessToken")
219 procGetTokenInformation = modadvapi32.NewProc("GetTokenInformation")
220 procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW")
223 func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) {
224 r0, _, e1 := syscall.Syscall(procRegisterEventSourceW.Addr(), 2, uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName)), 0)
236 func DeregisterEventSource(handle Handle) (err error) {
237 r1, _, e1 := syscall.Syscall(procDeregisterEventSource.Addr(), 1, uintptr(handle), 0, 0)
248 func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) {
249 r1, _, e1 := syscall.Syscall9(procReportEventW.Addr(), 9, uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData)))
260 func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) {
261 r0, _, e1 := syscall.Syscall(procOpenSCManagerW.Addr(), 3, uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access))
273 func CloseServiceHandle(handle Handle) (err error) {
274 r1, _, e1 := syscall.Syscall(procCloseServiceHandle.Addr(), 1, uintptr(handle), 0, 0)
285 func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) {
286 r0, _, e1 := syscall.Syscall15(procCreateServiceW.Addr(), 13, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), 0, 0)
298 func OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) {
299 r0, _, e1 := syscall.Syscall(procOpenServiceW.Addr(), 3, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access))
311 func DeleteService(service Handle) (err error) {
312 r1, _, e1 := syscall.Syscall(procDeleteService.Addr(), 1, uintptr(service), 0, 0)
323 func StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) {
324 r1, _, e1 := syscall.Syscall(procStartServiceW.Addr(), 3, uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors)))
335 func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) {
336 r1, _, e1 := syscall.Syscall(procQueryServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(status)), 0)
347 func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) {
348 r1, _, e1 := syscall.Syscall(procControlService.Addr(), 3, uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status)))
359 func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) {
360 r1, _, e1 := syscall.Syscall(procStartServiceCtrlDispatcherW.Addr(), 1, uintptr(unsafe.Pointer(serviceTable)), 0, 0)
371 func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) {
372 r1, _, e1 := syscall.Syscall(procSetServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(serviceStatus)), 0)
383 func ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) (err error) {
384 r1, _, e1 := syscall.Syscall12(procChangeServiceConfigW.Addr(), 11, uintptr(service), uintptr(serviceType), uintptr(startType), uintptr(errorControl), uintptr(unsafe.Pointer(binaryPathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), uintptr(unsafe.Pointer(displayName)), 0)
395 func QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) {
396 r1, _, e1 := syscall.Syscall6(procQueryServiceConfigW.Addr(), 4, uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), 0, 0)
407 func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) {
408 r1, _, e1 := syscall.Syscall(procChangeServiceConfig2W.Addr(), 3, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info)))
419 func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) {
420 r1, _, e1 := syscall.Syscall6(procQueryServiceConfig2W.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0)
431 func GetLastError() (lasterr error) {
432 r0, _, _ := syscall.Syscall(procGetLastError.Addr(), 0, 0, 0, 0)
434 lasterr = syscall.Errno(r0)
439 func LoadLibrary(libname string) (handle Handle, err error) {
441 _p0, err = syscall.UTF16PtrFromString(libname)
445 return _LoadLibrary(_p0)
448 func _LoadLibrary(libname *uint16) (handle Handle, err error) {
449 r0, _, e1 := syscall.Syscall(procLoadLibraryW.Addr(), 1, uintptr(unsafe.Pointer(libname)), 0, 0)
461 func LoadLibraryEx(libname string, zero Handle, flags uintptr) (handle Handle, err error) {
463 _p0, err = syscall.UTF16PtrFromString(libname)
467 return _LoadLibraryEx(_p0, zero, flags)
470 func _LoadLibraryEx(libname *uint16, zero Handle, flags uintptr) (handle Handle, err error) {
471 r0, _, e1 := syscall.Syscall(procLoadLibraryExW.Addr(), 3, uintptr(unsafe.Pointer(libname)), uintptr(zero), uintptr(flags))
483 func FreeLibrary(handle Handle) (err error) {
484 r1, _, e1 := syscall.Syscall(procFreeLibrary.Addr(), 1, uintptr(handle), 0, 0)
495 func GetProcAddress(module Handle, procname string) (proc uintptr, err error) {
497 _p0, err = syscall.BytePtrFromString(procname)
501 return _GetProcAddress(module, _p0)
504 func _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) {
505 r0, _, e1 := syscall.Syscall(procGetProcAddress.Addr(), 2, uintptr(module), uintptr(unsafe.Pointer(procname)), 0)
517 func GetVersion() (ver uint32, err error) {
518 r0, _, e1 := syscall.Syscall(procGetVersion.Addr(), 0, 0, 0, 0)
530 func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) {
535 r0, _, e1 := syscall.Syscall9(procFormatMessageW.Addr(), 7, uintptr(flags), uintptr(msgsrc), uintptr(msgid), uintptr(langid), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(args)), 0, 0)
547 func ExitProcess(exitcode uint32) {
548 syscall.Syscall(procExitProcess.Addr(), 1, uintptr(exitcode), 0, 0)
552 func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, err error) {
553 r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0)
555 if handle == InvalidHandle {
565 func ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) {
570 r1, _, e1 := syscall.Syscall6(procReadFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0)
581 func WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) {
586 r1, _, e1 := syscall.Syscall6(procWriteFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0)
597 func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) {
598 r0, _, e1 := syscall.Syscall6(procSetFilePointer.Addr(), 4, uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence), 0, 0)
599 newlowoffset = uint32(r0)
600 if newlowoffset == 0xffffffff {
610 func CloseHandle(handle Handle) (err error) {
611 r1, _, e1 := syscall.Syscall(procCloseHandle.Addr(), 1, uintptr(handle), 0, 0)
622 func GetStdHandle(stdhandle int) (handle Handle, err error) {
623 r0, _, e1 := syscall.Syscall(procGetStdHandle.Addr(), 1, uintptr(stdhandle), 0, 0)
625 if handle == InvalidHandle {
635 func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) {
636 r0, _, e1 := syscall.Syscall(procFindFirstFileW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)), 0)
638 if handle == InvalidHandle {
648 func findNextFile1(handle Handle, data *win32finddata1) (err error) {
649 r1, _, e1 := syscall.Syscall(procFindNextFileW.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)
660 func FindClose(handle Handle) (err error) {
661 r1, _, e1 := syscall.Syscall(procFindClose.Addr(), 1, uintptr(handle), 0, 0)
672 func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) {
673 r1, _, e1 := syscall.Syscall(procGetFileInformationByHandle.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)
684 func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) {
685 r0, _, e1 := syscall.Syscall(procGetCurrentDirectoryW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
697 func SetCurrentDirectory(path *uint16) (err error) {
698 r1, _, e1 := syscall.Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
709 func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) {
710 r1, _, e1 := syscall.Syscall(procCreateDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa)), 0)
721 func RemoveDirectory(path *uint16) (err error) {
722 r1, _, e1 := syscall.Syscall(procRemoveDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
733 func DeleteFile(path *uint16) (err error) {
734 r1, _, e1 := syscall.Syscall(procDeleteFileW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
745 func MoveFile(from *uint16, to *uint16) (err error) {
746 r1, _, e1 := syscall.Syscall(procMoveFileW.Addr(), 2, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), 0)
757 func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) {
758 r1, _, e1 := syscall.Syscall(procMoveFileExW.Addr(), 3, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags))
769 func GetComputerName(buf *uint16, n *uint32) (err error) {
770 r1, _, e1 := syscall.Syscall(procGetComputerNameW.Addr(), 2, uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)), 0)
781 func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) {
782 r1, _, e1 := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)))
793 func SetEndOfFile(handle Handle) (err error) {
794 r1, _, e1 := syscall.Syscall(procSetEndOfFile.Addr(), 1, uintptr(handle), 0, 0)
805 func GetSystemTimeAsFileTime(time *Filetime) {
806 syscall.Syscall(procGetSystemTimeAsFileTime.Addr(), 1, uintptr(unsafe.Pointer(time)), 0, 0)
810 func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) {
811 r0, _, e1 := syscall.Syscall(procGetTimeZoneInformation.Addr(), 1, uintptr(unsafe.Pointer(tzi)), 0, 0)
813 if rc == 0xffffffff {
823 func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, err error) {
824 r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt), 0, 0)
836 func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (err error) {
837 r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout), 0)
848 func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (err error) {
849 r1, _, e1 := syscall.Syscall6(procPostQueuedCompletionStatus.Addr(), 4, uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped)), 0, 0)
860 func CancelIo(s Handle) (err error) {
861 r1, _, e1 := syscall.Syscall(procCancelIo.Addr(), 1, uintptr(s), 0, 0)
872 func CancelIoEx(s Handle, o *Overlapped) (err error) {
873 r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(s), uintptr(unsafe.Pointer(o)), 0)
884 func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) {
891 r1, _, e1 := syscall.Syscall12(procCreateProcessW.Addr(), 10, uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0, 0)
902 func OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error) {
909 r0, _, e1 := syscall.Syscall(procOpenProcess.Addr(), 3, uintptr(da), uintptr(_p0), uintptr(pid))
921 func TerminateProcess(handle Handle, exitcode uint32) (err error) {
922 r1, _, e1 := syscall.Syscall(procTerminateProcess.Addr(), 2, uintptr(handle), uintptr(exitcode), 0)
933 func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) {
934 r1, _, e1 := syscall.Syscall(procGetExitCodeProcess.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(exitcode)), 0)
945 func GetStartupInfo(startupInfo *StartupInfo) (err error) {
946 r1, _, e1 := syscall.Syscall(procGetStartupInfoW.Addr(), 1, uintptr(unsafe.Pointer(startupInfo)), 0, 0)
957 func GetCurrentProcess() (pseudoHandle Handle, err error) {
958 r0, _, e1 := syscall.Syscall(procGetCurrentProcess.Addr(), 0, 0, 0, 0)
959 pseudoHandle = Handle(r0)
960 if pseudoHandle == 0 {
970 func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) {
971 r1, _, e1 := syscall.Syscall6(procGetProcessTimes.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime)), 0)
982 func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) {
989 r1, _, e1 := syscall.Syscall9(procDuplicateHandle.Addr(), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, 0)
1000 func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) {
1001 r0, _, e1 := syscall.Syscall(procWaitForSingleObject.Addr(), 2, uintptr(handle), uintptr(waitMilliseconds), 0)
1003 if event == 0xffffffff {
1007 err = syscall.EINVAL
1013 func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) {
1014 r0, _, e1 := syscall.Syscall(procGetTempPathW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
1020 err = syscall.EINVAL
1026 func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) {
1027 r1, _, e1 := syscall.Syscall6(procCreatePipe.Addr(), 4, uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size), 0, 0)
1032 err = syscall.EINVAL
1038 func GetFileType(filehandle Handle) (n uint32, err error) {
1039 r0, _, e1 := syscall.Syscall(procGetFileType.Addr(), 1, uintptr(filehandle), 0, 0)
1045 err = syscall.EINVAL
1051 func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) {
1052 r1, _, e1 := syscall.Syscall6(procCryptAcquireContextW.Addr(), 5, uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags), 0)
1057 err = syscall.EINVAL
1063 func CryptReleaseContext(provhandle Handle, flags uint32) (err error) {
1064 r1, _, e1 := syscall.Syscall(procCryptReleaseContext.Addr(), 2, uintptr(provhandle), uintptr(flags), 0)
1069 err = syscall.EINVAL
1075 func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) {
1076 r1, _, e1 := syscall.Syscall(procCryptGenRandom.Addr(), 3, uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf)))
1081 err = syscall.EINVAL
1087 func GetEnvironmentStrings() (envs *uint16, err error) {
1088 r0, _, e1 := syscall.Syscall(procGetEnvironmentStringsW.Addr(), 0, 0, 0, 0)
1089 envs = (*uint16)(unsafe.Pointer(r0))
1094 err = syscall.EINVAL
1100 func FreeEnvironmentStrings(envs *uint16) (err error) {
1101 r1, _, e1 := syscall.Syscall(procFreeEnvironmentStringsW.Addr(), 1, uintptr(unsafe.Pointer(envs)), 0, 0)
1106 err = syscall.EINVAL
1112 func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) {
1113 r0, _, e1 := syscall.Syscall(procGetEnvironmentVariableW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size))
1119 err = syscall.EINVAL
1125 func SetEnvironmentVariable(name *uint16, value *uint16) (err error) {
1126 r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0)
1131 err = syscall.EINVAL
1137 func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) {
1138 r1, _, e1 := syscall.Syscall6(procSetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0)
1143 err = syscall.EINVAL
1149 func GetFileAttributes(name *uint16) (attrs uint32, err error) {
1150 r0, _, e1 := syscall.Syscall(procGetFileAttributesW.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)
1152 if attrs == INVALID_FILE_ATTRIBUTES {
1156 err = syscall.EINVAL
1162 func SetFileAttributes(name *uint16, attrs uint32) (err error) {
1163 r1, _, e1 := syscall.Syscall(procSetFileAttributesW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(attrs), 0)
1168 err = syscall.EINVAL
1174 func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) {
1175 r1, _, e1 := syscall.Syscall(procGetFileAttributesExW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info)))
1180 err = syscall.EINVAL
1186 func GetCommandLine() (cmd *uint16) {
1187 r0, _, _ := syscall.Syscall(procGetCommandLineW.Addr(), 0, 0, 0, 0)
1188 cmd = (*uint16)(unsafe.Pointer(r0))
1192 func CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) {
1193 r0, _, e1 := syscall.Syscall(procCommandLineToArgvW.Addr(), 2, uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc)), 0)
1194 argv = (*[8192]*[8192]uint16)(unsafe.Pointer(r0))
1199 err = syscall.EINVAL
1205 func LocalFree(hmem Handle) (handle Handle, err error) {
1206 r0, _, e1 := syscall.Syscall(procLocalFree.Addr(), 1, uintptr(hmem), 0, 0)
1212 err = syscall.EINVAL
1218 func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) {
1219 r1, _, e1 := syscall.Syscall(procSetHandleInformation.Addr(), 3, uintptr(handle), uintptr(mask), uintptr(flags))
1224 err = syscall.EINVAL
1230 func FlushFileBuffers(handle Handle) (err error) {
1231 r1, _, e1 := syscall.Syscall(procFlushFileBuffers.Addr(), 1, uintptr(handle), 0, 0)
1236 err = syscall.EINVAL
1242 func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) {
1243 r0, _, e1 := syscall.Syscall6(procGetFullPathNameW.Addr(), 4, uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname)), 0, 0)
1249 err = syscall.EINVAL
1255 func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) {
1256 r0, _, e1 := syscall.Syscall(procGetLongPathNameW.Addr(), 3, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen))
1262 err = syscall.EINVAL
1268 func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) {
1269 r0, _, e1 := syscall.Syscall(procGetShortPathNameW.Addr(), 3, uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen))
1275 err = syscall.EINVAL
1281 func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) {
1282 r0, _, e1 := syscall.Syscall6(procCreateFileMappingW.Addr(), 6, uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name)))
1288 err = syscall.EINVAL
1294 func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) {
1295 r0, _, e1 := syscall.Syscall6(procMapViewOfFile.Addr(), 5, uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length), 0)
1301 err = syscall.EINVAL
1307 func UnmapViewOfFile(addr uintptr) (err error) {
1308 r1, _, e1 := syscall.Syscall(procUnmapViewOfFile.Addr(), 1, uintptr(addr), 0, 0)
1313 err = syscall.EINVAL
1319 func FlushViewOfFile(addr uintptr, length uintptr) (err error) {
1320 r1, _, e1 := syscall.Syscall(procFlushViewOfFile.Addr(), 2, uintptr(addr), uintptr(length), 0)
1325 err = syscall.EINVAL
1331 func VirtualLock(addr uintptr, length uintptr) (err error) {
1332 r1, _, e1 := syscall.Syscall(procVirtualLock.Addr(), 2, uintptr(addr), uintptr(length), 0)
1337 err = syscall.EINVAL
1343 func VirtualUnlock(addr uintptr, length uintptr) (err error) {
1344 r1, _, e1 := syscall.Syscall(procVirtualUnlock.Addr(), 2, uintptr(addr), uintptr(length), 0)
1349 err = syscall.EINVAL
1355 func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) {
1356 r1, _, e1 := syscall.Syscall9(procTransmitFile.Addr(), 7, uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags), 0, 0)
1361 err = syscall.EINVAL
1367 func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) {
1374 r1, _, e1 := syscall.Syscall9(procReadDirectoryChangesW.Addr(), 8, uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine), 0)
1379 err = syscall.EINVAL
1385 func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) {
1386 r0, _, e1 := syscall.Syscall(procCertOpenSystemStoreW.Addr(), 2, uintptr(hprov), uintptr(unsafe.Pointer(name)), 0)
1392 err = syscall.EINVAL
1398 func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) {
1399 r0, _, e1 := syscall.Syscall6(procCertOpenStore.Addr(), 5, uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para), 0)
1401 if handle == InvalidHandle {
1405 err = syscall.EINVAL
1411 func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) {
1412 r0, _, e1 := syscall.Syscall(procCertEnumCertificatesInStore.Addr(), 2, uintptr(store), uintptr(unsafe.Pointer(prevContext)), 0)
1413 context = (*CertContext)(unsafe.Pointer(r0))
1418 err = syscall.EINVAL
1424 func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) {
1425 r1, _, e1 := syscall.Syscall6(procCertAddCertificateContextToStore.Addr(), 4, uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext)), 0, 0)
1430 err = syscall.EINVAL
1436 func CertCloseStore(store Handle, flags uint32) (err error) {
1437 r1, _, e1 := syscall.Syscall(procCertCloseStore.Addr(), 2, uintptr(store), uintptr(flags), 0)
1442 err = syscall.EINVAL
1448 func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) {
1449 r1, _, e1 := syscall.Syscall9(procCertGetCertificateChain.Addr(), 8, uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx)), 0)
1454 err = syscall.EINVAL
1460 func CertFreeCertificateChain(ctx *CertChainContext) {
1461 syscall.Syscall(procCertFreeCertificateChain.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0)
1465 func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) {
1466 r0, _, e1 := syscall.Syscall(procCertCreateCertificateContext.Addr(), 3, uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen))
1467 context = (*CertContext)(unsafe.Pointer(r0))
1472 err = syscall.EINVAL
1478 func CertFreeCertificateContext(ctx *CertContext) (err error) {
1479 r1, _, e1 := syscall.Syscall(procCertFreeCertificateContext.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0)
1484 err = syscall.EINVAL
1490 func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) {
1491 r1, _, e1 := syscall.Syscall6(procCertVerifyCertificateChainPolicy.Addr(), 4, uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status)), 0, 0)
1496 err = syscall.EINVAL
1502 func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) {
1503 r0, _, _ := syscall.Syscall6(procRegOpenKeyExW.Addr(), 5, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result)), 0)
1505 regerrno = syscall.Errno(r0)
1510 func RegCloseKey(key Handle) (regerrno error) {
1511 r0, _, _ := syscall.Syscall(procRegCloseKey.Addr(), 1, uintptr(key), 0, 0)
1513 regerrno = syscall.Errno(r0)
1518 func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) {
1519 r0, _, _ := syscall.Syscall12(procRegQueryInfoKeyW.Addr(), 12, uintptr(key), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(subkeysLen)), uintptr(unsafe.Pointer(maxSubkeyLen)), uintptr(unsafe.Pointer(maxClassLen)), uintptr(unsafe.Pointer(valuesLen)), uintptr(unsafe.Pointer(maxValueNameLen)), uintptr(unsafe.Pointer(maxValueLen)), uintptr(unsafe.Pointer(saLen)), uintptr(unsafe.Pointer(lastWriteTime)))
1521 regerrno = syscall.Errno(r0)
1526 func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) {
1527 r0, _, _ := syscall.Syscall9(procRegEnumKeyExW.Addr(), 8, uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(lastWriteTime)), 0)
1529 regerrno = syscall.Errno(r0)
1534 func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) {
1535 r0, _, _ := syscall.Syscall6(procRegQueryValueExW.Addr(), 6, uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen)))
1537 regerrno = syscall.Errno(r0)
1542 func getCurrentProcessId() (pid uint32) {
1543 r0, _, _ := syscall.Syscall(procGetCurrentProcessId.Addr(), 0, 0, 0, 0)
1548 func GetConsoleMode(console Handle, mode *uint32) (err error) {
1549 r1, _, e1 := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(mode)), 0)
1554 err = syscall.EINVAL
1560 func WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) {
1561 r1, _, e1 := syscall.Syscall6(procWriteConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved)), 0)
1566 err = syscall.EINVAL
1572 func ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) {
1573 r1, _, e1 := syscall.Syscall6(procReadConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl)), 0)
1578 err = syscall.EINVAL
1584 func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) {
1585 r0, _, e1 := syscall.Syscall(procCreateToolhelp32Snapshot.Addr(), 2, uintptr(flags), uintptr(processId), 0)
1587 if handle == InvalidHandle {
1591 err = syscall.EINVAL
1597 func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) {
1598 r1, _, e1 := syscall.Syscall(procProcess32FirstW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0)
1603 err = syscall.EINVAL
1609 func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) {
1610 r1, _, e1 := syscall.Syscall(procProcess32NextW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0)
1615 err = syscall.EINVAL
1621 func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) {
1622 r1, _, e1 := syscall.Syscall9(procDeviceIoControl.Addr(), 8, uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped)), 0)
1627 err = syscall.EINVAL
1633 func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) {
1634 r1, _, e1 := syscall.Syscall(procCreateSymbolicLinkW.Addr(), 3, uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags))
1639 err = syscall.EINVAL
1645 func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) {
1646 r1, _, e1 := syscall.Syscall(procCreateHardLinkW.Addr(), 3, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved))
1651 err = syscall.EINVAL
1657 func GetCurrentThreadId() (id uint32) {
1658 r0, _, _ := syscall.Syscall(procGetCurrentThreadId.Addr(), 0, 0, 0, 0)
1663 func CreateEvent(eventAttrs *syscall.SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) {
1664 r0, _, e1 := syscall.Syscall6(procCreateEventW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name)), 0, 0)
1670 err = syscall.EINVAL
1676 func SetEvent(event Handle) (err error) {
1677 r1, _, e1 := syscall.Syscall(procSetEvent.Addr(), 1, uintptr(event), 0, 0)
1682 err = syscall.EINVAL
1688 func WSAStartup(verreq uint32, data *WSAData) (sockerr error) {
1689 r0, _, _ := syscall.Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0)
1691 sockerr = syscall.Errno(r0)
1696 func WSACleanup() (err error) {
1697 r1, _, e1 := syscall.Syscall(procWSACleanup.Addr(), 0, 0, 0, 0)
1698 if r1 == socket_error {
1702 err = syscall.EINVAL
1708 func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) {
1709 r1, _, e1 := syscall.Syscall9(procWSAIoctl.Addr(), 9, uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine))
1710 if r1 == socket_error {
1714 err = syscall.EINVAL
1720 func socket(af int32, typ int32, protocol int32) (handle Handle, err error) {
1721 r0, _, e1 := syscall.Syscall(procsocket.Addr(), 3, uintptr(af), uintptr(typ), uintptr(protocol))
1723 if handle == InvalidHandle {
1727 err = syscall.EINVAL
1733 func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) {
1734 r1, _, e1 := syscall.Syscall6(procsetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0)
1735 if r1 == socket_error {
1739 err = syscall.EINVAL
1745 func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) {
1746 r1, _, e1 := syscall.Syscall6(procgetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen)), 0)
1747 if r1 == socket_error {
1751 err = syscall.EINVAL
1757 func bind(s Handle, name unsafe.Pointer, namelen int32) (err error) {
1758 r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))
1759 if r1 == socket_error {
1763 err = syscall.EINVAL
1769 func connect(s Handle, name unsafe.Pointer, namelen int32) (err error) {
1770 r1, _, e1 := syscall.Syscall(procconnect.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))
1771 if r1 == socket_error {
1775 err = syscall.EINVAL
1781 func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {
1782 r1, _, e1 := syscall.Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
1783 if r1 == socket_error {
1787 err = syscall.EINVAL
1793 func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {
1794 r1, _, e1 := syscall.Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
1795 if r1 == socket_error {
1799 err = syscall.EINVAL
1805 func listen(s Handle, backlog int32) (err error) {
1806 r1, _, e1 := syscall.Syscall(proclisten.Addr(), 2, uintptr(s), uintptr(backlog), 0)
1807 if r1 == socket_error {
1811 err = syscall.EINVAL
1817 func shutdown(s Handle, how int32) (err error) {
1818 r1, _, e1 := syscall.Syscall(procshutdown.Addr(), 2, uintptr(s), uintptr(how), 0)
1819 if r1 == socket_error {
1823 err = syscall.EINVAL
1829 func Closesocket(s Handle) (err error) {
1830 r1, _, e1 := syscall.Syscall(procclosesocket.Addr(), 1, uintptr(s), 0, 0)
1831 if r1 == socket_error {
1835 err = syscall.EINVAL
1841 func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) {
1842 r1, _, e1 := syscall.Syscall9(procAcceptEx.Addr(), 8, uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped)), 0)
1847 err = syscall.EINVAL
1853 func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) {
1854 syscall.Syscall9(procGetAcceptExSockaddrs.Addr(), 8, uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(lrsa)), uintptr(unsafe.Pointer(lrsalen)), uintptr(unsafe.Pointer(rrsa)), uintptr(unsafe.Pointer(rrsalen)), 0)
1858 func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) {
1859 r1, _, e1 := syscall.Syscall9(procWSARecv.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0)
1860 if r1 == socket_error {
1864 err = syscall.EINVAL
1870 func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) {
1871 r1, _, e1 := syscall.Syscall9(procWSASend.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0)
1872 if r1 == socket_error {
1876 err = syscall.EINVAL
1882 func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) {
1883 r1, _, e1 := syscall.Syscall9(procWSARecvFrom.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
1884 if r1 == socket_error {
1888 err = syscall.EINVAL
1894 func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) {
1895 r1, _, e1 := syscall.Syscall9(procWSASendTo.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)))
1896 if r1 == socket_error {
1900 err = syscall.EINVAL
1906 func GetHostByName(name string) (h *Hostent, err error) {
1908 _p0, err = syscall.BytePtrFromString(name)
1912 return _GetHostByName(_p0)
1915 func _GetHostByName(name *byte) (h *Hostent, err error) {
1916 r0, _, e1 := syscall.Syscall(procgethostbyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)
1917 h = (*Hostent)(unsafe.Pointer(r0))
1922 err = syscall.EINVAL
1928 func GetServByName(name string, proto string) (s *Servent, err error) {
1930 _p0, err = syscall.BytePtrFromString(name)
1935 _p1, err = syscall.BytePtrFromString(proto)
1939 return _GetServByName(_p0, _p1)
1942 func _GetServByName(name *byte, proto *byte) (s *Servent, err error) {
1943 r0, _, e1 := syscall.Syscall(procgetservbyname.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto)), 0)
1944 s = (*Servent)(unsafe.Pointer(r0))
1949 err = syscall.EINVAL
1955 func Ntohs(netshort uint16) (u uint16) {
1956 r0, _, _ := syscall.Syscall(procntohs.Addr(), 1, uintptr(netshort), 0, 0)
1961 func GetProtoByName(name string) (p *Protoent, err error) {
1963 _p0, err = syscall.BytePtrFromString(name)
1967 return _GetProtoByName(_p0)
1970 func _GetProtoByName(name *byte) (p *Protoent, err error) {
1971 r0, _, e1 := syscall.Syscall(procgetprotobyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)
1972 p = (*Protoent)(unsafe.Pointer(r0))
1977 err = syscall.EINVAL
1983 func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) {
1985 _p0, status = syscall.UTF16PtrFromString(name)
1989 return _DnsQuery(_p0, qtype, options, extra, qrs, pr)
1992 func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) {
1993 r0, _, _ := syscall.Syscall6(procDnsQuery_W.Addr(), 6, uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr)))
1995 status = syscall.Errno(r0)
2000 func DnsRecordListFree(rl *DNSRecord, freetype uint32) {
2001 syscall.Syscall(procDnsRecordListFree.Addr(), 2, uintptr(unsafe.Pointer(rl)), uintptr(freetype), 0)
2005 func DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) {
2006 r0, _, _ := syscall.Syscall(procDnsNameCompare_W.Addr(), 2, uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2)), 0)
2011 func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) {
2012 r0, _, _ := syscall.Syscall6(procGetAddrInfoW.Addr(), 4, uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result)), 0, 0)
2014 sockerr = syscall.Errno(r0)
2019 func FreeAddrInfoW(addrinfo *AddrinfoW) {
2020 syscall.Syscall(procFreeAddrInfoW.Addr(), 1, uintptr(unsafe.Pointer(addrinfo)), 0, 0)
2024 func GetIfEntry(pIfRow *MibIfRow) (errcode error) {
2025 r0, _, _ := syscall.Syscall(procGetIfEntry.Addr(), 1, uintptr(unsafe.Pointer(pIfRow)), 0, 0)
2027 errcode = syscall.Errno(r0)
2032 func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) {
2033 r0, _, _ := syscall.Syscall(procGetAdaptersInfo.Addr(), 2, uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol)), 0)
2035 errcode = syscall.Errno(r0)
2040 func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) {
2041 r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(handle), uintptr(flags), 0)
2046 err = syscall.EINVAL
2052 func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) {
2053 r0, _, e1 := syscall.Syscall(procWSAEnumProtocolsW.Addr(), 3, uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength)))
2059 err = syscall.EINVAL
2065 func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) {
2066 r0, _, _ := syscall.Syscall6(procGetAdaptersAddresses.Addr(), 5, uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer)), 0)
2068 errcode = syscall.Errno(r0)
2073 func GetACP() (acp uint32) {
2074 r0, _, _ := syscall.Syscall(procGetACP.Addr(), 0, 0, 0, 0)
2079 func MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) {
2080 r0, _, e1 := syscall.Syscall6(procMultiByteToWideChar.Addr(), 6, uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar))
2086 err = syscall.EINVAL
2092 func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) {
2093 r1, _, e1 := syscall.Syscall6(procTranslateNameW.Addr(), 5, uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize)), 0)
2098 err = syscall.EINVAL
2104 func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) {
2105 r1, _, e1 := syscall.Syscall(procGetUserNameExW.Addr(), 3, uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize)))
2110 err = syscall.EINVAL
2116 func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) {
2117 r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0)
2119 neterr = syscall.Errno(r0)
2124 func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) {
2125 r0, _, _ := syscall.Syscall(procNetGetJoinInformation.Addr(), 3, uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType)))
2127 neterr = syscall.Errno(r0)
2132 func NetApiBufferFree(buf *byte) (neterr error) {
2133 r0, _, _ := syscall.Syscall(procNetApiBufferFree.Addr(), 1, uintptr(unsafe.Pointer(buf)), 0, 0)
2135 neterr = syscall.Errno(r0)
2140 func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {
2141 r1, _, e1 := syscall.Syscall9(procLookupAccountSidW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0)
2146 err = syscall.EINVAL
2152 func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {
2153 r1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0)
2158 err = syscall.EINVAL
2164 func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) {
2165 r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid)), 0)
2170 err = syscall.EINVAL
2176 func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) {
2177 r1, _, e1 := syscall.Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid)), 0)
2182 err = syscall.EINVAL
2188 func GetLengthSid(sid *SID) (len uint32) {
2189 r0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
2194 func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) {
2195 r1, _, e1 := syscall.Syscall(procCopySid.Addr(), 3, uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid)))
2200 err = syscall.EINVAL
2206 func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **SID) (err error) {
2207 r1, _, e1 := syscall.Syscall12(procAllocateAndInitializeSid.Addr(), 11, uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid)), 0)
2212 err = syscall.EINVAL
2218 func FreeSid(sid *SID) (err error) {
2219 r1, _, e1 := syscall.Syscall(procFreeSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
2224 err = syscall.EINVAL
2230 func EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) {
2231 r0, _, _ := syscall.Syscall(procEqualSid.Addr(), 2, uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2)), 0)
2236 func OpenProcessToken(h Handle, access uint32, token *Token) (err error) {
2237 r1, _, e1 := syscall.Syscall(procOpenProcessToken.Addr(), 3, uintptr(h), uintptr(access), uintptr(unsafe.Pointer(token)))
2242 err = syscall.EINVAL
2248 func GetTokenInformation(t Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) {
2249 r1, _, e1 := syscall.Syscall6(procGetTokenInformation.Addr(), 5, uintptr(t), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen)), 0)
2254 err = syscall.EINVAL
2260 func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) {
2261 r1, _, e1 := syscall.Syscall(procGetUserProfileDirectoryW.Addr(), 3, uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen)))
2266 err = syscall.EINVAL