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 procEnumServicesStatusExW = modadvapi32.NewProc("EnumServicesStatusExW")
68 procGetLastError = modkernel32.NewProc("GetLastError")
69 procLoadLibraryW = modkernel32.NewProc("LoadLibraryW")
70 procLoadLibraryExW = modkernel32.NewProc("LoadLibraryExW")
71 procFreeLibrary = modkernel32.NewProc("FreeLibrary")
72 procGetProcAddress = modkernel32.NewProc("GetProcAddress")
73 procGetVersion = modkernel32.NewProc("GetVersion")
74 procFormatMessageW = modkernel32.NewProc("FormatMessageW")
75 procExitProcess = modkernel32.NewProc("ExitProcess")
76 procCreateFileW = modkernel32.NewProc("CreateFileW")
77 procReadFile = modkernel32.NewProc("ReadFile")
78 procWriteFile = modkernel32.NewProc("WriteFile")
79 procSetFilePointer = modkernel32.NewProc("SetFilePointer")
80 procCloseHandle = modkernel32.NewProc("CloseHandle")
81 procGetStdHandle = modkernel32.NewProc("GetStdHandle")
82 procSetStdHandle = modkernel32.NewProc("SetStdHandle")
83 procFindFirstFileW = modkernel32.NewProc("FindFirstFileW")
84 procFindNextFileW = modkernel32.NewProc("FindNextFileW")
85 procFindClose = modkernel32.NewProc("FindClose")
86 procGetFileInformationByHandle = modkernel32.NewProc("GetFileInformationByHandle")
87 procGetCurrentDirectoryW = modkernel32.NewProc("GetCurrentDirectoryW")
88 procSetCurrentDirectoryW = modkernel32.NewProc("SetCurrentDirectoryW")
89 procCreateDirectoryW = modkernel32.NewProc("CreateDirectoryW")
90 procRemoveDirectoryW = modkernel32.NewProc("RemoveDirectoryW")
91 procDeleteFileW = modkernel32.NewProc("DeleteFileW")
92 procMoveFileW = modkernel32.NewProc("MoveFileW")
93 procMoveFileExW = modkernel32.NewProc("MoveFileExW")
94 procGetComputerNameW = modkernel32.NewProc("GetComputerNameW")
95 procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW")
96 procSetEndOfFile = modkernel32.NewProc("SetEndOfFile")
97 procGetSystemTimeAsFileTime = modkernel32.NewProc("GetSystemTimeAsFileTime")
98 procGetSystemTimePreciseAsFileTime = modkernel32.NewProc("GetSystemTimePreciseAsFileTime")
99 procGetTimeZoneInformation = modkernel32.NewProc("GetTimeZoneInformation")
100 procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort")
101 procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus")
102 procPostQueuedCompletionStatus = modkernel32.NewProc("PostQueuedCompletionStatus")
103 procCancelIo = modkernel32.NewProc("CancelIo")
104 procCancelIoEx = modkernel32.NewProc("CancelIoEx")
105 procCreateProcessW = modkernel32.NewProc("CreateProcessW")
106 procOpenProcess = modkernel32.NewProc("OpenProcess")
107 procTerminateProcess = modkernel32.NewProc("TerminateProcess")
108 procGetExitCodeProcess = modkernel32.NewProc("GetExitCodeProcess")
109 procGetStartupInfoW = modkernel32.NewProc("GetStartupInfoW")
110 procGetCurrentProcess = modkernel32.NewProc("GetCurrentProcess")
111 procGetProcessTimes = modkernel32.NewProc("GetProcessTimes")
112 procDuplicateHandle = modkernel32.NewProc("DuplicateHandle")
113 procWaitForSingleObject = modkernel32.NewProc("WaitForSingleObject")
114 procGetTempPathW = modkernel32.NewProc("GetTempPathW")
115 procCreatePipe = modkernel32.NewProc("CreatePipe")
116 procGetFileType = modkernel32.NewProc("GetFileType")
117 procCryptAcquireContextW = modadvapi32.NewProc("CryptAcquireContextW")
118 procCryptReleaseContext = modadvapi32.NewProc("CryptReleaseContext")
119 procCryptGenRandom = modadvapi32.NewProc("CryptGenRandom")
120 procGetEnvironmentStringsW = modkernel32.NewProc("GetEnvironmentStringsW")
121 procFreeEnvironmentStringsW = modkernel32.NewProc("FreeEnvironmentStringsW")
122 procGetEnvironmentVariableW = modkernel32.NewProc("GetEnvironmentVariableW")
123 procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW")
124 procSetFileTime = modkernel32.NewProc("SetFileTime")
125 procGetFileAttributesW = modkernel32.NewProc("GetFileAttributesW")
126 procSetFileAttributesW = modkernel32.NewProc("SetFileAttributesW")
127 procGetFileAttributesExW = modkernel32.NewProc("GetFileAttributesExW")
128 procGetCommandLineW = modkernel32.NewProc("GetCommandLineW")
129 procCommandLineToArgvW = modshell32.NewProc("CommandLineToArgvW")
130 procLocalFree = modkernel32.NewProc("LocalFree")
131 procSetHandleInformation = modkernel32.NewProc("SetHandleInformation")
132 procFlushFileBuffers = modkernel32.NewProc("FlushFileBuffers")
133 procGetFullPathNameW = modkernel32.NewProc("GetFullPathNameW")
134 procGetLongPathNameW = modkernel32.NewProc("GetLongPathNameW")
135 procGetShortPathNameW = modkernel32.NewProc("GetShortPathNameW")
136 procCreateFileMappingW = modkernel32.NewProc("CreateFileMappingW")
137 procMapViewOfFile = modkernel32.NewProc("MapViewOfFile")
138 procUnmapViewOfFile = modkernel32.NewProc("UnmapViewOfFile")
139 procFlushViewOfFile = modkernel32.NewProc("FlushViewOfFile")
140 procVirtualLock = modkernel32.NewProc("VirtualLock")
141 procVirtualUnlock = modkernel32.NewProc("VirtualUnlock")
142 procVirtualAlloc = modkernel32.NewProc("VirtualAlloc")
143 procVirtualFree = modkernel32.NewProc("VirtualFree")
144 procVirtualProtect = modkernel32.NewProc("VirtualProtect")
145 procTransmitFile = modmswsock.NewProc("TransmitFile")
146 procReadDirectoryChangesW = modkernel32.NewProc("ReadDirectoryChangesW")
147 procCertOpenSystemStoreW = modcrypt32.NewProc("CertOpenSystemStoreW")
148 procCertOpenStore = modcrypt32.NewProc("CertOpenStore")
149 procCertEnumCertificatesInStore = modcrypt32.NewProc("CertEnumCertificatesInStore")
150 procCertAddCertificateContextToStore = modcrypt32.NewProc("CertAddCertificateContextToStore")
151 procCertCloseStore = modcrypt32.NewProc("CertCloseStore")
152 procCertGetCertificateChain = modcrypt32.NewProc("CertGetCertificateChain")
153 procCertFreeCertificateChain = modcrypt32.NewProc("CertFreeCertificateChain")
154 procCertCreateCertificateContext = modcrypt32.NewProc("CertCreateCertificateContext")
155 procCertFreeCertificateContext = modcrypt32.NewProc("CertFreeCertificateContext")
156 procCertVerifyCertificateChainPolicy = modcrypt32.NewProc("CertVerifyCertificateChainPolicy")
157 procRegOpenKeyExW = modadvapi32.NewProc("RegOpenKeyExW")
158 procRegCloseKey = modadvapi32.NewProc("RegCloseKey")
159 procRegQueryInfoKeyW = modadvapi32.NewProc("RegQueryInfoKeyW")
160 procRegEnumKeyExW = modadvapi32.NewProc("RegEnumKeyExW")
161 procRegQueryValueExW = modadvapi32.NewProc("RegQueryValueExW")
162 procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId")
163 procGetConsoleMode = modkernel32.NewProc("GetConsoleMode")
164 procSetConsoleMode = modkernel32.NewProc("SetConsoleMode")
165 procGetConsoleScreenBufferInfo = modkernel32.NewProc("GetConsoleScreenBufferInfo")
166 procWriteConsoleW = modkernel32.NewProc("WriteConsoleW")
167 procReadConsoleW = modkernel32.NewProc("ReadConsoleW")
168 procCreateToolhelp32Snapshot = modkernel32.NewProc("CreateToolhelp32Snapshot")
169 procProcess32FirstW = modkernel32.NewProc("Process32FirstW")
170 procProcess32NextW = modkernel32.NewProc("Process32NextW")
171 procDeviceIoControl = modkernel32.NewProc("DeviceIoControl")
172 procCreateSymbolicLinkW = modkernel32.NewProc("CreateSymbolicLinkW")
173 procCreateHardLinkW = modkernel32.NewProc("CreateHardLinkW")
174 procGetCurrentThreadId = modkernel32.NewProc("GetCurrentThreadId")
175 procCreateEventW = modkernel32.NewProc("CreateEventW")
176 procCreateEventExW = modkernel32.NewProc("CreateEventExW")
177 procOpenEventW = modkernel32.NewProc("OpenEventW")
178 procSetEvent = modkernel32.NewProc("SetEvent")
179 procResetEvent = modkernel32.NewProc("ResetEvent")
180 procPulseEvent = modkernel32.NewProc("PulseEvent")
181 procWSAStartup = modws2_32.NewProc("WSAStartup")
182 procWSACleanup = modws2_32.NewProc("WSACleanup")
183 procWSAIoctl = modws2_32.NewProc("WSAIoctl")
184 procsocket = modws2_32.NewProc("socket")
185 procsetsockopt = modws2_32.NewProc("setsockopt")
186 procgetsockopt = modws2_32.NewProc("getsockopt")
187 procbind = modws2_32.NewProc("bind")
188 procconnect = modws2_32.NewProc("connect")
189 procgetsockname = modws2_32.NewProc("getsockname")
190 procgetpeername = modws2_32.NewProc("getpeername")
191 proclisten = modws2_32.NewProc("listen")
192 procshutdown = modws2_32.NewProc("shutdown")
193 procclosesocket = modws2_32.NewProc("closesocket")
194 procAcceptEx = modmswsock.NewProc("AcceptEx")
195 procGetAcceptExSockaddrs = modmswsock.NewProc("GetAcceptExSockaddrs")
196 procWSARecv = modws2_32.NewProc("WSARecv")
197 procWSASend = modws2_32.NewProc("WSASend")
198 procWSARecvFrom = modws2_32.NewProc("WSARecvFrom")
199 procWSASendTo = modws2_32.NewProc("WSASendTo")
200 procgethostbyname = modws2_32.NewProc("gethostbyname")
201 procgetservbyname = modws2_32.NewProc("getservbyname")
202 procntohs = modws2_32.NewProc("ntohs")
203 procgetprotobyname = modws2_32.NewProc("getprotobyname")
204 procDnsQuery_W = moddnsapi.NewProc("DnsQuery_W")
205 procDnsRecordListFree = moddnsapi.NewProc("DnsRecordListFree")
206 procDnsNameCompare_W = moddnsapi.NewProc("DnsNameCompare_W")
207 procGetAddrInfoW = modws2_32.NewProc("GetAddrInfoW")
208 procFreeAddrInfoW = modws2_32.NewProc("FreeAddrInfoW")
209 procGetIfEntry = modiphlpapi.NewProc("GetIfEntry")
210 procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo")
211 procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes")
212 procWSAEnumProtocolsW = modws2_32.NewProc("WSAEnumProtocolsW")
213 procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses")
214 procGetACP = modkernel32.NewProc("GetACP")
215 procMultiByteToWideChar = modkernel32.NewProc("MultiByteToWideChar")
216 procTranslateNameW = modsecur32.NewProc("TranslateNameW")
217 procGetUserNameExW = modsecur32.NewProc("GetUserNameExW")
218 procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo")
219 procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation")
220 procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree")
221 procLookupAccountSidW = modadvapi32.NewProc("LookupAccountSidW")
222 procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW")
223 procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW")
224 procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW")
225 procGetLengthSid = modadvapi32.NewProc("GetLengthSid")
226 procCopySid = modadvapi32.NewProc("CopySid")
227 procAllocateAndInitializeSid = modadvapi32.NewProc("AllocateAndInitializeSid")
228 procFreeSid = modadvapi32.NewProc("FreeSid")
229 procEqualSid = modadvapi32.NewProc("EqualSid")
230 procOpenProcessToken = modadvapi32.NewProc("OpenProcessToken")
231 procGetTokenInformation = modadvapi32.NewProc("GetTokenInformation")
232 procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW")
235 func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) {
236 r0, _, e1 := syscall.Syscall(procRegisterEventSourceW.Addr(), 2, uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName)), 0)
248 func DeregisterEventSource(handle Handle) (err error) {
249 r1, _, e1 := syscall.Syscall(procDeregisterEventSource.Addr(), 1, uintptr(handle), 0, 0)
260 func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) {
261 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)))
272 func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) {
273 r0, _, e1 := syscall.Syscall(procOpenSCManagerW.Addr(), 3, uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access))
285 func CloseServiceHandle(handle Handle) (err error) {
286 r1, _, e1 := syscall.Syscall(procCloseServiceHandle.Addr(), 1, uintptr(handle), 0, 0)
297 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) {
298 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)
310 func OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) {
311 r0, _, e1 := syscall.Syscall(procOpenServiceW.Addr(), 3, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access))
323 func DeleteService(service Handle) (err error) {
324 r1, _, e1 := syscall.Syscall(procDeleteService.Addr(), 1, uintptr(service), 0, 0)
335 func StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) {
336 r1, _, e1 := syscall.Syscall(procStartServiceW.Addr(), 3, uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors)))
347 func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) {
348 r1, _, e1 := syscall.Syscall(procQueryServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(status)), 0)
359 func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) {
360 r1, _, e1 := syscall.Syscall(procControlService.Addr(), 3, uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status)))
371 func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) {
372 r1, _, e1 := syscall.Syscall(procStartServiceCtrlDispatcherW.Addr(), 1, uintptr(unsafe.Pointer(serviceTable)), 0, 0)
383 func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) {
384 r1, _, e1 := syscall.Syscall(procSetServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(serviceStatus)), 0)
395 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) {
396 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)
407 func QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) {
408 r1, _, e1 := syscall.Syscall6(procQueryServiceConfigW.Addr(), 4, uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), 0, 0)
419 func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) {
420 r1, _, e1 := syscall.Syscall(procChangeServiceConfig2W.Addr(), 3, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info)))
431 func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) {
432 r1, _, e1 := syscall.Syscall6(procQueryServiceConfig2W.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0)
443 func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serviceState uint32, services *byte, bufSize uint32, bytesNeeded *uint32, servicesReturned *uint32, resumeHandle *uint32, groupName *uint16) (err error) {
444 r1, _, e1 := syscall.Syscall12(procEnumServicesStatusExW.Addr(), 10, uintptr(mgr), uintptr(infoLevel), uintptr(serviceType), uintptr(serviceState), uintptr(unsafe.Pointer(services)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)), uintptr(unsafe.Pointer(resumeHandle)), uintptr(unsafe.Pointer(groupName)), 0, 0)
455 func GetLastError() (lasterr error) {
456 r0, _, _ := syscall.Syscall(procGetLastError.Addr(), 0, 0, 0, 0)
458 lasterr = syscall.Errno(r0)
463 func LoadLibrary(libname string) (handle Handle, err error) {
465 _p0, err = syscall.UTF16PtrFromString(libname)
469 return _LoadLibrary(_p0)
472 func _LoadLibrary(libname *uint16) (handle Handle, err error) {
473 r0, _, e1 := syscall.Syscall(procLoadLibraryW.Addr(), 1, uintptr(unsafe.Pointer(libname)), 0, 0)
485 func LoadLibraryEx(libname string, zero Handle, flags uintptr) (handle Handle, err error) {
487 _p0, err = syscall.UTF16PtrFromString(libname)
491 return _LoadLibraryEx(_p0, zero, flags)
494 func _LoadLibraryEx(libname *uint16, zero Handle, flags uintptr) (handle Handle, err error) {
495 r0, _, e1 := syscall.Syscall(procLoadLibraryExW.Addr(), 3, uintptr(unsafe.Pointer(libname)), uintptr(zero), uintptr(flags))
507 func FreeLibrary(handle Handle) (err error) {
508 r1, _, e1 := syscall.Syscall(procFreeLibrary.Addr(), 1, uintptr(handle), 0, 0)
519 func GetProcAddress(module Handle, procname string) (proc uintptr, err error) {
521 _p0, err = syscall.BytePtrFromString(procname)
525 return _GetProcAddress(module, _p0)
528 func _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) {
529 r0, _, e1 := syscall.Syscall(procGetProcAddress.Addr(), 2, uintptr(module), uintptr(unsafe.Pointer(procname)), 0)
541 func GetVersion() (ver uint32, err error) {
542 r0, _, e1 := syscall.Syscall(procGetVersion.Addr(), 0, 0, 0, 0)
554 func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) {
559 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)
571 func ExitProcess(exitcode uint32) {
572 syscall.Syscall(procExitProcess.Addr(), 1, uintptr(exitcode), 0, 0)
576 func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile int32) (handle Handle, err error) {
577 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)
579 if handle == InvalidHandle {
589 func ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) {
594 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)
605 func WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) {
610 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)
621 func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) {
622 r0, _, e1 := syscall.Syscall6(procSetFilePointer.Addr(), 4, uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence), 0, 0)
623 newlowoffset = uint32(r0)
624 if newlowoffset == 0xffffffff {
634 func CloseHandle(handle Handle) (err error) {
635 r1, _, e1 := syscall.Syscall(procCloseHandle.Addr(), 1, uintptr(handle), 0, 0)
646 func GetStdHandle(stdhandle uint32) (handle Handle, err error) {
647 r0, _, e1 := syscall.Syscall(procGetStdHandle.Addr(), 1, uintptr(stdhandle), 0, 0)
649 if handle == InvalidHandle {
659 func SetStdHandle(stdhandle uint32, handle Handle) (err error) {
660 r1, _, e1 := syscall.Syscall(procSetStdHandle.Addr(), 2, uintptr(stdhandle), uintptr(handle), 0)
671 func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) {
672 r0, _, e1 := syscall.Syscall(procFindFirstFileW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)), 0)
674 if handle == InvalidHandle {
684 func findNextFile1(handle Handle, data *win32finddata1) (err error) {
685 r1, _, e1 := syscall.Syscall(procFindNextFileW.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)
696 func FindClose(handle Handle) (err error) {
697 r1, _, e1 := syscall.Syscall(procFindClose.Addr(), 1, uintptr(handle), 0, 0)
708 func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) {
709 r1, _, e1 := syscall.Syscall(procGetFileInformationByHandle.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0)
720 func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) {
721 r0, _, e1 := syscall.Syscall(procGetCurrentDirectoryW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
733 func SetCurrentDirectory(path *uint16) (err error) {
734 r1, _, e1 := syscall.Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
745 func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) {
746 r1, _, e1 := syscall.Syscall(procCreateDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa)), 0)
757 func RemoveDirectory(path *uint16) (err error) {
758 r1, _, e1 := syscall.Syscall(procRemoveDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
769 func DeleteFile(path *uint16) (err error) {
770 r1, _, e1 := syscall.Syscall(procDeleteFileW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
781 func MoveFile(from *uint16, to *uint16) (err error) {
782 r1, _, e1 := syscall.Syscall(procMoveFileW.Addr(), 2, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), 0)
793 func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) {
794 r1, _, e1 := syscall.Syscall(procMoveFileExW.Addr(), 3, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags))
805 func GetComputerName(buf *uint16, n *uint32) (err error) {
806 r1, _, e1 := syscall.Syscall(procGetComputerNameW.Addr(), 2, uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)), 0)
817 func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) {
818 r1, _, e1 := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)))
829 func SetEndOfFile(handle Handle) (err error) {
830 r1, _, e1 := syscall.Syscall(procSetEndOfFile.Addr(), 1, uintptr(handle), 0, 0)
841 func GetSystemTimeAsFileTime(time *Filetime) {
842 syscall.Syscall(procGetSystemTimeAsFileTime.Addr(), 1, uintptr(unsafe.Pointer(time)), 0, 0)
846 func GetSystemTimePreciseAsFileTime(time *Filetime) {
847 syscall.Syscall(procGetSystemTimePreciseAsFileTime.Addr(), 1, uintptr(unsafe.Pointer(time)), 0, 0)
851 func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) {
852 r0, _, e1 := syscall.Syscall(procGetTimeZoneInformation.Addr(), 1, uintptr(unsafe.Pointer(tzi)), 0, 0)
854 if rc == 0xffffffff {
864 func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, err error) {
865 r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt), 0, 0)
877 func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (err error) {
878 r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout), 0)
889 func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (err error) {
890 r1, _, e1 := syscall.Syscall6(procPostQueuedCompletionStatus.Addr(), 4, uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped)), 0, 0)
901 func CancelIo(s Handle) (err error) {
902 r1, _, e1 := syscall.Syscall(procCancelIo.Addr(), 1, uintptr(s), 0, 0)
913 func CancelIoEx(s Handle, o *Overlapped) (err error) {
914 r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(s), uintptr(unsafe.Pointer(o)), 0)
925 func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) {
932 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)
943 func OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error) {
950 r0, _, e1 := syscall.Syscall(procOpenProcess.Addr(), 3, uintptr(da), uintptr(_p0), uintptr(pid))
962 func TerminateProcess(handle Handle, exitcode uint32) (err error) {
963 r1, _, e1 := syscall.Syscall(procTerminateProcess.Addr(), 2, uintptr(handle), uintptr(exitcode), 0)
974 func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) {
975 r1, _, e1 := syscall.Syscall(procGetExitCodeProcess.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(exitcode)), 0)
986 func GetStartupInfo(startupInfo *StartupInfo) (err error) {
987 r1, _, e1 := syscall.Syscall(procGetStartupInfoW.Addr(), 1, uintptr(unsafe.Pointer(startupInfo)), 0, 0)
998 func GetCurrentProcess() (pseudoHandle Handle, err error) {
999 r0, _, e1 := syscall.Syscall(procGetCurrentProcess.Addr(), 0, 0, 0, 0)
1000 pseudoHandle = Handle(r0)
1001 if pseudoHandle == 0 {
1005 err = syscall.EINVAL
1011 func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) {
1012 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)
1017 err = syscall.EINVAL
1023 func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) {
1030 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)
1035 err = syscall.EINVAL
1041 func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) {
1042 r0, _, e1 := syscall.Syscall(procWaitForSingleObject.Addr(), 2, uintptr(handle), uintptr(waitMilliseconds), 0)
1044 if event == 0xffffffff {
1048 err = syscall.EINVAL
1054 func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) {
1055 r0, _, e1 := syscall.Syscall(procGetTempPathW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0)
1061 err = syscall.EINVAL
1067 func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) {
1068 r1, _, e1 := syscall.Syscall6(procCreatePipe.Addr(), 4, uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size), 0, 0)
1073 err = syscall.EINVAL
1079 func GetFileType(filehandle Handle) (n uint32, err error) {
1080 r0, _, e1 := syscall.Syscall(procGetFileType.Addr(), 1, uintptr(filehandle), 0, 0)
1086 err = syscall.EINVAL
1092 func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) {
1093 r1, _, e1 := syscall.Syscall6(procCryptAcquireContextW.Addr(), 5, uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags), 0)
1098 err = syscall.EINVAL
1104 func CryptReleaseContext(provhandle Handle, flags uint32) (err error) {
1105 r1, _, e1 := syscall.Syscall(procCryptReleaseContext.Addr(), 2, uintptr(provhandle), uintptr(flags), 0)
1110 err = syscall.EINVAL
1116 func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) {
1117 r1, _, e1 := syscall.Syscall(procCryptGenRandom.Addr(), 3, uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf)))
1122 err = syscall.EINVAL
1128 func GetEnvironmentStrings() (envs *uint16, err error) {
1129 r0, _, e1 := syscall.Syscall(procGetEnvironmentStringsW.Addr(), 0, 0, 0, 0)
1130 envs = (*uint16)(unsafe.Pointer(r0))
1135 err = syscall.EINVAL
1141 func FreeEnvironmentStrings(envs *uint16) (err error) {
1142 r1, _, e1 := syscall.Syscall(procFreeEnvironmentStringsW.Addr(), 1, uintptr(unsafe.Pointer(envs)), 0, 0)
1147 err = syscall.EINVAL
1153 func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) {
1154 r0, _, e1 := syscall.Syscall(procGetEnvironmentVariableW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size))
1160 err = syscall.EINVAL
1166 func SetEnvironmentVariable(name *uint16, value *uint16) (err error) {
1167 r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0)
1172 err = syscall.EINVAL
1178 func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) {
1179 r1, _, e1 := syscall.Syscall6(procSetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0)
1184 err = syscall.EINVAL
1190 func GetFileAttributes(name *uint16) (attrs uint32, err error) {
1191 r0, _, e1 := syscall.Syscall(procGetFileAttributesW.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)
1193 if attrs == INVALID_FILE_ATTRIBUTES {
1197 err = syscall.EINVAL
1203 func SetFileAttributes(name *uint16, attrs uint32) (err error) {
1204 r1, _, e1 := syscall.Syscall(procSetFileAttributesW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(attrs), 0)
1209 err = syscall.EINVAL
1215 func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) {
1216 r1, _, e1 := syscall.Syscall(procGetFileAttributesExW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info)))
1221 err = syscall.EINVAL
1227 func GetCommandLine() (cmd *uint16) {
1228 r0, _, _ := syscall.Syscall(procGetCommandLineW.Addr(), 0, 0, 0, 0)
1229 cmd = (*uint16)(unsafe.Pointer(r0))
1233 func CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) {
1234 r0, _, e1 := syscall.Syscall(procCommandLineToArgvW.Addr(), 2, uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc)), 0)
1235 argv = (*[8192]*[8192]uint16)(unsafe.Pointer(r0))
1240 err = syscall.EINVAL
1246 func LocalFree(hmem Handle) (handle Handle, err error) {
1247 r0, _, e1 := syscall.Syscall(procLocalFree.Addr(), 1, uintptr(hmem), 0, 0)
1253 err = syscall.EINVAL
1259 func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) {
1260 r1, _, e1 := syscall.Syscall(procSetHandleInformation.Addr(), 3, uintptr(handle), uintptr(mask), uintptr(flags))
1265 err = syscall.EINVAL
1271 func FlushFileBuffers(handle Handle) (err error) {
1272 r1, _, e1 := syscall.Syscall(procFlushFileBuffers.Addr(), 1, uintptr(handle), 0, 0)
1277 err = syscall.EINVAL
1283 func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) {
1284 r0, _, e1 := syscall.Syscall6(procGetFullPathNameW.Addr(), 4, uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname)), 0, 0)
1290 err = syscall.EINVAL
1296 func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) {
1297 r0, _, e1 := syscall.Syscall(procGetLongPathNameW.Addr(), 3, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen))
1303 err = syscall.EINVAL
1309 func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) {
1310 r0, _, e1 := syscall.Syscall(procGetShortPathNameW.Addr(), 3, uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen))
1316 err = syscall.EINVAL
1322 func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) {
1323 r0, _, e1 := syscall.Syscall6(procCreateFileMappingW.Addr(), 6, uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name)))
1329 err = syscall.EINVAL
1335 func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) {
1336 r0, _, e1 := syscall.Syscall6(procMapViewOfFile.Addr(), 5, uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length), 0)
1342 err = syscall.EINVAL
1348 func UnmapViewOfFile(addr uintptr) (err error) {
1349 r1, _, e1 := syscall.Syscall(procUnmapViewOfFile.Addr(), 1, uintptr(addr), 0, 0)
1354 err = syscall.EINVAL
1360 func FlushViewOfFile(addr uintptr, length uintptr) (err error) {
1361 r1, _, e1 := syscall.Syscall(procFlushViewOfFile.Addr(), 2, uintptr(addr), uintptr(length), 0)
1366 err = syscall.EINVAL
1372 func VirtualLock(addr uintptr, length uintptr) (err error) {
1373 r1, _, e1 := syscall.Syscall(procVirtualLock.Addr(), 2, uintptr(addr), uintptr(length), 0)
1378 err = syscall.EINVAL
1384 func VirtualUnlock(addr uintptr, length uintptr) (err error) {
1385 r1, _, e1 := syscall.Syscall(procVirtualUnlock.Addr(), 2, uintptr(addr), uintptr(length), 0)
1390 err = syscall.EINVAL
1396 func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint32) (value uintptr, err error) {
1397 r0, _, e1 := syscall.Syscall6(procVirtualAlloc.Addr(), 4, uintptr(address), uintptr(size), uintptr(alloctype), uintptr(protect), 0, 0)
1403 err = syscall.EINVAL
1409 func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) {
1410 r1, _, e1 := syscall.Syscall(procVirtualFree.Addr(), 3, uintptr(address), uintptr(size), uintptr(freetype))
1415 err = syscall.EINVAL
1421 func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect *uint32) (err error) {
1422 r1, _, e1 := syscall.Syscall6(procVirtualProtect.Addr(), 4, uintptr(address), uintptr(size), uintptr(newprotect), uintptr(unsafe.Pointer(oldprotect)), 0, 0)
1427 err = syscall.EINVAL
1433 func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) {
1434 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)
1439 err = syscall.EINVAL
1445 func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) {
1452 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)
1457 err = syscall.EINVAL
1463 func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) {
1464 r0, _, e1 := syscall.Syscall(procCertOpenSystemStoreW.Addr(), 2, uintptr(hprov), uintptr(unsafe.Pointer(name)), 0)
1470 err = syscall.EINVAL
1476 func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) {
1477 r0, _, e1 := syscall.Syscall6(procCertOpenStore.Addr(), 5, uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para), 0)
1479 if handle == InvalidHandle {
1483 err = syscall.EINVAL
1489 func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) {
1490 r0, _, e1 := syscall.Syscall(procCertEnumCertificatesInStore.Addr(), 2, uintptr(store), uintptr(unsafe.Pointer(prevContext)), 0)
1491 context = (*CertContext)(unsafe.Pointer(r0))
1496 err = syscall.EINVAL
1502 func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) {
1503 r1, _, e1 := syscall.Syscall6(procCertAddCertificateContextToStore.Addr(), 4, uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext)), 0, 0)
1508 err = syscall.EINVAL
1514 func CertCloseStore(store Handle, flags uint32) (err error) {
1515 r1, _, e1 := syscall.Syscall(procCertCloseStore.Addr(), 2, uintptr(store), uintptr(flags), 0)
1520 err = syscall.EINVAL
1526 func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) {
1527 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)
1532 err = syscall.EINVAL
1538 func CertFreeCertificateChain(ctx *CertChainContext) {
1539 syscall.Syscall(procCertFreeCertificateChain.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0)
1543 func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) {
1544 r0, _, e1 := syscall.Syscall(procCertCreateCertificateContext.Addr(), 3, uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen))
1545 context = (*CertContext)(unsafe.Pointer(r0))
1550 err = syscall.EINVAL
1556 func CertFreeCertificateContext(ctx *CertContext) (err error) {
1557 r1, _, e1 := syscall.Syscall(procCertFreeCertificateContext.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0)
1562 err = syscall.EINVAL
1568 func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) {
1569 r1, _, e1 := syscall.Syscall6(procCertVerifyCertificateChainPolicy.Addr(), 4, uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status)), 0, 0)
1574 err = syscall.EINVAL
1580 func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) {
1581 r0, _, _ := syscall.Syscall6(procRegOpenKeyExW.Addr(), 5, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result)), 0)
1583 regerrno = syscall.Errno(r0)
1588 func RegCloseKey(key Handle) (regerrno error) {
1589 r0, _, _ := syscall.Syscall(procRegCloseKey.Addr(), 1, uintptr(key), 0, 0)
1591 regerrno = syscall.Errno(r0)
1596 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) {
1597 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)))
1599 regerrno = syscall.Errno(r0)
1604 func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) {
1605 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)
1607 regerrno = syscall.Errno(r0)
1612 func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) {
1613 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)))
1615 regerrno = syscall.Errno(r0)
1620 func getCurrentProcessId() (pid uint32) {
1621 r0, _, _ := syscall.Syscall(procGetCurrentProcessId.Addr(), 0, 0, 0, 0)
1626 func GetConsoleMode(console Handle, mode *uint32) (err error) {
1627 r1, _, e1 := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(mode)), 0)
1632 err = syscall.EINVAL
1638 func SetConsoleMode(console Handle, mode uint32) (err error) {
1639 r1, _, e1 := syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(console), uintptr(mode), 0)
1644 err = syscall.EINVAL
1650 func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) {
1651 r1, _, e1 := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(info)), 0)
1656 err = syscall.EINVAL
1662 func WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) {
1663 r1, _, e1 := syscall.Syscall6(procWriteConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved)), 0)
1668 err = syscall.EINVAL
1674 func ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) {
1675 r1, _, e1 := syscall.Syscall6(procReadConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl)), 0)
1680 err = syscall.EINVAL
1686 func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) {
1687 r0, _, e1 := syscall.Syscall(procCreateToolhelp32Snapshot.Addr(), 2, uintptr(flags), uintptr(processId), 0)
1689 if handle == InvalidHandle {
1693 err = syscall.EINVAL
1699 func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) {
1700 r1, _, e1 := syscall.Syscall(procProcess32FirstW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0)
1705 err = syscall.EINVAL
1711 func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) {
1712 r1, _, e1 := syscall.Syscall(procProcess32NextW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0)
1717 err = syscall.EINVAL
1723 func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) {
1724 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)
1729 err = syscall.EINVAL
1735 func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) {
1736 r1, _, e1 := syscall.Syscall(procCreateSymbolicLinkW.Addr(), 3, uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags))
1741 err = syscall.EINVAL
1747 func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) {
1748 r1, _, e1 := syscall.Syscall(procCreateHardLinkW.Addr(), 3, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved))
1753 err = syscall.EINVAL
1759 func GetCurrentThreadId() (id uint32) {
1760 r0, _, _ := syscall.Syscall(procGetCurrentThreadId.Addr(), 0, 0, 0, 0)
1765 func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) {
1766 r0, _, e1 := syscall.Syscall6(procCreateEventW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name)), 0, 0)
1772 err = syscall.EINVAL
1778 func CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) {
1779 r0, _, e1 := syscall.Syscall6(procCreateEventExW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess), 0, 0)
1785 err = syscall.EINVAL
1791 func OpenEvent(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) {
1798 r0, _, e1 := syscall.Syscall(procOpenEventW.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name)))
1804 err = syscall.EINVAL
1810 func SetEvent(event Handle) (err error) {
1811 r1, _, e1 := syscall.Syscall(procSetEvent.Addr(), 1, uintptr(event), 0, 0)
1816 err = syscall.EINVAL
1822 func ResetEvent(event Handle) (err error) {
1823 r1, _, e1 := syscall.Syscall(procResetEvent.Addr(), 1, uintptr(event), 0, 0)
1828 err = syscall.EINVAL
1834 func PulseEvent(event Handle) (err error) {
1835 r1, _, e1 := syscall.Syscall(procPulseEvent.Addr(), 1, uintptr(event), 0, 0)
1840 err = syscall.EINVAL
1846 func WSAStartup(verreq uint32, data *WSAData) (sockerr error) {
1847 r0, _, _ := syscall.Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0)
1849 sockerr = syscall.Errno(r0)
1854 func WSACleanup() (err error) {
1855 r1, _, e1 := syscall.Syscall(procWSACleanup.Addr(), 0, 0, 0, 0)
1856 if r1 == socket_error {
1860 err = syscall.EINVAL
1866 func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) {
1867 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))
1868 if r1 == socket_error {
1872 err = syscall.EINVAL
1878 func socket(af int32, typ int32, protocol int32) (handle Handle, err error) {
1879 r0, _, e1 := syscall.Syscall(procsocket.Addr(), 3, uintptr(af), uintptr(typ), uintptr(protocol))
1881 if handle == InvalidHandle {
1885 err = syscall.EINVAL
1891 func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) {
1892 r1, _, e1 := syscall.Syscall6(procsetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0)
1893 if r1 == socket_error {
1897 err = syscall.EINVAL
1903 func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) {
1904 r1, _, e1 := syscall.Syscall6(procgetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen)), 0)
1905 if r1 == socket_error {
1909 err = syscall.EINVAL
1915 func bind(s Handle, name unsafe.Pointer, namelen int32) (err error) {
1916 r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))
1917 if r1 == socket_error {
1921 err = syscall.EINVAL
1927 func connect(s Handle, name unsafe.Pointer, namelen int32) (err error) {
1928 r1, _, e1 := syscall.Syscall(procconnect.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))
1929 if r1 == socket_error {
1933 err = syscall.EINVAL
1939 func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {
1940 r1, _, e1 := syscall.Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
1941 if r1 == socket_error {
1945 err = syscall.EINVAL
1951 func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) {
1952 r1, _, e1 := syscall.Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
1953 if r1 == socket_error {
1957 err = syscall.EINVAL
1963 func listen(s Handle, backlog int32) (err error) {
1964 r1, _, e1 := syscall.Syscall(proclisten.Addr(), 2, uintptr(s), uintptr(backlog), 0)
1965 if r1 == socket_error {
1969 err = syscall.EINVAL
1975 func shutdown(s Handle, how int32) (err error) {
1976 r1, _, e1 := syscall.Syscall(procshutdown.Addr(), 2, uintptr(s), uintptr(how), 0)
1977 if r1 == socket_error {
1981 err = syscall.EINVAL
1987 func Closesocket(s Handle) (err error) {
1988 r1, _, e1 := syscall.Syscall(procclosesocket.Addr(), 1, uintptr(s), 0, 0)
1989 if r1 == socket_error {
1993 err = syscall.EINVAL
1999 func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) {
2000 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)
2005 err = syscall.EINVAL
2011 func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) {
2012 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)
2016 func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) {
2017 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)
2018 if r1 == socket_error {
2022 err = syscall.EINVAL
2028 func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) {
2029 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)
2030 if r1 == socket_error {
2034 err = syscall.EINVAL
2040 func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) {
2041 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)))
2042 if r1 == socket_error {
2046 err = syscall.EINVAL
2052 func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) {
2053 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)))
2054 if r1 == socket_error {
2058 err = syscall.EINVAL
2064 func GetHostByName(name string) (h *Hostent, err error) {
2066 _p0, err = syscall.BytePtrFromString(name)
2070 return _GetHostByName(_p0)
2073 func _GetHostByName(name *byte) (h *Hostent, err error) {
2074 r0, _, e1 := syscall.Syscall(procgethostbyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)
2075 h = (*Hostent)(unsafe.Pointer(r0))
2080 err = syscall.EINVAL
2086 func GetServByName(name string, proto string) (s *Servent, err error) {
2088 _p0, err = syscall.BytePtrFromString(name)
2093 _p1, err = syscall.BytePtrFromString(proto)
2097 return _GetServByName(_p0, _p1)
2100 func _GetServByName(name *byte, proto *byte) (s *Servent, err error) {
2101 r0, _, e1 := syscall.Syscall(procgetservbyname.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto)), 0)
2102 s = (*Servent)(unsafe.Pointer(r0))
2107 err = syscall.EINVAL
2113 func Ntohs(netshort uint16) (u uint16) {
2114 r0, _, _ := syscall.Syscall(procntohs.Addr(), 1, uintptr(netshort), 0, 0)
2119 func GetProtoByName(name string) (p *Protoent, err error) {
2121 _p0, err = syscall.BytePtrFromString(name)
2125 return _GetProtoByName(_p0)
2128 func _GetProtoByName(name *byte) (p *Protoent, err error) {
2129 r0, _, e1 := syscall.Syscall(procgetprotobyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0)
2130 p = (*Protoent)(unsafe.Pointer(r0))
2135 err = syscall.EINVAL
2141 func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) {
2143 _p0, status = syscall.UTF16PtrFromString(name)
2147 return _DnsQuery(_p0, qtype, options, extra, qrs, pr)
2150 func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) {
2151 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)))
2153 status = syscall.Errno(r0)
2158 func DnsRecordListFree(rl *DNSRecord, freetype uint32) {
2159 syscall.Syscall(procDnsRecordListFree.Addr(), 2, uintptr(unsafe.Pointer(rl)), uintptr(freetype), 0)
2163 func DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) {
2164 r0, _, _ := syscall.Syscall(procDnsNameCompare_W.Addr(), 2, uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2)), 0)
2169 func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) {
2170 r0, _, _ := syscall.Syscall6(procGetAddrInfoW.Addr(), 4, uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result)), 0, 0)
2172 sockerr = syscall.Errno(r0)
2177 func FreeAddrInfoW(addrinfo *AddrinfoW) {
2178 syscall.Syscall(procFreeAddrInfoW.Addr(), 1, uintptr(unsafe.Pointer(addrinfo)), 0, 0)
2182 func GetIfEntry(pIfRow *MibIfRow) (errcode error) {
2183 r0, _, _ := syscall.Syscall(procGetIfEntry.Addr(), 1, uintptr(unsafe.Pointer(pIfRow)), 0, 0)
2185 errcode = syscall.Errno(r0)
2190 func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) {
2191 r0, _, _ := syscall.Syscall(procGetAdaptersInfo.Addr(), 2, uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol)), 0)
2193 errcode = syscall.Errno(r0)
2198 func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) {
2199 r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(handle), uintptr(flags), 0)
2204 err = syscall.EINVAL
2210 func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) {
2211 r0, _, e1 := syscall.Syscall(procWSAEnumProtocolsW.Addr(), 3, uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength)))
2217 err = syscall.EINVAL
2223 func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) {
2224 r0, _, _ := syscall.Syscall6(procGetAdaptersAddresses.Addr(), 5, uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer)), 0)
2226 errcode = syscall.Errno(r0)
2231 func GetACP() (acp uint32) {
2232 r0, _, _ := syscall.Syscall(procGetACP.Addr(), 0, 0, 0, 0)
2237 func MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) {
2238 r0, _, e1 := syscall.Syscall6(procMultiByteToWideChar.Addr(), 6, uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar))
2244 err = syscall.EINVAL
2250 func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) {
2251 r1, _, e1 := syscall.Syscall6(procTranslateNameW.Addr(), 5, uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize)), 0)
2256 err = syscall.EINVAL
2262 func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) {
2263 r1, _, e1 := syscall.Syscall(procGetUserNameExW.Addr(), 3, uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize)))
2268 err = syscall.EINVAL
2274 func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) {
2275 r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0)
2277 neterr = syscall.Errno(r0)
2282 func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) {
2283 r0, _, _ := syscall.Syscall(procNetGetJoinInformation.Addr(), 3, uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType)))
2285 neterr = syscall.Errno(r0)
2290 func NetApiBufferFree(buf *byte) (neterr error) {
2291 r0, _, _ := syscall.Syscall(procNetApiBufferFree.Addr(), 1, uintptr(unsafe.Pointer(buf)), 0, 0)
2293 neterr = syscall.Errno(r0)
2298 func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {
2299 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)
2304 err = syscall.EINVAL
2310 func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {
2311 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)
2316 err = syscall.EINVAL
2322 func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) {
2323 r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid)), 0)
2328 err = syscall.EINVAL
2334 func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) {
2335 r1, _, e1 := syscall.Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid)), 0)
2340 err = syscall.EINVAL
2346 func GetLengthSid(sid *SID) (len uint32) {
2347 r0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
2352 func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) {
2353 r1, _, e1 := syscall.Syscall(procCopySid.Addr(), 3, uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid)))
2358 err = syscall.EINVAL
2364 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) {
2365 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)
2370 err = syscall.EINVAL
2376 func FreeSid(sid *SID) (err error) {
2377 r1, _, e1 := syscall.Syscall(procFreeSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
2382 err = syscall.EINVAL
2388 func EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) {
2389 r0, _, _ := syscall.Syscall(procEqualSid.Addr(), 2, uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2)), 0)
2394 func OpenProcessToken(h Handle, access uint32, token *Token) (err error) {
2395 r1, _, e1 := syscall.Syscall(procOpenProcessToken.Addr(), 3, uintptr(h), uintptr(access), uintptr(unsafe.Pointer(token)))
2400 err = syscall.EINVAL
2406 func GetTokenInformation(t Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) {
2407 r1, _, e1 := syscall.Syscall6(procGetTokenInformation.Addr(), 5, uintptr(t), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen)), 0)
2412 err = syscall.EINVAL
2418 func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) {
2419 r1, _, e1 := syscall.Syscall(procGetUserProfileDirectoryW.Addr(), 3, uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen)))
2424 err = syscall.EINVAL