home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / LordLucifer / win32asm / files / win32asm.exe / Win32ASM / ASMInc / Kernel32.equ < prev    next >
Encoding:
Text File  |  1997-09-28  |  50.8 KB  |  1,370 lines

  1. ; Kernel32 system call prototypes.
  2. ; Philippe Auphelle, 30 May 1996
  3.  
  4. ; $Header: /WIN32EQU/Kernel32.equ 4     8/11/97 22:09 Philippe $
  5.  
  6. ; Additional system call prototypes.
  7. ; Fred Lepow, 30 June 1997
  8.  
  9.  
  10.                 INCLUDELIB KERNEL32.LIB
  11.  
  12.  
  13. ; These functions are Unicode/ANSI dependant, and will be postfixed at
  14. ; assembly time according to the value of the Unicode equate.
  15.  
  16.  
  17.                 UnicAnsiExtern CreateEvent
  18.                 UnicAnsiExtern CreateFile
  19.                 UnicAnsiExtern CreateFileMapping
  20.                 UnicAnsiExtern CreateMutex
  21.                 UnicAnsiExtern CreateProcess
  22.                 UnicAnsiExtern CreateSemaphore
  23.  
  24.                 UnicAnsiExtern FillConsoleOutputCharacter
  25.                 UnicAnsiExtern FindFirstFile
  26.                 UnicAnsiExtern FindNextFile
  27.                 UnicAnsiExtern FormatMessage
  28.  
  29.                 UnicAnsiExtern GetCommandLine
  30.                 UnicAnsiExtern GetConsoleTitle
  31.                 UnicAnsiExtern GetModuleFileName
  32.                 UnicAnsiExtern GetModuleHandle
  33.                 UnicAnsiExtern GetTempFileName
  34.                 UnicAnsiExtern LoadLibrary
  35.                 UnicAnsiExtern LoadLibraryEx
  36.                 UnicAnsiExtern lstrcat
  37.                 UnicAnsiExtern lstrcmp
  38.                 UnicAnsiExtern lstrcmpi
  39.                 UnicAnsiExtern lstrcpy
  40.                 UnicAnsiExtern lstrlen
  41.  
  42.                 UnicAnsiExtern OpenFileMapping
  43.                 UnicAnsiExtern OpenMutex
  44.                 UnicAnsiExtern OpenSemaphore
  45.                 UnicAnsiExtern OutputDebugString
  46.  
  47.                 UnicAnsiExtern PeekConsoleInput
  48.  
  49.                 UnicAnsiExtern ReadConsole
  50.                 UnicAnsiExtern ReadConsoleInput
  51.                 UnicAnsiExtern ReadConsoleOutput
  52.                 UnicAnsiExtern ReadConsoleOutputCharacter
  53.  
  54.                 UnicAnsiExtern ScrollConsoleScreenBuffer
  55.                 UnicAnsiExtern SetConsoleTitle
  56.  
  57.                 UnicAnsiExtern WriteConsole
  58.                 UnicAnsiExtern WriteConsoleInput
  59.                 UnicAnsiExtern WriteConsoleOutput
  60.                 UnicAnsiExtern WriteConsoleOutputCharacter
  61.  
  62.  
  63.  
  64.  
  65. AllocConsole                PROTO
  66. Beep                        PROTO \
  67.                                 dwFreq:DWORD,
  68.                                 dwDuration:DWORD
  69. CloseHandle                 PROTO \
  70.                                 hObject:DWORD
  71. CreateConsoleScreenBuffer   PROTO \
  72.                                 dwDesiredAccess:DWORD,
  73.                                 dwShareMode:DWORD,
  74.                                 lpSecurityAttributes:DWORD,
  75.                                 dwFlags:DWORD,
  76.                                 lpScreenBufferData:DWORD
  77. CreateEvent                 PROTO  \
  78.                                 lpEventAttributes:DWORD,
  79.                                 bManualReset:DWORD,
  80.                                 bInitialState:DWORD,
  81.                                 lpName:DWORD
  82. CreateFile                  PROTO \
  83.                                 lpFileName:DWORD,
  84.                                 dwDesiredAccess:DWORD,
  85.                                 dwShareMode:DWORD,
  86.                                 lpSecurityAttributes:DWORD,
  87.                                 dwCreationDistribution:DWORD,
  88.                                 dwFlagsAndAttributes:DWORD,
  89.                                 hTemplateFile:DWORD
  90. CreateFileMapping           PROTO \
  91.                                 hFile:DWORD,
  92.                                 lpFileMappingAttributes:DWORD,
  93.                                 flProtect:DWORD,
  94.                                 dwMaximumSizeHigh:DWORD,
  95.                                 dwMaximumSizeLow:DWORD,
  96.                                 lpName:DWORD
  97. CreateProcess PROTO \
  98.             lpApplicationName:DWORD,
  99.             lpCommandLine:DWORD,
  100.             lpProcessAttributes:DWORD,
  101.             lpThreadAttributes:DWORD,
  102.             bInheritHandles:DWORD,
  103.             dwCreationFlags:DWORD,
  104.             lpEnvironment:DWORD,
  105.             lpCurrentDirectory:DWORD,
  106.             lpStartupInfo:DWORD,
  107.             lpProcessInformation:DWORD
  108.  
  109. CreateMutex                 PROTO \
  110.                                 lpMutexAttributes:DWORD,
  111.                                 bInitialOwner:DWORD,
  112.                                 lpszName:DWORD
  113. CreateSemaphore             PROTO \
  114.                                 lpSemaphoreAttributes:DWORD,
  115.                                 lInitialCount:DWORD,
  116.                                 lMaximumCount:DWORD,
  117.                                 lpName:DWORD
  118. CreateThread                PROTO \
  119.                                 lpThreadAttributes:DWORD,
  120.                                 dwStackSize:DWORD,
  121.                                 lpStartAddress:DWORD,
  122.                                 lpParameter:DWORD,
  123.                                 dwCreationFlags:DWORD,
  124.                                 lpThreadId:DWORD
  125. DebugActiveProcess          PROTO \
  126.                                 dwProcessId:DWORD
  127. DebugBreak                  PROTO
  128. DeleteCriticalSection       PROTO \
  129.                                 lpCriticalSection:DWORD
  130. DuplicateHandle             PROTO \
  131.                                 hSourceProcessHandle:DWORD,
  132.                                 hSourceHandle:DWORD,
  133.                                 hTargetProcessHandle:DWORD,
  134.                                 lpTargetHandle:DWORD,
  135.                                 dwDesiredAccess:DWORD,
  136.                                 bInheritHandle:DWORD,
  137.                                 dwOptions:DWORD
  138. EndPaint                    PROTO \
  139.                                 hWnd:DWORD,
  140.                                 lpPaint:DWORD
  141. EnterCriticalSection        PROTO \
  142.                                 lpCriticalSection:DWORD
  143. ExitProcess                 PROTO \
  144.                                 dwExitCode:DWORD
  145. ExitThread                  PROTO \
  146.                                 dwExitCode:DWORD
  147. FillConsoleOutputAttribute  PROTO \
  148.                                 hConsoleOutput:DWORD,
  149.                                 wAttribute:DWORD,
  150.                                 nLength:DWORD,
  151.                                 dwWriteCoord:DWORD,
  152.                                 lpNumberOfAttrsWritten:DWORD
  153. FillConsoleOutputCharacter  PROTO \
  154.                                 hConsoleOutput:DWORD,
  155.                                 cCharacter:DWORD,
  156.                                 nLength:DWORD,
  157.                                 dwWriteCoord:DWORD,
  158.                                 lpNumberOfCharsWritten:DWORD
  159. FindFirstFile               PROTO \
  160.                                 lpFileName:DWORD,
  161.                                 lpFindFileData:DWORD
  162. FindNextFile                PROTO \
  163.                                 hFindFile:DWORD,
  164.                                 lpFindFileData:DWORD
  165. FindClose                   PROTO \
  166.                                 hFindFile:DWORD
  167. FlushConsoleInputBuffer     PROTO \
  168.                                 hConsoleInput:WORD
  169. FlushFileBuffers            PROTO \
  170.                                 hFile:DWORD
  171. FreeConsole                 PROTO
  172. FormatMessage               PROTO \
  173.                                 dwFlags:DWORD,
  174.                                 lpSource:DWORD,
  175.                                 dwMessageId:DWORD,
  176.                                 dwLanguageId:DWORD,
  177.                                 lpBuffer:DWORD,
  178.                                 nSize:DWORD,
  179.                                 va_list:DWORD
  180.  
  181. FORMAT_MESSAGE_ALLOCATE_BUFFER  EQU     000000100h
  182. FORMAT_MESSAGE_IGNORE_INSERTS   EQU     000000200h
  183. FORMAT_MESSAGE_FROM_STRING      EQU     000000400h
  184. FORMAT_MESSAGE_FROM_HMODULE     EQU     000000800h
  185. FORMAT_MESSAGE_FROM_SYSTEM      EQU     000001000h
  186. FORMAT_MESSAGE_ARGUMENT_ARRAY   EQU     000002000h
  187. FORMAT_MESSAGE_MAX_WIDTH_MASK   EQU     0000000ffh
  188.  
  189. FreeLibrary                 PROTO \
  190.                                 hLibModule:DWORD
  191. GenerateConsoleCtrlEvent    PROTO \
  192.                                 dwCtrlEvent:DWORD,
  193.                                 dwProcessGroupId:DWORD
  194. GetCommandLine              PROTO
  195. GetCommConfig               PROTO \
  196.                                 hCommDev:DWORD,
  197.                                 lpCC:DWORD,
  198.                                 lpdwSize:DWORD
  199. GetCommProperties           PROTO \
  200.                                 hFile:DWORD,
  201.                                 lpCommProp:DWORD
  202. GetCommState                PROTO \
  203.                                 hFile:DWORD,
  204.                                 lpDCB:DWORD
  205. GetCommTimeouts             PROTO \
  206.                                 hFile:DWORD,
  207.                                 lpCommTimeOuts:DWORD
  208. GetConsoleCP                PROTO
  209.  
  210.  
  211. GetConsoleCursorInfo        PROTO \
  212.                                 hConsoleOutput:DWORD,
  213.                                 lpConsoleCursorInfo:DWORD
  214. GetConsoleMode              PROTO \
  215.                                 hConsoleHandle:DWORD,
  216.                                 lpMode:DWORD
  217. GetConsoleOutputCP          PROTO
  218. GetConsoleScreenBufferInfo  PROTO \
  219.                                 hConsoleOutput:DWORD,
  220.                                 lpConsoleScreenBufferInfo:DWORD
  221. GetConsoleTitle             PROTO \
  222.                                 lpConsoleTitle:DWORD,
  223.                                 nSize:DWORD
  224. GetCurrentProcess           PROTO
  225. GetCurrentThread            PROTO
  226. GetFileSize                 PROTO \
  227.                                 hFile:DWORD,
  228.                                 lpFileSizeHigh:DWORD
  229. GetLargestConsoleWindowSize PROTO \
  230.                                 hConsoleOutput:DWORD
  231. GetLastError                PROTO
  232. GetNumberOfConsoleInputEvents  PROTO \
  233.                                 hConsoleInput:DWORD,
  234.                                 lpNumberOfEvents:DWORD
  235. GetNumberOfConsoleMouseButtons PROTO \
  236.                                 lpNumberOfMouseButtons:DWORD
  237. GetStdHandle                PROTO \
  238.                                 nStdHandle:DWORD
  239. GetLocalTime                PROTO \
  240.                                 lpSystemTime:DWORD
  241. GetProcAddress              PROTO \
  242.                                 hModule:DWORD,
  243.                                 lpProcName:DWORD
  244. GetModuleFileName           PROTO \
  245.                                 hModule:DWORD,
  246.                                 lpStr:DWORD,
  247.                                 nSize:DWORD
  248. GetModuleHandle             PROTO \
  249.                                 lpModuleHandle:DWORD
  250. GetOverlappedResult         PROTO \
  251.                                 hFile:DWORD,
  252.                                 lpOverlapped:DWORD,
  253.                                 lpNumberOfBytesTransferred:DWORD,
  254.                                 bWait:DWORD
  255. GetSystemTime               PROTO \
  256.                                 lpSystemTime:DWORD
  257. GetSystemTimeAsFileTime     PROTO \
  258.                                 lpSystemTimeAsFileTime:DWORD
  259. GetTempFileName             PROTO \
  260.                                  lpPathName:DWORD,
  261.                                  lpPrefixString:DWORD,
  262.                                  uUnique:DWORD,
  263.                                  lpTempFileName:DWORD
  264. GetTickCount                PROTO
  265. InitializeCriticalSection   PROTO \
  266.                                 lpCriticalSection:DWORD
  267. LeaveCriticalSection        PROTO \
  268.                                 lpCriticalSection:DWORD
  269. LoadLibrary                 PROTO \
  270.                                 lpLibFileName:DWORD
  271. LoadLibraryEx               PROTO \
  272.                                 lpLibFileName:DWORD,
  273.                                 hFile:DWORD,
  274.                                 dwFlags:DWORD
  275. LocalAlloc                  PROTO \
  276.                                 uFlags:DWORD,
  277.                                 uBytes:DWORD
  278. LocalFree                   PROTO \
  279.                                 hMem:DWORD
  280. LockFile                    PROTO \
  281.                                 hFile:DWORD,
  282.                                 dwFileOffsetLow:DWORD,
  283.                                 dwFileOffsetHigh:DWORD,
  284.                                 nNumberOfBytesToLockLow:DWORD,
  285.                                 nNumberOfBytesToLockHigh:DWORD
  286. lstrcat                     PROTO \
  287.                                 lpString1:DWORD,
  288.                                 lpString2:DWORD
  289. lstrcmp                     PROTO \
  290.                                 lpString1:DWORD,
  291.                                 lpString2:DWORD
  292. lstrcmpi                    PROTO \
  293.                                 lpString1:DWORD,
  294.                                 lpString2:DWORD
  295. lstrcpy                     PROTO \
  296.                                 lpString1:DWORD,
  297.                                 lpString2:DWORD
  298. lstrlen                     PROTO \
  299.                                 lpString:DWORD
  300. MapViewOfFile               PROTO \
  301.                                 hFileMappingObject:DWORD,
  302.                                 dwDesiredAccess:DWORD,
  303.                                 dwFileOffsetHigh:DWORD,
  304.                                 dwFileOffsetLow:DWORD,
  305.                                 dwNumberOfBytesToMap:DWORD
  306. MoveFile                    PROTO \
  307.                                 lpExistingFileName:DWORD,
  308.                                 lpNewFileName:DWORD
  309. MoveFileEx                  PROTO \
  310.                                 lpExistingFileName:DWORD,
  311.                                 lpNewFileName:DWORD,
  312.                                 dwFlags:DWORD
  313. OpenFile                    PROTO \
  314.                                 lpFileName:DWORD,
  315.                                 lpReOpenBuff:DWORD,
  316.                                 uStyle:DWORD
  317. OpenFileMapping             PROTO \
  318.                                 dwDesiredAccess:DWORD,
  319.                                 bInheritHandle:DWORD,
  320.                                 lpName:DWORD
  321. OpenMutex                   PROTO \
  322.                                 dwDesiredAccess:DWORD,
  323.                                 bInheritHandle:DWORD,
  324.                                 lpName:DWORD
  325. OpenSemaphore               PROTO \
  326.                                 dwDesiredAccess:DWORD,
  327.                                 bInheritHandle:DWORD,
  328.                                 lpName:DWORD
  329. OutputDebugString           PROTO \
  330.                                 lpOutputstring:DWORD
  331. PeekConsoleInput            PROTO \
  332.                                 hConsoleInput:DWORD,
  333.                                 lpBuffer:DWORD,
  334.                                 nLength:DWORD,
  335.                                 lpNumberOfEventsRead:DWORD
  336. PulseEvent                  PROTO \
  337.                                 hEvent:DWORD
  338. ReadConsole                 PROTO \
  339.                                 hConsoleInput:DWORD,
  340.                                 lpBuffer:DWORD,
  341.                                 nNumberOfCharsToRead:DWORD,
  342.                                 lpNumberOfCharsRead:DWORD,
  343.                                 lpReserved:DWORD
  344. ReadConsoleInput            PROTO \
  345.                                 hConsoleInput:DWORD,
  346.                                 lpBuffer:DWORD,
  347.                                 nLength:DWORD,
  348.                                 lpNumberOfEventsRead:DWORD
  349. ReadConsoleOutput           PROTO \
  350.                                 hConsoleOutput:DWORD,
  351.                                 lpBuffer:DWORD,
  352.                                 dwBufferSize:DWORD,
  353.                                 dwBufferCoord:DWORD,
  354.                                 lpReadRegion:DWORD
  355. ReadConsoleOutputAttribute  PROTO \
  356.                                 hConsoleOutput:DWORD,
  357.                                 lpAttribute:DWORD,
  358.                                 nLength:DWORD,
  359.                                 dwReadCoord:DWORD,
  360.                                 lpNumberOfAttrsRead:DWORD
  361. ReadConsoleOutputCharacter  PROTO \
  362.                                 hConsoleOutput:DWORD,
  363.                                 lpCharacter:DWORD,
  364.                                 nLength:DWORD,
  365.                                 dwReadCoord:DWORD,
  366.                                 lpNumberOfCharsRead:DWORD
  367. ReadFile                     PROTO \
  368.                                 hFile:DWORD,
  369.                                 lpBuffer:DWORD,
  370.                                 nNumberOfBytesToRead:DWORD,
  371.                                 lpNumberOfBytesRead:DWORD,
  372.                                 lpOverlapped:DWORD
  373. ReleaseSemaphore             PROTO \
  374.                                 hSemaphore:DWORD,
  375.                                 lReleaseCount:DWORD,
  376.                                 lpPreviousCount:DWORD
  377. ReleaseMutex                 PROTO \
  378.                                 hMutex:DWORD
  379. ResetEvent                   PROTO \
  380.                                 hEvent:DWORD
  381. ResumeThread                 PROTO \
  382.                                 hThread:DWORD
  383. ScrollConsoleScreenBuffer    PROTO \
  384.                                 hConsoleOutput:DWORD,
  385.                                 lpScrollRectangle:DWORD,
  386.                                 lpClipRectangle:DWORD,
  387.                                 dwDestinationOrigin:DWORD,
  388.                                 lpFill:DWORD
  389. SetCommConfig                PROTO \
  390.                                 hCommDev:DWORD,
  391.                                 lpCC:DWORD,
  392.                                 dwSize:DWORD
  393. SetCommState                 PROTO \
  394.                                 hFile:DWORD,
  395.                                 lpDCB:DWORD
  396. SetCommTimeouts              PROTO \
  397.                                 hFile:DWORD,
  398.                                 lpCommTimeOuts:DWORD
  399. SetConsoleActiveScreenBuffer PROTO \
  400.                                 hConsoleOutput:DWORD
  401. SetConsoleCP                 PROTO \
  402.                                  wCodePageID:DWORD
  403. SetConsoleCtrlHandler        PROTO \
  404.                                 HandlerRoutine:DWORD,
  405.                                 bAdd:DWORD
  406. SetConsoleCtrlHandler        PROTO \
  407.                                 HandlerRoutine:DWORD,
  408.                                 AddHandler:DWORD
  409. SetConsoleCursorInfo         PROTO \
  410.                                 hConsoleOutput:DWORD,
  411.                                 lpConsoleCursorInfo:DWORD
  412. SetConsoleCursorPosition     PROTO \
  413.                                 hConsoleOutput:DWORD,
  414.                                 dwCursorPosition:DWORD
  415. SetConsoleMode               PROTO \
  416.                                 hConsoleHandle:DWORD,
  417.                                 dwMode:DWORD
  418. SetConsoleOutputCP           PROTO \
  419.                                 wCodePageID:DWORD
  420. SetConsoleScreenBufferSize   PROTO \
  421.                                 hConsoleOutput:DWORD,
  422.                                 dwSize:DWORD
  423. SetConsoleTextAttribute      PROTO \
  424.                                 hConsoleOutput:DWORD,
  425.                                 wAttributes:DWORD
  426. SetConsoleTitle              PROTO \
  427.                                 lpConsoleTitle:DWORD
  428. SetConsoleWindowInfo         PROTO \
  429.                                 hConsoleOutput:DWORD,
  430.                                 bAbsolute:DWORD,
  431.                                 lpConsoleWindow:DWORD
  432. SetEvent                     PROTO \
  433.                                 hEvent:DWORD
  434. SetFilePointer               PROTO \
  435.                              hFile:DWORD,
  436.                              lDistanceToMove:DWORD,
  437.                              lpDistanceToMoveHigh:DWORD,
  438.                              dwMoveMethod:DWORD
  439. SetStdHandle                 PROTO \
  440.                                 nStdHandle:DWORD,
  441.                                 hHandle:DWORD
  442. SetThreadPriority            PROTO \
  443.                                 hThread:DWORD,
  444.                                 nPriority:DWORD
  445. SetupComm                    PROTO \
  446.                                 hFile:DWORD,
  447.                                 dwInQueue:DWORD,
  448.                                 dwOutQueue:DWORD
  449. Sleep                        PROTO \
  450.                                 dwMilliSeconds:DWORD
  451. SleepEx                      PROTO \
  452.                                 dwMilliSeconds:DWORD,
  453.                                 bAlertable:DWORD
  454. SuspendThread                PROTO \
  455.                                 hThread:DWORD
  456. UnlockFile                   PROTO \
  457.                                 hFile:DWORD,
  458.                                 dwFileOffsetLow:DWORD,
  459.                                 dwFileOffsetHigh:DWORD,
  460.                                 nNumberOfBytesToLockLow:DWORD,
  461.                                 nNumberOfBytesToLockHigh:DWORD
  462. UnmapViewOfFile              PROTO \
  463.                                 lpBaseAddress:DWORD
  464. WaitForSingleObject          PROTO \
  465.                                 hHandle:DWORD,
  466.                                 dwMilliseconds:DWORD
  467. WriteConsole                 PROTO \
  468.                                 hConsoleOutput:DWORD,
  469.                                 lpBuffer:DWORD,
  470.                                 nNumberOfCharsToWrite:DWORD,
  471.                                 lpNumberOfCharsWritten:DWORD,
  472.                                 lpReserved:DWORD
  473. WriteConsoleInput            PROTO \
  474.                                 hConsoleInput:DWORD,
  475.                                 lpBuffer:DWORD,
  476.                                 nLength:DWORD,
  477.                                 lpNumberOfEventsWritten:DWORD
  478. WriteConsoleOutput           PROTO \
  479.                                 hConsoleOutput:DWORD,
  480.                                 lpBuffer:DWORD,
  481.                                 dwBufferSize:DWORD,
  482.                                 dwBufferCoord:DWORD,
  483.                                 lpWriteRegion:DWORD
  484. WriteConsoleOutputAttribute  PROTO \
  485.                                 hConsoleOutput:DWORD,
  486.                                 lpAttribute:DWORD,
  487.                                 nLength:DWORD,
  488.                                 dwWriteCoord:DWORD,
  489.                                 lpNumberOfAttrsWritten:DWORD
  490. WriteConsoleOutputCharacter  PROTO \
  491.                                 hConsoleOutput:DWORD,
  492.                                 lpCharacter:DWORD,
  493.                                 nLength:DWORD,
  494.                                 dwWriteCoord:DWORD,
  495.                                 lpNumberOfCharsWritten:DWORD
  496. WriteFile                    PROTO \
  497.                                 hFile:DWORD,
  498.                                 lpBuffer:DWORD,nNumberOfBytesToWrite:DWORD,
  499.                                 lpNumberOfBytesWritten:DWORD,
  500.                                 lpOverlapped:DWORD
  501.  
  502.  
  503. OSVERSIONINFO   STRUCT DWORD
  504. dwOSVersionInfoSize DWORD SIZEOF OSVERSIONINFO ;structure size
  505. dwMajorVersion      DWORD 0             ;major version number
  506. dwMinorVersion      DWORD 0             ;minor version number
  507. dwBuildNumber       DWORD 0             ;build number
  508. dwPlatformId        DWORD 0             ;platform id
  509. szCSDVersion        CHAR 128 dup (0)    ;info string
  510. OSVERSIONINFO   ends
  511.  
  512.  
  513. PROCESS_INFORMATION STRUCT DWORD
  514. hProcess        HANDLE 0                ;process handle
  515. hThread         HANDLE 0                ;thread handle
  516. dwProcessId     DWORD 0                 ;process id
  517. dwThreadId      DWORD 0                 ;thread id
  518. PROCESS_INFORMATION ends
  519.  
  520.  
  521. SYSTEMTIME      STRUCT DWORD
  522. wYear           WORD 0                 ;current year
  523. wMonth          WORD 0                 ;current month (1..12)
  524. wDayOfWeek      WORD 0                 ;day of week (0 = sunday)
  525. wDay            WORD 0                 ;current day of the month
  526. wHour           WORD 0                 ;current hour
  527. wMinute         WORD 0                 ;current minute
  528. wSecond         WORD 0                 ;current second
  529. wMilliseconds   WORD 0                 ;current millisecond
  530. SYSTEMTIME      ends
  531.  
  532.  
  533. FILETIME struct DWORD
  534. dwLowDateTime   DWORD 0                 ;low-order 32 bits
  535. dwHighDateTime  DWORD 0                 ;high-order 32 bits
  536. FILETIME ends
  537.  
  538.  
  539.  
  540. ; Used by CreateProcess and others.
  541.  
  542. STARTUPINFO     STRUCT DWORD
  543. cb              DWORD SIZEOF STARTUPINFO;structure size
  544. lpReserved      DWORD 0                 ;(reserved)
  545. lpDesktop       DWORD 0                 ;desktop name
  546. lpTitle         DWORD 0                 ;console window title
  547. dwX             DWORD 0                 ;window origin (column)
  548. dwY             DWORD 0                 ;window origin (row)
  549. dwXSize         DWORD 0                 ;window width
  550. dwYSize         DWORD 0                 ;window height
  551. dwXCountChars   DWORD 0                 ;screen buffer width
  552. dwYCountChars   DWORD 0                 ;screen buffer height
  553. dwFillAttribute DWORD 0                 ;console window initialization
  554. dwFlags         DWORD 0                 ;structure member flags
  555. wShowWindow     WORD  0                 ;ShowWindow() parameter
  556. cbReserved2     WORD  0                 ;(reserved)
  557. lpReserved2     DWORD 0                 ;(reserved)
  558. hStdInput       DWORD 0                 ;standard input handle
  559. hStdOutput      DWORD 0                 ;standard output handle
  560. hStdError       DWORD 0                 ;standard error handle
  561. STARTUPINFO     ENDS
  562.  
  563.  
  564.  
  565. ; Various File related structures.
  566.  
  567.  
  568. OFSTRUCT        STRUCT DWORD
  569. cBytes          BYTE 0                  ;structure size
  570. fFixedDisk      BYTE 0                  ;fixed-disk flag
  571. nErrCode        WORD 0                  ;error code
  572. Reserved1       WORD 0                  ;(reserved)
  573. Reserved2       WORD 0                  ;(reserved)
  574. szPathName      BYTE OFS_MAXPATHNAME DUP (0) ;path name
  575. OFSTRUCT        ends
  576.  
  577.  
  578. WIN32_FIND_DATA struct DWORD
  579. dwFileAttributes   DWORD 0              ;file attributes
  580. ftCreationTime     DWORD 0, 0           ;time of file creation
  581. ftLastAccessTime   DWORD 0, 0           ;time of last file access
  582. ftLastWriteTime    DWORD 0, 0           ;time of last write access
  583. nFileSizeHigh      DWORD 0              ;high-order word of file size
  584. nFileSizeLow       DWORD 0              ;low-order word of file size
  585. dwReserved0        DWORD 0              ;(reserved)
  586. dwReserved1        DWORD 0              ;(reserved)
  587. cFileName          CHAR MAX_PATH dup (0);matching file name
  588. cAlternateFileName CHAR 14 dup (0)      ;8.3 alias name
  589. WIN32_FIND_DATA ends
  590.  
  591.  
  592. BY_HANDLE_FILE_INFORMATION struct DWORD
  593. dwFileAttributes      DWORD 0           ;file attributes
  594. ftCreationTime        DWORD 0, 0        ;time of file creation
  595. ftLastAccessTime      DWORD 0, 0        ;time of last file access
  596. ftLastWriteTime       DWORD 0, 0        ;time of last write access
  597. dwVolumeSerialNumber  DWORD 0           ;volume serial number
  598. nFileSizeHigh         DWORD 0           ;high-order word of file size
  599. nFileSizeLow          DWORD 0           ;low-order word of file size
  600. nNumberOfLinks        DWORD 0           ;number of links to the file
  601. nFileIndexHigh        DWORD 0           ;high-order word of identifier
  602. nFileIndexLow         DWORD 0           ;low-order word of identifier
  603. BY_HANDLE_FILE_INFORMATION ends
  604.  
  605.  
  606.  
  607. ; status codes
  608.  
  609. STATUS_WAIT_0                  = 000000000h
  610. STATUS_ABANDONED_WAIT_0        = 000000080h
  611. STATUS_USER_APC                = 0000000C0h
  612. STATUS_TIMEOUT                 = 000000102h
  613. STATUS_PENDING                 = 000000103h
  614. STATUS_SEGMENT_NOTIFICATION    = 040000005h
  615. STATUS_GUARD_PAGE_VIOLATION    = 080000001h
  616. STATUS_DATATYPE_MISALIGNMENT   = 080000002h
  617. STATUS_BREAKPOINT              = 080000003h
  618. STATUS_SINGLE_STEP             = 080000004h
  619. STATUS_ACCESS_VIOLATION        = 0C0000005h
  620. STATUS_IN_PAGE_ERROR           = 0C0000006h
  621. STATUS_NO_MEMORY               = 0C0000017h
  622. STATUS_ILLEGAL_INSTRUCTION     = 0C000001Dh
  623. STATUS_NONCONTINUABLE_EXCEPTION = 0C0000025h
  624. STATUS_INVALID_DISPOSITION     = 0C0000026h
  625. STATUS_ARRAY_BOUNDS_EXCEEDED   = 0C000008Ch
  626. STATUS_FLOAT_DENORMAL_OPERAND  = 0C000008Dh
  627. STATUS_FLOAT_DIVIDE_BY_ZERO    = 0C000008Eh
  628. STATUS_FLOAT_INEXACT_RESULT    = 0C000008Fh
  629. STATUS_FLOAT_INVALID_OPERATION = 0C0000090h
  630. STATUS_FLOAT_OVERFLOW          = 0C0000091h
  631. STATUS_FLOAT_STACK_CHECK       = 0C0000092h
  632. STATUS_FLOAT_UNDERFLOW         = 0C0000093h
  633. STATUS_INTEGER_DIVIDE_BY_ZERO  = 0C0000094h
  634. STATUS_INTEGER_OVERFLOW        = 0C0000095h
  635. STATUS_PRIVILEGED_INSTRUCTION  = 0C0000096h
  636. STATUS_STACK_OVERFLOW          = 0C00000FDh
  637. STATUS_CONTROL_C_EXIT          = 0C000013Ah
  638.  
  639.  
  640. ; wait status codes
  641.  
  642. WAIT_FAILED                = -1
  643. WAIT_OBJECT_0              = STATUS_WAIT_0              ; == 000h
  644.  
  645. WAIT_ABANDONED             = STATUS_ABANDONED_WAIT_0    ; == 080h
  646. WAIT_ABANDONED_0           = STATUS_ABANDONED_WAIT_0
  647.  
  648. WAIT_TIMEOUT               = STATUS_TIMEOUT             ; == 102h
  649. WAIT_IO_COMPLETION         = STATUS_USER_APC            ; == 0C0h
  650. STILL_ACTIVE               = STATUS_PENDING             ; == 103h
  651.  
  652. MAXIMUM_WAIT_OBJECTS       =  64
  653. MAXIMUM_SUSPEND_COUNT      = 127
  654. INFINITE                   =  -1
  655.  
  656.  
  657. ; standard access types
  658.  
  659. DELETE                     = 00010000h
  660. READ_CONTROL               = 00020000h
  661. WRITE_DAC                  = 00040000h
  662. WRITE_OWNER                = 00080000h
  663. SYNCHRONIZE                = 00100000h
  664.  
  665. SPECIFIC_RIGHTS_ALL        = 0000FFFFh
  666. STANDARD_RIGHTS_REQUIRED   = 000F0000h
  667. STANDARD_RIGHTS_ALL        = 001F0000h
  668.  
  669. STANDARD_RIGHTS_READ       = READ_CONTROL
  670. STANDARD_RIGHTS_WRITE      = READ_CONTROL
  671. STANDARD_RIGHTS_EXECUTE    = READ_CONTROL
  672.  
  673. MUTANT_QUERY_STATE         = 00001h
  674. MUTEX_ALL_ACCESS           = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or\
  675.                               MUTANT_QUERY_STATE)
  676.  
  677. SEMAPHORE_MODIFY_STATE     = 00002h
  678. SEMAPHORE_ALL_ACCESS       = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or 03h)
  679.  
  680. EVENT_MODIFY_STATE         = 00002h
  681. EVENT_ALL_ACCESS           = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or 03h)
  682.  
  683.  
  684.  
  685. ; thread access flags
  686.  
  687. THREAD_TERMINATE           = 0001h
  688. THREAD_SUSPEND_RESUME      = 0002h
  689. THREAD_GET_CONTEXT         = 0008h
  690. THREAD_SET_CONTEXT         = 0010h
  691. THREAD_SET_INFORMATION     = 0020h
  692. THREAD_QUERY_INFORMATION   = 0040h
  693. THREAD_SET_THREAD_TOKEN    = 0080h
  694. THREAD_IMPERSONATE         = 0100h
  695. THREAD_DIRECT_IMPERSONATION = 0200h
  696.  
  697. THREAD_ALL_ACCESS          = STANDARD_RIGHTS_REQUIRED+\
  698.                              SYNCHRONIZE+\
  699.                              03FFh
  700.  
  701. ; thread priorities
  702.  
  703. THREAD_BASE_PRIORITY_IDLE  = -15
  704. THREAD_BASE_PRIORITY_MIN   =  -2
  705. THREAD_BASE_PRIORITY_MAX   =   2
  706. THREAD_BASE_PRIORITY_LOWRT =  15
  707.  
  708. THREAD_PRIORITY_LOWEST         = THREAD_BASE_PRIORITY_MIN
  709. THREAD_PRIORITY_BELOW_NORMAL   = THREAD_PRIORITY_LOWEST+1
  710. THREAD_PRIORITY_NORMAL         = 0
  711. THREAD_PRIORITY_ABOVE_NORMAL   = THREAD_PRIORITY_HIGHEST-1
  712. THREAD_PRIORITY_HIGHEST        = THREAD_BASE_PRIORITY_MAX
  713.  
  714. THREAD_PRIORITY_TIME_CRITICAL  = THREAD_BASE_PRIORITY_LOWRT
  715. THREAD_PRIORITY_IDLE           = THREAD_BASE_PRIORITY_IDLE
  716.  
  717. THREAD_PRIORITY_ERROR_RETURN   =  -1
  718.  
  719.  
  720. ; process access flags
  721.  
  722. PROCESS_TERMINATE          = 0001h
  723. PROCESS_CREATE_THREAD      = 0002h
  724. PROCESS_VM_OPERATION       = 0008h
  725. PROCESS_VM_READ            = 0010h
  726. PROCESS_VM_WRITE           = 0020h
  727. PROCESS_DUP_HANDLE         = 0040h
  728. PROCESS_CREATE_PROCESS     = 0080h
  729. PROCESS_SET_QUOTA          = 0100h
  730. PROCESS_SET_INFORMATION    = 0200h
  731. PROCESS_QUERY_INFORMATION  = 0400h
  732.  
  733. PROCESS_ALL_ACCESS         = STANDARD_RIGHTS_REQUIRED+\
  734.                              SYNCHRONIZE+\
  735.                              0FFFh
  736.  
  737.  
  738. ; Memory Attributes.
  739.  
  740. PAGE_NOACCESS              = 00000001h
  741. PAGE_READONLY              = 00000002h
  742. PAGE_READWRITE             = 00000004h
  743. PAGE_WRITECOPY             = 00000008h
  744. PAGE_EXECUTE               = 00000010h
  745. PAGE_EXECUTE_READ          = 00000020h
  746. PAGE_EXECUTE_READWRITE     = 00000040h
  747. PAGE_EXECUTE_WRITECOPY     = 00000080h
  748. PAGE_GUARD                 = 00000100h
  749. PAGE_NOCACHE               = 00000200h
  750.  
  751. MEM_COMMIT                 = 00001000h
  752. MEM_RESERVE                = 00002000h
  753. MEM_DECOMMIT               = 00004000h
  754. MEM_RELEASE                = 00008000h
  755. MEM_FREE                   = 00010000h
  756. MEM_PRIVATE                = 00020000h
  757. MEM_MAPPED                 = 00040000h
  758. MEM_TOP_DOWN               = 00100000h
  759.  
  760. SEC_FILE                   = 00800000h
  761. SEC_IMAGE                  = 01000000h
  762. SEC_RESERVE                = 04000000h
  763. SEC_COMMIT                 = 08000000h
  764. SEC_NOCACHE                = 10000000h
  765.  
  766. MEM_IMAGE                  = SEC_IMAGE
  767.  
  768. SECTION_QUERY              = 00000001h
  769. SECTION_MAP_WRITE          = 00000002h
  770. SECTION_MAP_READ           = 00000004h
  771. SECTION_MAP_EXECUTE        = 00000008h
  772. SECTION_EXTEND_SIZE        = 00000010h
  773.  
  774. SECTION_ALL_ACCESS         = STANDARD_RIGHTS_REQUIRED+\
  775.                              SECTION_QUERY+\
  776.                              SECTION_MAP_WRITE+\
  777.                              SECTION_MAP_READ+\
  778.                              SECTION_MAP_EXECUTE+\
  779.                              SECTION_EXTEND_SIZE
  780.  
  781. FILE_MAP_COPY              = SECTION_QUERY
  782. FILE_MAP_WRITE             = SECTION_MAP_WRITE
  783. FILE_MAP_READ              = SECTION_MAP_READ
  784. FILE_MAP_ALL_ACCESS        = SECTION_ALL_ACCESS
  785.  
  786.  
  787.  
  788. ; Critical section structures.
  789.  
  790. LIST_ENTRY STRUCT DWORD
  791. FLink            DWORD ?
  792. BLink            DWORD ?
  793. LIST_ENTRY ENDS
  794.  
  795. CRITICAL_SECTION_DEBUG  STRUCT DWORD
  796. _Type                   WORD  ?
  797. CreatorBackTraceIndex   WORD  ?
  798. CriticalSection         DWORD ?         ;Pointer to CRITICAL_SECTION
  799. ProcessLocksList        LIST_ENTRY  <>
  800. EntryCount              DWORD ?
  801. ContentionCount         DWORD ?
  802. Depth                   DWORD ?
  803. OwnerBackTrace          DWORD 2 DUP (?)
  804. CRITICAL_SECTION_DEBUG  ENDS
  805.  
  806.  
  807. CRITICAL_SECTION STRUCT DWORD
  808. DebugInfo        DWORD ?                ;Pointer to CRITICAL_SECTION_DEBUG
  809. LockCount        DWORD ?
  810. RecursionCount   DWORD ?
  811. OwningThread     DWORD ?                ;From the thread's ClientId->UniqueThread
  812. LockSemaphore    DWORD ?
  813. Reserved         DWORD ?
  814. CRITICAL_SECTION ENDS
  815.  
  816.  
  817.  
  818. OVERLAPPED      STRUCT DWORD
  819. Internal        DWORD 0                 ;== STATUS_PENDING until I/O completed.
  820. InternalHigh    DWORD 0                 ;Number of bytes actually transferred.
  821. _Offset         DWORD 0                 ;Offset in file where to begin IO
  822. _OffsetHigh     DWORD 0                 ;(set to zero for non-file IO!)
  823. hEvent          DWORD 0                 ;Event handle to be signaled at end.
  824. OVERLAPPED      ENDS
  825.  
  826.  
  827.  
  828. ; Console equates and structures.
  829.  
  830.  
  831. COORD STRUCT
  832. X   WORD 0
  833. Y   WORD 0
  834. COORD ENDS
  835.  
  836. SMALL_RECT STRUCT
  837. Left    WORD 0
  838. Top     WORD 0
  839. Right   WORD 0
  840. Bottom  WORD 0
  841. SMALL_RECT ENDS
  842.  
  843. KEY_EVENT_RECORD STRUCT
  844. bKeyDown          DWORD 0
  845. wRepeatCount      WORD 0
  846. wVirtualKeyCode   WORD 0
  847. wVirtualScanCode  WORD 0
  848.     union uChar
  849.       UnicodeChar   WCHAR '?'
  850.       AsciiChar     ACHAR '?'
  851.     ENDS
  852. dwControlKeyState DWORD 0
  853. KEY_EVENT_RECORD ENDS
  854.  
  855. ;
  856. ; ControlKeyState flags
  857. ;
  858.  
  859. RIGHT_ALT_PRESSED     = 0001h           ; the right alt key is pressed.
  860. LEFT_ALT_PRESSED      = 0002h           ; the left alt key is pressed.
  861. RIGHT_CTRL_PRESSED    = 0004h           ; the right ctrl key is pressed.
  862. LEFT_CTRL_PRESSED     = 0008h           ; the left ctrl key is pressed.
  863. SHIFT_PRESSED         = 0010h           ; the shift key is pressed.
  864. NUMLOCK_ON            = 0020h           ; the numlock light is on.
  865. SCROLLLOCK_ON         = 0040h           ; the scrolllock light is on.
  866. CAPSLOCK_ON           = 0080h           ; the capslock light is on.
  867. ENHANCED_KEY          = 0100h           ; the key is enhanced.
  868.  
  869. MOUSE_EVENT_RECORD STRUCT
  870. dwMousePosition    COORD <>
  871. dwButtonState      DWORD 0
  872. dwControlKeyState  DWORD 0
  873. dwEventFlags       DWORD 0
  874. MOUSE_EVENT_RECORD ENDS
  875.  
  876. ;
  877. ; ButtonState flags
  878. ;
  879.  
  880. FROM_LEFT_1ST_BUTTON_PRESSED    = 00001h
  881. RIGHTMOST_BUTTON_PRESSED        = 00002h
  882. FROM_LEFT_2ND_BUTTON_PRESSED    = 00004h
  883. FROM_LEFT_3RD_BUTTON_PRESSED    = 00008h
  884. FROM_LEFT_4TH_BUTTON_PRESSED    = 00010h
  885.  
  886. ;
  887. ; EventFlags
  888. ;
  889.  
  890. MOUSE_MOVED     = 00001h
  891. DOUBLE_CLICK    = 00002h
  892.  
  893.  
  894. WINDOW_BUFFER_SIZE_RECORD STRUCT
  895. dwSize      COORD <>
  896. WINDOW_BUFFER_SIZE_RECORD ENDS
  897.  
  898. MENU_EVENT_RECORD STRUCT
  899. dwCommandId DWORD 0
  900. MENU_EVENT_RECORD ENDS
  901.  
  902. FOCUS_EVENT_RECORD STRUCT
  903. bSetFocus   DWORD 0
  904. FOCUS_EVENT_RECORD ENDS
  905.  
  906. INPUT_RECORD STRUCT
  907. EventType  WORD 0
  908.   UNION Event
  909.   KeyEvent              KEY_EVENT_RECORD <>
  910.   MouseEZvent           MOUSE_EVENT_RECORD <>
  911.   WindowBufferSizeEvent WINDOW_BUFFER_SIZE_RECORD <>
  912.   MenuEvent             MENU_EVENT_RECORD <>
  913.   FocusEvent            FOCUS_EVENT_RECORD <>
  914.   ENDS
  915. INPUT_RECORD ENDS
  916.  
  917. ;
  918. ;  EventType flags:
  919. ;
  920.  
  921. KEY_EVENT                  = 00001h     ; Event contains key event record
  922. MOUSE_EVENT                = 00002h     ; Event contains mouse event record
  923. WINDOW_BUFFER_SIZE_EVENT   = 00004h     ; Event contains window change event record
  924. MENU_EVENT                 = 00008h     ; Event contains menu event record
  925. FOCUS_EVENT                = 00010h     ; event contains focus change
  926.  
  927. CHAR_INFO STRUCT
  928.   UNION uChar
  929.   UnicodeChar WCHAR '?'
  930.   AsciiChar   WCHAR '?'
  931.   ENDS
  932. Attributes  WORD 0
  933. CHAR_INFO ENDS
  934.  
  935. ;
  936. ; Attributes flags:
  937. ;
  938.  
  939. FOREGROUND_BLUE            = 00001h     ; text color contains blue.
  940. FOREGROUND_GREEN           = 00002h     ; text color contains green.
  941. FOREGROUND_RED             = 00004h     ; text color contains red.
  942. FOREGROUND_INTENSITY       = 00008h     ; text color is intensified.
  943. BACKGROUND_BLUE            = 00010h     ; background color contains blue.
  944. BACKGROUND_GREEN           = 00020h     ; background color contains green.
  945. BACKGROUND_RED             = 00040h     ; background color contains red.
  946. BACKGROUND_INTENSITY       = 00080h     ; background color is intensified.
  947.  
  948.  
  949. CONSOLE_SCREEN_BUFFER_INFO STRUCT
  950. dwSize              COORD <>
  951. dwCursorPosition    COORD <>
  952. wAttributes         WORD  0
  953. srWindow            SMALL_RECT <>
  954. dwMaximumWindowSize COORD <>
  955. CONSOLE_SCREEN_BUFFER_INFO ENDS
  956.  
  957. CONSOLE_CURSOR_INFO STRUCT
  958. dwSize   DWORD 0
  959. bVisible DWORD  0
  960. CONSOLE_CURSOR_INFO ENDS
  961.  
  962. CTRL_C_EVENT               = 0
  963. CTRL_BREAK_EVENT           = 1
  964. CTRL_CLOSE_EVENT           = 2
  965. ; 3 is reserved!
  966. ; 4 is reserved!
  967. CTRL_LOGOFF_EVENT          = 5
  968. CTRL_SHUTDOWN_EVENT        = 6
  969.  
  970. ;
  971. ;  Input Mode flags:
  972. ;
  973.  
  974. ENABLE_PROCESSED_INPUT     = 00001h
  975. ENABLE_LINE_INPUT          = 00002h
  976. ENABLE_ECHO_INPUT          = 00004h
  977. ENABLE_WINDOW_INPUT        = 00008h
  978. ENABLE_MOUSE_INPUT         = 00010h
  979.  
  980. ;
  981. ; Output Mode flags:
  982. ;
  983.  
  984. ENABLE_PROCESSED_OUTPUT    = 00001h
  985. ENABLE_WRAP_AT_EOL_OUTPUT  = 00002h
  986.  
  987.  
  988.  
  989. CONSOLE_TEXTMODE_BUFFER  = 1
  990.  
  991.  
  992. CR                       = 13           ;Basic ASCII control characters.
  993. LF                       = 10
  994. BEL                      = 7
  995. BELL                     = BEL
  996.  
  997.  
  998. ; Comm32 (serial) & Modem stuff.
  999.  
  1000.  
  1001. SP_SERIALCOMM      = 00000001h
  1002.  
  1003. PST_UNSPECIFIED    = 00000000h
  1004. PST_RS232          = 00000001h
  1005. PST_PARALLELPORT   = 00000002h
  1006. PST_RS422          = 00000003h
  1007. PST_RS423          = 00000004h
  1008. PST_RS449          = 00000005h
  1009. PST_FAX            = 00000021h
  1010. PST_SCANNER        = 00000022h
  1011. PST_NETWORK_BRIDGE = 00000100h
  1012. PST_LAT            = 00000101h
  1013. PST_TCPIP_TELNET   = 00000102h
  1014. PST_X25            = 00000103h
  1015.  
  1016. PCF_DTRDSR         = 0001h
  1017. PCF_RTSCTS         = 0002h
  1018. PCF_RLSD           = 0004h
  1019. PCF_PARITY_CHECK   = 0008h
  1020. PCF_XONXOFF        = 0010h
  1021. PCF_SETXCHAR       = 0020h
  1022. PCF_TOTALTIMEOUTS  = 0040h
  1023. PCF_INTTIMEOUTS    = 0080h
  1024. PCF_SPECIALCHARS   = 0100h
  1025. PCF_16BITMODE      = 0200h
  1026.  
  1027. SP_PARITY          = 0001h
  1028. SP_BAUD            = 0002h
  1029. SP_DATABITS        = 0004h
  1030. SP_STOPBITS        = 0008h
  1031. SP_HANDSHAKING     = 0010h
  1032. SP_PARITY_CHECK    = 0020h
  1033. SP_RLSD            = 0040h
  1034.  
  1035. BAUD_075           = 00000001h
  1036. BAUD_110           = 00000002h
  1037. BAUD_134_5         = 00000004h
  1038. BAUD_150           = 00000008h
  1039. BAUD_300           = 00000010h
  1040. BAUD_600           = 00000020h
  1041. BAUD_1200          = 00000040h
  1042. BAUD_1800          = 00000080h
  1043. BAUD_2400          = 00000100h
  1044. BAUD_4800          = 00000200h
  1045. BAUD_7200          = 00000400h
  1046. BAUD_9600          = 00000800h
  1047. BAUD_14400         = 00001000h
  1048. BAUD_19200         = 00002000h
  1049. BAUD_38400         = 00004000h
  1050. BAUD_56K           = 00008000h
  1051. BAUD_128K          = 00010000h
  1052. BAUD_USER          = 10000000h
  1053.  
  1054. DATABITS_5         = 0001h
  1055. DATABITS_6         = 0002h
  1056. DATABITS_7         = 0004h
  1057. DATABITS_8         = 0008h
  1058. DATABITS_16        = 0010h
  1059. DATABITS_16X       = 0020h
  1060. STOPBITS_10        = 0001h
  1061. STOPBITS_15        = 0002h
  1062. STOPBITS_20        = 0004h
  1063. PARITY_NONE        = 0100h
  1064. PARITY_ODD         = 0200h
  1065. PARITY_EVEN        = 0400h
  1066. PARITY_MARK        = 0800h
  1067. PARITY_SPACE       = 1000h
  1068.  
  1069.  
  1070.  
  1071. ; COMSTAT flags.
  1072.  
  1073. fCtsHold        = 00000000000000001b
  1074. fDsrHold        = 00000000000000010b
  1075. fRlsdHold       = 00000000000000100b
  1076. fXoffHold       = 00000000000001000b
  1077. fXoffSent       = 00000000000010000b
  1078. fEof            = 00000000000100000b
  1079. fTxim           = 00000000001000000b
  1080.  
  1081.  
  1082. COMSTAT   STRUCT DWORD
  1083. COMSTATFlags    DWORD ?                 ;See flags above.
  1084. cbInQue         DWORD ?
  1085. cbOutQue        DWORD ?
  1086. COMSTAT   ENDS
  1087.  
  1088.  
  1089.  
  1090. ; DCB Parity
  1091.  
  1092. NOPARITY        EQU     0t
  1093. ODDPARITY       EQU     1t
  1094. EVENPARITY      EQU     2t
  1095. MARKPARITY      EQU     3t
  1096. SPACEPARITY     EQU     4t
  1097.  
  1098.  
  1099. ; DCB StopBits
  1100.  
  1101. ONESTOPBIT      EQU     0t
  1102. ONE5STOPBITS    EQU     1t
  1103. TWOSTOPBITS     EQU     2t
  1104.  
  1105. IGNORE          EQU     0t
  1106. INFINITE        EQU     0ffffffffh
  1107.  
  1108.  
  1109. ; DCB BaudRate
  1110.  
  1111. CBR_110         EQU     110t
  1112. CBR_300         EQU     300t
  1113. CBR_600         EQU     600t
  1114. CBR_1200        EQU     1200t
  1115. CBR_2400        EQU     2400t
  1116. CBR_4800        EQU     4800t
  1117. CBR_9600        EQU     9600t
  1118. CBR_14400       EQU     14400t
  1119. CBR_19200       EQU     19200t
  1120. CBR_38400       EQU     38400t
  1121. CBR_56000       EQU     56000t
  1122. CBR_128000      EQU     128000t
  1123. CBR_256000      EQU     256000t
  1124.  
  1125.  
  1126. ; ClearCommError constants.
  1127.  
  1128. CE_RXOVER       EQU     000000001h
  1129. CE_OVERRUN      EQU     000000002h
  1130. CE_RXPARITY     EQU     000000004h
  1131. CE_FRAME        EQU     000000008h
  1132. CE_BREAK        EQU     000000010h
  1133. CE_TXFULL       EQU     000000100h
  1134. CE_PTO          EQU     000000200h
  1135. CE_IOE          EQU     000000400h
  1136. CE_DNS          EQU     000000800h
  1137. CE_OOP          EQU     000001000h
  1138. CE_MODE         EQU     000008000h
  1139.  
  1140.  
  1141. ; CommEvent mask.
  1142.  
  1143. EV_RXCHAR       EQU     000000001h
  1144. EV_RXFLAG       EQU     000000002h
  1145. EV_TXEMPTY      EQU     000000004h
  1146. EV_CTS          EQU     000000008h
  1147. EV_DSR          EQU     000000010h
  1148. EV_RLSD         EQU     000000020h
  1149. EV_BREAK        EQU     000000040h
  1150. EV_ERR          EQU     000000080h
  1151. EV_RING         EQU     000000100h
  1152. EV_PERR         EQU     000000200h
  1153. EV_RX80FULL     EQU     000000400h
  1154. EV_EVENT1       EQU     000000800h
  1155. EV_EVENT2       EQU     000001000h
  1156.  
  1157.  
  1158. ; EscapeCommFunction constants.
  1159.  
  1160. SETXOFF         EQU     1t
  1161. SETXON          EQU     2t
  1162. SETRTS          EQU     3t
  1163. CLRRTS          EQU     4t
  1164. SETDTR          EQU     5t
  1165. CLRDTR          EQU     6t
  1166. RESETDEV        EQU     7t
  1167. SETBREAK        EQU     8t
  1168. CLRBREAK        EQU     9t
  1169.  
  1170.  
  1171. ; PurgeComm constants.
  1172.  
  1173. PURGE_TXABORT   EQU     0001h
  1174. PURGE_RXABORT   EQU     0002h
  1175. PURGE_TXCLEAR   EQU     0004h
  1176. PURGE_RXCLEAR   EQU     0008h
  1177.  
  1178.  
  1179. ; GetCommModemStatus constants.
  1180.  
  1181. MS_CTS_ON       EQU     0010h
  1182. MS_DSR_ON       EQU     0020h
  1183. MS_RING_ON      EQU     0040h
  1184. MS_RLSD_ON      EQU     0080h
  1185.  
  1186.  
  1187. ; DCB Flags
  1188.  
  1189. fBinary                 = 00000000000000001b ;Binary Mode (skip EOF check)
  1190. fParity                 = 00000000000000010b ;Enable parity checking
  1191. fOutxCtsFlow            = 00000000000000100b ;CTS handshaking on output
  1192. fOutxDsrFlow            = 00000000000001000b ;DSR handshaking on output
  1193. fDtrControlMask         = 00000000000110000b ;DTR Flow control mask.
  1194.   DTR_CONTROL_DISABLE   =           0000000b   ;DTR always disabled.
  1195.   DTR_CONTROL_ENABLE    =           0010000b   ;DTR enabled when device Open.
  1196.   DTR_CONTROL_HANDSHAKE =           0100000b   ;Enable DTR handshaking.
  1197. fDsrSensitivity         = 00000000001000000b ;DSR Sensitivity
  1198. fTXContinueOnXoff       = 00000000010000000b ;Continue TX when Xoff sent
  1199. fOutX                   = 00000000100000000b ;Enable output X-ON/X-OFF
  1200. fInX                    = 00000001000000000b ;Enable input X-ON/X-OFF
  1201. fErrorChar              = 00000010000000000b ;Enable Err Replacement
  1202. fNull                   = 00000100000000000b ;Enable Null stripping
  1203. fRtsControlMask         = 00011000000000000b ;Rts Flow control mask.
  1204.   RTS_CONTROL_DISABLE   =   000000000000000b   ;RTS always disabled.
  1205.   RTS_CONTROL_ENABLE    =   001000000000000b   ;RTS enabled when device Open.
  1206.   RTS_CONTROL_HANDSHAKE =   010000000000000b   ;RTS handshaking (input control)
  1207.   RTS_CONTROL_TOGGLE    =   011000000000000b   ;Switched carried (on when Txing)
  1208. fAbortOnError           = 00100000000000000b ;Abort all reads and writes on Error
  1209.  
  1210.  
  1211. DCB STRUCT DWORD
  1212. DCBlength   DWORD SIZEOF DCB            ;sizeof(DCB)
  1213. BaudRate    DWORD ?                     ;Baudrate at which running
  1214. DCBFlags    DWORD ?                     ;Set of flags, see above.
  1215.  
  1216. wReserved   WORD  ?                     ;Not currently used
  1217. XonLim      WORD  ?                     ;Transmit X-ON threshold
  1218.  
  1219. XoffLim     WORD  ?                     ;Transmit X-OFF threshold
  1220. ByteSize    BYTE  ?                     ;Number of bits/byte, 4-8
  1221. Parity      BYTE  ?                     ;0-4=None,Odd,Even,Mark,Space
  1222.  
  1223. StopBits    BYTE  ?                     ;0,1,2 = 1, 1.5, 2
  1224. XonChar     BYTE  ?                     ;Tx and Rx X-ON character
  1225. XoffChar    BYTE  ?                     ;Tx and Rx X-OFF character
  1226. ErrorChar   BYTE  ?                     ;Error replacement char
  1227.  
  1228. EofChar     BYTE  ?                     ;End of Input character
  1229. EvtChar     BYTE  ?                     ;Received Event character
  1230. wReserved1  WORD  ?                     ;Fill for now.
  1231. DCB ENDS
  1232.  
  1233.  
  1234. COMMTIMEOUTS STRUCT DWORD
  1235. ReadIntervalTimeout          DWORD ?    ;Maximum time between read chars.
  1236. ReadTotalTimeoutMultiplier   DWORD ?    ;Multiplier of characters.
  1237. ReadTotalTimeoutConstant     DWORD ?    ;Constant in milliseconds.
  1238. WriteTotalTimeoutMultiplier  DWORD ?    ;Multiplier of characters.
  1239. WriteTotalTimeoutConstant    DWORD ?    ;Constant in milliseconds.
  1240. COMMTIMEOUTS ENDS
  1241.  
  1242.  
  1243. MODEMSETTINGS STRUCT DWORD
  1244. dwActualSize            DWORD SIZEOF MODEMSETTINGS
  1245. dwRequiredSize          DWORD ?
  1246. dwDevSpecificOffset     DWORD ?
  1247. dwDevSpecificSize       DWORD ?
  1248. ; static local options (read/write)
  1249. dwCallSetupFailTimer    DWORD ?         ;seconds
  1250. dwInactivityTimeout     DWORD ?         ;seconds
  1251. dwSpeakerVolume         DWORD ?         ;level
  1252. dwSpeakerMode           DWORD ?         ;mode
  1253. dwPreferredModemOptions DWORD ?         ;bitmap
  1254. ; negotiated options (read only) for current or last call
  1255. dwNegotiatedModemOptions DWORD ?        ; bitmap
  1256. dwNegotiatedDCERate      DWORD ?        ; bit/s
  1257. ; Variable portion for proprietary expansion
  1258. abVariablePortion       BYTE 4 DUP(0)
  1259. MODEMSETTINGS ENDS
  1260.  
  1261. COMMCONFIG STRUCT DWORD
  1262. dwSize            DWORD SIZEOF COMMCONFIG ;Size of the entire struct
  1263. wVersion          WORD  ?               ;version of the structure
  1264. wReserved         WORD  ?               ;alignment
  1265. ccDCB             DCB   {}              ;device control block
  1266. dwProviderSubType DWORD ?               ;ordinal value for identifying
  1267.                                         ;provider-defined data structure format
  1268. dwProviderOffset  DWORD ?               ;Specifies the offset of provider specific
  1269.                                         ;data field in bytes from the start
  1270. dwProviderSize    DWORD ?               ;size of the provider-specific data field
  1271. wcProviderData    MODEMSETTINGS {}      ;Provider-specific data.
  1272. COMMCONFIG ENDS
  1273.  
  1274.  
  1275.  
  1276. MODEMDEVCAPS STRUCT DWORD
  1277. dwActualSize         DWORD SIZEOF MODEMDEVCAPS
  1278. dwRequiredSize       DWORD ?
  1279. dwDevSpecificOffset  DWORD ?
  1280. dwDevSpecificSize    DWORD ?
  1281. ; product and version identification
  1282. dwModemProviderVersion     DWORD ?
  1283. dwModemManufacturerOffset  DWORD ?
  1284. dwModemManufacturerSize    DWORD ?
  1285. dwModemModelOffset         DWORD ?
  1286. dwModemModelSize           DWORD ?
  1287. dwModemVersionOffset       DWORD ?
  1288. dwModemVersionSize         DWORD ?
  1289. ; local option capabilities
  1290. dwDialOptions        DWORD ?            ; bitmap of supported values
  1291. dwCallSetupFailTimer DWORD ?            ; maximum in seconds
  1292. dwInactivityTimeout  DWORD ?            ; maximum in seconds
  1293. dwSpeakerVolume      DWORD ?            ; bitmap of supported values
  1294. dwSpeakerMode        DWORD ?            ; bitmap of supported values
  1295. dwModemOptions       DWORD ?            ; bitmap of supported values
  1296. dwMaxDTERate         DWORD ?            ; maximum value in bit/s
  1297. dwMaxDCERate         DWORD ?            ; maximum value in bit/s
  1298. ; Variable portion for proprietary expansion
  1299. abVariablePortion    BYTE 0
  1300. MODEMDEVCAPS ENDS
  1301.  
  1302.  
  1303. ; Set dwProvSpec1 to COMMPROP_INITIALIZED to indicate that wPacketLength
  1304. ; is valid before a call to GetCommProperties().
  1305.  
  1306. COMMPROP_INITIALIZED    = 0E73CF52Eh
  1307.  
  1308. COMMPROP           STRUCT DWORD
  1309. wPacketLength       WORD  SIZEOF COMMPROP
  1310. wPacketVersion      WORD  ?
  1311. dwServiceMask       DWORD ?
  1312. dwReserved1         DWORD ?
  1313. dwMaxTxQueue        DWORD ?
  1314. dwMaxRxQueue        DWORD ?
  1315. dwMaxBaud           DWORD ?
  1316. dwProvSubType       DWORD ?
  1317. dwProvCapabilities  DWORD ?
  1318. dwSettableParams    DWORD ?
  1319. dwSettableBaud      DWORD ?
  1320. wSettableData       WORD  ?
  1321. wSettableStopParity WORD  ?
  1322. dwCurrentTxQueue    DWORD ?
  1323. dwCurrentRxQueue    DWORD ?
  1324. dwProvSpec1         DWORD COMMPROP_INITIALIZED
  1325. dwProvSpec2         DWORD ?
  1326. wcProvChar          MODEMDEVCAPS {}     ;Start of provider data.
  1327. COMMPROP           ENDS
  1328.  
  1329.  
  1330. ; Dial Options
  1331. DIALOPTION_BILLING    = 00000040h       ; Supports wait for bong "$"
  1332. DIALOPTION_QUIET      = 00000080h       ; Supports wait for quiet "@"
  1333. DIALOPTION_DIALTONE   = 00000100h       ; Supports wait for dial tone "W"
  1334.  
  1335. ; SpeakerVolume for MODEMDEVCAPS
  1336. MDMVOLFLAG_LOW        = 00000001h       ;Low
  1337. MDMVOLFLAG_MEDIUM     = 00000002h       ;Medium
  1338. MDMVOLFLAG_HIGH       = 00000004h       ;High
  1339.  
  1340. ; SpeakerVolume for MODEMSETTINGS
  1341. MDMVOL_LOW            = 00000000h       ;Low
  1342. MDMVOL_MEDIUM         = 00000001h       ;Medium
  1343. MDMVOL_HIGH           = 00000002h       ;High
  1344.  
  1345. ; SpeakerMode for MODEMDEVCAPS
  1346. MDMSPKRFLAG_OFF       = 00000001h       ;Turn speaker off.
  1347. MDMSPKRFLAG_DIAL      = 00000002h       ;Speaker on during call setup, except dial.
  1348. MDMSPKRFLAG_ON        = 00000004h       ;Speaker always on.
  1349. MDMSPKRFLAG_CALLSETUP = 00000008h       ;Speaker on, except during call setup.
  1350.  
  1351. ; SpeakerMode for MODEMSETTINGS
  1352. MDMSPKR_OFF           = 00000000h       ;Turn speaker off.
  1353. MDMSPKR_DIAL          = 00000001h       ;Speaker on during call setup, except dial.
  1354. MDMSPKR_ON            = 00000002h       ;Speaker always on.
  1355. MDMSPKR_CALLSETUP     = 00000003h       ;Speaker on, except during call setup.
  1356.  
  1357. ; Modem Options
  1358. MDM_COMPRESSION       = 00000001h       ;Use compression.
  1359. MDM_ERROR_CONTROL     = 00000002h       ;Use error control.
  1360. MDM_FORCED_EC         = 00000004h       ;Force error control.
  1361. MDM_CELLULAR          = 00000008h       ;Cellular error control (?)
  1362. MDM_FLOWCONTROL_HARD  = 00000010h       ;RTS/CTS
  1363. MDM_FLOWCONTROL_SOFT  = 00000020h       ;XON/XOFF
  1364. MDM_CCITT_OVERRIDE    = 00000040h       ;Non-CCITT modulations.
  1365. MDM_SPEED_ADJUST      = 00000080h       ;Allow speed negociation fallback.
  1366. MDM_TONE_DIAL         = 00000100h       ;Can toggle between tone and pulse.
  1367. MDM_BLIND_DIAL        = 00000200h       ;Can blind dial (skip tone detection)
  1368. MDM_V23_OVERRIDE      = 00000400h       ;Supports V.23. Must have CCITT
  1369.                                         ;Override too.
  1370.