Source Edit

This module implements a small wrapper for some needed Win API procedures, so that the Nim compiler does not depend on the huge Windows module.

Imports

dynlib

Types

  1. AddrInfo = object
  2. ai_flags*: cint ## Input flags.
  3. ai_family*: cint ## Address family of socket.
  4. ai_socktype*: cint ## Socket type.
  5. ai_protocol*: cint ## Protocol of socket.
  6. ai_addrlen*: csize_t ## Length of socket address.
  7. ai_canonname*: cstring ## Canonical name of service location.
  8. ai_addr*: ptr SockAddr ## Socket address of socket.
  9. ai_next*: ptr AddrInfo ## Pointer to next in list.

Source Edit

  1. BY_HANDLE_FILE_INFORMATION = object
  2. dwFileAttributes*: DWORD
  3. ftCreationTime*: FILETIME
  4. ftLastAccessTime*: FILETIME
  5. ftLastWriteTime*: FILETIME
  6. dwVolumeSerialNumber*: DWORD
  7. nFileSizeHigh*: DWORD
  8. nFileSizeLow*: DWORD
  9. nNumberOfLinks*: DWORD
  10. nFileIndexHigh*: DWORD
  11. nFileIndexLow*: DWORD

Source Edit

  1. BYTE = uint8

Source Edit

  1. DWORD = int32

Source Edit

  1. FILETIME = object
  2. dwLowDateTime*: DWORD
  3. dwHighDateTime*: DWORD

CANNOT BE int64 BECAUSE OF ALIGNMENT Source Edit

  1. GUID = object
  2. D1*: int32
  3. D2*: int16
  4. D3*: int16
  5. D4*: array[0 .. 7, int8]

Source Edit

  1. Handle = int

Source Edit

  1. HDC = Handle

Source Edit

  1. HGLRC = Handle

Source Edit

  1. Hostent = object
  2. h_name*: cstring
  3. h_aliases*: cstringArray
  4. h_addrtype*: int16
  5. h_length*: int16
  6. h_addr_list*: cstringArray

Source Edit

  1. In6_addr {.importc: "IN6_ADDR", header: "winsock2.h".} = object
  2. bytes* {.importc: "u.Byte".}: array[0 .. 15, char]

Source Edit

  1. InAddr {.importc: "IN_ADDR", header: "winsock2.h", union.} = object
  2. s_addr*: uint32

Source Edit

  1. KEY_EVENT_RECORD = object
  2. eventType*: int16
  3. bKeyDown*: WINBOOL
  4. wRepeatCount*: int16
  5. wVirtualKeyCode*: int16
  6. wVirtualScanCode*: int16
  7. uChar*: int16
  8. dwControlKeyState*: DWORD

Source Edit

  1. LONG = int32

Source Edit

  1. LPFIBER_START_ROUTINE = proc (param: pointer) {.stdcall.}

Source Edit

  1. LPFILETIME = ptr FILETIME

Source Edit

  1. LPINT = ptr int32

Source Edit

  1. OSVERSIONINFO = object
  2. dwOSVersionInfoSize*: DWORD
  3. dwMajorVersion*: DWORD
  4. dwMinorVersion*: DWORD
  5. dwBuildNumber*: DWORD
  6. dwPlatformId*: DWORD
  7. szCSDVersion*: array[0 .. 127, WinChar]

Source Edit

  1. OVERLAPPED {.pure, inheritable.} = object
  2. internal*: PULONG
  3. internalHigh*: PULONG
  4. offset*: DWORD
  5. offsetHigh*: DWORD
  6. hEvent*: Handle

Source Edit

  1. PBOOL = ptr WINBOOL

Source Edit

  1. PDWORD = ptr DWORD

Source Edit

  1. POVERLAPPED = ptr OVERLAPPED

Source Edit

  1. POVERLAPPED_COMPLETION_ROUTINE = proc (para1: DWORD; para2: DWORD;
  2. para3: POVERLAPPED) {.stdcall.}

Source Edit

  1. PROCESS_INFORMATION = object
  2. hProcess*: Handle
  3. hThread*: Handle
  4. dwProcessId*: int32
  5. dwThreadId*: int32

Source Edit

  1. Protoent = object
  2. p_name*: cstring
  3. p_aliases*: cstringArray
  4. p_proto*: cshort

Source Edit

  1. PSID = ptr SID

Source Edit

  1. PULONG = ptr int

Source Edit

  1. PULONG_PTR = ptr uint

Source Edit

  1. PWOHandleArray = ptr WOHandleArray

Source Edit

  1. SECURITY_ATTRIBUTES = object
  2. nLength*: int32
  3. lpSecurityDescriptor*: pointer
  4. bInheritHandle*: WINBOOL

Source Edit

  1. Servent = object
  2. s_name*: cstring
  3. s_aliases*: cstringArray
  4. when defined(cpu64):
  5. s_proto*: cstring
  6. s_port*: int16
  7. else:
  8. s_port*: int16
  9. s_proto*: cstring

Source Edit

  1. SID {.importc, header: "<windows.h>".} = object

Source Edit

  1. SID_IDENTIFIER_AUTHORITY {.importc, header: "<windows.h>".} = object
  2. value* {.importc: "Value".}: array[6, BYTE]

Source Edit

  1. SockAddr {.importc: "SOCKADDR", header: "winsock2.h".} = object
  2. sa_family*: uint16
  3. sa_data*: array[0 .. 13, char]

Source Edit

  1. Sockaddr_in {.importc: "SOCKADDR_IN", header: "winsock2.h".} = object
  2. sin_family*: uint16
  3. sin_port*: uint16
  4. sin_addr*: InAddr
  5. sin_zero*: array[0 .. 7, char]

Source Edit

  1. Sockaddr_in6 {.importc: "SOCKADDR_IN6", header: "ws2tcpip.h".} = object
  2. sin6_family*: uint16
  3. sin6_port*: uint16
  4. sin6_flowinfo*: int32
  5. sin6_addr*: In6_addr
  6. sin6_scope_id*: int32

Source Edit

  1. Sockaddr_storage {.importc: "SOCKADDR_STORAGE", header: "winsock2.h".} = object
  2. ss_family*: uint16

Source Edit

  1. SocketHandle = distinct int

Source Edit

  1. SockLen = cuint

Source Edit

  1. STARTUPINFO = object
  2. cb*: int32
  3. lpReserved*: cstring
  4. lpDesktop*: cstring
  5. lpTitle*: cstring
  6. dwX*: int32
  7. dwY*: int32
  8. dwXSize*: int32
  9. dwYSize*: int32
  10. dwXCountChars*: int32
  11. dwYCountChars*: int32
  12. dwFillAttribute*: int32
  13. dwFlags*: int32
  14. wShowWindow*: int16
  15. cbReserved2*: int16
  16. lpReserved2*: pointer
  17. hStdInput*: Handle
  18. hStdOutput*: Handle
  19. hStdError*: Handle

Source Edit

  1. TFdSet = object
  2. fd_count*: cint
  3. fd_array*: array[0 .. 64 - 1, SocketHandle]

Source Edit

  1. Timeval = object
  2. tv_sec*, tv_usec*: int32

Source Edit

  1. TWSABuf {.importc: "WSABUF", header: "winsock2.h".} = object
  2. len*: ULONG
  3. buf*: cstring

Source Edit

  1. ULONG = int32

Source Edit

  1. ULONG_PTR = uint

Source Edit

  1. WAITORTIMERCALLBACK = proc (para1: pointer; para2: int32) {.stdcall.}

Source Edit

  1. WIN32_FIND_DATA {.pure.} = object
  2. dwFileAttributes*: int32
  3. ftCreationTime*: FILETIME
  4. ftLastAccessTime*: FILETIME
  5. ftLastWriteTime*: FILETIME
  6. nFileSizeHigh*: int32
  7. nFileSizeLow*: int32
  8. cFileName*: array[0 .. 260 - 1, WinChar]
  9. cAlternateFileName*: array[0 .. 13, WinChar]

Source Edit

  1. WINBOOL = int32

WINBOOL uses opposite convention as posix, !=0 meaning success. Source Edit

  1. WinChar = Utf16Char

Source Edit

  1. WinSizeT = uint64

Source Edit

  1. WOHandleArray = array[0 .. 0x00000040 - 1, Handle]

Source Edit

  1. WSAData {.importc: "WSADATA", header: "winsock2.h".} = object

Source Edit

  1. WSAPROC_ACCEPTEX = proc (sListenSocket: SocketHandle;
  2. sAcceptSocket: SocketHandle; lpOutputBuffer: pointer;
  3. dwReceiveDataLength: DWORD;
  4. dwLocalAddressLength: DWORD;
  5. dwRemoteAddressLength: DWORD;
  6. lpdwBytesReceived: ptr DWORD; lpOverlapped: POVERLAPPED): bool {.
  7. stdcall, ...gcsafe, raises: [].}

Source Edit

  1. WSAPROC_CONNECTEX = proc (s: SocketHandle; name: ptr SockAddr; namelen: cint;
  2. lpSendBuffer: pointer; dwSendDataLength: DWORD;
  3. lpdwBytesSent: ptr DWORD; lpOverlapped: POVERLAPPED): bool {.
  4. stdcall, ...gcsafe, raises: [].}

Source Edit

  1. WSAPROC_GETACCEPTEXSOCKADDRS = proc (lpOutputBuffer: pointer;
  2. dwReceiveDataLength: DWORD;
  3. dwLocalAddressLength: DWORD;
  4. dwRemoteAddressLength: DWORD;
  5. LocalSockaddr: ptr PSockAddr;
  6. LocalSockaddrLength: ptr cint;
  7. RemoteSockaddr: ptr PSockAddr;
  8. RemoteSockaddrLength: ptr cint) {.stdcall,
  9. ...gcsafe, raises: [].}

Source Edit

Vars

  1. INVALID_SOCKET {.importc, header: "winsock2.h".}: SocketHandle

Source Edit

  1. SO_ACCEPTCONN {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SO_BROADCAST {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SO_DEBUG {.importc, header: "winsock2.h".}: cint

turn on debugging info recording Source Edit

  1. SO_DONTLINGER {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SO_DONTROUTE {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SO_ERROR {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SO_EXCLUSIVEADDRUSE {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SO_KEEPALIVE {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SO_LINGER {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SO_OOBINLINE {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SO_REUSEADDR {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SO_REUSEPORT {.importc: "SO_REUSEADDR", header: "winsock2.h".}: cint

Source Edit

  1. SO_USELOOPBACK {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SOL_SOCKET {.importc, header: "winsock2.h".}: cint

Source Edit

  1. SOMAXCONN {.importc, header: "winsock2.h".}: cint

Source Edit

  1. TCP_NODELAY {.importc, header: "winsock2.h".}: cint

Source Edit

  1. WSAID_ACCEPTEX: GUID = GUID(D1: 0xB5367DF1'i32, D2: 0xCBAC'i16, D3: 0x000011CF, D4: [
  2. 0x95'i8, 0xCA'i8, 0x00'i8, 0x80'i8, 0x5F'i8, 0x48'i8, 0xA1'i8, 0x92'i8])

Source Edit

  1. WSAID_CONNECTEX: GUID = GUID(D1: 0x25A207B9, D2: 0xDDF3'i16, D3: 0x00004660, D4: [
  2. 0x8E'i8, 0xE9'i8, 0x76'i8, 0xE5'i8, 0x8C'i8, 0x74'i8, 0x06'i8, 0x3E'i8])

Source Edit

  1. WSAID_GETACCEPTEXSOCKADDRS: GUID = GUID(D1: 0xB5367DF2'i32, D2: 0xCBAC'i16,
  2. D3: 0x000011CF, D4: [0x95'i8, 0xCA'i8,
  3. 0x00'i8, 0x80'i8, 0x5F'i8, 0x48'i8, 0xA1'i8, 0x92'i8])

Source Edit

Consts

  1. AF_INET = 2

Source Edit

  1. AF_INET6 = 23

Source Edit

  1. AF_UNSPEC = 0

Source Edit

  1. AI_V4MAPPED = 0x00000008

Source Edit

  1. CREATE_ALWAYS = 2'i32

Source Edit

  1. CREATE_NEW = 1'i32

Source Edit

  1. CREATE_NO_WINDOW = 0x08000000'i32

Source Edit

  1. CREATE_UNICODE_ENVIRONMENT = 1024'i32

Source Edit

  1. DETACHED_PROCESS = 8'i32

Source Edit

  1. DOMAIN_ALIAS_RID_ADMINS = 544

Source Edit

  1. DUPLICATE_SAME_ACCESS = 2

Source Edit

  1. ERROR_ACCESS_DENIED = 5

Source Edit

  1. ERROR_BAD_ARGUMENTS = 165

Source Edit

  1. ERROR_FILE_EXISTS = 80

Source Edit

  1. ERROR_FILE_NOT_FOUND = 2

https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes—0-499- Source Edit

  1. ERROR_HANDLE_EOF = 38

Source Edit

  1. ERROR_IO_PENDING = 997

Source Edit

  1. ERROR_LOCK_VIOLATION = 33

Source Edit

  1. ERROR_NETNAME_DELETED = 64

Source Edit

  1. ERROR_NO_MORE_FILES = 18

Source Edit

  1. ERROR_PATH_NOT_FOUND = 3

Source Edit

  1. FD_ACCEPT = 0x00000008'i32

Source Edit

  1. FD_ADDRESS_LIST_CHANGE = 0x00000200'i32

Source Edit

  1. FD_ALL_EVENTS = 0x000003FF'i32

Source Edit

  1. FD_CLOSE = 0x00000020'i32

Source Edit

  1. FD_CONNECT = 0x00000010'i32

Source Edit

  1. FD_GROUP_QQS = 0x00000080'i32

Source Edit

  1. FD_OOB = 0x00000004'i32

Source Edit

  1. FD_QQS = 0x00000040'i32

Source Edit

  1. FD_READ = 0x00000001'i32

Source Edit

  1. FD_ROUTING_INTERFACE_CHANGE = 0x00000100'i32

Source Edit

  1. FD_SETSIZE = 64

Source Edit

  1. FD_WRITE = 0x00000002'i32

Source Edit

  1. FIBER_FLAG_FLOAT_SWITCH = 0x00000001

Source Edit

  1. FILE_ATTRIBUTE_ARCHIVE = 0x00000020'i32

Source Edit

  1. FILE_ATTRIBUTE_COMPRESSED = 0x00000800'i32

Source Edit

  1. FILE_ATTRIBUTE_DEVICE = 0x00000040'i32

Source Edit

  1. FILE_ATTRIBUTE_DIRECTORY = 0x00000010'i32

Source Edit

  1. FILE_ATTRIBUTE_HIDDEN = 0x00000002'i32

Source Edit

  1. FILE_ATTRIBUTE_NORMAL = 0x00000080'i32

Source Edit

  1. FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x00002000'i32

Source Edit

  1. FILE_ATTRIBUTE_OFFLINE = 0x00001000'i32

Source Edit

  1. FILE_ATTRIBUTE_READONLY = 0x00000001'i32

Source Edit

  1. FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400'i32

Source Edit

  1. FILE_ATTRIBUTE_SPARSE_FILE = 0x00000200'i32

Source Edit

  1. FILE_ATTRIBUTE_SYSTEM = 0x00000004'i32

Source Edit

  1. FILE_ATTRIBUTE_TEMPORARY = 0x00000100'i32

Source Edit

  1. FILE_BEGIN = 0'i32

Source Edit

  1. FILE_FLAG_BACKUP_SEMANTICS = 0x02000000'i32

Source Edit

  1. FILE_FLAG_DELETE_ON_CLOSE = 0x04000000'i32

Source Edit

  1. FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000'i32

Source Edit

  1. FILE_FLAG_NO_BUFFERING = 0x20000000'i32

Source Edit

  1. FILE_FLAG_OPEN_NO_RECALL = 0x00100000'i32

Source Edit

  1. FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000'i32

Source Edit

  1. FILE_FLAG_OVERLAPPED = 0x40000000'i32

Source Edit

  1. FILE_FLAG_POSIX_SEMANTICS = 0x01000000'i32

Source Edit

  1. FILE_FLAG_RANDOM_ACCESS = 0x10000000'i32

Source Edit

  1. FILE_FLAG_SEQUENTIAL_SCAN = 0x08000000'i32

Source Edit

  1. FILE_FLAG_WRITE_THROUGH = 0x80000000'i32

Source Edit

  1. FILE_MAP_READ = 4'i32

Source Edit

  1. FILE_MAP_WRITE = 2'i32

Source Edit

  1. FILE_READ_DATA = 0x00000001

Source Edit

  1. FILE_SHARE_DELETE = 4'i32

Source Edit

  1. FILE_SHARE_READ = 1'i32

Source Edit

  1. FILE_SHARE_WRITE = 2'i32

Source Edit

  1. FILE_WRITE_DATA = 0x00000002

Source Edit

  1. GENERIC_ALL = 0x10000000'i32

Source Edit

  1. GENERIC_READ = 0x80000000'i32

Source Edit

  1. GENERIC_WRITE = 0x40000000'i32

Source Edit

  1. HANDLE_FLAG_INHERIT = 0x00000001'i32

Source Edit

  1. HIGH_PRIORITY_CLASS = 128'i32

Source Edit

  1. IDLE_PRIORITY_CLASS = 64'i32

Source Edit

  1. INADDR_ANY = 0'u32

Source Edit

  1. INADDR_BROADCAST = -1

Source Edit

  1. INADDR_LOOPBACK = 0x7F000001

Source Edit

  1. INADDR_NONE = -1

Source Edit

  1. INFINITE = -1'i32

Source Edit

  1. INVALID_FILE_SIZE = -1'i32

Source Edit

  1. INVALID_HANDLE_VALUE = -1

Source Edit

  1. INVALID_SET_FILE_POINTER = -1'i32

Source Edit

  1. IOC_IN = 0x80000000'i32

Source Edit

  1. IOC_INOUT = -1073741824'i32

Source Edit

  1. IOC_OUT = 0x40000000'i32

Source Edit

  1. IOC_WS2 = 0x08000000'i32

Source Edit

  1. MAX_PATH = 260

Source Edit

  1. MAXIMUM_WAIT_OBJECTS = 0x00000040

Source Edit

  1. MOVEFILE_COPY_ALLOWED = 0x00000002'i32

Source Edit

  1. MOVEFILE_CREATE_HARDLINK = 0x00000010'i32

Source Edit

  1. MOVEFILE_DELAY_UNTIL_REBOOT = 0x00000004'i32

Source Edit

  1. MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x00000020'i32

Source Edit

  1. MOVEFILE_REPLACE_EXISTING = 0x00000001'i32

Source Edit

  1. MOVEFILE_WRITE_THROUGH = 0x00000008'i32

Source Edit

  1. MSG_PEEK = 2

Source Edit

  1. NO_ERROR = 0'i32

Source Edit

  1. NORMAL_PRIORITY_CLASS = 32'i32

Source Edit

  1. OPEN_ALWAYS = 4'i32

Source Edit

  1. OPEN_EXISTING = 3'i32

Source Edit

  1. PAGE_EXECUTE = 0x00000010'i32

Source Edit

  1. PAGE_EXECUTE_READ = 0x00000020'i32

Source Edit

  1. PAGE_EXECUTE_READWRITE = 0x00000040'i32

Source Edit

  1. PAGE_NOACCESS = 0x00000001'i32

Source Edit

  1. PAGE_READONLY = 2'i32

Source Edit

  1. PAGE_READWRITE = 4'i32

Source Edit

  1. PIPE_ACCESS_DUPLEX = 0x00000003'i32

Source Edit

  1. PIPE_ACCESS_INBOUND = 1'i32

Source Edit

  1. PIPE_ACCESS_OUTBOUND = 2'i32

Source Edit

  1. PIPE_NOWAIT = 0x00000001'i32

Source Edit

  1. PROCESS_CREATE_PROCESS = 0x00000080'i32

Source Edit

  1. PROCESS_CREATE_THREAD = 0x00000002'i32

Source Edit

  1. PROCESS_DUP_HANDLE = 0x00000040'i32

Source Edit

  1. PROCESS_QUERY_INFORMATION = 0x00000400'i32

Source Edit

  1. PROCESS_QUERY_LIMITED_INFORMATION = 0x00001000'i32

Source Edit

  1. PROCESS_SET_INFORMATION = 0x00000200'i32

Source Edit

  1. PROCESS_SET_LIMITED_INFORMATION = 0x00002000'i32

Source Edit

  1. PROCESS_SET_QUOTA = 0x00000100'i32

Source Edit

  1. PROCESS_SET_SESSIONID = 0x00000004'i32

Source Edit

  1. PROCESS_SUSPEND_RESUME = 0x00000800'i32

Source Edit

  1. PROCESS_TERMINATE = 0x00000001'i32

Source Edit

  1. PROCESS_VM_OPERATION = 0x00000008'i32

Source Edit

  1. PROCESS_VM_READ = 0x00000010'i32

Source Edit

  1. PROCESS_VM_WRITE = 0x00000020'i32

Source Edit

  1. REALTIME_PRIORITY_CLASS = 256'i32

Source Edit

  1. SECURITY_BUILTIN_DOMAIN_RID = 32

Source Edit

  1. SECURITY_NT_AUTHORITY = [0'u, 0'u, 0'u, 0'u, 0'u, 5'u]

Source Edit

  1. SIO_GET_EXTENSION_FUNCTION_POINTER = -939524090'i32

Source Edit

  1. SO_UPDATE_ACCEPT_CONTEXT = 0x0000700B

Source Edit

  1. STARTF_USESHOWWINDOW = 1'i32

Source Edit

  1. STARTF_USESTDHANDLES = 256'i32

Source Edit

  1. STATUS_PENDING = 0x00000103

Source Edit

  1. STD_ERROR_HANDLE = -12'i32

Source Edit

  1. STD_INPUT_HANDLE = -10'i32

Source Edit

  1. STD_OUTPUT_HANDLE = -11'i32

Source Edit

  1. STILL_ACTIVE = 0x00000103'i32

Source Edit

  1. SW_SHOWNORMAL = 1'i32

Source Edit

  1. SYNCHRONIZE = 0x00100000'i32

Source Edit

  1. WAIT_FAILED = 0xFFFFFFFF'i32

Source Edit

  1. WAIT_OBJECT_0 = 0'i32

Source Edit

  1. WAIT_TIMEOUT = 0x00000102'i32

Source Edit

  1. WSADESCRIPTION_LEN = 256

Source Edit

  1. WSAEADDRINUSE = 10048

Source Edit

  1. WSAECONNABORTED = 10053

Source Edit

  1. WSAECONNRESET = 10054

Source Edit

  1. WSAEDISCON = 10101

Source Edit

  1. WSAEINPROGRESS = 10036

Source Edit

  1. WSAEINTR = 10004

Source Edit

  1. WSAENETRESET = 10052

Source Edit

  1. WSAENOTSOCK = 10038

Source Edit

  1. WSAESHUTDOWN = 10058

Source Edit

  1. WSAETIMEDOUT = 10060

Source Edit

  1. WSAEWOULDBLOCK = 10035

Source Edit

  1. WSANOTINITIALISED = 10093

Source Edit

  1. WSASYS_STATUS_LEN = 128

Source Edit

  1. WT_EXECUTEDEFAULT = 0x00000000'i32

Source Edit

  1. WT_EXECUTEINIOTHREAD = 0x00000001'i32

Source Edit

  1. WT_EXECUTEINPERSISTENTIOTHREAD = 0x00000040'i32

Source Edit

  1. WT_EXECUTEINPERSISTENTTHREAD = 0x00000080'i32

Source Edit

  1. WT_EXECUTEINTIMERTHREAD = 0x00000020'i32

Source Edit

  1. WT_EXECUTEINUITHREAD = 0x00000002'i32

Source Edit

  1. WT_EXECUTEINWAITTHREAD = 0x00000004'i32

Source Edit

  1. WT_EXECUTELONGFUNCTION = 0x00000010'i32

Source Edit

  1. WT_EXECUTEONLYONCE = 0x00000008'i32

Source Edit

  1. WT_TRANSFER_IMPERSONATION = 0x00000100'i32

Source Edit

Procs

  1. proc `==`(x, y: SocketHandle): bool {.borrow, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc accept(s: SocketHandle; a: ptr SockAddr; addrlen: ptr SockLen): SocketHandle {.
  2. stdcall, importc: "accept", dynlib: ws2dll, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc allocateAndInitializeSid(pIdentifierAuthority: ptr SID_IDENTIFIER_AUTHORITY;
  2. nSubAuthorityCount: BYTE; nSubAuthority0: DWORD;
  3. nSubAuthority1: DWORD; nSubAuthority2: DWORD;
  4. nSubAuthority3: DWORD; nSubAuthority4: DWORD;
  5. nSubAuthority5: DWORD; nSubAuthority6: DWORD;
  6. nSubAuthority7: DWORD; pSid: ptr PSID): WINBOOL {.
  7. stdcall, dynlib: "Advapi32", importc: "AllocateAndInitializeSid",
  8. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc bindSocket(s: SocketHandle; name: ptr SockAddr; namelen: SockLen): cint {.
  2. stdcall, importc: "bind", dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc checkTokenMembership(tokenHandle: Handle; sidToCheck: PSID; isMember: PBOOL): WINBOOL {.
  2. stdcall, dynlib: "Advapi32", importc: "CheckTokenMembership", ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc closeHandle(hObject: Handle): WINBOOL {.stdcall, dynlib: "kernel32",
  2. importc: "CloseHandle", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc closesocket(s: SocketHandle): cint {.stdcall, importc: "closesocket",
  2. dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc connect(s: SocketHandle; name: ptr SockAddr; namelen: SockLen): cint {.
  2. stdcall, importc: "connect", dynlib: ws2dll, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc ConvertThreadToFiber(param: pointer): pointer {.stdcall, discardable,
  2. dynlib: "kernel32", importc, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc ConvertThreadToFiberEx(param: pointer; flags: int32): pointer {.stdcall,
  2. discardable, dynlib: "kernel32", importc, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc copyFileW(lpExistingFileName, lpNewFileName: WideCString;
  2. bFailIfExists: WINBOOL): WINBOOL {.importc: "CopyFileW", stdcall,
  3. dynlib: "kernel32", sideEffect, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc createDirectoryW(pathName: WideCString; security: pointer = nil): int32 {.
  2. importc: "CreateDirectoryW", dynlib: "kernel32", stdcall, sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc createEvent(lpEventAttributes: ptr SECURITY_ATTRIBUTES;
  2. bManualReset: DWORD; bInitialState: DWORD;
  3. lpName: ptr Utf16Char): Handle {.stdcall, dynlib: "kernel32",
  4. importc: "CreateEventW", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc CreateFiber(stackSize: int; fn: LPFIBER_START_ROUTINE; param: pointer): pointer {.
  2. stdcall, discardable, dynlib: "kernel32", importc, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc CreateFiberEx(stkCommit: int; stkReserve: int; flags: int32;
  2. fn: LPFIBER_START_ROUTINE; param: pointer): pointer {.
  3. stdcall, discardable, dynlib: "kernel32", importc, ...raises: [], tags: [],
  4. forbids: [].}

Source Edit

  1. proc createFileA(lpFileName: cstring; dwDesiredAccess, dwShareMode: DWORD;
  2. lpSecurityAttributes: pointer;
  3. dwCreationDisposition, dwFlagsAndAttributes: DWORD;
  4. hTemplateFile: Handle): Handle {.stdcall, dynlib: "kernel32",
  5. importc: "CreateFileA", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc createFileMappingW(hFile: Handle; lpFileMappingAttributes: pointer;
  2. flProtect, dwMaximumSizeHigh: DWORD;
  3. dwMaximumSizeLow: DWORD; lpName: pointer): Handle {.
  4. stdcall, dynlib: "kernel32", importc: "CreateFileMappingW", ...raises: [],
  5. tags: [], forbids: [].}

Source Edit

  1. proc createFileW(lpFileName: WideCString; dwDesiredAccess, dwShareMode: DWORD;
  2. lpSecurityAttributes: pointer;
  3. dwCreationDisposition, dwFlagsAndAttributes: DWORD;
  4. hTemplateFile: Handle): Handle {.stdcall, dynlib: "kernel32",
  5. importc: "CreateFileW", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc createHardLinkW(lpFileName, lpExistingFileName: WideCString;
  2. security: pointer = nil): int32 {.
  3. importc: "CreateHardLinkW", dynlib: "kernel32", stdcall, sideEffect,
  4. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc createIoCompletionPort(FileHandle: Handle; ExistingCompletionPort: Handle;
  2. CompletionKey: ULONG_PTR;
  3. NumberOfConcurrentThreads: DWORD): Handle {.stdcall,
  4. dynlib: "kernel32", importc: "CreateIoCompletionPort", ...raises: [], tags: [],
  5. forbids: [].}

Source Edit

  1. proc createNamedPipe(lpName: WideCString; dwOpenMode, dwPipeMode, nMaxInstances,
  2. nOutBufferSize, nInBufferSize, nDefaultTimeOut: int32;
  3. lpSecurityAttributes: ptr SECURITY_ATTRIBUTES): Handle {.
  4. stdcall, dynlib: "kernel32", importc: "CreateNamedPipeW", sideEffect,
  5. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc createPipe(hReadPipe, hWritePipe: var Handle;
  2. lpPipeAttributes: var SECURITY_ATTRIBUTES; nSize: int32): WINBOOL {.
  3. stdcall, dynlib: "kernel32", importc: "CreatePipe", sideEffect, ...raises: [],
  4. tags: [], forbids: [].}

Source Edit

  1. proc createProcessW(lpApplicationName, lpCommandLine: WideCString;
  2. lpProcessAttributes: ptr SECURITY_ATTRIBUTES;
  3. lpThreadAttributes: ptr SECURITY_ATTRIBUTES;
  4. bInheritHandles: WINBOOL; dwCreationFlags: int32;
  5. lpEnvironment, lpCurrentDirectory: WideCString;
  6. lpStartupInfo: var STARTUPINFO;
  7. lpProcessInformation: var PROCESS_INFORMATION): WINBOOL {.
  8. stdcall, dynlib: "kernel32", importc: "CreateProcessW", sideEffect,
  9. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc createSymbolicLinkW(lpSymlinkFileName, lpTargetFileName: WideCString;
  2. flags: DWORD): int32 {.importc: "CreateSymbolicLinkW",
  3. dynlib: "kernel32", stdcall, sideEffect, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc DeleteFiber(fiber: pointer) {.stdcall, discardable, dynlib: "kernel32",
  2. importc, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc deleteFileA(pathName: cstring): int32 {.importc: "DeleteFileA",
  2. dynlib: "kernel32", stdcall, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc deleteFileW(pathName: WideCString): int32 {.importc: "DeleteFileW",
  2. dynlib: "kernel32", stdcall, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc duplicateHandle(hSourceProcessHandle: Handle; hSourceHandle: Handle;
  2. hTargetProcessHandle: Handle; lpTargetHandle: ptr Handle;
  3. dwDesiredAccess: DWORD; bInheritHandle: WINBOOL;
  4. dwOptions: DWORD): WINBOOL {.stdcall, dynlib: "kernel32",
  5. importc: "DuplicateHandle", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc FD_ISSET(socket: SocketHandle; set: var TFdSet): cint {....raises: [],
  2. tags: [], forbids: [].}

Source Edit

  1. proc FD_SET(socket: SocketHandle; s: var TFdSet) {....raises: [], tags: [],
  2. forbids: [].}

Source Edit

  1. proc FD_ZERO(s: var TFdSet) {....raises: [], tags: [], forbids: [].}

Source Edit

  1. proc findClose(hFindFile: Handle) {.stdcall, dynlib: "kernel32",
  2. importc: "FindClose", ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc findFirstFileW(lpFileName: WideCString; lpFindFileData: var WIN32_FIND_DATA): Handle {.
  2. stdcall, dynlib: "kernel32", importc: "FindFirstFileW", sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc findNextFileW(hFindFile: Handle; lpFindFileData: var WIN32_FIND_DATA): int32 {.
  2. stdcall, dynlib: "kernel32", importc: "FindNextFileW", sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc flushFileBuffers(hFile: Handle): WINBOOL {.stdcall, dynlib: "kernel32",
  2. importc: "FlushFileBuffers", sideEffect, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc flushViewOfFile(lpBaseAddress: pointer; dwNumberOfBytesToFlush: DWORD): WINBOOL {.
  2. stdcall, dynlib: "kernel32", importc: "FlushViewOfFile", ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc formatMessageW(dwFlags: int32; lpSource: pointer;
  2. dwMessageId, dwLanguageId: int32; lpBuffer: pointer;
  3. nSize: int32; arguments: pointer): int32 {.
  4. importc: "FormatMessageW", stdcall, dynlib: "kernel32", ...raises: [],
  5. tags: [], forbids: [].}

Source Edit

  1. proc freeAddrInfo(ai: ptr AddrInfo) {.stdcall, importc: "freeaddrinfo",
  2. dynlib: ws2dll, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc freeEnvironmentStringsW(para1: WideCString): int32 {.stdcall,
  2. dynlib: "kernel32", importc: "FreeEnvironmentStringsW", sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc freeSid(pSid: PSID): PSID {.stdcall, dynlib: "Advapi32",
  2. importc: "FreeSid", ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc get_osfhandle(fd: FileHandle): Handle {.importc: "_get_osfhandle",
  2. header: "<io.h>", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getaddrinfo(nodename, servname: cstring; hints: ptr AddrInfo;
  2. res: var ptr AddrInfo): cint {.stdcall, importc: "getaddrinfo",
  3. dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getCommandLineW(): WideCString {.importc: "GetCommandLineW", stdcall,
  2. dynlib: "kernel32", sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getCurrentDirectoryW(nBufferLength: int32; lpBuffer: WideCString): int32 {.
  2. importc: "GetCurrentDirectoryW", dynlib: "kernel32", stdcall, sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc GetCurrentFiber(): pointer {.stdcall, importc, header: "windows.h",
  2. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getCurrentProcess(): Handle {.stdcall, dynlib: "kernel32",
  2. importc: "GetCurrentProcess", ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc getEnvironmentStringsW(): WideCString {.stdcall, dynlib: "kernel32",
  2. importc: "GetEnvironmentStringsW", sideEffect, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc getExitCodeProcess(hProcess: Handle; lpExitCode: var int32): WINBOOL {.
  2. stdcall, dynlib: "kernel32", importc: "GetExitCodeProcess", ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc getFileAttributesW(lpFileName: WideCString): int32 {.stdcall,
  2. dynlib: "kernel32", importc: "GetFileAttributesW", sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc getFileInformationByHandle(hFile: Handle; lpFileInformation: ptr BY_HANDLE_FILE_INFORMATION): WINBOOL {.
  2. stdcall, dynlib: "kernel32", importc: "GetFileInformationByHandle",
  3. sideEffect, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getFileSize(hFile: Handle; lpFileSizeHigh: ptr DWORD): DWORD {.stdcall,
  2. dynlib: "kernel32", importc: "GetFileSize", ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc getFullPathNameW(lpFileName: WideCString; nBufferLength: int32;
  2. lpBuffer: WideCString; lpFilePart: var WideCString): int32 {.
  3. stdcall, dynlib: "kernel32", importc: "GetFullPathNameW", sideEffect,
  4. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getHandleInformation(hObject: Handle; lpdwFlags: ptr DWORD): WINBOOL {.
  2. stdcall, dynlib: "kernel32", importc: "GetHandleInformation", ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc gethostbyaddr(ip: ptr InAddr; len: cuint; theType: cint): ptr Hostent {.
  2. stdcall, importc: "gethostbyaddr", dynlib: ws2dll, sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc gethostbyname(name: cstring): ptr Hostent {.stdcall,
  2. importc: "gethostbyname", dynlib: ws2dll, sideEffect, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc gethostname(hostname: cstring; len: cint): cint {.stdcall,
  2. importc: "gethostname", dynlib: ws2dll, sideEffect, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc getLastError(): int32 {.importc: "GetLastError", stdcall,
  2. dynlib: "kernel32", sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc getModuleFileNameW(handle: Handle; buf: WideCString; size: int32): int32 {.
  2. importc: "GetModuleFileNameW", dynlib: "kernel32", stdcall, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc getnameinfo(a1: ptr SockAddr; a2: SockLen; a3: cstring; a4: SockLen;
  2. a5: cstring; a6: SockLen; a7: cint): cint {.stdcall,
  3. importc: "getnameinfo", dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getOverlappedResult(hFile: Handle; lpOverlapped: POVERLAPPED;
  2. lpNumberOfBytesTransferred: var DWORD; bWait: WINBOOL): WINBOOL {.
  3. stdcall, dynlib: "kernel32", importc: "GetOverlappedResult", ...raises: [],
  4. tags: [], forbids: [].}

Source Edit

  1. proc getpeername(s: SocketHandle; name: ptr SockAddr; namelen: ptr SockLen): cint {.
  2. stdcall, importc, dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getProcessTimes(hProcess: Handle; lpCreationTime, lpExitTime, lpKernelTime,
  2. lpUserTime: var FILETIME): WINBOOL {.
  3. stdcall, dynlib: "kernel32", importc: "GetProcessTimes", ...raises: [],
  4. tags: [], forbids: [].}

Source Edit

  1. proc getprotobyname(name: cstring): ptr Protoent {.stdcall,
  2. importc: "getprotobyname", dynlib: ws2dll, sideEffect, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc getprotobynumber(proto: cint): ptr Protoent {.stdcall,
  2. importc: "getprotobynumber", dynlib: ws2dll, sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc getQueuedCompletionStatus(CompletionPort: Handle;
  2. lpNumberOfBytesTransferred: PDWORD;
  3. lpCompletionKey: PULONG_PTR;
  4. lpOverlapped: ptr POVERLAPPED;
  5. dwMilliseconds: DWORD): WINBOOL {.stdcall,
  6. dynlib: "kernel32", importc: "GetQueuedCompletionStatus", ...raises: [],
  7. tags: [], forbids: [].}

Source Edit

  1. proc getservbyname(name, proto: cstring): ptr Servent {.stdcall,
  2. importc: "getservbyname", dynlib: ws2dll, sideEffect, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc getservbyport(port: cint; proto: cstring): ptr Servent {.stdcall,
  2. importc: "getservbyport", dynlib: ws2dll, sideEffect, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc getsockname(s: SocketHandle; name: ptr SockAddr; namelen: ptr SockLen): cint {.
  2. stdcall, importc: "getsockname", dynlib: ws2dll, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc getsockopt(s: SocketHandle; level, optname: cint; optval: pointer;
  2. optlen: ptr SockLen): cint {.stdcall, importc: "getsockopt",
  3. dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getStdHandle(nStdHandle: int32): Handle {.stdcall, dynlib: "kernel32",
  2. importc: "GetStdHandle", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getSystemTimeAsFileTime(lpSystemTimeAsFileTime: var FILETIME) {.
  2. importc: "GetSystemTimeAsFileTime", dynlib: "kernel32", stdcall, sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getSystemTimePreciseAsFileTime(lpSystemTimeAsFileTime: var FILETIME) {.
  2. importc: "GetSystemTimePreciseAsFileTime", dynlib: "kernel32", stdcall,
  3. sideEffect, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getSystemTimes(lpIdleTime, lpKernelTime, lpUserTime: var FILETIME): WINBOOL {.
  2. stdcall, dynlib: "kernel32", importc: "GetSystemTimes", ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc getVersion(): DWORD {.stdcall, dynlib: "kernel32", importc: "GetVersion",
  2. sideEffect, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc getVersionExA(lpVersionInfo: ptr OSVERSIONINFO): WINBOOL {.stdcall,
  2. dynlib: "kernel32", importc: "GetVersionExA", sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc getVersionExW(lpVersionInfo: ptr OSVERSIONINFO): WINBOOL {.stdcall,
  2. dynlib: "kernel32", importc: "GetVersionExW", sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc inet_addr(cp: cstring): uint32 {.stdcall, importc: "inet_addr",
  2. dynlib: ws2dll, ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc inet_ntoa(i: InAddr): cstring {.stdcall, importc, dynlib: ws2dll,
  2. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc inet_ntop(family: cint; paddr: pointer; pStringBuffer: cstring;
  2. stringBufSize: int32): cstring {.stdcall, ...raises: [Exception],
  3. tags: [], forbids: [].}

Source Edit

  1. proc isSuccess(a: WINBOOL): bool {.inline, ...raises: [], tags: [], forbids: [].}

Returns true if a != 0. Windows uses a different convention than POSIX, where a == 0 is commonly used on success. Source Edit

  1. proc listen(s: SocketHandle; backlog: cint): cint {.stdcall, importc: "listen",
  2. dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc localFree(p: pointer) {.importc: "LocalFree", stdcall, dynlib: "kernel32",
  2. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc mapViewOfFileEx(hFileMappingObject: Handle; dwDesiredAccess: DWORD;
  2. dwFileOffsetHigh, dwFileOffsetLow: DWORD;
  3. dwNumberOfBytesToMap: WinSizeT; lpBaseAddress: pointer): pointer {.
  4. stdcall, dynlib: "kernel32", importc: "MapViewOfFileEx", ...raises: [],
  5. tags: [], forbids: [].}

Source Edit

  1. proc moveFileExW(lpExistingFileName, lpNewFileName: WideCString; flags: DWORD): WINBOOL {.
  2. importc: "MoveFileExW", stdcall, dynlib: "kernel32", sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc moveFileW(lpExistingFileName, lpNewFileName: WideCString): WINBOOL {.
  2. importc: "MoveFileW", stdcall, dynlib: "kernel32", sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc openProcess(dwDesiredAccess: DWORD; bInheritHandle: WINBOOL;
  2. dwProcessId: DWORD): Handle {.stdcall, dynlib: "kernel32",
  3. importc: "OpenProcess", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc peekNamedPipe(hNamedPipe: Handle; lpBuffer: pointer = nil;
  2. nBufferSize: int32 = 0; lpBytesRead: ptr int32 = nil;
  3. lpTotalBytesAvail: ptr int32 = nil;
  4. lpBytesLeftThisMessage: ptr int32 = nil): bool {.stdcall,
  5. dynlib: "kernel32", importc: "PeekNamedPipe", ...raises: [], tags: [],
  6. forbids: [].}

Source Edit

  1. proc postQueuedCompletionStatus(CompletionPort: Handle;
  2. dwNumberOfBytesTransferred: DWORD;
  3. dwCompletionKey: ULONG_PTR;
  4. lpOverlapped: pointer): bool {.stdcall,
  5. dynlib: "kernel32", importc: "PostQueuedCompletionStatus", ...raises: [],
  6. tags: [], forbids: [].}

Source Edit

  1. proc rdFileSize(f: WIN32_FIND_DATA): int64 {....raises: [], tags: [], forbids: [].}

Source Edit

  1. proc rdFileTime(f: FILETIME): int64 {....raises: [], tags: [], forbids: [].}

Source Edit

  1. proc readConsoleInput(hConsoleInput: Handle; lpBuffer: pointer; nLength: cint;
  2. lpNumberOfEventsRead: ptr cint): cint {.stdcall,
  3. dynlib: "kernel32", importc: "ReadConsoleInputW", ...raises: [], tags: [],
  4. forbids: [].}

Source Edit

  1. proc readFile(hFile: Handle; buffer: pointer; nNumberOfBytesToRead: int32;
  2. lpNumberOfBytesRead: ptr int32; lpOverlapped: pointer): WINBOOL {.
  3. stdcall, dynlib: "kernel32", importc: "ReadFile", sideEffect, ...raises: [],
  4. tags: [], forbids: [].}

Source Edit

  1. proc recv(s: SocketHandle; buf: pointer; len, flags: cint): cint {.stdcall,
  2. importc: "recv", dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc recvfrom(s: SocketHandle; buf: cstring; len, flags: cint;
  2. fromm: ptr SockAddr; fromlen: ptr SockLen): cint {.stdcall,
  3. importc: "recvfrom", dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc registerWaitForSingleObject(phNewWaitObject: ptr Handle; hObject: Handle;
  2. Callback: WAITORTIMERCALLBACK;
  3. Context: pointer; dwMilliseconds: ULONG;
  4. dwFlags: ULONG): bool {.stdcall,
  5. dynlib: "kernel32", importc: "RegisterWaitForSingleObject", ...raises: [],
  6. tags: [], forbids: [].}

Source Edit

  1. proc removeDirectoryW(lpPathName: WideCString): int32 {.
  2. importc: "RemoveDirectoryW", dynlib: "kernel32", stdcall, sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc resumeThread(hThread: Handle): int32 {.stdcall, dynlib: "kernel32",
  2. importc: "ResumeThread", sideEffect, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc select(nfds: cint; readfds, writefds, exceptfds: ptr TFdSet;
  2. timeout: ptr Timeval): cint {.stdcall, importc: "select",
  3. dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc send(s: SocketHandle; buf: pointer; len, flags: cint): cint {.stdcall,
  2. importc: "send", dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc sendto(s: SocketHandle; buf: pointer; len, flags: cint; to: ptr SockAddr;
  2. tolen: SockLen): cint {.stdcall, importc: "sendto", dynlib: ws2dll,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc setCurrentDirectoryW(lpPathName: WideCString): int32 {.
  2. importc: "SetCurrentDirectoryW", dynlib: "kernel32", stdcall, sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc setEndOfFile(hFile: Handle): WINBOOL {.stdcall, dynlib: "kernel32",
  2. importc: "SetEndOfFile", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc setEnvironmentVariableW(lpName, lpValue: WideCString): int32 {.stdcall,
  2. dynlib: "kernel32", importc: "SetEnvironmentVariableW", sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc setEvent(hEvent: Handle): cint {.stdcall, dynlib: "kernel32",
  2. importc: "SetEvent", ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc setFileAttributesW(lpFileName: WideCString; dwFileAttributes: int32): WINBOOL {.
  2. stdcall, dynlib: "kernel32", importc: "SetFileAttributesW", sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc setFilePointer(hFile: Handle; lDistanceToMove: LONG;
  2. lpDistanceToMoveHigh: ptr LONG; dwMoveMethod: DWORD): DWORD {.
  3. stdcall, dynlib: "kernel32", importc: "SetFilePointer", ...raises: [],
  4. tags: [], forbids: [].}

Source Edit

  1. proc setFileTime(hFile: Handle; lpCreationTime: LPFILETIME;
  2. lpLastAccessTime: LPFILETIME; lpLastWriteTime: LPFILETIME): WINBOOL {.
  3. stdcall, dynlib: "kernel32", importc: "SetFileTime", ...raises: [], tags: [],
  4. forbids: [].}

Source Edit

  1. proc setHandleInformation(hObject: Handle; dwMask: DWORD; dwFlags: DWORD): WINBOOL {.
  2. stdcall, dynlib: "kernel32", importc: "SetHandleInformation", ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc setLastError(error: int32) {.importc: "SetLastError", stdcall,
  2. dynlib: "kernel32", sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc setsockopt(s: SocketHandle; level, optname: cint; optval: pointer;
  2. optlen: SockLen): cint {.stdcall, importc: "setsockopt",
  3. dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc setStdHandle(nStdHandle: int32; hHandle: Handle): WINBOOL {.stdcall,
  2. dynlib: "kernel32", importc: "SetStdHandle", sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc shellExecuteW(hwnd: Handle;
  2. lpOperation, lpFile, lpParameters, lpDirectory: WideCString;
  3. nShowCmd: int32): Handle {.stdcall, dynlib: "shell32.dll",
  4. importc: "ShellExecuteW", sideEffect, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc shutdown(s: SocketHandle; how: cint): cint {.stdcall, importc: "shutdown",
  2. dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc sleep(dwMilliseconds: int32) {.stdcall, dynlib: "kernel32",
  2. importc: "Sleep", sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc socket(af, typ, protocol: cint): SocketHandle {.stdcall, importc: "socket",
  2. dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc suspendThread(hThread: Handle): int32 {.stdcall, dynlib: "kernel32",
  2. importc: "SuspendThread", sideEffect, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc SwitchToFiber(fiber: pointer) {.stdcall, discardable, dynlib: "kernel32",
  2. importc, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc terminateProcess(hProcess: Handle; uExitCode: int): WINBOOL {.stdcall,
  2. dynlib: "kernel32", importc: "TerminateProcess", sideEffect, ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc toFILETIME(t: int64): FILETIME {....raises: [], tags: [], forbids: [].}

Convert the Windows file time timestamp t to FILETIME. Source Edit

  1. proc unmapViewOfFile(lpBaseAddress: pointer): WINBOOL {.stdcall,
  2. dynlib: "kernel32", importc: "UnmapViewOfFile", ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc unregisterWait(WaitHandle: Handle): DWORD {.stdcall, dynlib: "kernel32",
  2. importc: "UnregisterWait", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc waitForMultipleObjects(nCount: DWORD; lpHandles: PWOHandleArray;
  2. bWaitAll: WINBOOL; dwMilliseconds: DWORD): DWORD {.
  3. stdcall, dynlib: "kernel32", importc: "WaitForMultipleObjects", ...raises: [],
  4. tags: [], forbids: [].}

Source Edit

  1. proc waitForSingleObject(hHandle: Handle; dwMilliseconds: int32): int32 {.
  2. stdcall, dynlib: "kernel32", importc: "WaitForSingleObject", sideEffect,
  3. ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc writeFile(hFile: Handle; buffer: pointer; nNumberOfBytesToWrite: int32;
  2. lpNumberOfBytesWritten: ptr int32; lpOverlapped: pointer): WINBOOL {.
  3. stdcall, dynlib: "kernel32", importc: "WriteFile", sideEffect, ...raises: [],
  4. tags: [], forbids: [].}

Source Edit

  1. proc wsaCloseEvent(hEvent: Handle): bool {.stdcall, importc: "WSACloseEvent",
  2. dynlib: "ws2_32.dll", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc wsaCreateEvent(): Handle {.stdcall, importc: "WSACreateEvent",
  2. dynlib: "ws2_32.dll", ...raises: [], tags: [],
  3. forbids: [].}

Source Edit

  1. proc wsaEventSelect(s: SocketHandle; hEventObject: Handle; lNetworkEvents: clong): cint {.
  2. stdcall, importc: "WSAEventSelect", dynlib: "ws2_32.dll", ...raises: [],
  3. tags: [], forbids: [].}

Source Edit

  1. proc wsaGetLastError(): cint {.importc: "WSAGetLastError", dynlib: ws2dll,
  2. sideEffect, ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc WSAIoctl(s: SocketHandle; dwIoControlCode: DWORD; lpvInBuffer: pointer;
  2. cbInBuffer: DWORD; lpvOutBuffer: pointer; cbOutBuffer: DWORD;
  3. lpcbBytesReturned: PDWORD; lpOverlapped: POVERLAPPED;
  4. lpCompletionRoutine: POVERLAPPED_COMPLETION_ROUTINE): cint {.
  5. stdcall, importc: "WSAIoctl", dynlib: "Ws2_32.dll", ...raises: [], tags: [],
  6. forbids: [].}

Source Edit

  1. proc WSARecv(s: SocketHandle; buf: ptr TWSABuf; bufCount: DWORD;
  2. bytesReceived, flags: PDWORD; lpOverlapped: POVERLAPPED;
  3. completionProc: POVERLAPPED_COMPLETION_ROUTINE): cint {.stdcall,
  4. importc: "WSARecv", dynlib: "Ws2_32.dll", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc WSARecvFrom(s: SocketHandle; buf: ptr TWSABuf; bufCount: DWORD;
  2. bytesReceived: PDWORD; flags: PDWORD; name: ptr SockAddr;
  3. namelen: ptr cint; lpOverlapped: POVERLAPPED;
  4. completionProc: POVERLAPPED_COMPLETION_ROUTINE): cint {.
  5. stdcall, importc: "WSARecvFrom", dynlib: "Ws2_32.dll", ...raises: [], tags: [],
  6. forbids: [].}

Source Edit

  1. proc wsaResetEvent(hEvent: Handle): bool {.stdcall, importc: "WSAResetEvent",
  2. dynlib: "ws2_32.dll", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc WSASend(s: SocketHandle; buf: ptr TWSABuf; bufCount: DWORD;
  2. bytesSent: PDWORD; flags: DWORD; lpOverlapped: POVERLAPPED;
  3. completionProc: POVERLAPPED_COMPLETION_ROUTINE): cint {.stdcall,
  4. importc: "WSASend", dynlib: "Ws2_32.dll", ...raises: [], tags: [], forbids: [].}

Source Edit

  1. proc WSASendTo(s: SocketHandle; buf: ptr TWSABuf; bufCount: DWORD;
  2. bytesSent: PDWORD; flags: DWORD; name: ptr SockAddr;
  3. namelen: cint; lpOverlapped: POVERLAPPED;
  4. completionProc: POVERLAPPED_COMPLETION_ROUTINE): cint {.stdcall,
  5. importc: "WSASendTo", dynlib: "Ws2_32.dll", ...raises: [], tags: [],
  6. forbids: [].}

Source Edit

  1. proc wsaStartup(wVersionRequired: int16; WSData: ptr WSAData): cint {.stdcall,
  2. importc: "WSAStartup", dynlib: ws2dll, ...raises: [], tags: [], forbids: [].}

Source Edit

Templates

  1. template hasOverlappedIoCompleted(lpOverlapped): bool

Source Edit

  1. template WSAIORW(x, y): untyped

Source Edit