1// Code generated by 'go generate'; DO NOT EDIT. 2 3package windows 4 5import ( 6 "internal/syscall/windows/sysdll" 7 "syscall" 8 "unsafe" 9) 10 11var _ unsafe.Pointer 12 13// Do the interface allocations only once for common 14// Errno values. 15const ( 16 errnoERROR_IO_PENDING = 997 17) 18 19var ( 20 errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) 21 errERROR_EINVAL error = syscall.EINVAL 22) 23 24// errnoErr returns common boxed Errno values, to prevent 25// allocations at runtime. 26func errnoErr(e syscall.Errno) error { 27 switch e { 28 case 0: 29 return errERROR_EINVAL 30 case errnoERROR_IO_PENDING: 31 return errERROR_IO_PENDING 32 } 33 // TODO: add more here, after collecting data on the common 34 // error values see on Windows. (perhaps when running 35 // all.bat?) 36 return e 37} 38 39var ( 40 modadvapi32 = syscall.NewLazyDLL(sysdll.Add("advapi32.dll")) 41 modbcryptprimitives = syscall.NewLazyDLL(sysdll.Add("bcryptprimitives.dll")) 42 modiphlpapi = syscall.NewLazyDLL(sysdll.Add("iphlpapi.dll")) 43 modkernel32 = syscall.NewLazyDLL(sysdll.Add("kernel32.dll")) 44 modnetapi32 = syscall.NewLazyDLL(sysdll.Add("netapi32.dll")) 45 modntdll = syscall.NewLazyDLL(sysdll.Add("ntdll.dll")) 46 modpsapi = syscall.NewLazyDLL(sysdll.Add("psapi.dll")) 47 moduserenv = syscall.NewLazyDLL(sysdll.Add("userenv.dll")) 48 modws2_32 = syscall.NewLazyDLL(sysdll.Add("ws2_32.dll")) 49 50 procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges") 51 procDuplicateTokenEx = modadvapi32.NewProc("DuplicateTokenEx") 52 procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf") 53 procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW") 54 procOpenSCManagerW = modadvapi32.NewProc("OpenSCManagerW") 55 procOpenServiceW = modadvapi32.NewProc("OpenServiceW") 56 procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") 57 procQueryServiceStatus = modadvapi32.NewProc("QueryServiceStatus") 58 procRevertToSelf = modadvapi32.NewProc("RevertToSelf") 59 procSetTokenInformation = modadvapi32.NewProc("SetTokenInformation") 60 procProcessPrng = modbcryptprimitives.NewProc("ProcessPrng") 61 procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses") 62 procCreateEventW = modkernel32.NewProc("CreateEventW") 63 procGetACP = modkernel32.NewProc("GetACP") 64 procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW") 65 procGetConsoleCP = modkernel32.NewProc("GetConsoleCP") 66 procGetCurrentThread = modkernel32.NewProc("GetCurrentThread") 67 procGetFileInformationByHandleEx = modkernel32.NewProc("GetFileInformationByHandleEx") 68 procGetFinalPathNameByHandleW = modkernel32.NewProc("GetFinalPathNameByHandleW") 69 procGetModuleFileNameW = modkernel32.NewProc("GetModuleFileNameW") 70 procGetTempPath2W = modkernel32.NewProc("GetTempPath2W") 71 procGetVolumeInformationByHandleW = modkernel32.NewProc("GetVolumeInformationByHandleW") 72 procGetVolumeNameForVolumeMountPointW = modkernel32.NewProc("GetVolumeNameForVolumeMountPointW") 73 procLockFileEx = modkernel32.NewProc("LockFileEx") 74 procModule32FirstW = modkernel32.NewProc("Module32FirstW") 75 procModule32NextW = modkernel32.NewProc("Module32NextW") 76 procMoveFileExW = modkernel32.NewProc("MoveFileExW") 77 procMultiByteToWideChar = modkernel32.NewProc("MultiByteToWideChar") 78 procRtlLookupFunctionEntry = modkernel32.NewProc("RtlLookupFunctionEntry") 79 procRtlVirtualUnwind = modkernel32.NewProc("RtlVirtualUnwind") 80 procSetFileInformationByHandle = modkernel32.NewProc("SetFileInformationByHandle") 81 procUnlockFileEx = modkernel32.NewProc("UnlockFileEx") 82 procVirtualQuery = modkernel32.NewProc("VirtualQuery") 83 procNetShareAdd = modnetapi32.NewProc("NetShareAdd") 84 procNetShareDel = modnetapi32.NewProc("NetShareDel") 85 procNetUserGetLocalGroups = modnetapi32.NewProc("NetUserGetLocalGroups") 86 procRtlGetVersion = modntdll.NewProc("RtlGetVersion") 87 procGetProcessMemoryInfo = modpsapi.NewProc("GetProcessMemoryInfo") 88 procCreateEnvironmentBlock = moduserenv.NewProc("CreateEnvironmentBlock") 89 procDestroyEnvironmentBlock = moduserenv.NewProc("DestroyEnvironmentBlock") 90 procGetProfilesDirectoryW = moduserenv.NewProc("GetProfilesDirectoryW") 91 procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") 92 procWSASocketW = modws2_32.NewProc("WSASocketW") 93) 94 95func adjustTokenPrivileges(token syscall.Token, disableAllPrivileges bool, newstate *TOKEN_PRIVILEGES, buflen uint32, prevstate *TOKEN_PRIVILEGES, returnlen *uint32) (ret uint32, err error) { 96 var _p0 uint32 97 if disableAllPrivileges { 98 _p0 = 1 99 } 100 r0, _, e1 := syscall.Syscall6(procAdjustTokenPrivileges.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) 101 ret = uint32(r0) 102 if true { 103 err = errnoErr(e1) 104 } 105 return 106} 107 108func DuplicateTokenEx(hExistingToken syscall.Token, dwDesiredAccess uint32, lpTokenAttributes *syscall.SecurityAttributes, impersonationLevel uint32, tokenType TokenType, phNewToken *syscall.Token) (err error) { 109 r1, _, e1 := syscall.Syscall6(procDuplicateTokenEx.Addr(), 6, uintptr(hExistingToken), uintptr(dwDesiredAccess), uintptr(unsafe.Pointer(lpTokenAttributes)), uintptr(impersonationLevel), uintptr(tokenType), uintptr(unsafe.Pointer(phNewToken))) 110 if r1 == 0 { 111 err = errnoErr(e1) 112 } 113 return 114} 115 116func ImpersonateSelf(impersonationlevel uint32) (err error) { 117 r1, _, e1 := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(impersonationlevel), 0, 0) 118 if r1 == 0 { 119 err = errnoErr(e1) 120 } 121 return 122} 123 124func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err error) { 125 r1, _, e1 := syscall.Syscall(procLookupPrivilegeValueW.Addr(), 3, uintptr(unsafe.Pointer(systemname)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) 126 if r1 == 0 { 127 err = errnoErr(e1) 128 } 129 return 130} 131 132func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle syscall.Handle, err error) { 133 r0, _, e1 := syscall.Syscall(procOpenSCManagerW.Addr(), 3, uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access)) 134 handle = syscall.Handle(r0) 135 if handle == 0 { 136 err = errnoErr(e1) 137 } 138 return 139} 140 141func OpenService(mgr syscall.Handle, serviceName *uint16, access uint32) (handle syscall.Handle, err error) { 142 r0, _, e1 := syscall.Syscall(procOpenServiceW.Addr(), 3, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access)) 143 handle = syscall.Handle(r0) 144 if handle == 0 { 145 err = errnoErr(e1) 146 } 147 return 148} 149 150func OpenThreadToken(h syscall.Handle, access uint32, openasself bool, token *syscall.Token) (err error) { 151 var _p0 uint32 152 if openasself { 153 _p0 = 1 154 } 155 r1, _, e1 := syscall.Syscall6(procOpenThreadToken.Addr(), 4, uintptr(h), uintptr(access), uintptr(_p0), uintptr(unsafe.Pointer(token)), 0, 0) 156 if r1 == 0 { 157 err = errnoErr(e1) 158 } 159 return 160} 161 162func QueryServiceStatus(hService syscall.Handle, lpServiceStatus *SERVICE_STATUS) (err error) { 163 r1, _, e1 := syscall.Syscall(procQueryServiceStatus.Addr(), 2, uintptr(hService), uintptr(unsafe.Pointer(lpServiceStatus)), 0) 164 if r1 == 0 { 165 err = errnoErr(e1) 166 } 167 return 168} 169 170func RevertToSelf() (err error) { 171 r1, _, e1 := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0) 172 if r1 == 0 { 173 err = errnoErr(e1) 174 } 175 return 176} 177 178func SetTokenInformation(tokenHandle syscall.Token, tokenInformationClass uint32, tokenInformation uintptr, tokenInformationLength uint32) (err error) { 179 r1, _, e1 := syscall.Syscall6(procSetTokenInformation.Addr(), 4, uintptr(tokenHandle), uintptr(tokenInformationClass), uintptr(tokenInformation), uintptr(tokenInformationLength), 0, 0) 180 if r1 == 0 { 181 err = errnoErr(e1) 182 } 183 return 184} 185 186func ProcessPrng(buf []byte) (err error) { 187 var _p0 *byte 188 if len(buf) > 0 { 189 _p0 = &buf[0] 190 } 191 r1, _, e1 := syscall.Syscall(procProcessPrng.Addr(), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0) 192 if r1 == 0 { 193 err = errnoErr(e1) 194 } 195 return 196} 197 198func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) { 199 r0, _, _ := syscall.Syscall6(procGetAdaptersAddresses.Addr(), 5, uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer)), 0) 200 if r0 != 0 { 201 errcode = syscall.Errno(r0) 202 } 203 return 204} 205 206func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle syscall.Handle, err error) { 207 r0, _, e1 := syscall.Syscall6(procCreateEventW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name)), 0, 0) 208 handle = syscall.Handle(r0) 209 if handle == 0 { 210 err = errnoErr(e1) 211 } 212 return 213} 214 215func GetACP() (acp uint32) { 216 r0, _, _ := syscall.Syscall(procGetACP.Addr(), 0, 0, 0, 0) 217 acp = uint32(r0) 218 return 219} 220 221func GetComputerNameEx(nameformat uint32, buf *uint16, n *uint32) (err error) { 222 r1, _, e1 := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nameformat), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) 223 if r1 == 0 { 224 err = errnoErr(e1) 225 } 226 return 227} 228 229func GetConsoleCP() (ccp uint32) { 230 r0, _, _ := syscall.Syscall(procGetConsoleCP.Addr(), 0, 0, 0, 0) 231 ccp = uint32(r0) 232 return 233} 234 235func GetCurrentThread() (pseudoHandle syscall.Handle, err error) { 236 r0, _, e1 := syscall.Syscall(procGetCurrentThread.Addr(), 0, 0, 0, 0) 237 pseudoHandle = syscall.Handle(r0) 238 if pseudoHandle == 0 { 239 err = errnoErr(e1) 240 } 241 return 242} 243 244func GetFileInformationByHandleEx(handle syscall.Handle, class uint32, info *byte, bufsize uint32) (err error) { 245 r1, _, e1 := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(), 4, uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(info)), uintptr(bufsize), 0, 0) 246 if r1 == 0 { 247 err = errnoErr(e1) 248 } 249 return 250} 251 252func GetFinalPathNameByHandle(file syscall.Handle, filePath *uint16, filePathSize uint32, flags uint32) (n uint32, err error) { 253 r0, _, e1 := syscall.Syscall6(procGetFinalPathNameByHandleW.Addr(), 4, uintptr(file), uintptr(unsafe.Pointer(filePath)), uintptr(filePathSize), uintptr(flags), 0, 0) 254 n = uint32(r0) 255 if n == 0 { 256 err = errnoErr(e1) 257 } 258 return 259} 260 261func GetModuleFileName(module syscall.Handle, fn *uint16, len uint32) (n uint32, err error) { 262 r0, _, e1 := syscall.Syscall(procGetModuleFileNameW.Addr(), 3, uintptr(module), uintptr(unsafe.Pointer(fn)), uintptr(len)) 263 n = uint32(r0) 264 if n == 0 { 265 err = errnoErr(e1) 266 } 267 return 268} 269 270func GetTempPath2(buflen uint32, buf *uint16) (n uint32, err error) { 271 r0, _, e1 := syscall.Syscall(procGetTempPath2W.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0) 272 n = uint32(r0) 273 if n == 0 { 274 err = errnoErr(e1) 275 } 276 return 277} 278 279func GetVolumeInformationByHandle(file syscall.Handle, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) { 280 r1, _, e1 := syscall.Syscall9(procGetVolumeInformationByHandleW.Addr(), 8, uintptr(file), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize), 0) 281 if r1 == 0 { 282 err = errnoErr(e1) 283 } 284 return 285} 286 287func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16, bufferlength uint32) (err error) { 288 r1, _, e1 := syscall.Syscall(procGetVolumeNameForVolumeMountPointW.Addr(), 3, uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferlength)) 289 if r1 == 0 { 290 err = errnoErr(e1) 291 } 292 return 293} 294 295func LockFileEx(file syscall.Handle, flags uint32, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *syscall.Overlapped) (err error) { 296 r1, _, e1 := syscall.Syscall6(procLockFileEx.Addr(), 6, uintptr(file), uintptr(flags), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) 297 if r1 == 0 { 298 err = errnoErr(e1) 299 } 300 return 301} 302 303func Module32First(snapshot syscall.Handle, moduleEntry *ModuleEntry32) (err error) { 304 r1, _, e1 := syscall.Syscall(procModule32FirstW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry)), 0) 305 if r1 == 0 { 306 err = errnoErr(e1) 307 } 308 return 309} 310 311func Module32Next(snapshot syscall.Handle, moduleEntry *ModuleEntry32) (err error) { 312 r1, _, e1 := syscall.Syscall(procModule32NextW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry)), 0) 313 if r1 == 0 { 314 err = errnoErr(e1) 315 } 316 return 317} 318 319func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) { 320 r1, _, e1 := syscall.Syscall(procMoveFileExW.Addr(), 3, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags)) 321 if r1 == 0 { 322 err = errnoErr(e1) 323 } 324 return 325} 326 327func MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) { 328 r0, _, e1 := syscall.Syscall6(procMultiByteToWideChar.Addr(), 6, uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar)) 329 nwrite = int32(r0) 330 if nwrite == 0 { 331 err = errnoErr(e1) 332 } 333 return 334} 335 336func RtlLookupFunctionEntry(pc uintptr, baseAddress *uintptr, table *byte) (ret uintptr) { 337 r0, _, _ := syscall.Syscall(procRtlLookupFunctionEntry.Addr(), 3, uintptr(pc), uintptr(unsafe.Pointer(baseAddress)), uintptr(unsafe.Pointer(table))) 338 ret = uintptr(r0) 339 return 340} 341 342func RtlVirtualUnwind(handlerType uint32, baseAddress uintptr, pc uintptr, entry uintptr, ctxt uintptr, data *uintptr, frame *uintptr, ctxptrs *byte) (ret uintptr) { 343 r0, _, _ := syscall.Syscall9(procRtlVirtualUnwind.Addr(), 8, uintptr(handlerType), uintptr(baseAddress), uintptr(pc), uintptr(entry), uintptr(ctxt), uintptr(unsafe.Pointer(data)), uintptr(unsafe.Pointer(frame)), uintptr(unsafe.Pointer(ctxptrs)), 0) 344 ret = uintptr(r0) 345 return 346} 347 348func SetFileInformationByHandle(handle syscall.Handle, fileInformationClass uint32, buf unsafe.Pointer, bufsize uint32) (err error) { 349 r1, _, e1 := syscall.Syscall6(procSetFileInformationByHandle.Addr(), 4, uintptr(handle), uintptr(fileInformationClass), uintptr(buf), uintptr(bufsize), 0, 0) 350 if r1 == 0 { 351 err = errnoErr(e1) 352 } 353 return 354} 355 356func UnlockFileEx(file syscall.Handle, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *syscall.Overlapped) (err error) { 357 r1, _, e1 := syscall.Syscall6(procUnlockFileEx.Addr(), 5, uintptr(file), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped)), 0) 358 if r1 == 0 { 359 err = errnoErr(e1) 360 } 361 return 362} 363 364func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) { 365 r1, _, e1 := syscall.Syscall(procVirtualQuery.Addr(), 3, uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) 366 if r1 == 0 { 367 err = errnoErr(e1) 368 } 369 return 370} 371 372func NetShareAdd(serverName *uint16, level uint32, buf *byte, parmErr *uint16) (neterr error) { 373 r0, _, _ := syscall.Syscall6(procNetShareAdd.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(parmErr)), 0, 0) 374 if r0 != 0 { 375 neterr = syscall.Errno(r0) 376 } 377 return 378} 379 380func NetShareDel(serverName *uint16, netName *uint16, reserved uint32) (neterr error) { 381 r0, _, _ := syscall.Syscall(procNetShareDel.Addr(), 3, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(netName)), uintptr(reserved)) 382 if r0 != 0 { 383 neterr = syscall.Errno(r0) 384 } 385 return 386} 387 388func NetUserGetLocalGroups(serverName *uint16, userName *uint16, level uint32, flags uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32) (neterr error) { 389 r0, _, _ := syscall.Syscall9(procNetUserGetLocalGroups.Addr(), 8, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(flags), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), 0) 390 if r0 != 0 { 391 neterr = syscall.Errno(r0) 392 } 393 return 394} 395 396func rtlGetVersion(info *_OSVERSIONINFOW) { 397 syscall.Syscall(procRtlGetVersion.Addr(), 1, uintptr(unsafe.Pointer(info)), 0, 0) 398 return 399} 400 401func GetProcessMemoryInfo(handle syscall.Handle, memCounters *PROCESS_MEMORY_COUNTERS, cb uint32) (err error) { 402 r1, _, e1 := syscall.Syscall(procGetProcessMemoryInfo.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(memCounters)), uintptr(cb)) 403 if r1 == 0 { 404 err = errnoErr(e1) 405 } 406 return 407} 408 409func CreateEnvironmentBlock(block **uint16, token syscall.Token, inheritExisting bool) (err error) { 410 var _p0 uint32 411 if inheritExisting { 412 _p0 = 1 413 } 414 r1, _, e1 := syscall.Syscall(procCreateEnvironmentBlock.Addr(), 3, uintptr(unsafe.Pointer(block)), uintptr(token), uintptr(_p0)) 415 if r1 == 0 { 416 err = errnoErr(e1) 417 } 418 return 419} 420 421func DestroyEnvironmentBlock(block *uint16) (err error) { 422 r1, _, e1 := syscall.Syscall(procDestroyEnvironmentBlock.Addr(), 1, uintptr(unsafe.Pointer(block)), 0, 0) 423 if r1 == 0 { 424 err = errnoErr(e1) 425 } 426 return 427} 428 429func GetProfilesDirectory(dir *uint16, dirLen *uint32) (err error) { 430 r1, _, e1 := syscall.Syscall(procGetProfilesDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen)), 0) 431 if r1 == 0 { 432 err = errnoErr(e1) 433 } 434 return 435} 436 437func WSAGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { 438 var _p0 uint32 439 if wait { 440 _p0 = 1 441 } 442 r1, _, e1 := syscall.Syscall6(procWSAGetOverlappedResult.Addr(), 5, uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)), 0) 443 if r1 == 0 { 444 err = errnoErr(e1) 445 } 446 return 447} 448 449func WSASocket(af int32, typ int32, protocol int32, protinfo *syscall.WSAProtocolInfo, group uint32, flags uint32) (handle syscall.Handle, err error) { 450 r0, _, e1 := syscall.Syscall6(procWSASocketW.Addr(), 6, uintptr(af), uintptr(typ), uintptr(protocol), uintptr(unsafe.Pointer(protinfo)), uintptr(group), uintptr(flags)) 451 handle = syscall.Handle(r0) 452 if handle == syscall.InvalidHandle { 453 err = errnoErr(e1) 454 } 455 return 456} 457