|
|
1.1 root 1: /*++ BUILD Version: 0001 // Increment this if a change has global effects
2:
3: Copyright (c) 1990 Microsoft Corporation
4:
5: Module Name:
6:
7: winbase.h
8:
9: Abstract:
10:
11: This module defines the 32-Bit Windows Base APIs
12:
13: Created:
14:
15: 18-Sep-1990
16:
17: Revision History:
18:
19: --*/
20:
21: #ifndef _WINBASE_
22: #define _WINBASE_
23:
24: /*
25: * Compatability macros
26: */
27:
28: #define DefineHandleTable(w) ((w),TRUE)
29: #define LimitEmsPages(dw)
30: #define SetSwapAreaSize(w) (w)
31: #define LockSegment(w) GlobalFix((HANDLE)(w))
32: #define UnlockSegment(w) GlobalUnfix((HANDLE)(w))
33:
34: #define Yield()
35:
36: #define INVALID_HANDLE_VALUE (HANDLE)-1
37: #define FILE_BEGIN 0
38: #define FILE_CURRENT 1
39: #define FILE_END 2
40: #define FILE_ATTRIBUTE_DIRECTORY 0x00000010
41:
42: #define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 )
43:
44: #define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 )
45: #define WAIT_ABANDONED_0 ((STATUS_ABANDONED_WAIT_0 ) + 0 )
46:
47: #define WAIT_TIMEOUT STATUS_TIMEOUT
48: #define STILL_ACTIVE STATUS_PENDING
49: #define EXCEPTION_ACCESS_VIOLATION STATUS_ACCESS_VIOLATION
50: #define EXCEPTION_DATATYPE_MISALIGNMENT STATUS_DATATYPE_MISALIGNMENT
51: #define EXCEPTION_BREAKPOINT STATUS_BREAKPOINT
52: #define EXCEPTION_SINGLE_STEP STATUS_SINGLE_STEP
53: #define CONTROL_C_EXIT STATUS_CONTROL_C_EXIT
54:
55: //
56: // File creation flags must start in second byte since they
57: // are combined with the attributes
58: //
59:
60: #define FILE_FLAG_WRITE_THROUGH 0x00000100
61: #define FILE_FLAG_OVERLAPPED 0x00000200
62: #define FILE_FLAG_NO_BUFFERING 0x00000400
63: #define FILE_FLAG_RANDOM_ACCESS 0x00000800
64: #define FILE_FLAG_SEQUENTIAL_SCAN 0x00001000
65:
66: #define CREATE_NEW 1
67: #define CREATE_ALWAYS 2
68: #define OPEN_EXISTING 3
69: #define OPEN_ALWAYS 4
70: #define TRUNCATE_EXISTING 5
71:
72: //
73: // Define the NamedPipe definitions
74: //
75:
76:
77: //
78: // Define the dwOpenMode values for CreateNamedPipe
79: //
80:
81: #define PIPE_ACCESS_INBOUND 0x00000001
82: #define PIPE_ACCESS_OUTBOUND 0x00000002
83: #define PIPE_ACCESS_DUPLEX 0x00000003
84:
85: //
86: // Define the Named Pipe End flags for GetNamedPipeInfo
87: //
88:
89: #define PIPE_CLIENT_END 0x00000000
90: #define PIPE_SERVER_END 0x00000001
91:
92: //
93: // Define the dwPipeMode values for CreateNamedPipe
94: //
95:
96: #define PIPE_WAIT 0x00000000
97: #define PIPE_NOWAIT 0x00000001
98: #define PIPE_READMODE_BYTE 0x00000000
99: #define PIPE_READMODE_MESSAGE 0x00000002
100: #define PIPE_TYPE_BYTE 0x00000000
101: #define PIPE_TYPE_MESSAGE 0x00000004
102:
103: //
104: // Define the well known values for CreateNamedPipe nMaxInstances
105: //
106:
107: #define PIPE_UNLIMITED_INSTANCES 255
108:
109: //
110: // Special values for mailslot information.
111: //
112:
113: //
114: // Special value for NextMessageSize to indicate that there is no next
115: // message.
116: //
117:
118: #define MAILSLOT_NO_MESSAGE -1
119:
120: //
121: // Special value for mailslot size creation to indicate that the system
122: // should choose the size of the mailslot buffer.
123: //
124:
125: #define MAILSLOT_SIZE_AUTO 0
126:
127: //
128: // Special value for read timeout to indicate that mailslot reads should
129: // never timeout.
130: //
131:
132: #define MAILSLOT_WAIT_FOREVER -1
133:
134: //
135: // File structures
136: //
137:
138: typedef struct _OVERLAPPED {
139: DWORD Internal;
140: DWORD InternalHigh;
141: DWORD Offset;
142: DWORD OffsetHigh;
143: HANDLE hEvent;
144: } OVERLAPPED, *LPOVERLAPPED;
145:
146: typedef struct _SECURITY_ATTRIBUTES {
147: DWORD nLength;
148: LPVOID lpSecurityDescriptor;
149: BOOL bInheritHandle;
150: } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
151:
152: typedef struct _PROCESS_INFORMATION {
153: HANDLE hProcess;
154: HANDLE hThread;
155: DWORD dwProcessId;
156: DWORD dwThreadId;
157: } PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION;
158:
159: //
160: // File System time stamps are represented with the following structure:
161: //
162:
163: typedef struct _FILETIME {
164: DWORD dwLowDateTime;
165: DWORD dwHighDateTime;
166: } FILETIME, *PFILETIME, *LPFILETIME;
167:
168: //
169: // System time is represented with the following structure:
170: //
171:
172: typedef struct _SYSTEMTIME {
173: WORD wYear;
174: WORD wMonth;
175: WORD wDayOfWeek;
176: WORD wDay;
177: WORD wHour;
178: WORD wMinute;
179: WORD wSecond;
180: WORD wMilliseconds;
181: } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
182:
183: typedef DWORD (*PTHREAD_START_ROUTINE)(
184: LPVOID lpThreadParameter
185: );
186: typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
187:
188: typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
189: typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION;
190: typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION;
191:
192: #ifdef i386
193: typedef PLDT_ENTRY LPLDT_ENTRY;
194: #else
195: typedef LPVOID LPLDT_ENTRY;
196: #endif
197:
198: #define MUTEX_MODIFY_STATE MUTANT_QUERY_STATE
199: #define MUTEX_ALL_ACCESS MUTANT_ALL_ACCESS
200:
201: //
202: // Provider capabilities flags.
203: //
204:
205: #define PCF_DTRDTS ((DWORD)0x0001)
206: #define PCF_RTSCTS ((DWORD)0x0002)
207: #define PCF_CD ((DWORD)0x0004)
208: #define PCF_PARITY_CHECK ((DWORD)0x0008)
209: #define PCF_XONXOFF ((DWORD)0x0010)
210: #define PCF_SETXCHAR ((DWORD)0x0020)
211: #define PCF_TOTTIMEOUTS ((DWORD)0x0040)
212: #define PCF_INTTIMEOUTS ((DWORD)0x0080)
213: #define PCF_SPECIALCHARS ((DWORD)0x0100)
214: #define PCF_16BITMODE ((DWORD)0x0200)
215:
216: //
217: // Comm provider settable parameters.
218: //
219:
220: #define SP_PARITY ((DWORD)0x0001)
221: #define SP_BAUD ((DWORD)0x0002)
222: #define SP_DATABITS ((DWORD)0x0004)
223: #define SP_STOPBITS ((DWORD)0x0008)
224: #define SP_HANDSHAKING ((DWORD)0x0010)
225: #define SP_PARITY_CHECK ((DWORD)0x0020)
226: #define SP_CARRIER_DETECT ((DWORD)0x0040)
227:
228: //
229: // Settable baud rates in the provider.
230: //
231:
232: #define BAUD_075 ((DWORD)0x00000001)
233: #define BAUD_110 ((DWORD)0x00000002)
234: #define BAUD_134_5 ((DWORD)0x00000004)
235: #define BAUD_150 ((DWORD)0x00000008)
236: #define BAUD_300 ((DWORD)0x00000010)
237: #define BAUD_600 ((DWORD)0x00000020)
238: #define BAUD_1200 ((DWORD)0x00000040)
239: #define BAUD_1800 ((DWORD)0x00000080)
240: #define BAUD_2400 ((DWORD)0x00000100)
241: #define BAUD_4800 ((DWORD)0x00000200)
242: #define BAUD_7200 ((DWORD)0x00000400)
243: #define BAUD_9600 ((DWORD)0x00000800)
244: #define BAUD_14400 ((DWORD)0x00001000)
245: #define BAUD_19200 ((DWORD)0x00002000)
246: #define BAUD_38400 ((DWORD)0x00004000)
247: #define BAUD_56K ((DWORD)0x00008000)
248: #define BAUD_USER ((DWORD)0x10000000)
249:
250: //
251: // Settable Data Bits
252: //
253:
254: #define DATABITS_5 ((WORD)0x0001)
255: #define DATABITS_6 ((WORD)0x0002)
256: #define DATABITS_7 ((WORD)0x0004)
257: #define DATABITS_8 ((WORD)0x0008)
258: #define DATABITS_16 ((WORD)0x0010)
259: #define DATABITS_16X ((WORD)0x0020)
260:
261: //
262: // Settable Stop and Parity bits.
263: //
264:
265: #define STOPBITS_10 ((WORD)0x0001)
266: #define STOPBITS_15 ((WORD)0x0002)
267: #define STOPBITS_20 ((WORD)0x0004)
268: #define PARITY_NONE ((WORD)0x0100)
269: #define PARITY_ODD ((WORD)0x0200)
270: #define PARITY_EVEN ((WORD)0x0400)
271: #define PARITY_MARK ((WORD)0x0800)
272: #define PARITY_SPACE ((WORD)0x1000)
273:
274: typedef struct _COMMPROP {
275: WORD wPacketLength;
276: WORD wPacketVersion;
277: DWORD dwServiceMask;
278: DWORD dwMaxConfigData;
279: DWORD dwMaxTxQueue;
280: DWORD dwMaxRxQueue;
281: DWORD dwMaxBaud;
282: DWORD dwDefTxQueue;
283: DWORD dwDefRxQueue;
284: DWORD dwDefBaud;
285: WORD wDefDataBits;
286: WORD wDefStopParity;
287: DWORD dwProvSubType;
288: DWORD dwProvCapabilities;
289: DWORD dwSettableParams;
290: DWORD dwSettableBaud;
291: WORD wSettableData;
292: WORD wSettableStopParity;
293: DWORD dwCurrentTxQueue;
294: DWORD dwCurrentRxQueue;
295: DWORD dwProvSpec1;
296: DWORD dwProvSpec2;
297: WCHAR ProvChar[1];
298: } COMMPROP,*LPCOMMPROP;
299:
300: typedef struct _COMSTAT {
301: DWORD fCtsHold : 1;
302: DWORD fDsrHold : 1;
303: DWORD fRlsdHold : 1;
304: DWORD fXoffHold : 1;
305: DWORD fXoffSent : 1;
306: DWORD fEof : 1;
307: DWORD fTxim : 1;
308: DWORD fReserved : 17;
309: DWORD cbInQue;
310: DWORD cbOutQue;
311: } COMSTAT, *LPCOMSTAT;
312:
313: //
314: // DTR Control Flow Values.
315: //
316: #define DTR_CONTROL_DISABLE 0x00
317: #define DTR_CONTROL_ENABLE 0x01
318: #define DTR_CONTROL_HANDSHAKE 0x02
319:
320: //
321: // RTS Control Flow Values
322: //
323: #define RTS_CONTROL_DISABLE 0x00
324: #define RTS_CONTROL_ENABLE 0x01
325: #define RTS_CONTROL_HANDSHAKE 0x02
326:
327: typedef struct _DCB {
328: DWORD DCBlength; /* sizeof(DCB) */
329: DWORD BaudRate; /* Baudrate at which running */
330: DWORD fBinary: 1; /* Binary Mode (skip EOF check) */
331: DWORD fParity: 1; /* Enable parity checking */
332: DWORD fOutxCtsFlow:1; /* CTS handshaking on output */
333: DWORD fOutxDsrFlow:1; /* DSR handshaking on output */
334: DWORD fDtrControl:2; /* DTR Flow control */
335: DWORD fDummy: 2; /* Reserved */
336: DWORD fOutX: 1; /* Enable output X-ON/X-OFF */
337: DWORD fInX: 1; /* Enable input X-ON/X-OFF */
338: DWORD fPeChar: 1; /* Enable Parity Err Replacement */
339: DWORD fNull: 1; /* Enable Null stripping */
340: DWORD fRtsControl:2; /* Rts Flow control */
341: DWORD fDummy2:2; /* Reserved */
342: WORD TxDelay; /* Amount of time between chars */
343: WORD XonLim; /* Transmit X-ON threshold */
344: WORD XoffLim; /* Transmit X-OFF threshold */
345: BYTE ByteSize; /* Number of bits/byte, 4-8 */
346: BYTE Parity; /* 0-4=None,Odd,Even,Mark,Space */
347: BYTE StopBits; /* 0,1,2 = 1, 1.5, 2 */
348: char XonChar; /* Tx and Rx X-ON character */
349: char XoffChar; /* Tx and Rx X-OFF character */
350: char PeChar; /* Parity error replacement char */
351: char EofChar; /* End of Input character */
352: char EvtChar; /* Recieved Event character */
353: } DCB, *LPDCB;
354:
355: typedef struct _COMMTIMEOUTS {
356: DWORD ReadIntervalTimeout; /* Maximum time between read chars. */
357: DWORD ReadTotalTimeoutMultiplier; /* Multiplier of characters. */
358: DWORD ReadTotalTimeoutConstant; /* Constant in milliseconds. */
359: DWORD WriteTotalTimeoutMultiplier; /* Multiplier of characters. */
360: DWORD WriteTotalTimeoutConstant; /* Constant in milliseconds. */
361: } COMMTIMEOUTS,*LPCOMMTIMEOUTS;
362:
363: typedef struct _SYSTEM_INFO {
364: DWORD dwOemId;
365: DWORD dwPageSize;
366: LPVOID lpMinimumApplicationAddress;
367: LPVOID lpMaximumApplicationAddress;
368: DWORD dwActiveProcessorMask;
369: DWORD dwNumberOfProcessors;
370: DWORD dwProcessorType;
371: DWORD dwProcessorRevision;
372: DWORD dwProcessorOptions;
373: } SYSTEM_INFO, *LPSYSTEM_INFO;
374:
375: #define FreeModule(hLibModule) FreeLibrary((hLibModule))
376: #define MakeProcInstance(lpProc,hInstance) (lpProc)
377: #define FreeProcInstance(lpProc)
378:
379: /* Global Memory Flags */
380: #define GMEM_FIXED 0x0000
381: #define GMEM_MOVEABLE 0x0002
382: #define GMEM_NOCOMPACT 0x0010
383: #define GMEM_NODISCARD 0x0020
384: #define GMEM_ZEROINIT 0x0040
385: #define GMEM_MODIFY 0x0080
386: #define GMEM_DISCARDABLE 0x0100
387: #define GMEM_NOT_BANKED 0x1000
388: #define GMEM_SHARE 0x2000
389: #define GMEM_DDESHARE 0x2000
390: #define GMEM_NOTIFY 0x4000
391: #define GMEM_LOWER GMEM_NOT_BANKED
392: #define GMEM_VALID_FLAGS 0x7F72
393: #define GMEM_INVALID_HANDLE 0x8000
394:
395: #define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
396: #define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
397:
398: #define GlobalDiscard( h ) (HANDLE)(h)
399: #define GlobalLRUNewest( h ) (HANDLE)(h)
400: #define GlobalLRUOldest( h ) (HANDLE)(h)
401: #define GlobalCompact( dw ) (0x100000L)
402: #define GlobalFix( h ) (h)
403: #define GlobalUnfix( h ) ((BOOL)h)
404: #define GlobalUnWire( h ) (TRUE)
405: #define GlobalWire( h ) (LPSTR)(h)
406:
407: /* Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE) */
408: #define GMEM_DISCARDED 0x4000
409: #define GMEM_LOCKCOUNT 0x00FF
410:
411: typedef struct _MEMORYSTATUS {
412: DWORD dwLength;
413: DWORD dwMemoryLoad;
414: DWORD dwTotalPhys;
415: DWORD dwAvailPhys;
416: DWORD dwTotalPageFile;
417: DWORD dwAvailPageFile;
418: DWORD dwTotalVirtual;
419: DWORD dwAvailVirtual;
420: } MEMORYSTATUS, *LPMEMORYSTATUS;
421:
422: /* Local Memory Flags */
423: #define LMEM_FIXED 0x0000
424: #define LMEM_MOVEABLE 0x0002
425: #define LMEM_NOCOMPACT 0x0010
426: #define LMEM_NODISCARD 0x0020
427: #define LMEM_ZEROINIT 0x0040
428: #define LMEM_MODIFY 0x0080
429: #define LMEM_DISCARDABLE 0x0F00
430: #define LMEM_VALID_FLAGS 0x0F72
431: #define LMEM_INVALID_HANDLE 0x8000
432:
433: #define LHND (LMEM_MOVEABLE | LMEM_ZEROINIT)
434: #define LPTR (LMEM_FIXED | LMEM_ZEROINIT)
435:
436: #define NONZEROLHND (LMEM_MOVEABLE)
437: #define NONZEROLPTR (LMEM_FIXED)
438:
439: #define LocalShrink( h, n ) (0x10000)
440: #define LocalCompact( h ) (0x10000)
441: #define LocalDiscard( h ) (NULL)
442:
443: /* Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) */
444: #define LMEM_DISCARDED 0x4000
445: #define LMEM_LOCKCOUNT 0x00FF
446:
447: //
448: // dwCreationFlag values
449: //
450:
451: #define DEBUG_PROCESS 0x00000001
452: #define DEBUG_ONLY_THIS_PROCESS 0x00000002
453:
454: #define CREATE_SUSPENDED 0x00000004
455:
456: #define DETACHED_PROCESS 0x00000008
457:
458: #define CREATE_NEW_CONSOLE 0x00000010
459:
460: #define PROFILE_USER 0x10000000
461: #define PROFILE_KERNEL 0x20000000
462: #define PROFILE_SERVER 0x40000000
463:
464: #define THREAD_PRIORITY_LOWEST THREAD_BASE_PRIORITY_MIN
465: #define THREAD_PRIORITY_BELOW_NORMAL (THREAD_PRIORITY_LOWEST+1)
466: #define THREAD_PRIORITY_NORMAL 0
467: #define THREAD_PRIORITY_HIGHEST THREAD_BASE_PRIORITY_MAX
468: #define THREAD_PRIORITY_ABOVE_NORMAL (THREAD_PRIORITY_HIGHEST-1)
469: #define THREAD_PRIORITY_ERROR_RETURN (MAXLONG)
470:
471: //
472: // Debug APIs
473: //
474: #define EXCEPTION_DEBUG_EVENT 1
475: #define CREATE_THREAD_DEBUG_EVENT 2
476: #define CREATE_PROCESS_DEBUG_EVENT 3
477: #define EXIT_THREAD_DEBUG_EVENT 4
478: #define EXIT_PROCESS_DEBUG_EVENT 5
479: #define LOAD_DLL_DEBUG_EVENT 6
480: #define UNLOAD_DLL_DEBUG_EVENT 7
481: #define OUTPUT_DEBUG_STRING_EVENT 8
482:
483: typedef struct _EXCEPTION_DEBUG_INFO {
484: EXCEPTION_RECORD ExceptionRecord;
485: DWORD dwFirstChance;
486: } EXCEPTION_DEBUG_INFO, *LPEXCEPTION_DEBUG_INFO;
487:
488: typedef struct _CREATE_THREAD_DEBUG_INFO {
489: HANDLE hThread;
490: LPTHREAD_START_ROUTINE lpStartAddress;
491: } CREATE_THREAD_DEBUG_INFO, *LPCREATE_THREAD_DEBUG_INFO;
492:
493: typedef struct _CREATE_PROCESS_DEBUG_INFO {
494: HANDLE hFile;
495: HANDLE hProcess;
496: HANDLE hThread;
497: LPVOID lpBaseOfImage;
498: DWORD dwDebugInfoFileOffset;
499: DWORD nDebugInfoSize;
500: LPTHREAD_START_ROUTINE lpStartAddress;
501: } CREATE_PROCESS_DEBUG_INFO, *LPCREATE_PROCESS_DEBUG_INFO;
502:
503: typedef struct _EXIT_THREAD_DEBUG_INFO {
504: DWORD dwExitCode;
505: } EXIT_THREAD_DEBUG_INFO, *LPEXIT_THREAD_DEBUG_INFO;
506:
507: typedef struct _EXIT_PROCESS_DEBUG_INFO {
508: DWORD dwExitCode;
509: } EXIT_PROCESS_DEBUG_INFO, *LPEXIT_PROCESS_DEBUG_INFO;
510:
511: typedef struct _LOAD_DLL_DEBUG_INFO {
512: HANDLE hFile;
513: LPVOID lpBaseOfDll;
514: DWORD dwDebugInfoFileOffset;
515: DWORD nDebugInfoSize;
516: } LOAD_DLL_DEBUG_INFO, *LPLOAD_DLL_DEBUG_INFO;
517:
518: typedef struct _UNLOAD_DLL_DEBUG_INFO {
519: LPVOID lpBaseOfDll;
520: } UNLOAD_DLL_DEBUG_INFO, *LPUNLOAD_DLL_DEBUG_INFO;
521:
522: typedef struct _OUTPUT_DEBUG_STRING_INFO {
523: LPSTR lpDebugStringData;
524: WORD fUnicode;
525: WORD nDebugStringLength;
526: } OUTPUT_DEBUG_STRING_INFO, *LPOUTPUT_DEBUG_STRING_INFO;
527:
528: typedef struct _DEBUG_EVENT {
529: DWORD dwDebugEventCode;
530: DWORD dwProcessId;
531: DWORD dwThreadId;
532: union {
533: EXCEPTION_DEBUG_INFO Exception;
534: CREATE_THREAD_DEBUG_INFO CreateThread;
535: CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
536: EXIT_THREAD_DEBUG_INFO ExitThread;
537: EXIT_THREAD_DEBUG_INFO ExitProcess;
538: LOAD_DLL_DEBUG_INFO LoadDll;
539: UNLOAD_DLL_DEBUG_INFO UnloadDll;
540: OUTPUT_DEBUG_STRING_INFO DebugString;
541: } u;
542: } DEBUG_EVENT, *LPDEBUG_EVENT;
543:
544: typedef PCONTEXT LPCONTEXT;
545: typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD;
546: typedef EXCEPTION_POINTERS LPEXCEPTION_POINTERS;
547:
548: #define DRIVE_REMOVABLE 2
549: #define DRIVE_FIXED 3
550: #define DRIVE_REMOTE 4
551: #define DRIVE_CDROM 5
552: #define DRIVE_RAMDISK 6
553:
554:
555: #define GetFreeSpace(w) (0x100000L)
556:
557:
558: #define FILE_TYPE_UNKNOWN 0x0000
559: #define FILE_TYPE_DISK 0x0001
560: #define FILE_TYPE_CHAR 0x0002
561: #define FILE_TYPE_PIPE 0x0003
562: #define FILE_TYPE_REMOTE 0x8000
563:
564:
565: #define STD_INPUT_HANDLE (DWORD)-10
566: #define STD_OUTPUT_HANDLE (DWORD)-11
567: #define STD_ERROR_HANDLE (DWORD)-12
568:
569: #define NOPARITY 0
570: #define ODDPARITY 1
571: #define EVENPARITY 2
572: #define MARKPARITY 3
573: #define SPACEPARITY 4
574:
575: #define ONESTOPBIT 0
576: #define ONE5STOPBITS 1
577: #define TWOSTOPBITS 2
578:
579: #define IGNORE 0 // Ignore signal
580: #define INFINITE 0xFFFFFFFF // Infinite timeout
581:
582: //
583: // Basud rates at which the communication device operates
584: //
585:
586: #define CBR_110 110
587: #define CBR_300 300
588: #define CBR_600 600
589: #define CBR_1200 1200
590: #define CBR_2400 2400
591: #define CBR_4800 4800
592: #define CBR_9600 9600
593: #define CBR_14400 14400
594: #define CBR_19200 19200
595: #define CBR_38400 38400
596: #define CBR_56000 56000
597: #define CBR_128000 128000
598: #define CBR_256000 256000
599:
600: //
601: // Error Flags
602: //
603:
604: #define CE_RXOVER 0x0001 // Receive Queue overflow
605: #define CE_OVERRUN 0x0002 // Receive Overrun Error
606: #define CE_RXPARITY 0x0004 // Receive Parity Error
607: #define CE_FRAME 0x0008 // Receive Framing error
608: #define CE_BREAK 0x0010 // Break Detected
609: #define CE_TXFULL 0x0100 // TX Queue is full
610: #define CE_PTO 0x0200 // LPTx Timeout
611: #define CE_IOE 0x0400 // LPTx I/O Error
612: #define CE_DNS 0x0800 // LPTx Device not selected
613: #define CE_OOP 0x1000 // LPTx Out-Of-Paper
614: #define CE_MODE 0x8000 // Requested mode unsupported
615:
616: #define IE_BADID (-1) // Invalid or unsupported id
617: #define IE_OPEN (-2) // Device Already Open
618: #define IE_NOPEN (-3) // Device Not Open
619: #define IE_MEMORY (-4) // Unable to allocate queues
620: #define IE_DEFAULT (-5) // Error in default parameters
621: #define IE_HARDWARE (-10) // Hardware Not Present
622: #define IE_BYTESIZE (-11) // Illegal Byte Size
623: #define IE_BAUDRATE (-12) // Unsupported BaudRate
624:
625: //
626: // Events
627: //
628:
629: #define EV_RXCHAR 0x0001 // Any Character received
630: #define EV_RXFLAG 0x0002 // Received certain character
631: #define EV_TXEMPTY 0x0004 // Transmitt Queue Empty
632: #define EV_CTS 0x0008 // CTS changed state
633: #define EV_DSR 0x0010 // DSR changed state
634: #define EV_RLSD 0x0020 // RLSD changed state
635: #define EV_BREAK 0x0040 // BREAK received
636: #define EV_ERR 0x0080 // Line status error occurred
637: #define EV_RING 0x0100 // Ring signal detected
638: #define EV_PERR 0x0200 // Printer error occured
639: #define EV_RX80FULL 0x0400 // Receive buffer is 80 percent full
640: #define EV_EVENT1 0x0800 // Provider specific event 1
641: #define EV_EVENT2 0x1000 // Provider specific event 2
642:
643: //
644: // Escape Functions
645: //
646:
647: #define SETXOFF 1 // Simulate XOFF received
648: #define SETXON 2 // Simulate XON received
649: #define SETRTS 3 // Set RTS high
650: #define CLRRTS 4 // Set RTS low
651: #define SETDTR 5 // Set DTR high
652: #define CLRDTR 6 // Set DTR low
653: #define RESETDEV 7 // Reset device if possible
654: #define SETBREAK 8 // Set the device break line.
655: #define CLRBREAK 9 // Clear the device break line.
656:
657: //
658: // PURGE function flags.
659: //
660: #define PURGE_TXABORT 0x0001 // Kill the pending/current writes to the comm port.
661: #define PURGE_RXABORT 0x0002 // Kill the pending/current reads to the comm port.
662: #define PURGE_TXCLEAR 0x0004 // Kill the transmit queue if there.
663: #define PURGE_RXCLEAR 0x0008 // Kill the typeahead buffer if there.
664:
665: #define LPTx 0x80 // Set if ID is for LPT device
666:
667: //
668: // Modem Status Flags
669: //
670: #define MS_CTS_ON ((DWORD)0x0010)
671: #define MS_DSR_ON ((DWORD)0x0020)
672: #define MS_RING_ON ((DWORD)0x0040)
673: #define MS_RLSD_ON ((DWORD)0x0080)
674:
675: //
676: // WaitSoundState() Constants
677: //
678:
679: #define S_QUEUEEMPTY 0
680: #define S_THRESHOLD 1
681: #define S_ALLTHRESHOLD 2
682:
683: //
684: // Accent Modes
685: //
686:
687: #define S_NORMAL 0
688: #define S_LEGATO 1
689: #define S_STACCATO 2
690:
691: //
692: // SetSoundNoise() Sources
693: //
694:
695: #define S_PERIOD512 0 // Freq = N/512 high pitch, less coarse hiss
696: #define S_PERIOD1024 1 // Freq = N/1024
697: #define S_PERIOD2048 2 // Freq = N/2048 low pitch, more coarse hiss
698: #define S_PERIODVOICE 3 // Source is frequency from voice channel (3)
699: #define S_WHITE512 4 // Freq = N/512 high pitch, less coarse hiss
700: #define S_WHITE1024 5 // Freq = N/1024
701: #define S_WHITE2048 6 // Freq = N/2048 low pitch, more coarse hiss
702: #define S_WHITEVOICE 7 // Source is frequency from voice channel (3)
703:
704: #define S_SERDVNA (-1) // Device not available
705: #define S_SEROFM (-2) // Out of memory
706: #define S_SERMACT (-3) // Music active
707: #define S_SERQFUL (-4) // Queue full
708: #define S_SERBDNT (-5) // Invalid note
709: #define S_SERDLN (-6) // Invalid note length
710: #define S_SERDCC (-7) // Invalid note count
711: #define S_SERDTP (-8) // Invalid tempo
712: #define S_SERDVL (-9) // Invalid volume
713: #define S_SERDMD (-10) // Invalid mode
714: #define S_SERDSH (-11) // Invalid shape
715: #define S_SERDPT (-12) // Invalid pitch
716: #define S_SERDFQ (-13) // Invalid frequency
717: #define S_SERDDR (-14) // Invalid duration
718: #define S_SERDSR (-15) // Invalid source
719: #define S_SERDST (-16) // Invalid state
720:
721: #define NMPWAIT_WAIT_FOREVER 0xffffffff
722: #define NMPWAIT_NOWAIT 0x00000001
723: #define NMPWAIT_USE_DEFAULT_WAIT 0x00000000
724:
725: #define FS_CASE_IS_PRESERVED FILE_CASE_PRESERVED_NAMES
726: #define FS_CASE_SENSITIVE FILE_CASE_SENSITIVE_SEARCH
727: #define FS_UNICODE_STORED_ON_DISK FILE_UNICODE_ON_DISK
728:
729: #define FILE_MAP_WRITE SECTION_MAP_WRITE
730: #define FILE_MAP_READ SECTION_MAP_READ
731: #define FILE_MAP_ALL_ACCESS SECTION_ALL_ACCESS
732:
733: #define OF_READ 0x00000000
734: #define OF_WRITE 0x00000001
735: #define OF_READWRITE 0x00000002
736: #define OF_SHARE_COMPAT 0x00000000
737: #define OF_SHARE_EXCLUSIVE 0x00000010
738: #define OF_SHARE_DENY_WRITE 0x00000020
739: #define OF_SHARE_DENY_READ 0x00000030
740: #define OF_SHARE_DENY_NONE 0x00000040
741: #define OF_PARSE 0x00000100
742: #define OF_DELETE 0x00000200
743: #define OF_VERIFY 0x00000400
744: #define OF_CANCEL 0x00000800
745: #define OF_CREATE 0x00001000
746: #define OF_PROMPT 0x00002000
747: #define OF_EXIST 0x00004000
748: #define OF_REOPEN 0x00008000
749:
750: typedef struct _OFSTRUCT {
751: BYTE cBytes;
752: BYTE fFixedDisk;
753: WORD nErrCode;
754: WORD Reserved1;
755: WORD Reserved2;
756: BYTE szPathName[120];
757: } OFSTRUCT, *LPOFSTRUCT, *POFSTRUCT;
758:
759: LONG
760: APIENTRY
761: InterlockedIncrement(
762: LPLONG lpAddend
763: );
764:
765: LONG
766: APIENTRY
767: InterlockedDecrement(
768: LPLONG lpAddend
769: );
770:
771: // MVDM related Stuff
772: #define MAXIMUM_VDM_COMMAND_LENGTH 128
773: #define MAXIMUM_VDM_ENVIORNMENT 32*1024
774: #define MAXIMUM_VDM_CURRENT_DIR 64
775:
776: // VDMState defines
777: #define ASKING_FOR_FIRST_COMMAND 1 // Very First call.
778: #define ASKING_FOR_WOW_BINARY 2 // Caller is WOWVDM
779: #define ASKING_FOR_DOS_BINARY 4 // Caller is DOSVDM
780: #define ASKING_FOR_SECOND_TIME 8 // Caller is asking second time after
781: // allocating bigger buffers.
782: typedef struct _VDMINFO {
783: LPVOID CmdLine;
784: LPVOID Enviornment;
785: USHORT CmdSize;
786: USHORT CurDrive;
787: ULONG EnviornmentSize;
788: ULONG ErrorCode;
789: ULONG VDMState;
790: ULONG iTask;
791: } VDMINFO, *PVDMINFO;
792:
793: DWORD
794: APIENTRY
795: FreeResource(
796: HANDLE hResData
797: );
798:
799: LPSTR
800: APIENTRY
801: LockResource(
802: HANDLE hResData
803: );
804:
805: #define UnlockResource(hResData) ((hResData), 0)
806: #define MAXINTATOM 0xC000
807: #define MAKEINTATOM(i) (LPSTR)((DWORD)((WORD)(i)))
808:
809: int
810: APIENTRY
811: WinMain(
812: HANDLE hInstance,
813: HANDLE hPrevInstance,
814: LPSTR lpCmdLine,
815: int nShowCmd
816: );
817:
818: BOOL
819: APIENTRY
820: FreeLibrary(
821: HANDLE hLibModule
822: );
823:
824: FARPROC
825: APIENTRY
826: GetProcAddress(
827: HANDLE hModule,
828: LPSTR lpProcName
829: );
830:
831: DWORD
832: APIENTRY
833: GetVersion( VOID );
834:
835: HANDLE
836: APIENTRY
837: GlobalAlloc(
838: DWORD dwFlags,
839: DWORD dwBytes
840: );
841:
842: HANDLE
843: APIENTRY
844: GlobalReAlloc(
845: HANDLE hMem,
846: DWORD dwBytes,
847: DWORD dwFlags
848: );
849:
850: DWORD
851: APIENTRY
852: GlobalSize(
853: HANDLE hMem
854: );
855:
856: DWORD
857: APIENTRY
858: GlobalFlags(
859: HANDLE hMem
860: );
861:
862:
863: LPSTR
864: APIENTRY
865: GlobalLock(
866: HANDLE hMem
867: );
868:
869:
870: HANDLE
871: APIENTRY
872: GlobalHandle(
873: LPSTR pMem
874: );
875:
876:
877: BOOL
878: APIENTRY
879: GlobalUnlock(
880: HANDLE hMem
881: );
882:
883:
884: LPVOID
885: APIENTRY
886: GlobalFree(
887: HANDLE hMem
888: );
889:
890:
891: VOID
892: APIENTRY
893: GlobalMemoryStatus(
894: LPMEMORYSTATUS lpBuffer
895: );
896:
897: HANDLE
898: APIENTRY
899: LocalAlloc(
900: DWORD dwFlags,
901: DWORD dwBytes
902: );
903:
904: HANDLE
905: APIENTRY
906: LocalReAlloc(
907: HANDLE hMem,
908: DWORD dwBytes,
909: DWORD dwFlags
910: );
911:
912: LPSTR
913: APIENTRY
914: LocalLock(
915: HANDLE hMem
916: );
917:
918: HANDLE
919: APIENTRY
920: LocalHandle(
921: LPSTR pMem
922: );
923:
924: BOOL
925: APIENTRY
926: LocalUnlock(
927: HANDLE hMem
928: );
929:
930: DWORD
931: APIENTRY
932: LocalSize(
933: HANDLE hMem
934: );
935:
936: DWORD
937: LocalFlags(
938: HANDLE hMem
939: );
940:
941: HANDLE
942: APIENTRY
943: LocalFree(
944: HANDLE hMem
945: );
946:
947: LPVOID
948: APIENTRY
949: VirtualAlloc(
950: LPVOID lpAddress,
951: DWORD dwSize,
952: DWORD flAllocationType,
953: DWORD flProtect
954: );
955:
956: BOOL
957: APIENTRY
958: VirtualFree(
959: LPVOID lpAddress,
960: DWORD dwSize,
961: DWORD dwFreeType
962: );
963:
964: BOOL
965: APIENTRY
966: VirtualProtect(
967: LPVOID lpAddress,
968: DWORD dwSize,
969: DWORD flNewProtect,
970: PDWORD lpflOldProtect
971: );
972:
973: DWORD
974: APIENTRY
975: VirtualQuery(
976: LPVOID lpAddress,
977: PMEMORY_BASIC_INFORMATION lpBuffer,
978: DWORD dwLength
979: );
980:
981: HANDLE
982: APIENTRY
983: HeapCreate(
984: DWORD flOptions,
985: DWORD dwInitialSize,
986: DWORD dwMaximumSize
987: );
988:
989: BOOL
990: APIENTRY
991: HeapDestroy(
992: HANDLE hHeap
993: );
994:
995: LPSTR
996: APIENTRY
997: HeapAlloc(
998: HANDLE hHeap,
999: DWORD dwBytes
1000: );
1001:
1002: BOOL
1003: APIENTRY
1004: HeapFree(
1005: HANDLE hHeap,
1006: LPSTR lpMem
1007: );
1008:
1009: DWORD
1010: APIENTRY
1011: HeapSize(
1012: HANDLE hHeap,
1013: LPSTR lpMem
1014: );
1015:
1016:
1017: HANDLE
1018: APIENTRY
1019: OpenProcess(
1020: DWORD dwDesiredAccess,
1021: BOOL bInheritHandle,
1022: DWORD dwProcessId
1023: );
1024:
1025: HANDLE
1026: APIENTRY
1027: GetCurrentProcess(
1028: VOID
1029: );
1030:
1031: DWORD
1032: APIENTRY
1033: GetCurrentProcessId(
1034: VOID
1035: );
1036:
1037: VOID
1038: APIENTRY
1039: ExitProcess(
1040: DWORD dwExitCode
1041: );
1042:
1043: BOOL
1044: APIENTRY
1045: TerminateProcess(
1046: HANDLE hProcess,
1047: DWORD dwExitCode
1048: );
1049:
1050: BOOL
1051: APIENTRY
1052: GetExitCodeProcess(
1053: HANDLE hProcess,
1054: LPDWORD lpExitCode
1055: );
1056:
1057:
1058: VOID
1059: APIENTRY
1060: FatalExit(
1061: DWORD dwExitCode
1062: );
1063:
1064: LPVOID
1065: APIENTRY
1066: GetEnvironmentStrings(
1067: VOID
1068: );
1069:
1070: VOID
1071: APIENTRY
1072: RaiseException(
1073: DWORD dwExceptionCode,
1074: DWORD dwExceptionFlags,
1075: DWORD nNumberOfArguments,
1076: LPDWORD lpArguments
1077: );
1078:
1079: EXCEPTION_DISPOSITION
1080: APIENTRY
1081: UnhandledExceptionFilter(
1082: struct _EXCEPTION_POINTERS *ExceptionInfo
1083: );
1084:
1085: HANDLE
1086: APIENTRY
1087: CreateThread(
1088: LPSECURITY_ATTRIBUTES lpThreadAttributes,
1089: DWORD dwStackSize,
1090: LPTHREAD_START_ROUTINE lpStartAddress,
1091: LPVOID lpParameter,
1092: DWORD dwCreationFlags,
1093: LPDWORD lpThreadId
1094: );
1095:
1096: HANDLE
1097: APIENTRY
1098: GetCurrentThread(
1099: VOID
1100: );
1101:
1102: DWORD
1103: APIENTRY
1104: GetCurrentThreadId(
1105: VOID
1106: );
1107:
1108: BOOL
1109: APIENTRY
1110: SetThreadPriority(
1111: HANDLE hThread,
1112: int nPriority
1113: );
1114:
1115: int
1116: APIENTRY
1117: GetThreadPriority(
1118: HANDLE hThread
1119: );
1120:
1121: VOID
1122: APIENTRY
1123: ExitThread(
1124: DWORD dwExitCode
1125: );
1126:
1127: BOOL
1128: APIENTRY
1129: TerminateThread(
1130: HANDLE hThread,
1131: DWORD dwExitCode
1132: );
1133:
1134: BOOL
1135: APIENTRY
1136: GetExitCodeThread(
1137: HANDLE hThread,
1138: LPDWORD lpExitCode
1139: );
1140:
1141: BOOL
1142: APIENTRY
1143: GetThreadSelectorEntry(
1144: HANDLE hThread,
1145: DWORD dwSelector,
1146: LPLDT_ENTRY lpSelectorEntry
1147: );
1148:
1149: DWORD
1150: APIENTRY
1151: GetLastError(
1152: VOID
1153: );
1154:
1155: VOID
1156: APIENTRY
1157: SetLastError(
1158: DWORD dwErrCode
1159: );
1160:
1161: BOOL
1162: APIENTRY
1163: GetOverlappedResult(
1164: HANDLE hFile,
1165: LPOVERLAPPED lpOverlapped,
1166: LPDWORD lpNumberOfBytesTransferred,
1167: BOOL bWait
1168: );
1169:
1170: BOOL
1171: APIENTRY
1172: SetErrorMode(
1173: BOOL bMode
1174: );
1175:
1176:
1177: BOOL
1178: APIENTRY
1179: ReadProcessMemory(
1180: HANDLE hProcess,
1181: LPVOID lpBaseAddress,
1182: LPVOID lpBuffer,
1183: DWORD nSize,
1184: LPDWORD lpNumberOfBytesRead
1185: );
1186:
1187: BOOL
1188: APIENTRY
1189: WriteProcessMemory(
1190: HANDLE hProcess,
1191: LPVOID lpBaseAddress,
1192: LPVOID lpBuffer,
1193: DWORD nSize,
1194: LPDWORD lpNumberOfBytesWritten
1195: );
1196:
1197: BOOL
1198: APIENTRY
1199: GetThreadContext(
1200: HANDLE hThread,
1201: LPCONTEXT lpContext
1202: );
1203:
1204: BOOL
1205: APIENTRY
1206: SetThreadContext(
1207: HANDLE hThread,
1208: LPCONTEXT lpContext
1209: );
1210:
1211: DWORD
1212: APIENTRY
1213: SuspendThread(
1214: HANDLE hThread
1215: );
1216:
1217: DWORD
1218: APIENTRY
1219: ResumeThread(
1220: IN HANDLE hThread
1221: );
1222:
1223: VOID
1224: APIENTRY
1225: DebugBreak(
1226: VOID
1227: );
1228:
1229: BOOL
1230: APIENTRY
1231: WaitForDebugEvent(
1232: LPDEBUG_EVENT lpDebugEvent,
1233: DWORD dwMilliseconds
1234: );
1235:
1236: BOOL
1237: APIENTRY
1238: ContinueDebugEvent(
1239: DWORD dwProcessId,
1240: DWORD dwThreadId,
1241: DWORD dwContinueStatus
1242: );
1243:
1244: BOOL
1245: APIENTRY
1246: DebugActiveProcess(
1247: DWORD dwProcessId
1248: );
1249:
1250: VOID
1251: APIENTRY
1252: InitializeCriticalSection(
1253: LPCRITICAL_SECTION lpCriticalSection
1254: );
1255:
1256: VOID
1257: APIENTRY
1258: EnterCriticalSection(
1259: LPCRITICAL_SECTION lpCriticalSection
1260: );
1261:
1262: VOID
1263: APIENTRY
1264: LeaveCriticalSection(
1265: LPCRITICAL_SECTION lpCriticalSection
1266: );
1267:
1268: VOID
1269: APIENTRY
1270: DeleteCriticalSection(
1271: LPCRITICAL_SECTION lpCriticalSection
1272: );
1273:
1274: BOOL
1275: APIENTRY
1276: SetEvent(
1277: HANDLE hEvent
1278: );
1279:
1280: BOOL
1281: APIENTRY
1282: ResetEvent(
1283: HANDLE hEvent
1284: );
1285:
1286: BOOL
1287: APIENTRY
1288: PulseEvent(
1289: HANDLE hEvent
1290: );
1291:
1292: BOOL
1293: APIENTRY
1294: ReleaseSemaphore(
1295: HANDLE hSemaphore,
1296: LONG lReleaseCount,
1297: LPLONG lpPreviousCount
1298: );
1299:
1300: BOOL
1301: APIENTRY
1302: ReleaseMutex(
1303: HANDLE hMutex
1304: );
1305:
1306: DWORD
1307: APIENTRY
1308: WaitForSingleObject(
1309: HANDLE hHandle,
1310: DWORD dwMilliseconds
1311: );
1312:
1313: DWORD
1314: APIENTRY
1315: WaitForMultipleObjects(
1316: DWORD nCount,
1317: LPHANDLE lpHandles,
1318: BOOL bWaitAll,
1319: DWORD dwMilliseconds
1320: );
1321:
1322: VOID
1323: APIENTRY
1324: Sleep(
1325: DWORD dwMilliseconds
1326: );
1327:
1328: HANDLE
1329: APIENTRY
1330: LoadResource(
1331: HANDLE hModule,
1332: HANDLE hResInfo
1333: );
1334:
1335: DWORD
1336: APIENTRY
1337: SizeofResource(
1338: HANDLE hModule,
1339: HANDLE hResInfo
1340: );
1341:
1342: ATOM
1343: APIENTRY
1344: GlobalDeleteAtom(
1345: ATOM nAtom
1346: );
1347:
1348: BOOL
1349: APIENTRY
1350: InitAtomTable(
1351: DWORD nSize
1352: );
1353:
1354: ATOM
1355: APIENTRY
1356: DeleteAtom(
1357: ATOM nAtom
1358: );
1359:
1360: DWORD
1361: APIENTRY
1362: SetHandleCount(
1363: DWORD dwNumber
1364: );
1365:
1366: DWORD
1367: APIENTRY
1368: GetLogicalDrives(
1369: VOID
1370: );
1371:
1372: BOOL
1373: APIENTRY
1374: LockFile(
1375: HANDLE hFile,
1376: DWORD dwFileOffsetHigh,
1377: DWORD dwFileOffsetLow,
1378: DWORD nNumberOfBytesToLock
1379: );
1380:
1381: BOOL
1382: APIENTRY
1383: UnlockFile(
1384: HANDLE hFile,
1385: DWORD dwFileOffsetHigh,
1386: DWORD dwFileOffsetLow,
1387: DWORD nNumberOfBytesToUnlock
1388: );
1389:
1390: DWORD
1391: APIENTRY
1392: GetFileType(
1393: HANDLE hFile
1394: );
1395:
1396: DWORD
1397: APIENTRY
1398: GetFileSize(
1399: HANDLE hFile,
1400: LPDWORD lpFileSizeHigh
1401: );
1402:
1403: HANDLE
1404: APIENTRY
1405: GetStdHandle(
1406: DWORD nStdHandle
1407: );
1408:
1409: BOOL
1410: APIENTRY
1411: SetStdHandle(
1412: DWORD nStdHandle,
1413: HANDLE hHandle
1414: );
1415:
1416: BOOL
1417: APIENTRY
1418: WriteFile(
1419: HANDLE hFile,
1420: LPVOID lpBuffer,
1421: DWORD nNumberOfBytesToWrite,
1422: LPDWORD lpNumberOfBytesWritten,
1423: LPOVERLAPPED lpOverlapped
1424: );
1425:
1426: BOOL
1427: APIENTRY
1428: ReadFile(
1429: HANDLE hFile,
1430: LPVOID lpBuffer,
1431: DWORD nNumberOfBytesToRead,
1432: LPDWORD lpNumberOfBytesRead,
1433: LPOVERLAPPED lpOverlapped
1434: );
1435:
1436: BOOL
1437: APIENTRY
1438: FlushFileBuffers(
1439: HANDLE hFile
1440: );
1441:
1442: BOOL
1443: APIENTRY
1444: SetEndOfFile(
1445: HANDLE hFile
1446: );
1447:
1448: DWORD
1449: APIENTRY
1450: SetFilePointer(
1451: HANDLE hFile,
1452: LONG lDistanceToMove,
1453: PLONG lpDistanceToMoveHigh,
1454: DWORD dwMoveMethod
1455: );
1456:
1457: BOOL
1458: APIENTRY
1459: FindClose(
1460: HANDLE hFindFile
1461: );
1462:
1463: BOOL
1464: APIENTRY
1465: GetFileTime(
1466: HANDLE hFile,
1467: LPFILETIME lpCreationTime,
1468: LPFILETIME lpLastAccessTime,
1469: LPFILETIME lpLastWriteTime
1470: );
1471:
1472: BOOL
1473: APIENTRY
1474: SetFileTime(
1475: HANDLE hFile,
1476: LPFILETIME lpCreationTime,
1477: LPFILETIME lpLastAccessTime,
1478: LPFILETIME lpLastWriteTime
1479: );
1480:
1481: BOOL
1482: APIENTRY
1483: CloseHandle(
1484: HANDLE hObject
1485: );
1486:
1487: BOOL
1488: APIENTRY
1489: DuplicateHandle(
1490: HANDLE hSourceProcessHandle,
1491: HANDLE hSourceHandle,
1492: HANDLE hTargetProcessHandle,
1493: LPHANDLE lpTargetHandle,
1494: DWORD dwDesiredAccess,
1495: BOOL bInheritHandle,
1496: DWORD dwOptions
1497: );
1498:
1499: DWORD
1500: APIENTRY
1501: LoadModule(
1502: LPSTR lpModuleName,
1503: LPVOID lpParameterBlock
1504: );
1505:
1506: DWORD
1507: APIENTRY
1508: WinExec(
1509: LPSTR lpCmdLine,
1510: WORD nCmdShow
1511: );
1512:
1513: BOOL
1514: APIENTRY
1515: BuildCommDCB(
1516: LPSTR lpDef,
1517: LPDCB lpDCB
1518: );
1519:
1520: BOOL
1521: APIENTRY
1522: ClearCommBreak(
1523: HANDLE hFile
1524: );
1525:
1526: BOOL
1527: APIENTRY
1528: ClearCommError(
1529: HANDLE hFile,
1530: LPDWORD lpErrors,
1531: LPCOMSTAT lpStat
1532: );
1533:
1534: BOOL
1535: APIENTRY
1536: SetupComm(
1537: HANDLE hFile,
1538: DWORD dwInQueue,
1539: DWORD dwOutQueue
1540: );
1541:
1542: BOOL
1543: APIENTRY
1544: EnableCommNotification(
1545: HANDLE hFile,
1546: HANDLE hWnd,
1547: DWORD dwInTrigger,
1548: DWORD dwOutTrigger
1549: );
1550:
1551: BOOL
1552: APIENTRY
1553: EscapeCommFunction(
1554: HANDLE hFile,
1555: DWORD dwFunc
1556: );
1557:
1558: BOOL
1559: APIENTRY
1560: ExtendedProviderFunction(
1561: HANDLE hFile,
1562: WORD wCatagory,
1563: WORD wFunction,
1564: LPVOID lpParam,
1565: LPVOID lpData,
1566: DWORD dwParamLength,
1567: LPDWORD lpDataLength
1568: );
1569:
1570: BOOL
1571: APIENTRY
1572: GetCommConfig(
1573: HANDLE hFile,
1574: LPVOID lpCOMMCONFIG,
1575: DWORD dwSize
1576: );
1577:
1578: BOOL
1579: APIENTRY
1580: GetCommMask(
1581: HANDLE hFile,
1582: LPDWORD lpEvtMask
1583: );
1584:
1585: BOOL
1586: APIENTRY
1587: GetCommModemStatus(
1588: HANDLE hFile,
1589: LPDWORD lpModemStat
1590: );
1591:
1592: BOOL
1593: APIENTRY
1594: GetCommState(
1595: HANDLE hFile,
1596: LPDCB lpDCB
1597: );
1598:
1599: BOOL
1600: APIENTRY
1601: GetCommTimeouts(
1602: HANDLE hFile,
1603: LPCOMMTIMEOUTS lpCommTimeouts
1604: );
1605:
1606: BOOL
1607: APIENTRY
1608: PurgeComm(
1609: HANDLE hFile,
1610: DWORD dwFlags
1611: );
1612:
1613: BOOL
1614: APIENTRY
1615: SetCommBreak(
1616: HANDLE hFile
1617: );
1618:
1619: BOOL
1620: APIENTRY
1621: SetCommConfig(
1622: HANDLE hFile,
1623: LPVOID lpCOMMCONFIG,
1624: DWORD dwSize
1625: );
1626:
1627: BOOL
1628: APIENTRY
1629: SetCommMask(
1630: HANDLE hFile,
1631: DWORD dwEvtMask
1632: );
1633:
1634: BOOL
1635: APIENTRY
1636: SetCommState(
1637: HANDLE hFile,
1638: LPDCB lpDCB
1639: );
1640:
1641: BOOL
1642: APIENTRY
1643: SetCommTimeouts(
1644: HANDLE hFile,
1645: LPCOMMTIMEOUTS lpCommTimeouts
1646: );
1647:
1648: BOOL
1649: APIENTRY
1650: TransmitCommChar(
1651: HANDLE hFile,
1652: char cChar
1653: );
1654:
1655: BOOL
1656: APIENTRY
1657: WaitCommEvent(
1658: HANDLE hFile,
1659: LPDWORD lpEvtMask,
1660: HANDLE hEvent
1661: );
1662:
1663: BOOL
1664: APIENTRY
1665: Beep(
1666: DWORD dwFreq,
1667: DWORD dwDuration
1668: );
1669:
1670: VOID
1671: APIENTRY
1672: OpenSound(
1673: VOID
1674: );
1675:
1676: VOID
1677: APIENTRY
1678: CloseSound(
1679: VOID
1680: );
1681:
1682: VOID
1683: APIENTRY
1684: StartSound(
1685: VOID
1686: );
1687:
1688: VOID
1689: APIENTRY
1690: StopSound(
1691: VOID
1692: );
1693:
1694: DWORD
1695: APIENTRY
1696: WaitSoundState(
1697: DWORD nState
1698: );
1699:
1700: DWORD
1701: APIENTRY
1702: SyncAllVoices(
1703: VOID
1704: );
1705:
1706: DWORD
1707: APIENTRY
1708: CountVoiceNotes(
1709: DWORD nVoice
1710: );
1711:
1712: LPDWORD
1713: APIENTRY
1714: GetThresholdEvent(
1715: VOID
1716: );
1717:
1718: DWORD
1719: APIENTRY
1720: GetThresholdStatus(
1721: VOID
1722: );
1723:
1724: DWORD
1725: APIENTRY
1726: SetSoundNoise(
1727: DWORD nSource,
1728: DWORD nDuration
1729: );
1730:
1731: DWORD
1732: APIENTRY
1733: SetVoiceAccent(
1734: DWORD nVoice,
1735: DWORD nTempo,
1736: DWORD nVolume,
1737: DWORD nMode,
1738: DWORD nPitch
1739: );
1740:
1741: DWORD
1742: APIENTRY
1743: SetVoiceEnvelope(
1744: DWORD nVoice,
1745: DWORD nShape,
1746: DWORD nRepeat
1747: );
1748:
1749: DWORD
1750: APIENTRY
1751: SetVoiceNote(
1752: DWORD nVoice,
1753: DWORD nValue,
1754: DWORD nLength,
1755: DWORD nCdots
1756: );
1757:
1758: DWORD
1759: APIENTRY
1760: SetVoiceQueueSize(
1761: DWORD nVoice,
1762: DWORD nBytes
1763: );
1764:
1765: DWORD
1766: APIENTRY
1767: SetVoiceSound(
1768: DWORD nVoice,
1769: LONG lFrequency,
1770: DWORD nDuration
1771: );
1772:
1773: DWORD
1774: APIENTRY
1775: SetVoiceThreshold(
1776: DWORD nVoice,
1777: DWORD nNotes
1778: );
1779:
1780: int
1781: APIENTRY
1782: MulDiv(
1783: int nNumber,
1784: int nNumerator,
1785: int nDenominator
1786: );
1787:
1788: VOID
1789: APIENTRY
1790: GetSystemTime(
1791: LPSYSTEMTIME lpSystemTime
1792: );
1793:
1794: BOOL
1795: APIENTRY
1796: SetSystemTime(
1797: LPSYSTEMTIME lpSystemTime
1798: );
1799:
1800: VOID
1801: APIENTRY
1802: GetSystemInfo(
1803: LPSYSTEM_INFO lpSystemInfo
1804: );
1805:
1806:
1807: //
1808: // Routines to convert back and forth between system time and file time
1809: //
1810:
1811: BOOL
1812: APIENTRY
1813: SystemTimeToFileTime(
1814: LPSYSTEMTIME lpSystemTime,
1815: LPFILETIME lpFileTime
1816: );
1817:
1818: BOOL
1819: APIENTRY
1820: FileTimeToSystemTime(
1821: LPFILETIME lpFileTime,
1822: LPSYSTEMTIME lpSystemTime
1823: );
1824:
1825: LONG
1826: APIENTRY
1827: CompareFileTime(
1828: LPFILETIME lpFileTime1,
1829: LPFILETIME lpFileTime2
1830: );
1831:
1832: BOOL
1833: APIENTRY
1834: FileTimeToDosDateTime(
1835: LPFILETIME lpFileTime,
1836: LPWORD lpFatDate,
1837: LPWORD lpFatTime
1838: );
1839:
1840: BOOL
1841: APIENTRY
1842: DosDateTimeToFileTime(
1843: WORD wFatDate,
1844: WORD wFatTime,
1845: LPFILETIME lpFileTime
1846: );
1847:
1848: DWORD
1849: APIENTRY
1850: GetTickCount(
1851: VOID
1852: );
1853:
1854: DWORD
1855: APIENTRY
1856: FormatMessage(
1857: DWORD dwFlags,
1858: LPVOID lpSource,
1859: DWORD dwMessageId,
1860: DWORD dwLanguageId,
1861: LPSTR lpBuffer,
1862: DWORD nSize,
1863: LPVOID lpArguments
1864: );
1865:
1866: #define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100
1867: #define FORMAT_MESSAGE_IGNORE_INSERTS 0x00000200
1868: #define FORMAT_MESSAGE_FROM_STRING 0x00000400
1869: #define FORMAT_MESSAGE_FROM_HMODULE 0x00000800
1870: #define FORMAT_MESSAGE_FROM_SYSTEM 0x00001000
1871: #define FORMAT_MESSAGE_MAX_WIDTH_MASK 0x000000FF
1872:
1873:
1874: BOOL
1875: APIENTRY
1876: CreatePipe(
1877: PHANDLE hReadPipe,
1878: PHANDLE hWritePipe,
1879: LPSECURITY_ATTRIBUTES lpPipeAttributes,
1880: DWORD nSize
1881: );
1882:
1883: BOOL
1884: APIENTRY
1885: ConnectNamedPipe(
1886: HANDLE hNamedPipe,
1887: LPOVERLAPPED lpOverlapped
1888: );
1889:
1890: BOOL
1891: APIENTRY
1892: DisconnectNamedPipe(
1893: HANDLE hNamedPipe
1894: );
1895:
1896: BOOL
1897: APIENTRY
1898: SetNamedPipeHandleState(
1899: HANDLE hNamedPipe,
1900: LPDWORD lpMode,
1901: LPDWORD lpMaxCollectionCount,
1902: LPDWORD lpCollectDataTimeout
1903: );
1904:
1905: BOOL
1906: APIENTRY
1907: GetNamedPipeInfo(
1908: HANDLE hNamedPipe,
1909: LPDWORD lpFlags,
1910: LPDWORD lpOutBufferSize,
1911: LPDWORD lpInBufferSize,
1912: LPDWORD lpMaxInstances
1913: );
1914:
1915: BOOL
1916: APIENTRY
1917: PeekNamedPipe(
1918: HANDLE hNamedPipe,
1919: LPVOID lpBuffer,
1920: DWORD nBufferSize,
1921: LPDWORD lpBytesRead,
1922: LPDWORD lpTotalBytesAvail,
1923: LPDWORD lpBytesLeftThisMessage
1924: );
1925:
1926: BOOL
1927: APIENTRY
1928: TransactNamedPipe(
1929: HANDLE hNamedPipe,
1930: LPVOID lpInBuffer,
1931: DWORD nInBufferSize,
1932: LPVOID lpOutBuffer,
1933: DWORD nOutBufferSize,
1934: LPDWORD lpBytesRead,
1935: LPOVERLAPPED lpOverlapped
1936: );
1937:
1938: HANDLE
1939: APIENTRY
1940: CreateMailslotA(
1941: IN LPSTR lpName,
1942: IN DWORD nMaxMessageSize,
1943: IN DWORD nMailslotSize,
1944: IN DWORD lReadTimeout,
1945: IN LPSECURITY_ATTRIBUTES lpSecurityAttributes OPTIONAL
1946: );
1947: HANDLE
1948: APIENTRY
1949: CreateMailslotW(
1950: IN LPWSTR lpName,
1951: IN DWORD nMaxMessageSize,
1952: IN DWORD nMailslotSize,
1953: IN DWORD lReadTimeout,
1954: IN LPSECURITY_ATTRIBUTES lpSecurityAttributes OPTIONAL
1955: );
1956: #ifdef UNICODE
1957: #define CreateMailslot CreateMailslotW
1958: #else
1959: #define CreateMailslot CreateMailslotA
1960: #endif // !UNICODE
1961:
1962: BOOL
1963: APIENTRY
1964: GetMailslotInfo(
1965: IN HANDLE hMailslot,
1966: OUT LPDWORD lpMaxMessageSize OPTIONAL,
1967: OUT LPDWORD lpMailslotSize OPTIONAL,
1968: OUT LPDWORD lpNextSize OPTIONAL,
1969: OUT LPDWORD lpMessageCount OPTIONAL,
1970: OUT LPDWORD lpReadTimeout OPTIONAL
1971: );
1972:
1973: BOOL
1974: APIENTRY
1975: SetMailslotInfo(
1976: IN HANDLE hMailslot,
1977: IN DWORD lReadTimeout
1978: );
1979:
1980: LPVOID
1981: APIENTRY
1982: MapViewOfFile(
1983: HANDLE hFileMappingObject,
1984: DWORD dwDesiredAccess,
1985: DWORD dwFileOffsetHigh,
1986: DWORD dwFileOffsetLow,
1987: DWORD dwNumberOfBytesToMap
1988: );
1989:
1990: BOOL
1991: APIENTRY
1992: FlushViewOfFile(
1993: LPVOID lpBaseAddress,
1994: DWORD dwNumberOfBytesToFlush
1995: );
1996:
1997: BOOL
1998: APIENTRY
1999: UnmapViewOfFile(
2000: LPVOID lpBaseAddress
2001: );
2002:
2003: //
2004: // _l Compat Functions
2005: //
2006:
2007: int
2008: APIENTRY
2009: lstrcmp(
2010: LPSTR lpString1,
2011: LPSTR lpString2
2012: );
2013:
2014: int
2015: APIENTRY
2016: lstrcmpi(
2017: LPSTR lpString1,
2018: LPSTR lpString2
2019: );
2020:
2021: LPSTR
2022: APIENTRY
2023: lstrcpy(
2024: LPSTR lpString1,
2025: LPSTR lpString2
2026: );
2027:
2028: LPSTR
2029: APIENTRY
2030: lstrcat(
2031: LPSTR lpString1,
2032: LPSTR lpString2
2033: );
2034:
2035: int
2036: APIENTRY
2037: lstrlen(
2038: LPSTR lpString
2039: );
2040:
2041: int
2042: APIENTRY
2043: OpenFile(
2044: LPSTR lpFileName,
2045: LPOFSTRUCT lpReOpenBuff,
2046: WORD wStyle
2047: );
2048:
2049: int
2050: APIENTRY
2051: OpenSystemFile(
2052: LPSTR lpFileName,
2053: LPOFSTRUCT lpReOpenBuff,
2054: WORD wStyle
2055: );
2056:
2057: int
2058: APIENTRY
2059: _lopen(
2060: LPSTR lpPathName,
2061: int iReadWrite
2062: );
2063:
2064: int
2065: APIENTRY
2066: _lcreat(
2067: LPSTR lpPathName,
2068: WORD iAttribute
2069: );
2070:
2071: DWORD
2072: APIENTRY
2073: _lread(
2074: int hFile,
2075: LPSTR lpBuffer,
2076: int nBytes
2077: );
2078:
2079: DWORD
2080: APIENTRY
2081: _lwrite(
2082: int hFile,
2083: LPSTR lpBuffer,
2084: int nBytes
2085: );
2086:
2087: int
2088: APIENTRY
2089: _lclose(
2090: int hFile
2091: );
2092:
2093: int
2094: APIENTRY
2095: _llseek(
2096: int hFile,
2097: int lOffset,
2098: int iOrigin
2099: );
2100:
2101: DWORD
2102: APIENTRY
2103: TlsAlloc(
2104: VOID
2105: );
2106:
2107: LPVOID
2108: APIENTRY
2109: TlsGetValue(
2110: DWORD dwTlsIndex
2111: );
2112:
2113: BOOL
2114: APIENTRY
2115: TlsSetValue(
2116: DWORD dwTlsIndex,
2117: LPVOID lpTlsValue
2118: );
2119:
2120: BOOL
2121: APIENTRY
2122: TlsFree(
2123: DWORD dwTlsIndex
2124: );
2125:
2126: //
2127: // Dual Mode API below this line. Dual Mode Structures also included.
2128: //
2129:
2130: #define STARTF_USESHOWWINDOW 1
2131: #define STARTF_USESIZE 2
2132: #define STARTF_USEPOSITION 4
2133: #define STARTF_USECOUNTCHARS 8
2134: #define STARTF_USEFILLATTRIBUTE 16
2135:
2136: typedef struct _STARTUPINFOA {
2137: DWORD cb;
2138: LPSTR lpReserved;
2139: LPSTR lpDesktop;
2140: LPSTR lpTitle;
2141: DWORD dwX;
2142: DWORD dwY;
2143: DWORD dwXSize;
2144: DWORD dwYSize;
2145: DWORD dwXCountChars;
2146: DWORD dwYCountChars;
2147: DWORD dwFillAttribute;
2148: DWORD dwFlags;
2149: WORD wShowWindow;
2150: WORD cbReserved2;
2151: LPBYTE lpReserved2;
2152: } STARTUPINFOA, *LPSTARTUPINFOA;
2153: typedef struct _STARTUPINFOW {
2154: DWORD cb;
2155: LPWSTR lpReserved;
2156: LPWSTR lpDesktop;
2157: LPWSTR lpTitle;
2158: DWORD dwX;
2159: DWORD dwY;
2160: DWORD dwXSize;
2161: DWORD dwYSize;
2162: DWORD dwXCountChars;
2163: DWORD dwYCountChars;
2164: DWORD dwFillAttribute;
2165: DWORD dwFlags;
2166: WORD wShowWindow;
2167: WORD cbReserved2;
2168: LPBYTE lpReserved2;
2169: } STARTUPINFOW, *LPSTARTUPINFOW;
2170: #ifdef UNICODE
2171: #define STARTUPINFO STARTUPINFOW
2172: #define LPSTARTUPINFO LPSTARTUPINFOW
2173: #else
2174: #define STARTUPINFO STARTUPINFOA
2175: #define LPSTARTUPINFO LPSTARTUPINFOA
2176: #endif // UNICODE
2177:
2178: typedef struct _WIN32_FIND_DATAA {
2179: DWORD dwFileAttributes;
2180: FILETIME ftCreationTime;
2181: FILETIME ftLastAccessTime;
2182: FILETIME ftLastWriteTime;
2183: DWORD nFileSizeHigh;
2184: DWORD nFileSizeLow;
2185: CHAR cFileName[ MAX_PATH ];
2186: } WIN32_FIND_DATAA, *PWIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;
2187: typedef struct _WIN32_FIND_DATAW {
2188: DWORD dwFileAttributes;
2189: FILETIME ftCreationTime;
2190: FILETIME ftLastAccessTime;
2191: FILETIME ftLastWriteTime;
2192: DWORD nFileSizeHigh;
2193: DWORD nFileSizeLow;
2194: WCHAR cFileName[ MAX_PATH ];
2195: } WIN32_FIND_DATAW, *PWIN32_FIND_DATAW, *LPWIN32_FIND_DATAW;
2196: #ifdef UNICODE
2197: #define WIN32_FIND_DATA WIN32_FIND_DATAW
2198: #define PWIN32_FIND_DATA PWIN32_FIND_DATAW
2199: #define LPWIN32_FIND_DATA LPWIN32_FIND_DATAW
2200: #else
2201: #define WIN32_FIND_DATA WIN32_FIND_DATAA
2202: #define PWIN32_FIND_DATA PWIN32_FIND_DATAA
2203: #define LPWIN32_FIND_DATA LPWIN32_FIND_DATAA
2204: #endif // UNICODE
2205:
2206: HANDLE
2207: APIENTRY
2208: CreateMutexA(
2209: LPSECURITY_ATTRIBUTES lpMutexAttributes,
2210: BOOL bInitialOwner,
2211: LPSTR lpName
2212: );
2213: HANDLE
2214: APIENTRY
2215: CreateMutexW(
2216: LPSECURITY_ATTRIBUTES lpMutexAttributes,
2217: BOOL bInitialOwner,
2218: LPWSTR lpName
2219: );
2220: #ifdef UNICODE
2221: #define CreateMutex CreateMutexW
2222: #else
2223: #define CreateMutex CreateMutexA
2224: #endif // !UNICODE
2225:
2226: HANDLE
2227: APIENTRY
2228: OpenMutexA(
2229: DWORD dwDesiredAccess,
2230: BOOL bInheritHandle,
2231: LPSTR lpName
2232: );
2233: HANDLE
2234: APIENTRY
2235: OpenMutexW(
2236: DWORD dwDesiredAccess,
2237: BOOL bInheritHandle,
2238: LPWSTR lpName
2239: );
2240: #ifdef UNICODE
2241: #define OpenMutex OpenMutexW
2242: #else
2243: #define OpenMutex OpenMutexA
2244: #endif // !UNICODE
2245:
2246: HANDLE
2247: APIENTRY
2248: CreateEventA(
2249: LPSECURITY_ATTRIBUTES lpEventAttributes,
2250: BOOL bManualReset,
2251: BOOL bInitialState,
2252: LPSTR lpName
2253: );
2254: HANDLE
2255: APIENTRY
2256: CreateEventW(
2257: LPSECURITY_ATTRIBUTES lpEventAttributes,
2258: BOOL bManualReset,
2259: BOOL bInitialState,
2260: LPWSTR lpName
2261: );
2262: #ifdef UNICODE
2263: #define CreateEvent CreateEventW
2264: #else
2265: #define CreateEvent CreateEventA
2266: #endif // !UNICODE
2267:
2268: HANDLE
2269: APIENTRY
2270: OpenEventA(
2271: DWORD dwDesiredAccess,
2272: BOOL bInheritHandle,
2273: LPSTR lpName
2274: );
2275: HANDLE
2276: APIENTRY
2277: OpenEventW(
2278: DWORD dwDesiredAccess,
2279: BOOL bInheritHandle,
2280: LPWSTR lpName
2281: );
2282: #ifdef UNICODE
2283: #define OpenEvent OpenEventW
2284: #else
2285: #define OpenEvent OpenEventA
2286: #endif // !UNICODE
2287:
2288: HANDLE
2289: APIENTRY
2290: CreateSemaphoreA(
2291: LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
2292: LONG lInitialCount,
2293: LONG lMaximumCount,
2294: LPSTR lpName
2295: );
2296: HANDLE
2297: APIENTRY
2298: CreateSemaphoreW(
2299: LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
2300: LONG lInitialCount,
2301: LONG lMaximumCount,
2302: LPWSTR lpName
2303: );
2304: #ifdef UNICODE
2305: #define CreateSemaphore CreateSemaphoreW
2306: #else
2307: #define CreateSemaphore CreateSemaphoreA
2308: #endif // !UNICODE
2309:
2310: HANDLE
2311: APIENTRY
2312: OpenSemaphoreA(
2313: DWORD dwDesiredAccess,
2314: BOOL bInheritHandle,
2315: LPSTR lpName
2316: );
2317: HANDLE
2318: APIENTRY
2319: OpenSemaphoreW(
2320: DWORD dwDesiredAccess,
2321: BOOL bInheritHandle,
2322: LPWSTR lpName
2323: );
2324: #ifdef UNICODE
2325: #define OpenSemaphore OpenSemaphoreW
2326: #else
2327: #define OpenSemaphore OpenSemaphoreA
2328: #endif // !UNICODE
2329:
2330: HANDLE
2331: APIENTRY
2332: CreateFileMappingA(
2333: HANDLE hFile,
2334: LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
2335: DWORD flProtect,
2336: DWORD dwMaximumSizeHigh,
2337: DWORD dwMaximumSizeLow,
2338: LPSTR lpName
2339: );
2340: HANDLE
2341: APIENTRY
2342: CreateFileMappingW(
2343: HANDLE hFile,
2344: LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
2345: DWORD flProtect,
2346: DWORD dwMaximumSizeHigh,
2347: DWORD dwMaximumSizeLow,
2348: LPWSTR lpName
2349: );
2350: #ifdef UNICODE
2351: #define CreateFileMapping CreateFileMappingW
2352: #else
2353: #define CreateFileMapping CreateFileMappingA
2354: #endif // !UNICODE
2355:
2356: HANDLE
2357: APIENTRY
2358: OpenFileMappingA(
2359: DWORD dwDesiredAccess,
2360: BOOL bInheritHandle,
2361: LPSTR lpName
2362: );
2363: HANDLE
2364: APIENTRY
2365: OpenFileMappingW(
2366: DWORD dwDesiredAccess,
2367: BOOL bInheritHandle,
2368: LPWSTR lpName
2369: );
2370: #ifdef UNICODE
2371: #define OpenFileMapping OpenFileMappingW
2372: #else
2373: #define OpenFileMapping OpenFileMappingA
2374: #endif // !UNICODE
2375:
2376: DWORD
2377: APIENTRY
2378: GetLogicalDriveStringsA(
2379: DWORD nBufferLength,
2380: LPSTR lpBuffer
2381: );
2382: DWORD
2383: APIENTRY
2384: GetLogicalDriveStringsW(
2385: DWORD nBufferLength,
2386: LPWSTR lpBuffer
2387: );
2388: #ifdef UNICODE
2389: #define GetLogicalDriveStrings GetLogicalDriveStringsW
2390: #else
2391: #define GetLogicalDriveStrings GetLogicalDriveStringsA
2392: #endif // !UNICODE
2393:
2394: HANDLE
2395: APIENTRY
2396: LoadLibraryA(
2397: LPSTR lpLibFileName
2398: );
2399: HANDLE
2400: APIENTRY
2401: LoadLibraryW(
2402: LPWSTR lpLibFileName
2403: );
2404: #ifdef UNICODE
2405: #define LoadLibrary LoadLibraryW
2406: #else
2407: #define LoadLibrary LoadLibraryA
2408: #endif // !UNICODE
2409:
2410: DWORD
2411: APIENTRY
2412: GetModuleFileNameA(
2413: HANDLE hModule,
2414: LPSTR lpFilename,
2415: DWORD nSize
2416: );
2417: DWORD
2418: APIENTRY
2419: GetModuleFileNameW(
2420: HANDLE hModule,
2421: LPWSTR lpFilename,
2422: DWORD nSize
2423: );
2424: #ifdef UNICODE
2425: #define GetModuleFileName GetModuleFileNameW
2426: #else
2427: #define GetModuleFileName GetModuleFileNameA
2428: #endif // !UNICODE
2429:
2430: HANDLE
2431: APIENTRY
2432: GetModuleHandleA(
2433: LPSTR lpModuleName
2434: );
2435: HANDLE
2436: APIENTRY
2437: GetModuleHandleW(
2438: LPWSTR lpModuleName
2439: );
2440: #ifdef UNICODE
2441: #define GetModuleHandle GetModuleHandleW
2442: #else
2443: #define GetModuleHandle GetModuleHandleA
2444: #endif // !UNICODE
2445:
2446: BOOL
2447: APIENTRY
2448: CreateProcessA(
2449: LPSTR lpApplicationName,
2450: LPSTR lpCommandLine,
2451: LPSECURITY_ATTRIBUTES lpProcessAttributes,
2452: LPSECURITY_ATTRIBUTES lpThreadAttributes,
2453: BOOL bInheritHandles,
2454: DWORD dwCreationFlags,
2455: LPVOID lpEnvironment,
2456: LPSTR lpCurrentDirectory,
2457: LPSTARTUPINFOA lpStartupInfo,
2458: LPPROCESS_INFORMATION lpProcessInformation
2459: );
2460: BOOL
2461: APIENTRY
2462: CreateProcessW(
2463: LPWSTR lpApplicationName,
2464: LPWSTR lpCommandLine,
2465: LPSECURITY_ATTRIBUTES lpProcessAttributes,
2466: LPSECURITY_ATTRIBUTES lpThreadAttributes,
2467: BOOL bInheritHandles,
2468: DWORD dwCreationFlags,
2469: LPVOID lpEnvironment,
2470: LPWSTR lpCurrentDirectory,
2471: LPSTARTUPINFOW lpStartupInfo,
2472: LPPROCESS_INFORMATION lpProcessInformation
2473: );
2474: #ifdef UNICODE
2475: #define CreateProcess CreateProcessW
2476: #else
2477: #define CreateProcess CreateProcessA
2478: #endif // !UNICODE
2479:
2480: VOID
2481: APIENTRY
2482: FatalAppExitA(
2483: WORD wAction,
2484: LPSTR lpMessageText
2485: );
2486: VOID
2487: APIENTRY
2488: FatalAppExitW(
2489: WORD wAction,
2490: LPWSTR lpMessageText
2491: );
2492: #ifdef UNICODE
2493: #define FatalAppExit FatalAppExitW
2494: #else
2495: #define FatalAppExit FatalAppExitA
2496: #endif // !UNICODE
2497:
2498: VOID
2499: APIENTRY
2500: GetStartupInfoA(
2501: LPSTARTUPINFOA lpStartupInfo
2502: );
2503: VOID
2504: APIENTRY
2505: GetStartupInfoW(
2506: LPSTARTUPINFOW lpStartupInfo
2507: );
2508: #ifdef UNICODE
2509: #define GetStartupInfo GetStartupInfoW
2510: #else
2511: #define GetStartupInfo GetStartupInfoA
2512: #endif // !UNICODE
2513:
2514: LPSTR
2515: APIENTRY
2516: GetCommandLineA(
2517: VOID
2518: );
2519: LPWSTR
2520: APIENTRY
2521: GetCommandLineW(
2522: VOID
2523: );
2524: #ifdef UNICODE
2525: #define GetCommandLine GetCommandLineW
2526: #else
2527: #define GetCommandLine GetCommandLineA
2528: #endif // !UNICODE
2529:
2530: DWORD
2531: APIENTRY
2532: GetEnvironmentVariableA(
2533: LPSTR lpName,
2534: LPSTR lpBuffer,
2535: DWORD nSize
2536: );
2537: DWORD
2538: APIENTRY
2539: GetEnvironmentVariableW(
2540: LPWSTR lpName,
2541: LPWSTR lpBuffer,
2542: DWORD nSize
2543: );
2544: #ifdef UNICODE
2545: #define GetEnvironmentVariable GetEnvironmentVariableW
2546: #else
2547: #define GetEnvironmentVariable GetEnvironmentVariableA
2548: #endif // !UNICODE
2549:
2550: BOOL
2551: APIENTRY
2552: SetEnvironmentVariableA(
2553: LPSTR lpName,
2554: LPSTR lpValue
2555: );
2556: BOOL
2557: APIENTRY
2558: SetEnvironmentVariableW(
2559: LPWSTR lpName,
2560: LPWSTR lpValue
2561: );
2562: #ifdef UNICODE
2563: #define SetEnvironmentVariable SetEnvironmentVariableW
2564: #else
2565: #define SetEnvironmentVariable SetEnvironmentVariableA
2566: #endif // !UNICODE
2567:
2568: VOID
2569: APIENTRY
2570: OutputDebugStringA(
2571: LPSTR lpOutputString
2572: );
2573: VOID
2574: APIENTRY
2575: OutputDebugStringW(
2576: LPWSTR lpOutputString
2577: );
2578: #ifdef UNICODE
2579: #define OutputDebugString OutputDebugStringW
2580: #else
2581: #define OutputDebugString OutputDebugStringA
2582: #endif // !UNICODE
2583:
2584: HANDLE
2585: APIENTRY
2586: FindResourceA(
2587: HANDLE hModule,
2588: LPSTR lpName,
2589: LPSTR lpType
2590: );
2591: HANDLE
2592: APIENTRY
2593: FindResourceW(
2594: HANDLE hModule,
2595: LPWSTR lpName,
2596: LPWSTR lpType
2597: );
2598: #ifdef UNICODE
2599: #define FindResource FindResourceW
2600: #else
2601: #define FindResource FindResourceA
2602: #endif // !UNICODE
2603:
2604: BOOL
2605: APIENTRY
2606: EnumResourceTypesA(
2607: HANDLE hModule,
2608: FARPROC lpEnumFunc,
2609: LONG lParam
2610: );
2611: BOOL
2612: APIENTRY
2613: EnumResourceTypesW(
2614: HANDLE hModule,
2615: FARPROC lpEnumFunc,
2616: LONG lParam
2617: );
2618: #ifdef UNICODE
2619: #define EnumResourceTypes EnumResourceTypesW
2620: #else
2621: #define EnumResourceTypes EnumResourceTypesA
2622: #endif // !UNICODE
2623:
2624:
2625: BOOL
2626: APIENTRY
2627: EnumResourceNamesA(
2628: HANDLE hModule,
2629: LPSTR lpType,
2630: FARPROC lpEnumFunc,
2631: LONG lParam
2632: );
2633: BOOL
2634: APIENTRY
2635: EnumResourceNamesW(
2636: HANDLE hModule,
2637: LPWSTR lpType,
2638: FARPROC lpEnumFunc,
2639: LONG lParam
2640: );
2641: #ifdef UNICODE
2642: #define EnumResourceNames EnumResourceNamesW
2643: #else
2644: #define EnumResourceNames EnumResourceNamesA
2645: #endif // !UNICODE
2646:
2647: ATOM
2648: APIENTRY
2649: GlobalAddAtomA(
2650: LPSTR lpString
2651: );
2652: ATOM
2653: APIENTRY
2654: GlobalAddAtomW(
2655: LPWSTR lpString
2656: );
2657: #ifdef UNICODE
2658: #define GlobalAddAtom GlobalAddAtomW
2659: #else
2660: #define GlobalAddAtom GlobalAddAtomA
2661: #endif // !UNICODE
2662:
2663: ATOM
2664: APIENTRY
2665: GlobalFindAtomA(
2666: LPSTR lpString
2667: );
2668: ATOM
2669: APIENTRY
2670: GlobalFindAtomW(
2671: LPWSTR lpString
2672: );
2673: #ifdef UNICODE
2674: #define GlobalFindAtom GlobalFindAtomW
2675: #else
2676: #define GlobalFindAtom GlobalFindAtomA
2677: #endif // !UNICODE
2678:
2679: DWORD
2680: APIENTRY
2681: GlobalGetAtomNameA(
2682: ATOM nAtom,
2683: LPSTR lpBuffer,
2684: DWORD nSize
2685: );
2686: DWORD
2687: APIENTRY
2688: GlobalGetAtomNameW(
2689: ATOM nAtom,
2690: LPWSTR lpBuffer,
2691: DWORD nSize
2692: );
2693: #ifdef UNICODE
2694: #define GlobalGetAtomName GlobalGetAtomNameW
2695: #else
2696: #define GlobalGetAtomName GlobalGetAtomNameA
2697: #endif // !UNICODE
2698:
2699: ATOM
2700: APIENTRY
2701: AddAtomA(
2702: LPSTR lpString
2703: );
2704: ATOM
2705: APIENTRY
2706: AddAtomW(
2707: LPWSTR lpString
2708: );
2709: #ifdef UNICODE
2710: #define AddAtom AddAtomW
2711: #else
2712: #define AddAtom AddAtomA
2713: #endif // !UNICODE
2714:
2715: ATOM
2716: APIENTRY
2717: FindAtomA(
2718: LPSTR lpString
2719: );
2720: ATOM
2721: APIENTRY
2722: FindAtomW(
2723: LPWSTR lpString
2724: );
2725: #ifdef UNICODE
2726: #define FindAtom FindAtomW
2727: #else
2728: #define FindAtom FindAtomA
2729: #endif // !UNICODE
2730:
2731: DWORD
2732: APIENTRY
2733: GetAtomNameA(
2734: ATOM nAtom,
2735: LPSTR lpBuffer,
2736: DWORD nSize
2737: );
2738: DWORD
2739: APIENTRY
2740: GetAtomNameW(
2741: ATOM nAtom,
2742: LPWSTR lpBuffer,
2743: DWORD nSize
2744: );
2745: #ifdef UNICODE
2746: #define GetAtomName GetAtomNameW
2747: #else
2748: #define GetAtomName GetAtomNameA
2749: #endif // !UNICODE
2750:
2751: DWORD
2752: APIENTRY
2753: GetProfileIntA(
2754: LPSTR lpAppName,
2755: LPSTR lpKeyName,
2756: DWORD nDefault
2757: );
2758: DWORD
2759: APIENTRY
2760: GetProfileIntW(
2761: LPWSTR lpAppName,
2762: LPWSTR lpKeyName,
2763: DWORD nDefault
2764: );
2765: #ifdef UNICODE
2766: #define GetProfileInt GetProfileIntW
2767: #else
2768: #define GetProfileInt GetProfileIntA
2769: #endif // !UNICODE
2770:
2771: DWORD
2772: APIENTRY
2773: GetProfileStringA(
2774: LPSTR lpAppName,
2775: LPSTR lpKeyName,
2776: LPSTR lpDefault,
2777: LPSTR lpReturnedString,
2778: DWORD nSize
2779: );
2780: DWORD
2781: APIENTRY
2782: GetProfileStringW(
2783: LPWSTR lpAppName,
2784: LPWSTR lpKeyName,
2785: LPWSTR lpDefault,
2786: LPWSTR lpReturnedString,
2787: DWORD nSize
2788: );
2789: #ifdef UNICODE
2790: #define GetProfileString GetProfileStringW
2791: #else
2792: #define GetProfileString GetProfileStringA
2793: #endif // !UNICODE
2794:
2795: BOOL
2796: APIENTRY
2797: WriteProfileStringA(
2798: LPSTR lpAppName,
2799: LPSTR lpKeyName,
2800: LPSTR lpString
2801: );
2802: BOOL
2803: APIENTRY
2804: WriteProfileStringW(
2805: LPWSTR lpAppName,
2806: LPWSTR lpKeyName,
2807: LPWSTR lpString
2808: );
2809: #ifdef UNICODE
2810: #define WriteProfileString WriteProfileStringW
2811: #else
2812: #define WriteProfileString WriteProfileStringA
2813: #endif // !UNICODE
2814:
2815: DWORD
2816: APIENTRY
2817: GetProfileSectionA(
2818: LPSTR lpAppName,
2819: LPSTR lpReturnedString,
2820: DWORD nSize
2821: );
2822: DWORD
2823: APIENTRY
2824: GetProfileSectionW(
2825: LPWSTR lpAppName,
2826: LPWSTR lpReturnedString,
2827: DWORD nSize
2828: );
2829: #ifdef UNICODE
2830: #define GetProfileSection GetProfileSectionW
2831: #else
2832: #define GetProfileSection GetProfileSectionA
2833: #endif // !UNICODE
2834:
2835: DWORD
2836: APIENTRY
2837: WriteProfileSectionA(
2838: LPSTR lpAppName,
2839: LPSTR lpString
2840: );
2841: DWORD
2842: APIENTRY
2843: WriteProfileSectionW(
2844: LPWSTR lpAppName,
2845: LPWSTR lpString
2846: );
2847: #ifdef UNICODE
2848: #define WriteProfileSection WriteProfileSectionW
2849: #else
2850: #define WriteProfileSection WriteProfileSectionA
2851: #endif // !UNICODE
2852:
2853: DWORD
2854: APIENTRY
2855: GetPrivateProfileIntA(
2856: LPSTR lpAppName,
2857: LPSTR lpKeyName,
2858: DWORD nDefault,
2859: LPSTR lpFileName
2860: );
2861: DWORD
2862: APIENTRY
2863: GetPrivateProfileIntW(
2864: LPWSTR lpAppName,
2865: LPWSTR lpKeyName,
2866: DWORD nDefault,
2867: LPWSTR lpFileName
2868: );
2869: #ifdef UNICODE
2870: #define GetPrivateProfileInt GetPrivateProfileIntW
2871: #else
2872: #define GetPrivateProfileInt GetPrivateProfileIntA
2873: #endif // !UNICODE
2874:
2875: DWORD
2876: APIENTRY
2877: GetPrivateProfileStringA(
2878: LPSTR lpAppName,
2879: LPSTR lpKeyName,
2880: LPSTR lpDefault,
2881: LPSTR lpReturnedString,
2882: DWORD nSize,
2883: LPSTR lpFileName
2884: );
2885: DWORD
2886: APIENTRY
2887: GetPrivateProfileStringW(
2888: LPWSTR lpAppName,
2889: LPWSTR lpKeyName,
2890: LPWSTR lpDefault,
2891: LPWSTR lpReturnedString,
2892: DWORD nSize,
2893: LPWSTR lpFileName
2894: );
2895: #ifdef UNICODE
2896: #define GetPrivateProfileString GetPrivateProfileStringW
2897: #else
2898: #define GetPrivateProfileString GetPrivateProfileStringA
2899: #endif // !UNICODE
2900:
2901: BOOL
2902: APIENTRY
2903: WritePrivateProfileStringA(
2904: LPSTR lpAppName,
2905: LPSTR lpKeyName,
2906: LPSTR lpString,
2907: LPSTR lpFileName
2908: );
2909: BOOL
2910: APIENTRY
2911: WritePrivateProfileStringW(
2912: LPWSTR lpAppName,
2913: LPWSTR lpKeyName,
2914: LPWSTR lpString,
2915: LPWSTR lpFileName
2916: );
2917: #ifdef UNICODE
2918: #define WritePrivateProfileString WritePrivateProfileStringW
2919: #else
2920: #define WritePrivateProfileString WritePrivateProfileStringA
2921: #endif // !UNICODE
2922:
2923: DWORD
2924: APIENTRY
2925: GetPrivateProfileSectionA(
2926: LPSTR lpAppName,
2927: LPSTR lpReturnedString,
2928: DWORD nSize,
2929: LPSTR lpFileName
2930: );
2931: DWORD
2932: APIENTRY
2933: GetPrivateProfileSectionW(
2934: LPWSTR lpAppName,
2935: LPWSTR lpReturnedString,
2936: DWORD nSize,
2937: LPWSTR lpFileName
2938: );
2939: #ifdef UNICODE
2940: #define GetPrivateProfileSection GetPrivateProfileSectionW
2941: #else
2942: #define GetPrivateProfileSection GetPrivateProfileSectionA
2943: #endif // !UNICODE
2944:
2945: DWORD
2946: APIENTRY
2947: WritePrivateProfileSectionA(
2948: LPSTR lpAppName,
2949: LPSTR lpString,
2950: LPSTR lpFileName
2951: );
2952: DWORD
2953: APIENTRY
2954: WritePrivateProfileSectionW(
2955: LPWSTR lpAppName,
2956: LPWSTR lpString,
2957: LPWSTR lpFileName
2958: );
2959: #ifdef UNICODE
2960: #define WritePrivateProfileSection WritePrivateProfileSectionW
2961: #else
2962: #define WritePrivateProfileSection WritePrivateProfileSectionA
2963: #endif // !UNICODE
2964:
2965: DWORD
2966: APIENTRY
2967: GetDriveTypeA(
2968: LPSTR lpRootPathName
2969: );
2970: DWORD
2971: APIENTRY
2972: GetDriveTypeW(
2973: LPWSTR lpRootPathName
2974: );
2975: #ifdef UNICODE
2976: #define GetDriveType GetDriveTypeW
2977: #else
2978: #define GetDriveType GetDriveTypeA
2979: #endif // !UNICODE
2980:
2981: DWORD
2982: APIENTRY
2983: GetSystemDirectoryA(
2984: LPSTR lpBuffer,
2985: DWORD nSize
2986: );
2987: DWORD
2988: APIENTRY
2989: GetSystemDirectoryW(
2990: LPWSTR lpBuffer,
2991: DWORD nSize
2992: );
2993: #ifdef UNICODE
2994: #define GetSystemDirectory GetSystemDirectoryW
2995: #else
2996: #define GetSystemDirectory GetSystemDirectoryA
2997: #endif // !UNICODE
2998:
2999: DWORD
3000: APIENTRY
3001: GetTempPathA(
3002: DWORD nBufferLength,
3003: LPSTR lpBuffer
3004: );
3005: DWORD
3006: APIENTRY
3007: GetTempPathW(
3008: DWORD nBufferLength,
3009: LPWSTR lpBuffer
3010: );
3011: #ifdef UNICODE
3012: #define GetTempPath GetTempPathW
3013: #else
3014: #define GetTempPath GetTempPathA
3015: #endif // !UNICODE
3016:
3017: WORD
3018: APIENTRY
3019: GetTempFileNameA(
3020: LPSTR lpPathName,
3021: LPSTR lpPrefixString,
3022: WORD wUnique,
3023: LPSTR lpTempFileName
3024: );
3025: WORD
3026: APIENTRY
3027: GetTempFileNameW(
3028: LPWSTR lpPathName,
3029: LPWSTR lpPrefixString,
3030: WORD wUnique,
3031: LPWSTR lpTempFileName
3032: );
3033: #ifdef UNICODE
3034: #define GetTempFileName GetTempFileNameW
3035: #else
3036: #define GetTempFileName GetTempFileNameA
3037: #endif // !UNICODE
3038:
3039: DWORD
3040: APIENTRY
3041: GetWindowsDirectoryA(
3042: LPSTR lpBuffer,
3043: DWORD nSize
3044: );
3045: DWORD
3046: APIENTRY
3047: GetWindowsDirectoryW(
3048: LPWSTR lpBuffer,
3049: DWORD nSize
3050: );
3051: #ifdef UNICODE
3052: #define GetWindowsDirectory GetWindowsDirectoryW
3053: #else
3054: #define GetWindowsDirectory GetWindowsDirectoryA
3055: #endif // !UNICODE
3056:
3057: BOOL
3058: APIENTRY
3059: SetCurrentDirectoryA(
3060: LPSTR lpPathName
3061: );
3062: BOOL
3063: APIENTRY
3064: SetCurrentDirectoryW(
3065: LPWSTR lpPathName
3066: );
3067: #ifdef UNICODE
3068: #define SetCurrentDirectory SetCurrentDirectoryW
3069: #else
3070: #define SetCurrentDirectory SetCurrentDirectoryA
3071: #endif // !UNICODE
3072:
3073: DWORD
3074: APIENTRY
3075: GetCurrentDirectoryA(
3076: DWORD nBufferLength,
3077: LPSTR lpBuffer
3078: );
3079: DWORD
3080: APIENTRY
3081: GetCurrentDirectoryW(
3082: DWORD nBufferLength,
3083: LPWSTR lpBuffer
3084: );
3085: #ifdef UNICODE
3086: #define GetCurrentDirectory GetCurrentDirectoryW
3087: #else
3088: #define GetCurrentDirectory GetCurrentDirectoryA
3089: #endif // !UNICODE
3090:
3091: BOOL
3092: APIENTRY
3093: GetDiskFreeSpaceA(
3094: LPSTR lpRootPathName,
3095: LPDWORD lpSectorsPerCluster,
3096: LPDWORD lpBytesPerSector,
3097: LPDWORD lpNumberOfFreeClusters,
3098: LPDWORD lpTotalNumberOfClusters
3099: );
3100: BOOL
3101: APIENTRY
3102: GetDiskFreeSpaceW(
3103: LPWSTR lpRootPathName,
3104: LPDWORD lpSectorsPerCluster,
3105: LPDWORD lpBytesPerSector,
3106: LPDWORD lpNumberOfFreeClusters,
3107: LPDWORD lpTotalNumberOfClusters
3108: );
3109: #ifdef UNICODE
3110: #define GetDiskFreeSpace GetDiskFreeSpaceW
3111: #else
3112: #define GetDiskFreeSpace GetDiskFreeSpaceA
3113: #endif // !UNICODE
3114:
3115: BOOL
3116: APIENTRY
3117: CreateDirectoryA(
3118: LPSTR lpPathName,
3119: LPSECURITY_ATTRIBUTES lpSecurityAttributes
3120: );
3121: BOOL
3122: APIENTRY
3123: CreateDirectoryW(
3124: LPWSTR lpPathName,
3125: LPSECURITY_ATTRIBUTES lpSecurityAttributes
3126: );
3127: #ifdef UNICODE
3128: #define CreateDirectory CreateDirectoryW
3129: #else
3130: #define CreateDirectory CreateDirectoryA
3131: #endif // !UNICODE
3132:
3133: BOOL
3134: APIENTRY
3135: RemoveDirectoryA(
3136: LPSTR lpPathName
3137: );
3138: BOOL
3139: APIENTRY
3140: RemoveDirectoryW(
3141: LPWSTR lpPathName
3142: );
3143: #ifdef UNICODE
3144: #define RemoveDirectory RemoveDirectoryW
3145: #else
3146: #define RemoveDirectory RemoveDirectoryA
3147: #endif // !UNICODE
3148:
3149: DWORD
3150: APIENTRY
3151: GetFullPathNameA(
3152: LPSTR lpFileName,
3153: DWORD nBufferLength,
3154: LPSTR lpBuffer,
3155: LPSTR *lpFilePart
3156: );
3157: DWORD
3158: APIENTRY
3159: GetFullPathNameW(
3160: LPWSTR lpFileName,
3161: DWORD nBufferLength,
3162: LPWSTR lpBuffer,
3163: LPWSTR *lpFilePart
3164: );
3165: #ifdef UNICODE
3166: #define GetFullPathName GetFullPathNameW
3167: #else
3168: #define GetFullPathName GetFullPathNameA
3169: #endif // !UNICODE
3170:
3171: #define EXPAND_LOCAL_DRIVES
3172:
3173:
3174: HANDLE
3175: APIENTRY
3176: CreateFileA(
3177: LPSTR lpFileName,
3178: DWORD dwDesiredAccess,
3179: DWORD dwShareMode,
3180: LPSECURITY_ATTRIBUTES lpSecurityAttributes,
3181: DWORD dwCreationDisposition,
3182: DWORD dwFlagsAndAttributes,
3183: HANDLE hTemplateFile
3184: );
3185: HANDLE
3186: APIENTRY
3187: CreateFileW(
3188: LPWSTR lpFileName,
3189: DWORD dwDesiredAccess,
3190: DWORD dwShareMode,
3191: LPSECURITY_ATTRIBUTES lpSecurityAttributes,
3192: DWORD dwCreationDisposition,
3193: DWORD dwFlagsAndAttributes,
3194: HANDLE hTemplateFile
3195: );
3196: #ifdef UNICODE
3197: #define CreateFile CreateFileW
3198: #else
3199: #define CreateFile CreateFileA
3200: #endif // !UNICODE
3201:
3202: BOOL
3203: APIENTRY
3204: SetFileAttributesA(
3205: LPSTR lpFileName,
3206: DWORD dwFileAttributes
3207: );
3208: BOOL
3209: APIENTRY
3210: SetFileAttributesW(
3211: LPWSTR lpFileName,
3212: DWORD dwFileAttributes
3213: );
3214: #ifdef UNICODE
3215: #define SetFileAttributes SetFileAttributesW
3216: #else
3217: #define SetFileAttributes SetFileAttributesA
3218: #endif // !UNICODE
3219:
3220: DWORD
3221: APIENTRY
3222: GetFileAttributesA(
3223: LPSTR lpFileName
3224: );
3225: DWORD
3226: APIENTRY
3227: GetFileAttributesW(
3228: LPWSTR lpFileName
3229: );
3230: #ifdef UNICODE
3231: #define GetFileAttributes GetFileAttributesW
3232: #else
3233: #define GetFileAttributes GetFileAttributesA
3234: #endif // !UNICODE
3235:
3236: BOOL
3237: APIENTRY
3238: DeleteFileA(
3239: LPSTR lpFileName
3240: );
3241: BOOL
3242: APIENTRY
3243: DeleteFileW(
3244: LPWSTR lpFileName
3245: );
3246: #ifdef UNICODE
3247: #define DeleteFile DeleteFileW
3248: #else
3249: #define DeleteFile DeleteFileA
3250: #endif // !UNICODE
3251:
3252: HANDLE
3253: APIENTRY
3254: FindFirstFileA(
3255: LPSTR lpFileName,
3256: LPWIN32_FIND_DATAA lpFindFileData
3257: );
3258: HANDLE
3259: APIENTRY
3260: FindFirstFileW(
3261: LPWSTR lpFileName,
3262: LPWIN32_FIND_DATAW lpFindFileData
3263: );
3264: #ifdef UNICODE
3265: #define FindFirstFile FindFirstFileW
3266: #else
3267: #define FindFirstFile FindFirstFileA
3268: #endif // !UNICODE
3269:
3270: BOOL
3271: APIENTRY
3272: FindNextFileA(
3273: HANDLE hFindFile,
3274: LPWIN32_FIND_DATAA lpFindFileData
3275: );
3276: BOOL
3277: APIENTRY
3278: FindNextFileW(
3279: HANDLE hFindFile,
3280: LPWIN32_FIND_DATAW lpFindFileData
3281: );
3282: #ifdef UNICODE
3283: #define FindNextFile FindNextFileW
3284: #else
3285: #define FindNextFile FindNextFileA
3286: #endif // !UNICODE
3287:
3288: DWORD
3289: APIENTRY
3290: SearchPathA(
3291: LPSTR lpPath,
3292: LPSTR lpFileName,
3293: LPSTR lpExtension,
3294: DWORD nBufferLength,
3295: LPSTR lpBuffer,
3296: LPSTR *lpFilePart
3297: );
3298: DWORD
3299: APIENTRY
3300: SearchPathW(
3301: LPWSTR lpPath,
3302: LPWSTR lpFileName,
3303: LPWSTR lpExtension,
3304: DWORD nBufferLength,
3305: LPWSTR lpBuffer,
3306: LPWSTR *lpFilePart
3307: );
3308: #ifdef UNICODE
3309: #define SearchPath SearchPathW
3310: #else
3311: #define SearchPath SearchPathA
3312: #endif // !UNICODE
3313:
3314: BOOL
3315: APIENTRY
3316: CopyFileA(
3317: LPSTR lpExistingFileName,
3318: LPSTR lpNewFileName,
3319: BOOL bFailIfExists
3320: );
3321: BOOL
3322: APIENTRY
3323: CopyFileW(
3324: LPWSTR lpExistingFileName,
3325: LPWSTR lpNewFileName,
3326: BOOL bFailIfExists
3327: );
3328: #ifdef UNICODE
3329: #define CopyFile CopyFileW
3330: #else
3331: #define CopyFile CopyFileA
3332: #endif // !UNICODE
3333:
3334: BOOL
3335: APIENTRY
3336: MoveFileA(
3337: LPSTR lpExistingFileName,
3338: LPSTR lpNewFileName
3339: );
3340: BOOL
3341: APIENTRY
3342: MoveFileW(
3343: LPWSTR lpExistingFileName,
3344: LPWSTR lpNewFileName
3345: );
3346: #ifdef UNICODE
3347: #define MoveFile MoveFileW
3348: #else
3349: #define MoveFile MoveFileA
3350: #endif // !UNICODE
3351:
3352: HANDLE
3353: APIENTRY
3354: CreateNamedPipeA(
3355: LPSTR lpName,
3356: DWORD dwOpenMode,
3357: DWORD dwPipeMode,
3358: DWORD nMaxInstances,
3359: DWORD nOutBufferSize,
3360: DWORD nInBufferSize,
3361: DWORD nDefaultTimeOut,
3362: LPSECURITY_ATTRIBUTES lpSecurityAttributes
3363: );
3364: HANDLE
3365: APIENTRY
3366: CreateNamedPipeW(
3367: LPWSTR lpName,
3368: DWORD dwOpenMode,
3369: DWORD dwPipeMode,
3370: DWORD nMaxInstances,
3371: DWORD nOutBufferSize,
3372: DWORD nInBufferSize,
3373: DWORD nDefaultTimeOut,
3374: LPSECURITY_ATTRIBUTES lpSecurityAttributes
3375: );
3376: #ifdef UNICODE
3377: #define CreateNamedPipe CreateNamedPipeW
3378: #else
3379: #define CreateNamedPipe CreateNamedPipeA
3380: #endif // !UNICODE
3381:
3382: BOOL
3383: APIENTRY
3384: GetNamedPipeHandleStateA(
3385: HANDLE hNamedPipe,
3386: LPDWORD lpState,
3387: LPDWORD lpCurInstances,
3388: LPDWORD lpMaxCollectionCount,
3389: LPDWORD lpCollectDataTimeout,
3390: LPSTR lpUserName,
3391: DWORD nMaxUserNameSize
3392: );
3393: BOOL
3394: APIENTRY
3395: GetNamedPipeHandleStateW(
3396: HANDLE hNamedPipe,
3397: LPDWORD lpState,
3398: LPDWORD lpCurInstances,
3399: LPDWORD lpMaxCollectionCount,
3400: LPDWORD lpCollectDataTimeout,
3401: LPWSTR lpUserName,
3402: DWORD nMaxUserNameSize
3403: );
3404: #ifdef UNICODE
3405: #define GetNamedPipeHandleState GetNamedPipeHandleStateW
3406: #else
3407: #define GetNamedPipeHandleState GetNamedPipeHandleStateA
3408: #endif // !UNICODE
3409:
3410: BOOL
3411: APIENTRY
3412: CallNamedPipeA(
3413: LPSTR lpNamedPipeName,
3414: LPVOID lpInBuffer,
3415: DWORD nInBufferSize,
3416: LPVOID lpOutBuffer,
3417: DWORD nOutBufferSize,
3418: LPDWORD lpBytesRead,
3419: DWORD nTimeOut
3420: );
3421: BOOL
3422: APIENTRY
3423: CallNamedPipeW(
3424: LPWSTR lpNamedPipeName,
3425: LPVOID lpInBuffer,
3426: DWORD nInBufferSize,
3427: LPVOID lpOutBuffer,
3428: DWORD nOutBufferSize,
3429: LPDWORD lpBytesRead,
3430: DWORD nTimeOut
3431: );
3432: #ifdef UNICODE
3433: #define CallNamedPipe CallNamedPipeW
3434: #else
3435: #define CallNamedPipe CallNamedPipeA
3436: #endif // !UNICODE
3437:
3438: BOOL
3439: APIENTRY
3440: WaitNamedPipeA(
3441: LPSTR lpNamedPipeName,
3442: DWORD nTimeOut
3443: );
3444: BOOL
3445: APIENTRY
3446: WaitNamedPipeW(
3447: LPWSTR lpNamedPipeName,
3448: DWORD nTimeOut
3449: );
3450: #ifdef UNICODE
3451: #define WaitNamedPipe WaitNamedPipeW
3452: #else
3453: #define WaitNamedPipe WaitNamedPipeA
3454: #endif // !UNICODE
3455:
3456: BOOL
3457: APIENTRY
3458: GetVolumeInformationA(
3459: LPSTR lpRootPathName,
3460: LPSTR lpVolumeNameBuffer,
3461: DWORD nVolumeNameSize,
3462: LPDWORD lpVolumeSerialNumber,
3463: LPDWORD lpMaximumComponentLength,
3464: LPDWORD lpFileSystemFlags,
3465: LPSTR lpFileSystemNameBuffer,
3466: DWORD nFileSystemNameSize
3467: );
3468: BOOL
3469: APIENTRY
3470: GetVolumeInformationW(
3471: LPWSTR lpRootPathName,
3472: LPWSTR lpVolumeNameBuffer,
3473: DWORD nVolumeNameSize,
3474: LPDWORD lpVolumeSerialNumber,
3475: LPDWORD lpMaximumComponentLength,
3476: LPDWORD lpFileSystemFlags,
3477: LPWSTR lpFileSystemNameBuffer,
3478: DWORD nFileSystemNameSize
3479: );
3480: #ifdef UNICODE
3481: #define GetVolumeInformation GetVolumeInformationW
3482: #else
3483: #define GetVolumeInformation GetVolumeInformationA
3484: #endif // !UNICODE
3485:
3486: //
3487: // Private MVDM apis
3488: //
3489:
3490: VOID
3491: APIENTRY
3492: VDMOperationStarted(
3493: IN BOOL IsWowCaller
3494: );
3495:
3496: BOOL
3497: APIENTRY
3498: GetNextVDMCommand(
3499: PVDMINFO pVDMInfo
3500: );
3501:
3502: VOID
3503: APIENTRY
3504: ExitVDM(
3505: IN BOOL IsWowCaller,
3506: IN ULONG iWowTask
3507: );
3508: //
3509: // Event logging APIs
3510: //
3511: BOOL
3512: APIENTRY
3513: ClearEventLogA (
3514: IN HANDLE hEventLog,
3515: IN LPSTR lpBackupFileName
3516: );
3517: //
3518: // Event logging APIs
3519: //
3520: BOOL
3521: APIENTRY
3522: ClearEventLogW (
3523: IN HANDLE hEventLog,
3524: IN LPWSTR lpBackupFileName
3525: );
3526: #ifdef UNICODE
3527: #define ClearEventLog ClearEventLogW
3528: #else
3529: #define ClearEventLog ClearEventLogA
3530: #endif // !UNICODE
3531:
3532: BOOL
3533: APIENTRY
3534: CloseEventLog (
3535: IN HANDLE hEventLog
3536: );
3537:
3538: HANDLE
3539: APIENTRY
3540: OpenEventLogA (
3541: IN LPSTR lpUNCServerName,
3542: IN LPSTR lpModuleName
3543: );
3544: HANDLE
3545: APIENTRY
3546: OpenEventLogW (
3547: IN LPWSTR lpUNCServerName,
3548: IN LPWSTR lpModuleName
3549: );
3550: #ifdef UNICODE
3551: #define OpenEventLog OpenEventLogW
3552: #else
3553: #define OpenEventLog OpenEventLogA
3554: #endif // !UNICODE
3555:
3556: BOOL
3557: APIENTRY
3558: ReadEventLogA (
3559: IN HANDLE hEventLog,
3560: IN DWORD dwReadFlags,
3561: IN DWORD dwRecordOffset,
3562: OUT LPVOID lpBuffer,
3563: IN DWORD nNumberOfBytesToRead,
3564: OUT DWORD *pnBytesRead,
3565: OUT DWORD *pnMinNumberOfBytesNeeded
3566: );
3567: BOOL
3568: APIENTRY
3569: ReadEventLogW (
3570: IN HANDLE hEventLog,
3571: IN DWORD dwReadFlags,
3572: IN DWORD dwRecordOffset,
3573: OUT LPVOID lpBuffer,
3574: IN DWORD nNumberOfBytesToRead,
3575: OUT DWORD *pnBytesRead,
3576: OUT DWORD *pnMinNumberOfBytesNeeded
3577: );
3578: #ifdef UNICODE
3579: #define ReadEventLog ReadEventLogW
3580: #else
3581: #define ReadEventLog ReadEventLogA
3582: #endif // !UNICODE
3583:
3584: BOOL
3585: APIENTRY
3586: WriteEventLogEntryA (
3587: IN HANDLE hEventLog,
3588: IN WORD wType,
3589: IN DWORD dwEventID,
3590: IN PSID lpUserSid OPTIONAL,
3591: IN WORD wNumStrings,
3592: IN DWORD dwDataSize,
3593: IN LPSTR *lpStrings OPTIONAL,
3594: IN LPVOID lpRawData OPTIONAL
3595: );
3596: BOOL
3597: APIENTRY
3598: WriteEventLogEntryW (
3599: IN HANDLE hEventLog,
3600: IN WORD wType,
3601: IN DWORD dwEventID,
3602: IN PSID lpUserSid OPTIONAL,
3603: IN WORD wNumStrings,
3604: IN DWORD dwDataSize,
3605: IN LPWSTR *lpStrings OPTIONAL,
3606: IN LPVOID lpRawData OPTIONAL
3607: );
3608: #ifdef UNICODE
3609: #define WriteEventLogEntry WriteEventLogEntryW
3610: #else
3611: #define WriteEventLogEntry WriteEventLogEntryA
3612: #endif // !UNICODE
3613: //
3614: // DOS and OS/2 Compatible Error Code definitions returned by the Win32 Base
3615: // API functions.
3616: //
3617:
3618: #include <winerror.h>
3619:
3620: /* Abnormal termination codes */
3621:
3622: #define TC_NORMAL 0
3623: #define TC_HARDERR 1
3624: #define TC_GP_TRAP 2
3625: #define TC_SIGNAL 3
3626:
3627: #endif // _WINBASE_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.