--- /dev/null
+/* os2emx.h (emx+gcc) */
+
+#ifndef _OS2EMX_H
+#define _OS2EMX_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#pragma pack(1)
+
+/* ------------------------ INCL_ SYMBOLS --------------------------------- */
+
+#if defined (INCL_BASE)
+#define INCL_DOS
+#define INCL_DOSERRORS
+#define INCL_SUB
+#endif
+
+#if defined (INCL_DOS)
+#define INCL_DOSDATETIME
+#define INCL_DOSDEVICES
+#define INCL_DOSEXCEPTIONS
+#define INCL_DOSFILEMGR
+#define INCL_DOSMEMMGR
+#define INCL_DOSMISC
+#define INCL_DOSMVDM
+#define INCL_DOSMODULEMGR
+#define INCL_DOSNLS
+#define INCL_DOSPROCESS
+#define INCL_DOSPROFILE
+#define INCL_DOSRAS
+#define INCL_DOSQUEUES
+#define INCL_DOSRESOURCES
+#define INCL_DOSSEMAPHORES
+#define INCL_DOSSESMGR
+#endif
+
+#if defined (INCL_REXXSAA)
+#define INCL_RXSUBCOM
+#define INCL_RXSHV
+#define INCL_RXFUNC
+#define INCL_RXSYSEXIT
+#define INCL_RXMACRO
+#define INCL_RXARI
+#endif
+
+#if defined (INCL_SUB)
+#define INCL_KBD
+#define INCL_VIO
+#define INCL_MOU
+#endif
+
+#if defined (INCL_PM)
+#define INCL_AVIO
+#define INCL_FONTFILEFORMAT
+#define INCL_GPI
+#define INCL_SPL
+#define INCL_WIN
+#define INCL_WINWORKPLACE
+#endif
+
+#if defined (INCL_WIN) || defined (RC_INVOKED)
+#define INCL_WINACCELERATORS
+#define INCL_WINBUTTONS
+#define INCL_WINDIALOGS
+#define INCL_WINENTRYFIELDS
+#define INCL_WINFRAMECTLS
+#define INCL_WINFRAMEMGR
+#define INCL_WINHELP
+#define INCL_WININPUT
+#define INCL_WINLISTBOXES
+#define INCL_WINMENUS
+#define INCL_WINMESSAGEMGR
+#define INCL_WINMLE
+#define INCL_WINPOINTERS
+#define INCL_WINSCROLLBARS
+#define INCL_WINSTATICS
+#define INCL_WINSTDDLGS
+#define INCL_WINSYS
+#endif /* INCL_WIN || RC_INVOKED */
+
+#if defined (INCL_WIN)
+#define INCL_WINATOM
+#define INCL_WINCLIPBOARD
+#define INCL_WINCOUNTRY
+#define INCL_WINCURSORS
+#define INCL_WINDDE
+#define INCL_WINDESKTOP
+#define INCL_WINERRORS
+#define INCL_WINHOOKS
+#define INCL_WINLOAD
+#define INCL_WINPALETTE
+#define INCL_WINPROGRAMLIST
+#define INCL_WINRECTANGLES
+#define INCL_WINSHELLDATA
+#define INCL_WINSWITCHLIST
+#define INCL_WINTHUNKAPI
+#define INCL_WINTIMER
+#define INCL_WINTRACKRECT
+#define INCL_WINTYPES
+#define INCL_WINWINDOWMGR
+#endif /* INCL_WIN */
+
+#if defined (INCL_WINCOMMON)
+#define INCL_WINWINDOWMGR
+#endif
+
+#if defined (INCL_WINSTDDLGS)
+#define INCL_WINCIRCULARSLIDER
+#define INCL_WINSTDBOOK
+#define INCL_WINSTDCNR
+#define INCL_WINSTDDRAG
+#define INCL_WINSTDFILE
+#define INCL_WINSTDFONT
+#define INCL_WINSTDSLIDER
+#define INCL_WINSTDSPIN
+#define INCL_WINSTDVALSET
+#endif
+
+#if defined (INCL_WINSTDCNR) || defined (INCL_WINSTDVALSET)
+#define INCL_WINSTDDRAG
+#endif
+
+#if defined (INCL_WINMLE) && !defined (INCL_WINENTRYFIELDS)
+#define INCL_WINENTRYFIELDS
+#endif
+
+#if defined (INCL_WINWORKPLACE)
+#define INCL_WPCLASS
+#endif
+
+#if defined (INCL_GPI)
+#define INCL_GPIBITMAPS
+#define INCL_GPICONTROL
+#define INCL_GPICORRELATION
+#define INCL_GPIINK
+#define INCL_GPISEGMENTS
+#endif
+
+#if defined (INCL_ERRORS)
+#define INCL_DOSERRORS
+#define INCL_GPIERRORS
+#define INCL_SHLERRORS
+#define INCL_WINERRORS
+#endif
+
+#if defined (INCL_DDIDEFS)
+#define INCL_GPIBITMAPS
+#define INCL_GPIERRORS
+#endif
+
+#if defined (INCL_CIRCULARSLIDER) && !defined (INCL_WINCIRCULARSLIDER)
+#define INCL_WINCIRCULARSLIDER
+#endif
+
+/* ------------------------ DISABLE KEYWORDS ------------------------------ */
+
+#define APIENTRY
+#define EXPENTRY
+#define FAR
+
+/* ------------------------ CONSTANTS AND TYPES --------------------------- */
+
+#if !defined (FALSE)
+#define FALSE 0
+#endif
+
+#if !defined (TRUE)
+#define TRUE 1
+#endif
+
+#define VOID void
+
+#define NULLHANDLE ((LHANDLE)0)
+#define NULLSHANDLE ((SHANDLE)0)
+
+#if !defined (NULL)
+#if defined (__cplusplus)
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif
+
+typedef int INT; /* Required for Toolkit sample programs */
+typedef unsigned UINT;
+typedef unsigned long APIRET;
+
+typedef unsigned long BOOL;
+typedef BOOL *PBOOL;
+
+typedef unsigned long BOOL32;
+typedef BOOL *PBOOL32;
+
+typedef char CHAR;
+typedef CHAR *PCHAR;
+
+#if !defined (OS2EMX_PLAIN_CHAR)
+
+typedef unsigned char BYTE;
+typedef unsigned char *PCH;
+typedef unsigned char *PSZ;
+typedef __const__ unsigned char *PCCH;
+typedef __const__ unsigned char *PCSZ;
+
+#else
+
+typedef char BYTE;
+typedef char *PCH;
+typedef char *PSZ;
+typedef __const__ char *PCCH;
+typedef __const__ char *PCSZ;
+
+#endif
+
+typedef BYTE *PBYTE;
+
+typedef unsigned char UCHAR;
+typedef UCHAR *PUCHAR;
+
+typedef short SHORT;
+typedef SHORT *PSHORT;
+
+typedef unsigned short USHORT;
+typedef USHORT *PUSHORT;
+
+typedef long LONG;
+typedef LONG *PLONG;
+
+typedef unsigned long ULONG;
+typedef ULONG *PULONG;
+
+typedef VOID *PVOID;
+typedef PVOID *PPVOID;
+
+typedef __const__ VOID *CPVOID;
+
+typedef CHAR STR8[8];
+typedef STR8 *PSTR8;
+
+typedef CHAR STR16[16];
+typedef STR16 *PSTR16;
+typedef CHAR STR32[32];
+typedef STR32 *PSTR32;
+typedef CHAR STR64[64];
+typedef STR64 *PSTR64;
+
+typedef unsigned short SHANDLE;
+typedef unsigned long LHANDLE;
+
+typedef LHANDLE HPIPE;
+typedef HPIPE *PHPIPE;
+
+typedef LHANDLE HQUEUE;
+typedef HQUEUE *PHQUEUE;
+
+typedef LHANDLE HMODULE;
+typedef HMODULE *PHMODULE;
+
+typedef VOID *HSEM;
+typedef HSEM *PHSEM;
+
+typedef LHANDLE HOBJECT;
+
+typedef ULONG PID;
+typedef PID *PPID;
+
+typedef ULONG TID;
+typedef TID *PTID;
+
+typedef int (*PFN)();
+typedef PFN *PPFN;
+
+typedef USHORT SEL;
+typedef SEL *PSEL;
+
+typedef ULONG HMTX;
+typedef HMTX *PHMTX;
+
+typedef ULONG HMUX;
+typedef HMUX *PHMUX;
+
+
+#define FIELDOFFSET(t,f) ((SHORT)&(((t *)0)->f))
+
+#define MAKETYPE(v,t) (*((t *)&v))
+
+#define MAKEUSHORT(l,h) (((USHORT)(l)) | ((USHORT)(h))<<8)
+#define MAKESHORT(l,h) ((SHORT)MAKEUSHORT(l, h))
+
+#define MAKEULONG(l,h) ((ULONG)(((USHORT)(l)) | ((ULONG)((USHORT)(h)))<<16))
+#define MAKELONG(l,h) ((LONG)MAKEULONG(l, h))
+
+#define LOUCHAR(w) ((UCHAR)(w))
+#define HIUCHAR(w) ((UCHAR)((USHORT)(w)>>8))
+
+#define LOBYTE(x) LOUCHAR(x)
+#define HIBYTE(x) HIUCHAR(x)
+
+#define LOUSHORT(x) ((USHORT)((ULONG)(x)))
+#define HIUSHORT(x) ((USHORT)((ULONG)(x)>>16))
+
+/* ---------------------------- ERROR CODES ------------------------------- */
+
+#define WINERR_BASE 0x1000
+#define GPIERR_BASE 0x2000
+#define DEVERR_BASE 0x3000
+#define SPLERR_BASE 0x4000
+
+#define SEVERITY_NOERROR 0x0000
+#define SEVERITY_WARNING 0x0004
+#define SEVERITY_ERROR 0x0008
+#define SEVERITY_SEVERE 0x000c
+#define SEVERITY_UNRECOVERABLE 0x0010
+
+#if defined (INCL_DOSERRORS)
+
+#define NO_ERROR 0
+#define ERROR_INVALID_FUNCTION 1
+#define ERROR_FILE_NOT_FOUND 2
+#define ERROR_PATH_NOT_FOUND 3
+#define ERROR_TOO_MANY_OPEN_FILES 4
+#define ERROR_ACCESS_DENIED 5
+#define ERROR_INVALID_HANDLE 6
+#define ERROR_ARENA_TRASHED 7
+#define ERROR_NOT_ENOUGH_MEMORY 8
+#define ERROR_INVALID_BLOCK 9
+#define ERROR_BAD_ENVIRONMENT 10
+#define ERROR_BAD_FORMAT 11
+#define ERROR_INVALID_ACCESS 12
+#define ERROR_INVALID_DATA 13
+#define ERROR_INVALID_DRIVE 15
+#define ERROR_CURRENT_DIRECTORY 16
+#define ERROR_NOT_SAME_DEVICE 17
+#define ERROR_NO_MORE_FILES 18
+#define ERROR_WRITE_PROTECT 19
+#define ERROR_BAD_UNIT 20
+#define ERROR_NOT_READY 21
+#define ERROR_BAD_COMMAND 22
+#define ERROR_CRC 23
+#define ERROR_BAD_LENGTH 24
+#define ERROR_SEEK 25
+#define ERROR_NOT_DOS_DISK 26
+#define ERROR_SECTOR_NOT_FOUND 27
+#define ERROR_OUT_OF_PAPER 28
+#define ERROR_WRITE_FAULT 29
+#define ERROR_READ_FAULT 30
+#define ERROR_GEN_FAILURE 31
+#define ERROR_SHARING_VIOLATION 32
+#define ERROR_LOCK_VIOLATION 33
+#define ERROR_WRONG_DISK 34
+#define ERROR_FCB_UNAVAILABLE 35
+#define ERROR_SHARING_BUFFER_EXCEEDED 36
+#define ERROR_CODE_PAGE_MISMATCHED 37
+#define ERROR_HANDLE_EOF 38
+#define ERROR_HANDLE_DISK_FULL 39
+#define ERROR_NOT_SUPPORTED 50
+#define ERROR_REM_NOT_LIST 51
+#define ERROR_DUP_NAME 52
+#define ERROR_BAD_NETPATH 53
+#define ERROR_NETWORK_BUSY 54
+#define ERROR_DEV_NOT_EXIST 55
+#define ERROR_TOO_MANY_CMDS 56
+#define ERROR_ADAP_HDW_ERR 57
+#define ERROR_BAD_NET_RESP 58
+#define ERROR_UNEXP_NET_ERR 59
+#define ERROR_BAD_REM_ADAP 60
+#define ERROR_PRINTQ_FULL 61
+#define ERROR_NO_SPOOL_SPACE 62
+#define ERROR_PRINT_CANCELLED 63
+#define ERROR_NETNAME_DELETED 64
+#define ERROR_NETWORK_ACCESS_DENIED 65
+#define ERROR_BAD_DEV_TYPE 66
+#define ERROR_BAD_NET_NAME 67
+#define ERROR_TOO_MANY_NAMES 68
+#define ERROR_TOO_MANY_SESS 69
+#define ERROR_SHARING_PAUSED 70
+#define ERROR_REQ_NOT_ACCEP 71
+#define ERROR_REDIR_PAUSED 72
+#define ERROR_SBCS_ATT_WRITE_PROT 73
+#define ERROR_SBCS_GENERAL_FAILURE 74
+#define ERROR_XGA_OUT_MEMORY 75
+#define ERROR_FILE_EXISTS 80
+#define ERROR_DUP_FCB 81
+#define ERROR_CANNOT_MAKE 82
+#define ERROR_FAIL_I24 83
+#define ERROR_OUT_OF_STRUCTURES 84
+#define ERROR_ALREADY_ASSIGNED 85
+#define ERROR_INVALID_PASSWORD 86
+#define ERROR_INVALID_PARAMETER 87
+#define ERROR_NET_WRITE_FAULT 88
+#define ERROR_NO_PROC_SLOTS 89
+#define ERROR_NOT_FROZEN 90
+#define ERROR_SYS_COMP_NOT_LOADED 90 /*!*/
+#define ERR_TSTOVFL 91
+#define ERR_TSTDUP 92
+#define ERROR_NO_ITEMS 93
+#define ERROR_INTERRUPT 95
+#define ERROR_DEVICE_IN_USE 99
+#define ERROR_TOO_MANY_SEMAPHORES 100
+#define ERROR_EXCL_SEM_ALREADY_OWNED 101
+#define ERROR_SEM_IS_SET 102
+#define ERROR_TOO_MANY_SEM_REQUESTS 103
+#define ERROR_INVALID_AT_INTERRUPT_TIME 104
+#define ERROR_SEM_OWNER_DIED 105
+#define ERROR_SEM_USER_LIMIT 106
+#define ERROR_DISK_CHANGE 107
+#define ERROR_DRIVE_LOCKED 108
+#define ERROR_BROKEN_PIPE 109
+#define ERROR_OPEN_FAILED 110
+#define ERROR_BUFFER_OVERFLOW 111
+#define ERROR_DISK_FULL 112
+#define ERROR_NO_MORE_SEARCH_HANDLES 113
+#define ERROR_INVALID_TARGET_HANDLE 114
+#define ERROR_PROTECTION_VIOLATION 115
+#define ERROR_VIOKBD_REQUEST 116
+#define ERROR_INVALID_CATEGORY 117
+#define ERROR_INVALID_VERIFY_SWITCH 118
+#define ERROR_BAD_DRIVER_LEVEL 119
+#define ERROR_CALL_NOT_IMPLEMENTED 120
+#define ERROR_SEM_TIMEOUT 121
+#define ERROR_INSUFFICIENT_BUFFER 122
+#define ERROR_INVALID_NAME 123
+#define ERROR_INVALID_LEVEL 124
+#define ERROR_NO_VOLUME_LABEL 125
+#define ERROR_MOD_NOT_FOUND 126
+#define ERROR_PROC_NOT_FOUND 127
+#define ERROR_WAIT_NO_CHILDREN 128
+#define ERROR_CHILD_NOT_COMPLETE 129
+#define ERROR_DIRECT_ACCESS_HANDLE 130
+#define ERROR_NEGATIVE_SEEK 131
+#define ERROR_SEEK_ON_DEVICE 132
+#define ERROR_IS_JOIN_TARGET 133
+#define ERROR_IS_JOINED 134
+#define ERROR_IS_SUBSTED 135
+#define ERROR_NOT_JOINED 136
+#define ERROR_NOT_SUBSTED 137
+#define ERROR_JOIN_TO_JOIN 138
+#define ERROR_SUBST_TO_SUBST 139
+#define ERROR_JOIN_TO_SUBST 140
+#define ERROR_SUBST_TO_JOIN 141
+#define ERROR_BUSY_DRIVE 142
+#define ERROR_SAME_DRIVE 143
+#define ERROR_DIR_NOT_ROOT 144
+#define ERROR_DIR_NOT_EMPTY 145
+#define ERROR_IS_SUBST_PATH 146
+#define ERROR_IS_JOIN_PATH 147
+#define ERROR_PATH_BUSY 148
+#define ERROR_IS_SUBST_TARGET 149
+#define ERROR_SYSTEM_TRACE 150
+#define ERROR_INVALID_EVENT_COUNT 151
+#define ERROR_TOO_MANY_MUXWAITERS 152
+#define ERROR_INVALID_LIST_FORMAT 153
+#define ERROR_LABEL_TOO_LONG 154
+#define ERROR_TOO_MANY_TCBS 155
+#define ERROR_SIGNAL_REFUSED 156
+#define ERROR_DISCARDED 157
+#define ERROR_NOT_LOCKED 158
+#define ERROR_BAD_THREADID_ADDR 159
+#define ERROR_BAD_ARGUMENTS 160
+#define ERROR_BAD_PATHNAME 161
+#define ERROR_SIGNAL_PENDING 162
+#define ERROR_UNCERTAIN_MEDIA 163
+#define ERROR_MAX_THRDS_REACHED 164
+#define ERROR_MONITORS_NOT_SUPPORTED 165
+#define ERROR_UNC_DRIVER_NOT_INSTALLED 166
+#define ERROR_LOCK_FAILED 167
+#define ERROR_SWAPIO_FAILED 168
+#define ERROR_SWAPIN_FAILED 169
+#define ERROR_BUSY 170
+#define ERROR_CANCEL_VIOLATION 173
+#define ERROR_ATOMIC_LOCK_NOT_SUPPORTED 174
+#define ERROR_READ_LOCKS_NOT_SUPPORTED 175
+#define ERROR_INVALID_SEGMENT_NUMBER 180
+#define ERROR_INVALID_CALLGATE 181
+#define ERROR_INVALID_ORDINAL 182
+#define ERROR_ALREADY_EXISTS 183
+#define ERROR_NO_CHILD_PROCESS 184
+#define ERROR_CHILD_ALIVE_NOWAIT 185
+#define ERROR_INVALID_FLAG_NUMBER 186
+#define ERROR_SEM_NOT_FOUND 187
+#define ERROR_INVALID_STARTING_CODESEG 188
+#define ERROR_INVALID_STACKSEG 189
+#define ERROR_INVALID_MODULETYPE 190
+#define ERROR_INVALID_EXE_SIGNATURE 191
+#define ERROR_EXE_MARKED_INVALID 192
+#define ERROR_BAD_EXE_FORMAT 193
+#define ERROR_ITERATED_DATA_EXCEEDS_64K 194
+#define ERROR_INVALID_MINALLOCSIZE 195
+#define ERROR_DYNLINK_FROM_INVALID_RING 196
+#define ERROR_IOPL_NOT_ENABLED 197
+#define ERROR_INVALID_SEGDPL 198
+#define ERROR_AUTODATASEG_EXCEEDS_64K 199
+#define ERROR_RING2SEG_MUST_BE_MOVABLE 200
+#define ERROR_RELOCSRC_CHAIN_EXCEEDS_SEGLIMIT 201
+#define ERROR_INFLOOP_IN_RELOC_CHAIN 202
+#define ERROR_ENVVAR_NOT_FOUND 203
+#define ERROR_NOT_CURRENT_CTRY 204
+#define ERROR_NO_SIGNAL_SENT 205
+#define ERROR_FILENAME_EXCED_RANGE 206
+#define ERROR_RING2_STACK_IN_USE 207
+#define ERROR_META_EXPANSION_TOO_LONG 208
+#define ERROR_INVALID_SIGNAL_NUMBER 209
+#define ERROR_THREAD_1_INACTIVE 210
+#define ERROR_INFO_NOT_AVAIL 211
+#define ERROR_LOCKED 212
+#define ERROR_BAD_DYNALINK 213
+#define ERROR_TOO_MANY_MODULES 214
+#define ERROR_NESTING_NOT_ALLOWED 215
+#define ERROR_CANNOT_SHRINK 216
+#define ERROR_ZOMBIE_PROCESS 217
+#define ERROR_STACK_IN_HIGH_MEMORY 218
+#define ERROR_INVALID_EXITROUTINE_RING 219
+#define ERROR_GETBUF_FAILED 220
+#define ERROR_FLUSHBUF_FAILED 221
+#define ERROR_TRANSFER_TOO_LONG 222
+#define ERROR_FORCENOSWAP_FAILED 223
+#define ERROR_SMG_NO_TARGET_WINDOW 224
+#define ERROR_NO_CHILDREN 228
+#define ERROR_INVALID_SCREEN_GROUP 229
+#define ERROR_BAD_PIPE 230
+#define ERROR_PIPE_BUSY 231
+#define ERROR_NO_DATA 232
+#define ERROR_PIPE_NOT_CONNECTED 233
+#define ERROR_MORE_DATA 234
+#define ERROR_VC_DISCONNECTED 240
+#define ERROR_CIRCULARITY_REQUESTED 250
+#define ERROR_DIRECTORY_IN_CDS 251
+#define ERROR_INVALID_FSD_NAME 252
+#define ERROR_INVALID_PATH 253
+#define ERROR_INVALID_EA_NAME 254
+#define ERROR_EA_LIST_INCONSISTENT 255
+#define ERROR_EA_LIST_TOO_LONG 256
+#define ERROR_NO_META_MATCH 257
+#define ERROR_FINDNOTIFY_TIMEOUT 258
+#define ERROR_NO_MORE_ITEMS 259
+#define ERROR_SEARCH_STRUC_REUSED 260
+#define ERROR_CHAR_NOT_FOUND 261
+#define ERROR_TOO_MUCH_STACK 262
+#define ERROR_INVALID_ATTR 263
+#define ERROR_INVALID_STARTING_RING 264
+#define ERROR_INVALID_DLL_INIT_RING 265
+#define ERROR_CANNOT_COPY 266
+#define ERROR_DIRECTORY 267
+#define ERROR_OPLOCKED_FILE 268
+#define ERROR_OPLOCK_THREAD_EXISTS 269
+#define ERROR_VOLUME_CHANGED 270
+#define ERROR_FINDNOTIFY_HANDLE_IN_USE 271
+#define ERROR_FINDNOTIFY_HANDLE_CLOSED 272
+#define ERROR_NOTIFY_OBJECT_REMOVED 273
+#define ERROR_ALREADY_SHUTDOWN 274
+#define ERROR_EAS_DIDNT_FIT 275
+#define ERROR_EA_FILE_CORRUPT 276
+#define ERROR_EA_TABLE_FULL 277
+#define ERROR_INVALID_EA_HANDLE 278
+#define ERROR_NO_CLUSTER 279
+#define ERROR_CREATE_EA_FILE 280
+#define ERROR_CANNOT_OPEN_EA_FILE 281
+#define ERROR_EAS_NOT_SUPPORTED 282
+#define ERROR_NEED_EAS_FOUND 283
+#define ERROR_DUPLICATE_HANDLE 284
+#define ERROR_DUPLICATE_NAME 285
+#define ERROR_EMPTY_MUXWAIT 286
+#define ERROR_MUTEX_OWNED 287
+#define ERROR_NOT_OWNER 288
+#define ERROR_PARAM_TOO_SMALL 289
+#define ERROR_TOO_MANY_HANDLES 290
+#define ERROR_TOO_MANY_OPENS 291
+#define ERROR_WRONG_TYPE 292
+#define ERROR_UNUSED_CODE 293
+#define ERROR_THREAD_NOT_TERMINATED 294
+#define ERROR_INIT_ROUTINE_FAILED 295
+#define ERROR_MODULE_IN_USE 296
+#define ERROR_NOT_ENOUGH_WATCHPOINTS 297
+#define ERROR_TOO_MANY_POSTS 298
+#define ERROR_ALREADY_POSTED 299
+#define ERROR_ALREADY_RESET 300
+#define ERROR_SEM_BUSY 301
+#define ERROR_INVALID_PROCID 303
+#define ERROR_INVALID_PDELTA 304
+#define ERROR_NOT_DESCENDANT 305
+#define ERROR_NOT_SESSION_MANAGER 306
+#define ERROR_INVALID_PCLASS 307
+#define ERROR_INVALID_SCOPE 308
+#define ERROR_INVALID_THREADID 309
+#define ERROR_DOSSUB_SHRINK 310
+#define ERROR_DOSSUB_NOMEM 311
+#define ERROR_DOSSUB_OVERLAP 312
+#define ERROR_DOSSUB_BADSIZE 313
+#define ERROR_DOSSUB_BADFLAG 314
+#define ERROR_DOSSUB_BADSELECTOR 315
+#define ERROR_MR_MSG_TOO_LONG 316
+#define ERROR_MR_MID_NOT_FOUND 317
+#define ERROR_MR_UN_ACC_MSGF 318
+#define ERROR_MR_INV_MSGF_FORMAT 319
+#define ERROR_MR_INV_IVCOUNT 320
+#define ERROR_MR_UN_PERFORM 321
+#define ERROR_TS_WAKEUP 322
+#define ERROR_TS_SEMHANDLE 323
+#define ERROR_TS_NOTIMER 324
+#define ERROR_TS_HANDLE 326
+#define ERROR_TS_DATETIME 327
+#define ERROR_SYS_INTERNAL 328
+#define ERROR_QUE_CURRENT_NAME 329
+#define ERROR_QUE_PROC_NOT_OWNED 330
+#define ERROR_QUE_PROC_OWNED 331
+#define ERROR_QUE_DUPLICATE 332
+#define ERROR_QUE_ELEMENT_NOT_EXIST 333
+#define ERROR_QUE_NO_MEMORY 334
+#define ERROR_QUE_INVALID_NAME 335
+#define ERROR_QUE_INVALID_PRIORITY 336
+#define ERROR_QUE_INVALID_HANDLE 337
+#define ERROR_QUE_LINK_NOT_FOUND 338
+#define ERROR_QUE_MEMORY_ERROR 339
+#define ERROR_QUE_PREV_AT_END 340
+#define ERROR_QUE_PROC_NO_ACCESS 341
+#define ERROR_QUE_EMPTY 342
+#define ERROR_QUE_NAME_NOT_EXIST 343
+#define ERROR_QUE_NOT_INITIALIZED 344
+#define ERROR_QUE_UNABLE_TO_ACCESS 345
+#define ERROR_QUE_UNABLE_TO_ADD 346
+#define ERROR_QUE_UNABLE_TO_INIT 347
+#define ERROR_VIO_INVALID_MASK 349
+#define ERROR_VIO_PTR 350
+#define ERROR_VIO_APTR 351
+#define ERROR_VIO_RPTR 352
+#define ERROR_VIO_CPTR 353
+#define ERROR_VIO_LPTR 354
+#define ERROR_VIO_MODE 355
+#define ERROR_VIO_WIDTH 356
+#define ERROR_VIO_ATTR 357
+#define ERROR_VIO_ROW 358
+#define ERROR_VIO_COL 359
+#define ERROR_VIO_TOPROW 360
+#define ERROR_VIO_BOTROW 361
+#define ERROR_VIO_RIGHTCOL 362
+#define ERROR_VIO_LEFTCOL 363
+#define ERROR_SCS_CALL 364
+#define ERROR_SCS_VALUE 365
+#define ERROR_VIO_WAIT_FLAG 366
+#define ERROR_VIO_UNLOCK 367
+#define ERROR_SGS_NOT_SESSION_MGR 368
+#define ERROR_SMG_INVALID_SGID 369
+#define ERROR_SMG_INVALID_SESSION_ID 369 /*!*/
+#define ERROR_SMG_NOSG 370
+#define ERROR_SMG_NO_SESSIONS 370 /*!*/
+#define ERROR_SMG_GRP_NOT_FOUND 371
+#define ERROR_SMG_SESSION_NOT_FOUND 371 /*!*/
+#define ERROR_SMG_SET_TITLE 372
+#define ERROR_KBD_PARAMETER 373
+#define ERROR_KBD_NO_DEVICE 374
+#define ERROR_KBD_INVALID_IOWAIT 375
+#define ERROR_KBD_INVALID_LENGTH 376
+#define ERROR_KBD_INVALID_ECHO_MASK 377
+#define ERROR_KBD_INVALID_INPUT_MASK 378
+#define ERROR_MON_INVALID_PARMS 379
+#define ERROR_MON_INVALID_DEVNAME 380
+#define ERROR_MON_INVALID_HANDLE 381
+#define ERROR_MON_BUFFER_TOO_SMALL 382
+#define ERROR_MON_BUFFER_EMPTY 383
+#define ERROR_MON_DATA_TOO_LARGE 384
+#define ERROR_MOUSE_NO_DEVICE 385
+#define ERROR_MOUSE_INV_HANDLE 386
+#define ERROR_MOUSE_INV_PARMS 387
+#define ERROR_MOUSE_CANT_RESET 388
+#define ERROR_MOUSE_DISPLAY_PARMS 389
+#define ERROR_MOUSE_INV_MODULE 390
+#define ERROR_MOUSE_INV_ENTRY_PT 391
+#define ERROR_MOUSE_INV_MASK 392
+#define NO_ERROR_MOUSE_NO_DATA 393
+#define NO_ERROR_MOUSE_PTR_DRAWN 394
+#define ERROR_INVALID_FREQUENCY 395
+#define ERROR_NLS_NO_COUNTRY_FILE 396
+#define ERROR_NLS_OPEN_FAILED 397
+#define ERROR_NLS_NO_CTRY_CODE 398
+#define ERROR_NLS_TABLE_TRUNCATED 399
+#define ERROR_NLS_BAD_TYPE 400
+#define ERROR_NLS_TYPE_NOT_FOUND 401
+#define ERROR_VIO_SMG_ONLY 402
+#define ERROR_VIO_INVALID_ASCIIZ 403
+#define ERROR_VIO_DEREGISTER 404
+#define ERROR_VIO_NO_POPUP 405
+#define ERROR_VIO_EXISTING_POPUP 406
+#define ERROR_KBD_SMG_ONLY 407
+#define ERROR_KBD_INVALID_ASCIIZ 408
+#define ERROR_KBD_INVALID_MASK 409
+#define ERROR_KBD_REGISTER 410
+#define ERROR_KBD_DEREGISTER 411
+#define ERROR_MOUSE_SMG_ONLY 412
+#define ERROR_MOUSE_INVALID_ASCIIZ 413
+#define ERROR_MOUSE_INVALID_MASK 414
+#define ERROR_MOUSE_REGISTER 415
+#define ERROR_MOUSE_DEREGISTER 416
+#define ERROR_SMG_BAD_ACTION 417
+#define ERROR_SMG_INVALID_CALL 418
+#define ERROR_SCS_SG_NOTFOUND 419
+#define ERROR_SCS_NOT_SHELL 420
+#define ERROR_VIO_INVALID_PARMS 421
+#define ERROR_VIO_FUNCTION_OWNED 422
+#define ERROR_VIO_RETURN 423
+#define ERROR_SCS_INVALID_FUNCTION 424
+#define ERROR_SCS_NOT_SESSION_MGR 425
+#define ERROR_VIO_REGISTER 426
+#define ERROR_VIO_NO_MODE_THREAD 427
+#define ERROR_VIO_NO_SAVE_RESTORE_THD 428
+#define ERROR_VIO_IN_BG 429
+#define ERROR_VIO_ILLEGAL_DURING_POPUP 430
+#define ERROR_SMG_NOT_BASESHELL 431
+#define ERROR_SMG_BAD_STATUSREQ 432
+#define ERROR_QUE_INVALID_WAIT 433
+#define ERROR_VIO_LOCK 434
+#define ERROR_MOUSE_INVALID_IOWAIT 435
+#define ERROR_VIO_INVALID_HANDLE 436
+#define ERROR_VIO_ILLEGAL_DURING_LOCK 437
+#define ERROR_VIO_INVALID_LENGTH 438
+#define ERROR_KBD_INVALID_HANDLE 439
+#define ERROR_KBD_NO_MORE_HANDLE 440
+#define ERROR_KBD_CANNOT_CREATE_KCB 441
+#define ERROR_KBD_CODEPAGE_LOAD_INCOMPL 442
+#define ERROR_KBD_INVALID_CODEPAGE_ID 443
+#define ERROR_KBD_NO_CODEPAGE_SUPPORT 444
+#define ERROR_KBD_FOCUS_REQUIRED 445
+#define ERROR_KBD_FOCUS_ALREADY_ACTIVE 446
+#define ERROR_KBD_KEYBOARD_BUSY 447
+#define ERROR_KBD_INVALID_CODEPAGE 448
+#define ERROR_KBD_UNABLE_TO_FOCUS 449
+#define ERROR_SMG_SESSION_NON_SELECT 450
+#define ERROR_SMG_SESSION_NOT_FOREGRND 451
+#define ERROR_SMG_SESSION_NOT_PARENT 452
+#define ERROR_SMG_INVALID_START_MODE 453
+#define ERROR_SMG_INVALID_RELATED_OPT 454
+#define ERROR_SMG_INVALID_BOND_OPTION 455
+#define ERROR_SMG_INVALID_SELECT_OPT 456
+#define ERROR_SMG_START_IN_BACKGROUND 457
+#define ERROR_SMG_INVALID_STOP_OPTION 458
+#define ERROR_SMG_BAD_RESERVE 459
+#define ERROR_SMG_PROCESS_NOT_PARENT 460
+#define ERROR_SMG_INVALID_DATA_LENGTH 461
+#define ERROR_SMG_NOT_BOUND 462
+#define ERROR_SMG_RETRY_SUB_ALLOC 463
+#define ERROR_KBD_DETACHED 464
+#define ERROR_VIO_DETACHED 465
+#define ERROR_MOU_DETACHED 466
+#define ERROR_VIO_FONT 467
+#define ERROR_VIO_USER_FONT 468
+#define ERROR_VIO_BAD_CP 469
+#define ERROR_VIO_NO_CP 470
+#define ERROR_VIO_NA_CP 471
+#define ERROR_INVALID_CODE_PAGE 472
+#define ERROR_CPLIST_TOO_SMALL 473
+#define ERROR_CP_NOT_MOVED 474
+#define ERROR_MODE_SWITCH_INIT 475
+#define ERROR_CODE_PAGE_NOT_FOUND 476
+#define ERROR_UNEXPECTED_SLOT_RETURNED 477
+#define ERROR_SMG_INVALID_TRACE_OPTION 478
+#define ERROR_VIO_INTERNAL_RESOURCE 479
+#define ERROR_VIO_SHELL_INIT 480
+#define ERROR_SMG_NO_HARD_ERRORS 481
+#define ERROR_CP_SWITCH_INCOMPLETE 482
+#define ERROR_VIO_TRANSPARENT_POPUP 483
+#define ERROR_CRITSEC_OVERFLOW 484
+#define ERROR_CRITSEC_UNDERFLOW 485
+#define ERROR_VIO_BAD_RESERVE 486
+#define ERROR_INVALID_ADDRESS 487
+#define ERROR_ZERO_SELECTORS_REQUESTED 488
+#define ERROR_NOT_ENOUGH_SELECTORS_AVA 489
+#define ERROR_INVALID_SELECTOR 490
+#define ERROR_SMG_INVALID_PROGRAM_TYPE 491
+#define ERROR_SMG_INVALID_PGM_CONTROL 492
+#define ERROR_SMG_INVALID_INHERIT_OPT 493
+#define ERROR_VIO_EXTENDED_SG 494
+#define ERROR_VIO_NOT_PRES_MGR_SG 495
+#define ERROR_VIO_SHIELD_OWNED 496
+#define ERROR_VIO_NO_MORE_HANDLES 497
+#define ERROR_VIO_SEE_ERROR_LOG 498
+#define ERROR_VIO_ASSOCIATED_DC 499
+#define ERROR_KBD_NO_CONSOLE 500
+#define ERROR_MOUSE_NO_CONSOLE 501
+#define ERROR_MOUSE_INVALID_HANDLE 502
+#define ERROR_SMG_INVALID_DEBUG_PARMS 503
+#define ERROR_KBD_EXTENDED_SG 504
+#define ERROR_MOU_EXTENDED_SG 505
+#define ERROR_SMG_INVALID_ICON_FILE 506
+#define ERROR_TRC_PID_NON_EXISTENT 507
+#define ERROR_TRC_COUNT_ACTIVE 508
+#define ERROR_TRC_SUSPENDED_BY_COUNT 509
+#define ERROR_TRC_COUNT_INACTIVE 510
+#define ERROR_TRC_COUNT_REACHED 511
+#define ERROR_NO_MC_TRACE 512
+#define ERROR_MC_TRACE 513
+#define ERROR_TRC_COUNT_ZERO 514
+#define ERROR_SMG_TOO_MANY_DDS 515
+#define ERROR_SMG_INVALID_NOTIFICATION 516
+#define ERROR_LF_INVALID_FUNCTION 517
+#define ERROR_LF_NOT_AVAIL 518
+#define ERROR_LF_SUSPENDED 519
+#define ERROR_LF_BUF_TOO_SMALL 520
+#define ERROR_LF_BUFFER_CORRUPTED 521
+#define ERROR_LF_BUFFER_FULL 521 /*!*/
+#define ERROR_LF_INVALID_DAEMON 522
+#define ERROR_LF_INVALID_RECORD 522 /*!*/
+#define ERROR_LF_INVALID_TEMPL 523
+#define ERROR_LF_INVALID_SERVICE 523 /*!*/
+#define ERROR_LF_GENERAL_FAILURE 524
+#define ERROR_LF_INVALID_ID 525
+#define ERROR_LF_INVALID_HANDLE 526
+#define ERROR_LF_NO_ID_AVAIL 527
+#define ERROR_LF_TEMPLATE_AREA_FULL 528
+#define ERROR_LF_ID_IN_USE 529
+#define ERROR_MOU_NOT_INITIALIZED 530
+#define ERROR_MOUINITREAL_DONE 531
+#define ERROR_DOSSUB_CORRUPTED 532
+#define ERROR_MOUSE_CALLER_NOT_SUBSYS 533
+#define ERROR_ARITHMETIC_OVERFLOW 534
+#define ERROR_TMR_NO_DEVICE 535
+#define ERROR_TMR_INVALID_TIME 536
+#define ERROR_PVW_INVALID_ENTITY 537
+#define ERROR_PVW_INVALID_ENTITY_TYPE 538
+#define ERROR_PVW_INVALID_SPEC 539
+#define ERROR_PVW_INVALID_RANGE_TYPE 540
+#define ERROR_PVW_INVALID_COUNTER_BLK 541
+#define ERROR_PVW_INVALID_TEXT_BLK 542
+#define ERROR_PRF_NOT_INITIALIZED 543
+#define ERROR_PRF_ALREADY_INITIALIZED 544
+#define ERROR_PRF_NOT_STARTED 545
+#define ERROR_PRF_ALREADY_STARTED 546
+#define ERROR_PRF_TIMER_OUT_OF_RANGE 547
+#define ERROR_PRF_TIMER_RESET 548
+#define ERROR_VDD_LOCK_USEAGE_DENIED 639
+#define ERROR_TIMEOUT 640
+#define ERROR_VDM_DOWN 641
+#define ERROR_VDM_LIMIT 642
+#define ERROR_VDD_NOT_FOUND 643
+#define ERROR_INVALID_CALLER 644
+#define ERROR_PID_MISMATCH 645
+#define ERROR_INVALID_VDD_HANDLE 646
+#define ERROR_VLPT_NO_SPOOLER 647
+#define ERROR_VCOM_DEVICE_BUSY 648
+#define ERROR_VLPT_DEVICE_BUSY 649
+#define ERROR_NESTING_TOO_DEEP 650
+#define ERROR_VDD_MISSING 651
+#define ERROR_BIDI_INVALID_LENGTH 671
+#define ERROR_BIDI_INVALID_INCREMENT 672
+#define ERROR_BIDI_INVALID_COMBINATION 673
+#define ERROR_BIDI_INVALID_RESERVED 674
+#define ERROR_BIDI_INVALID_EFFECT 675
+#define ERROR_BIDI_INVALID_CSDREC 676
+#define ERROR_BIDI_INVALID_CSDSTATE 677
+#define ERROR_BIDI_INVALID_LEVEL 678
+#define ERROR_BIDI_INVALID_TYPE_SUPPORT 679
+#define ERROR_BIDI_INVALID_ORIENTATION 680
+#define ERROR_BIDI_INVALID_NUM_SHAPE 681
+#define ERROR_BIDI_INVALID_CSD 682
+#define ERROR_BIDI_NO_SUPPORT 683
+#define NO_ERROR_BIDI_RW_INCOMPLETE 684
+#define ERROR_IMP_INVALID_PARM 691
+#define ERROR_IMP_INVALID_LENGTH 692
+#define ERROR_MON_BAD_BUFFER 730
+#define ERROR_MODULE_CORRUPTED 731
+#define ERROR_SM_OUTOF_SWAPFILE 1477
+#define ERROR_LF_TIMEOUT 2055
+#define ERROR_LF_SUSPEND_SUCCESS 2057
+#define ERROR_LF_RESUME_SUCCESS 2058
+#define ERROR_LF_REDIRECT_SUCCESS 2059
+#define ERROR_LF_REDIRECT_FAILURE 2060
+#define ERROR_SWAPPER_NOT_ACTIVE 32768
+#define ERROR_INVALID_SWAPID 32769
+#define ERROR_IOERR_SWAP_FILE 32770
+#define ERROR_SWAP_TABLE_FULL 32771
+#define ERROR_SWAP_FILE_FULL 32772
+#define ERROR_CANT_INIT_SWAPPER 32773
+#define ERROR_SWAPPER_ALREADY_INIT 32774
+#define ERROR_PMM_INSUFFICIENT_MEMORY 32775
+#define ERROR_PMM_INVALID_FLAGS 32776
+#define ERROR_PMM_INVALID_ADDRESS 32777
+#define ERROR_PMM_LOCK_FAILED 32778
+#define ERROR_PMM_UNLOCK_FAILED 32779
+#define ERROR_PMM_MOVE_INCOMPLETE 32780
+#define ERROR_UCOM_DRIVE_RENAMED 32781
+#define ERROR_UCOM_FILENAME_TRUNCATED 32782
+#define ERROR_UCOM_BUFFER_LENGTH 32783
+#define ERROR_MON_CHAIN_HANDLE 32784
+#define ERROR_MON_NOT_REGISTERED 32785
+#define ERROR_SMG_ALREADY_TOP 32786
+#define ERROR_PMM_ARENA_MODIFIED 32787
+#define ERROR_SMG_PRINTER_OPEN 32788
+#define ERROR_PMM_SET_FLAGS_FAILED 32789
+#define ERROR_INVALID_DOS_DD 32790
+#define ERROR_BLOCKED 32791
+#define ERROR_NOBLOCK 32792
+#define ERROR_INSTANCE_SHARED 32793
+#define ERROR_NO_OBJECT 32794
+#define ERROR_PARTIAL_ATTACH 32795
+#define ERROR_INCACHE 32796
+#define ERROR_SWAP_IO_PROBLEMS 32797
+#define ERROR_CROSSES_OBJECT_BOUNDARY 32798
+#define ERROR_LONGLOCK 32799
+#define ERROR_SHORTLOCK 32800
+#define ERROR_UVIRTLOCK 32801
+#define ERROR_ALIASLOCK 32802
+#define ERROR_ALIAS 32803
+#define ERROR_NO_MORE_HANDLES 32804
+#define ERROR_SCAN_TERMINATED 32805
+#define ERROR_TERMINATOR_NOT_FOUND 32806
+#define ERROR_NOT_DIRECT_CHILD 32807
+#define ERROR_DELAY_FREE 32808
+#define ERROR_GUARDPAGE 32809
+#define ERROR_SWAPERROR 32900
+#define ERROR_LDRERROR 32901
+#define ERROR_NOMEMORY 32902
+#define ERROR_NOACCESS 32903
+#define ERROR_NO_DLL_TERM 32904
+#define ERROR_CPSIO_CODE_PAGE_INVALID 65026
+#define ERROR_CPSIO_NO_SPOOLER 65027
+#define ERROR_CPSIO_FONT_ID_INVALID 65028
+#define ERROR_CPSIO_INTERNAL_ERROR 65033
+#define ERROR_CPSIO_INVALID_PTR_NAME 65034
+#define ERROR_CPSIO_NOT_ACTIVE 65037
+#define ERROR_CPSIO_PID_FULL 65039
+#define ERROR_CPSIO_PID_NOT_FOUND 65040
+#define ERROR_CPSIO_READ_CTL_SEQ 65043
+#define ERROR_CPSIO_READ_FNT_DEF 65045
+#define ERROR_CPSIO_WRITE_ERROR 65047
+#define ERROR_CPSIO_WRITE_FULL_ERROR 65048
+#define ERROR_CPSIO_WRITE_HANDLE_BAD 65049
+#define ERROR_CPSIO_SWIT_LOAD 65074
+#define ERROR_CPSIO_INV_COMMAND 65077
+#define ERROR_CPSIO_NO_FONT_SWIT 65078
+#define ERROR_ENTRY_IS_CALLGATE 65079
+
+#endif /* INCL_DOSERRORS */
+
+/* ----------------------------- ERRORS ----------------------------------- */
+
+#if defined (INCL_DOSERRORS)
+
+#define ERRACT_RETRY 1
+#define ERRACT_DLYRET 2
+#define ERRACT_USER 3
+#define ERRACT_ABORT 4
+#define ERRACT_PANIC 5
+#define ERRACT_IGNORE 6
+#define ERRACT_INTRET 7
+
+#define ERRCLASS_OUTRES 1
+#define ERRCLASS_TEMPSIT 2
+#define ERRCLASS_AUTH 3
+#define ERRCLASS_INTRN 4
+#define ERRCLASS_HRDFAIL 5
+#define ERRCLASS_SYSFAIL 6
+#define ERRCLASS_APPERR 7
+#define ERRCLASS_NOTFND 8
+#define ERRCLASS_BADFMT 9
+#define ERRCLASS_LOCKED 10
+#define ERRCLASS_MEDIA 11
+#define ERRCLASS_ALREADY 12
+#define ERRCLASS_UNK 13
+#define ERRCLASS_CANT 14
+#define ERRCLASS_TIME 15
+
+#define ERRLOC_UNK 1
+#define ERRLOC_DISK 2
+#define ERRLOC_NET 3
+#define ERRLOC_SERDEV 4
+#define ERRLOC_MEM 5
+
+#endif /* INCL_DOSERRORS */
+
+#if defined (INCL_DOSMISC)
+
+#define FERR_DISABLEHARDERR 0x0000L
+#define FERR_ENABLEHARDERR 0x0001L
+#define FERR_ENABLEEXCEPTION 0x0000L
+#define FERR_DISABLEEXCEPTION 0x0002L
+
+#define BEGIN_LIBPATH 1
+#define END_LIBPATH 2
+
+ULONG DosErrClass (ULONG ulCode, PULONG pulClass, PULONG pulAction,
+ PULONG pulLocus);
+ULONG DosError (ULONG ulError);
+ULONG DosQueryExtLIBPATH (PCSZ pszExtLIBPATH, ULONG flags);
+ULONG DosSetExtLIBPATH (PCSZ pszExtLIBPATH, ULONG flags);
+
+#endif /* INCL_DOSMISC */
+
+/* ----------------------------- FONTS ------------------------------------ */
+
+#define FACESIZE 32
+
+#define FATTR_SEL_ITALIC 0x0001
+#define FATTR_SEL_UNDERSCORE 0x0002
+#define FATTR_SEL_OUTLINE 0x0008
+#define FATTR_SEL_STRIKEOUT 0x0010
+#define FATTR_SEL_BOLD 0x0020
+
+#define FATTR_TYPE_KERNING 0x0004
+#define FATTR_TYPE_MBCS 0x0008
+#define FATTR_TYPE_DBCS 0x0010
+#define FATTR_TYPE_ANTIALIASED 0x0020
+
+#define FATTR_FONTUSE_NOMIX 0x0002
+#define FATTR_FONTUSE_OUTLINE 0x0004
+#define FATTR_FONTUSE_TRANSFORMABLE 0x0008
+
+#define FM_TYPE_FIXED 0x0001
+#define FM_TYPE_LICENSED 0x0002
+#define FM_TYPE_KERNING 0x0004
+#define FM_TYPE_DBCS 0x0010
+#define FM_TYPE_MBCS 0x0018
+#define FM_TYPE_64K 0x8000
+#define FM_TYPE_ATOMS 0x4000
+#define FM_TYPE_FAMTRUNC 0x2000
+#define FM_TYPE_FACETRUNC 0x1000
+
+#define FM_DEFN_OUTLINE 0x0001
+#define FM_DEFN_IFI 0x0002
+#define FM_DEFN_WIN 0x0004
+#define FM_DEFN_GENERIC 0x8000
+
+#define FM_SEL_ITALIC 0x0001
+#define FM_SEL_UNDERSCORE 0x0002
+#define FM_SEL_NEGATIVE 0x0004
+#define FM_SEL_OUTLINE 0x0008
+#define FM_SEL_STRIKEOUT 0x0010
+#define FM_SEL_BOLD 0x0020
+#define FM_SEL_ISO9241_TESTED 0x0040
+
+#define FM_CAP_NOMIX 0x0001
+
+#define FM_ISO_9518_640 0x01
+#define FM_ISO_9515_640 0x02
+#define FM_ISO_9515_1024 0x04
+#define FM_ISO_9517_640 0x08
+#define FM_ISO_9517_1024 0x10
+
+
+typedef struct _PANOSE
+{
+ BYTE bFamilyType;
+ BYTE bSerifStyle;
+ BYTE bWeight;
+ BYTE bProportion;
+ BYTE bContrast;
+ BYTE bStrokeVariation;
+ BYTE bArmStyle;
+ BYTE bLetterform;
+ BYTE bMidline;
+ BYTE bXHeight;
+ BYTE fbPassedISO;
+ BYTE fbFailedISO;
+} PANOSE;
+
+typedef struct _FONTMETRICS
+{
+ CHAR szFamilyname[FACESIZE];
+ CHAR szFacename[FACESIZE];
+ USHORT idRegistry;
+ USHORT usCodePage;
+ LONG lEmHeight;
+ LONG lXHeight;
+ LONG lMaxAscender;
+ LONG lMaxDescender;
+ LONG lLowerCaseAscent;
+ LONG lLowerCaseDescent;
+ LONG lInternalLeading;
+ LONG lExternalLeading;
+ LONG lAveCharWidth;
+ LONG lMaxCharInc;
+ LONG lEmInc;
+ LONG lMaxBaselineExt;
+ SHORT sCharSlope;
+ SHORT sInlineDir;
+ SHORT sCharRot;
+ USHORT usWeightClass;
+ USHORT usWidthClass;
+ SHORT sXDeviceRes;
+ SHORT sYDeviceRes;
+ SHORT sFirstChar;
+ SHORT sLastChar;
+ SHORT sDefaultChar;
+ SHORT sBreakChar;
+ SHORT sNominalPointSize;
+ SHORT sMinimumPointSize;
+ SHORT sMaximumPointSize;
+ USHORT fsType;
+ USHORT fsDefn;
+ USHORT fsSelection;
+ USHORT fsCapabilities;
+ LONG lSubscriptXSize;
+ LONG lSubscriptYSize;
+ LONG lSubscriptXOffset;
+ LONG lSubscriptYOffset;
+ LONG lSuperscriptXSize;
+ LONG lSuperscriptYSize;
+ LONG lSuperscriptXOffset;
+ LONG lSuperscriptYOffset;
+ LONG lUnderscoreSize;
+ LONG lUnderscorePosition;
+ LONG lStrikeoutSize;
+ LONG lStrikeoutPosition;
+ SHORT sKerningPairs;
+ SHORT sFamilyClass;
+ LONG lMatch;
+ LONG FamilyNameAtom;
+ LONG FaceNameAtom;
+ PANOSE panose;
+} FONTMETRICS;
+typedef FONTMETRICS *PFONTMETRICS;
+
+typedef struct _FATTRS
+{
+ USHORT usRecordLength;
+ USHORT fsSelection;
+ LONG lMatch;
+ CHAR szFacename[FACESIZE];
+ USHORT idRegistry;
+ USHORT usCodePage;
+ LONG lMaxBaselineExt;
+ LONG lAveCharWidth;
+ USHORT fsType;
+ USHORT fsFontUse;
+} FATTRS;
+typedef FATTRS *PFATTRS;
+
+/* ------------------------- MEMORY MANAGEMENT ---------------------------- */
+
+#if defined (INCL_DOSMEMMGR) || !defined (INCL_NOCOMMON)
+
+#define PAG_READ 0x0001
+#define PAG_WRITE 0x0002
+#define PAG_EXECUTE 0x0004
+#define PAG_GUARD 0x0008
+#define PAG_COMMIT 0x0010
+#define PAG_DECOMMIT 0x0020
+#define OBJ_TILE 0x0040
+#define OBJ_PROTECTED 0x0080
+#define OBJ_GETTABLE 0x0100
+#define OBJ_GIVEABLE 0x0200
+#define PAG_DEFAULT 0x0400
+#define PAG_SHARED 0x2000
+#define PAG_FREE 0x4000
+#define PAG_BASE 0x00010000
+
+#define DOSSUB_INIT 0x0001
+#define DOSSUB_GROW 0x0002
+#define DOSSUB_SPARSE_OBJ 0x0004
+#define DOSSUB_SERIALIZE 0x0008
+
+#define fPERM (PAG_EXECUTE | PAG_READ | PAG_WRITE)
+#define fSHARE (OBJ_GETTABLE | OBJ_GIVEABLE)
+#define fALLOC (fPERM | OBJ_TILE | PAG_COMMIT)
+#define fALLOCSHR (fPERM | fSHARE | OBJ_TILE | PAG_COMMIT)
+#define fGETNMSHR (fPERM)
+#define fGETSHR (fPERM)
+#define fGIVESHR (fPERM)
+#define fSET (fPERM|PAG_COMMIT|PAG_DECOMMIT|PAG_DEFAULT)
+
+ULONG DosAllocMem (PPVOID pBaseAddress, ULONG ulObjectSize,
+ ULONG ulAllocationFlags);
+ULONG DosAllocSharedMem (PPVOID pBaseAddress, PCSZ pszName,
+ ULONG ulObjectSize, ULONG ulAllocationFlags);
+ULONG DosFreeMem (PVOID pBaseAddress);
+ULONG DosGetNamedSharedMem (PPVOID pBaseAddress, PCSZ pszSharedMemName,
+ ULONG ulAttributeFlags);
+ULONG DosGetSharedMem (CPVOID pBaseAddress, ULONG ulAttributeFlags);
+ULONG DosGiveSharedMem (CPVOID pBaseAddress, PID idProcessId,
+ ULONG ulAttributeFlags);
+ULONG DosQueryMem (CPVOID pBaseAddress, PULONG pulRegionSize,
+ PULONG pulAllocationFlags);
+ULONG DosSetMem (CPVOID pBaseAddress, ULONG ulRegionSize,
+ ULONG ulAttributeFlags);
+ULONG DosSubAllocMem (PVOID pOffset, PPVOID pBlockOffset, ULONG ulSize);
+ULONG DosSubFreeMem (PVOID pOffset, PVOID pBlockOffset, ULONG ulSize);
+ULONG DosSubSetMem (PVOID pOffset, ULONG ulFlags, ULONG ulSize);
+ULONG DosSubUnsetMem (PVOID pOffset);
+
+#endif /* INCL_DOSMEMMGR || !INCL_NOCOMMON */
+
+/* --------------------------- FILE SYSTEM -------------------------------- */
+
+#define CCHMAXPATH 260
+#define CCHMAXPATHCOMP 256
+
+#if defined (INCL_DOSMISC)
+#define DSP_IMPLIEDCUR 1
+#define DSP_PATHREF 2
+#define DSP_IGNORENETERR 4
+#endif
+
+#if defined (INCL_DOSFILEMGR) || !defined (INCL_NOCOMMON)
+
+#define DCPY_EXISTING 0x0001
+#define DCPY_APPEND 0x0002
+#define DCPY_FAILEAS 0x0004
+
+#define DSPI_WRTTHRU 0x0010
+
+#define EAT_BINARY 0xfffe
+#define EAT_ASCII 0xfffd
+#define EAT_BITMAP 0xfffb
+#define EAT_METAFILE 0xfffa
+#define EAT_ICON 0xfff9
+#define EAT_EA 0xffee
+#define EAT_MVMT 0xffdf
+#define EAT_MVST 0xffde
+#define EAT_ASN1 0xffdd
+
+#define ENUMEA_LEVEL_NO_VALUE 1
+
+#define ENUMEA_REFTYPE_FHANDLE 0
+#define ENUMEA_REFTYPE_PATH 1
+#define ENUMEA_REFTYPE_MAX ENUMEA_REFTYPE_PATH
+
+#define ENUMEA_REFTYPE_FHANDLE 0
+#define ENUMEA_REFTYPE_PATH 1
+
+#define FEA_NEEDEA 0x80
+
+#define FHB_DSKREMOTE 0x8000
+#define FHB_CHRDEVREMOTE 0x8000
+#define FHB_PIPEREMOTE 0x8000
+
+#define FHT_DISKFILE 0x0000
+#define FHT_CHRDEV 0x0001
+#define FHT_PIPE 0x0002
+
+#define FIL_STANDARD 1
+#define FIL_QUERYEASIZE 2
+#define FIL_QUERYEASFROMLIST 3
+#define FIL_QUERYFULLNAME 5 /* DosQueryPathInfo */
+
+#define FILE_BEGIN 0
+#define FILE_CURRENT 1
+#define FILE_END 2
+
+#define FILE_NORMAL 0x0000
+#define FILE_READONLY 0x0001
+#define FILE_HIDDEN 0x0002
+#define FILE_SYSTEM 0x0004
+#define FILE_DIRECTORY 0x0010
+#define FILE_ARCHIVED 0x0020
+
+#define FILE_IGNORE 0x10000
+
+#define FILE_EXISTED 0x0001
+#define FILE_CREATED 0x0002
+#define FILE_TRUNCATED 0x0003
+
+#define FILE_OPEN 0x0001
+#define FILE_TRUNCATE 0x0002
+#define FILE_CREATE 0x0010
+
+#define FS_ATTACH 0
+#define FS_DETACH 1
+#define FS_SPOOLATTACH 2
+#define FS_SPOOLDETACH 3
+
+#define FSAIL_QUERYNAME 1
+#define FSAIL_DEVNUMBER 2
+#define FSAIL_DRVNUMBER 3
+
+#define FSAT_CHARDEV 1
+#define FSAT_PSEUDODEV 2
+#define FSAT_LOCALDRV 3
+#define FSAT_REMOTEDRV 4
+
+#define FSCTL_HANDLE 1
+#define FSCTL_PATHNAME 2
+#define FSCTL_FSDNAME 3
+
+#define FSCTL_ERROR_INFO 1
+#define FSCTL_MAX_EASIZE 2
+#define FSCTL_GET_NEXT_ROUTE_NAME 3
+#define FSCTL_DAEMON_QUERY 4
+
+#define FSCTL_QUERY_COMPLETE 0
+#define FSCTL_QUERY_AGAIN 1
+
+#define FSIL_ALLOC 1
+#define FSIL_VOLSER 2
+
+#define HANDTYPE_FILE 0x0000
+#define HANDTYPE_DEVICE 0x0001
+#define HANDTYPE_PIPE 0x0002
+#define HANDTYPE_PROTECTED 0x4000
+#define HANDTYPE_NETWORK 0x8000
+
+#define HDIR_SYSTEM 1
+#define HDIR_CREATE ((HDIR)-1)
+
+#define MUST_HAVE_READONLY (FILE_READONLY | (FILE_READONLY << 8))
+#define MUST_HAVE_HIDDEN (FILE_HIDDEN | (FILE_HIDDEN << 8))
+#define MUST_HAVE_SYSTEM (FILE_SYSTEM | (FILE_SYSTEM << 8))
+#define MUST_HAVE_DIRECTORY (FILE_DIRECTORY | (FILE_DIRECTORY << 8))
+#define MUST_HAVE_ARCHIVED (FILE_ARCHIVED | (FILE_ARCHIVED << 8))
+
+#define OPEN_ACTION_FAIL_IF_EXISTS 0x0000
+#define OPEN_ACTION_OPEN_IF_EXISTS 0x0001
+#define OPEN_ACTION_REPLACE_IF_EXISTS 0x0002
+#define OPEN_ACTION_FAIL_IF_NEW 0x0000
+#define OPEN_ACTION_CREATE_IF_NEW 0x0010
+
+#define OPEN_ACCESS_READONLY 0x0000
+#define OPEN_ACCESS_WRITEONLY 0x0001
+#define OPEN_ACCESS_READWRITE 0x0002
+
+#define OPEN_SHARE_DENYREADWRITE 0x0010
+#define OPEN_SHARE_DENYWRITE 0x0020
+#define OPEN_SHARE_DENYREAD 0x0030
+#define OPEN_SHARE_DENYNONE 0x0040
+
+#define OPEN_FLAGS_NOINHERIT 0x0080
+#define OPEN_FLAGS_NO_LOCALITY 0x0000
+#define OPEN_FLAGS_SEQUENTIAL 0x0100
+#define OPEN_FLAGS_RANDOM 0x0200
+#define OPEN_FLAGS_RANDOMSEQUENTIAL 0x0300
+#define OPEN_FLAGS_NO_CACHE 0x1000
+#define OPEN_FLAGS_FAIL_ON_ERROR 0x2000
+#define OPEN_FLAGS_WRITE_THROUGH 0x4000
+#define OPEN_FLAGS_DASD 0x8000
+#define OPEN_FLAGS_NONSPOOLED 0x40000
+#define OPEN_FLAGS_PROTECTED_HANDLE 0x40000000
+
+#define SEARCH_PATH 0x0000
+#define SEARCH_CUR_DIRECTORY 0x0001
+#define SEARCH_ENVIRONMENT 0x0002
+#define SEARCH_IGNORENETERRS 0x0004
+
+
+typedef LHANDLE HFILE;
+typedef HFILE *PHFILE;
+
+typedef ULONG FHLOCK;
+typedef PULONG PFHLOCK;
+
+typedef LHANDLE HDIR;
+typedef HDIR *PHDIR;
+
+
+typedef struct _FTIME
+{
+ USHORT twosecs : 5;
+ USHORT minutes : 6;
+ USHORT hours : 5;
+} FTIME;
+typedef FTIME *PFTIME;
+
+typedef struct _FDATE
+{
+ USHORT day : 5;
+ USHORT month : 4;
+ USHORT year : 7;
+} FDATE;
+typedef FDATE *PFDATE;
+
+typedef struct _FEA
+{
+ BYTE fEA;
+ BYTE cbName;
+ USHORT cbValue;
+} FEA;
+typedef FEA *PFEA;
+
+typedef struct _FEALIST
+{
+ ULONG cbList;
+ FEA list[1];
+} FEALIST;
+typedef FEALIST *PFEALIST;
+
+typedef struct _GEA
+{
+ BYTE cbName;
+ CHAR szName[1];
+} GEA;
+typedef GEA *PGEA;
+
+typedef struct _GEALIST
+{
+ ULONG cbList;
+ GEA list[1];
+} GEALIST;
+typedef GEALIST *PGEALIST;
+
+typedef struct _EAOP
+{
+ PGEALIST fpGEAList;
+ PFEALIST fpFEAList;
+ ULONG oError;
+} EAOP;
+typedef EAOP *PEAOP;
+
+typedef struct _FEA2
+{
+ ULONG oNextEntryOffset;
+ BYTE fEA;
+ BYTE cbName;
+ USHORT cbValue;
+ CHAR szName[1];
+} FEA2;
+typedef FEA2 *PFEA2;
+
+typedef struct _FEA2LIST
+{
+ ULONG cbList;
+ FEA2 list[1];
+} FEA2LIST;
+typedef FEA2LIST *PFEA2LIST;
+
+typedef struct _GEA2
+{
+ ULONG oNextEntryOffset;
+ BYTE cbName;
+ CHAR szName[1];
+} GEA2;
+typedef GEA2 *PGEA2;
+
+typedef struct _GEA2LIST
+{
+ ULONG cbList;
+ GEA2 list[1];
+} GEA2LIST;
+typedef GEA2LIST *PGEA2LIST;
+
+typedef struct _EAOP2
+{
+ PGEA2LIST fpGEA2List;
+ PFEA2LIST fpFEA2List;
+ ULONG oError;
+} EAOP2;
+typedef EAOP2 *PEAOP2;
+
+typedef struct _DENA1
+{
+ UCHAR reserved;
+ UCHAR cbName;
+ USHORT cbValue;
+ UCHAR szName[1];
+} DENA1;
+typedef DENA1 *PDENA1;
+
+typedef FEA2 DENA2;
+typedef PFEA2 PDENA2;
+
+typedef struct _EASIZEBUF
+{
+ USHORT cbMaxEASize;
+ ULONG cbMaxEAListSize; /* Packed? */
+} EASIZEBUF;
+typedef EASIZEBUF *PEASIZEBUF;
+
+typedef struct _ROUTENAMEBUF
+{
+ ULONG hRouteHandle;
+ UCHAR szRouteName;
+} ROUTENAMEBUF;
+typedef ROUTENAMEBUF *PROUTENAMEBUF;
+
+typedef struct _FSDTHREAD
+{
+ USHORT usFunc;
+ USHORT usStackSize;
+ ULONG ulPriorityClass;
+ LONG lPriorityLevel;
+} FSDTHREAD;
+
+typedef struct _FSDDAEMON
+{
+ USHORT usNumThreads;
+ USHORT usMoreFlag;
+ USHORT usCallInstance;
+ FSDTHREAD tdThrds[16];
+} FSDDAEMON;
+
+typedef struct _FILEFINDBUF
+{
+ FDATE fdateCreation;
+ FTIME ftimeCreation;
+ FDATE fdateLastAccess;
+ FTIME ftimeLastAccess;
+ FDATE fdateLastWrite;
+ FTIME ftimeLastWrite;
+ ULONG cbFile;
+ ULONG cbFileAlloc;
+ USHORT attrFile;
+ UCHAR cchName;
+ CHAR achName[CCHMAXPATHCOMP];
+} FILEFINDBUF;
+typedef FILEFINDBUF *PFILEFINDBUF;
+
+typedef struct _FILEFINDBUF2
+{
+ FDATE fdateCreation;
+ FTIME ftimeCreation;
+ FDATE fdateLastAccess;
+ FTIME ftimeLastAccess;
+ FDATE fdateLastWrite;
+ FTIME ftimeLastWrite;
+ ULONG cbFile;
+ ULONG cbFileAlloc;
+ USHORT attrFile;
+ ULONG cbList;
+ UCHAR cchName;
+ CHAR achName[CCHMAXPATHCOMP];
+} FILEFINDBUF2;
+typedef FILEFINDBUF2 *PFILEFINDBUF2;
+
+typedef struct _FILEFINDBUF3
+{
+ ULONG oNextEntryOffset;
+ FDATE fdateCreation;
+ FTIME ftimeCreation;
+ FDATE fdateLastAccess;
+ FTIME ftimeLastAccess;
+ FDATE fdateLastWrite;
+ FTIME ftimeLastWrite;
+ ULONG cbFile;
+ ULONG cbFileAlloc;
+ ULONG attrFile;
+ UCHAR cchName;
+ CHAR achName[CCHMAXPATHCOMP];
+} FILEFINDBUF3;
+typedef FILEFINDBUF3 *PFILEFINDBUF3;
+
+typedef struct _FILEFINDBUF4
+{
+ ULONG oNextEntryOffset;
+ FDATE fdateCreation;
+ FTIME ftimeCreation;
+ FDATE fdateLastAccess;
+ FTIME ftimeLastAccess;
+ FDATE fdateLastWrite;
+ FTIME ftimeLastWrite;
+ ULONG cbFile;
+ ULONG cbFileAlloc;
+ ULONG attrFile;
+ ULONG cbList;
+ UCHAR cchName;
+ CHAR achName[CCHMAXPATHCOMP];
+} FILEFINDBUF4;
+typedef FILEFINDBUF4 *PFILEFINDBUF4;
+
+typedef struct _FILELOCK
+{
+ LONG lOffset;
+ LONG lRange;
+} FILELOCK;
+typedef FILELOCK *PFILELOCK;
+
+typedef struct _FILESTATUS
+{
+ FDATE fdateCreation;
+ FTIME ftimeCreation;
+ FDATE fdateLastAccess;
+ FTIME ftimeLastAccess;
+ FDATE fdateLastWrite;
+ FTIME ftimeLastWrite;
+ ULONG cbFile;
+ ULONG cbFileAlloc;
+ USHORT attrFile;
+} FILESTATUS;
+typedef FILESTATUS *PFILESTATUS;
+
+typedef struct _FILESTATUS2
+{
+ FDATE fdateCreation;
+ FTIME ftimeCreation;
+ FDATE fdateLastAccess;
+ FTIME ftimeLastAccess;
+ FDATE fdateLastWrite;
+ FTIME ftimeLastWrite;
+ ULONG cbFile;
+ ULONG cbFileAlloc;
+ USHORT attrFile;
+ ULONG cbList;
+} FILESTATUS2;
+typedef FILESTATUS2 *PFILESTATUS2;
+
+typedef struct _FILESTATUS3
+{
+ FDATE fdateCreation;
+ FTIME ftimeCreation;
+ FDATE fdateLastAccess;
+ FTIME ftimeLastAccess;
+ FDATE fdateLastWrite;
+ FTIME ftimeLastWrite;
+ ULONG cbFile;
+ ULONG cbFileAlloc;
+ ULONG attrFile;
+} FILESTATUS3;
+typedef FILESTATUS3 *PFILESTATUS3;
+
+typedef struct _FILESTATUS4
+{
+ FDATE fdateCreation;
+ FTIME ftimeCreation;
+ FDATE fdateLastAccess;
+ FTIME ftimeLastAccess;
+ FDATE fdateLastWrite;
+ FTIME ftimeLastWrite;
+ ULONG cbFile;
+ ULONG cbFileAlloc;
+ ULONG attrFile;
+ ULONG cbList;
+} FILESTATUS4;
+typedef FILESTATUS4 *PFILESTATUS4;
+
+typedef struct _FSALLOCATE
+{
+ ULONG idFileSystem;
+ ULONG cSectorUnit;
+ ULONG cUnit;
+ ULONG cUnitAvail;
+ USHORT cbSector;
+} FSALLOCATE;
+typedef FSALLOCATE *PFSALLOCATE;
+
+typedef struct _FSQBUFFER
+{
+ USHORT iType;
+ USHORT cbName;
+ UCHAR szName[1];
+ USHORT cbFSDName;
+ UCHAR szFSDName[1];
+ USHORT cbFSAData;
+ UCHAR rgFSAData[1];
+} FSQBUFFER;
+typedef FSQBUFFER *PFSQBUFFER;
+
+typedef struct _FSQBUFFER2
+{
+ USHORT iType;
+ USHORT cbName;
+ USHORT cbFSDName;
+ USHORT cbFSAData;
+ UCHAR szName[1];
+ UCHAR szFSDName[1];
+ UCHAR rgFSAData[1];
+} FSQBUFFER2;
+typedef FSQBUFFER2 *PFSQBUFFER2;
+
+typedef struct _SPOOLATTACH
+{
+ USHORT hNmPipe;
+ ULONG ulKey;
+} SPOOLATTACH;
+typedef SPOOLATTACH *PSPOOLATTACH;
+
+typedef struct _VOLUMELABEL
+{
+ BYTE cch;
+ CHAR szVolLabel[12];
+} VOLUMELABEL;
+typedef VOLUMELABEL *PVOLUMELABEL;
+
+typedef struct _FSINFO
+{
+ FDATE fdateCreation;
+ FTIME ftimeCreation;
+ VOLUMELABEL vol;
+} FSINFO;
+typedef FSINFO *PFSINFO;
+
+
+ULONG DosCancelLockRequest (HFILE hFile, __const__ FILELOCK *pfl);
+ULONG DosClose (HFILE hFile);
+ULONG DosCopy (PCSZ pszSource, PCSZ pszTarget, ULONG ulOption);
+ULONG DosCreateDir (PCSZ pszDirName, PEAOP2 pEABuf);
+ULONG DosDelete (PCSZ pszFileName);
+ULONG DosDeleteDir (PCSZ pszDirName);
+ULONG DosDupHandle (HFILE hFile, PHFILE phFile);
+ULONG DosEditName (ULONG ulLevel, PCSZ pszSource, PCSZ pszEdit,
+ PBYTE pszTargetBuf, ULONG ulTargetBufLength);
+ULONG DosEnumAttribute (ULONG ulRefType, CPVOID pvFile, ULONG ulEntry,
+ PVOID pvBuf, ULONG ulBufLength, PULONG pulCount, ULONG ulInfoLevel);
+ULONG DosFindClose (HDIR hDir);
+ULONG DosFindFirst (PCSZ pszFileSpec, PHDIR phDir, ULONG flAttribute,
+ PVOID pFindBuf, ULONG ulFindBufLength, PULONG pulFileNames,
+ ULONG ulInfoLevel);
+ULONG DosFindNext (HDIR hDir, PVOID pFindBuf, ULONG ulFindBufLength,
+ PULONG pulFileNames);
+ULONG DosForceDelete (PCSZ pszFileName);
+ULONG DosFSAttach (PCSZ pszDevice, PCSZ pszFilesystem,
+ __const__ VOID *pData, ULONG ulDataLength, ULONG ulFlag);
+ULONG DosFSCtl (PVOID pData, ULONG ulDataLengthMax, PULONG pulDataLength,
+ PVOID pParmList, ULONG ulParmLengthMax, PULONG pulParmLength,
+ ULONG ulFunction, PCSZ pszRouteName, HFILE hFile, ULONG ulMethod);
+ULONG DosMove (PCSZ pszOldName, PCSZ pszNewName);
+ULONG DosOpen (PCSZ pszFileName, PHFILE phFile, PULONG pulAction,
+ ULONG ulFileSize, ULONG ulAttribute, ULONG ulOpenFlags, ULONG ulOpenMode,
+ PEAOP2 pEABuf);
+ULONG DosProtectClose (HFILE hFile, FHLOCK fhFileHandleLockID);
+ULONG DosProtectEnumAttribute (ULONG ulRefType, CPVOID pvFile,
+ ULONG ulEntry, PVOID pvBuf, ULONG ulBufLength, PULONG pulCount,
+ ULONG ulInfoLevel, FHLOCK fhFileHandleLockID);
+ULONG DosProtectOpen (PCSZ pszFileName, PHFILE phFile, PULONG pulAction,
+ ULONG ulFileSize, ULONG ulAttribute, ULONG ulOpenFlags, ULONG ulOpenMode,
+ PEAOP2 pEABuf, PFHLOCK pfhFileHandleLockID);
+ULONG DosProtectQueryFHState (HFILE hFile, PULONG pulMode,
+ FHLOCK fhFileHandleLockID);
+ULONG DosProtectQueryFileInfo (HFILE hFile, ULONG ulInfoLevel,
+ PVOID pInfoBuffer, ULONG ulInfoLength, FHLOCK fhFileHandleLockID);
+ULONG DosProtectRead (HFILE hFile, PVOID pBuffer, ULONG ulLength,
+ PULONG pulBytesRead, FHLOCK fhFileHandleLockID);
+ULONG DosProtectSetFHState (HFILE hFile, ULONG ulMode,
+ FHLOCK fhFileHandleLockID);
+ULONG DosProtectSetFileInfo (HFILE hFile, ULONG ulInfoLevel, PVOID pInfoBuffer,
+ ULONG ulInfoLength, FHLOCK fhFileHandleLockID);
+ULONG DosProtectSetFileLocks (HFILE hFile, __const__ FILELOCK *pflUnlock,
+ __const__ FILELOCK *pflLock, ULONG ulTimeout, ULONG ulFlags,
+ FHLOCK fhFileHandleLockID);
+ULONG DosProtectSetFilePtr (HFILE hFile, LONG lOffset, ULONG ulOrigin,
+ PULONG pulPos, FHLOCK fhFileHandleLockID);
+ULONG DosProtectSetFileSize (HFILE hFile, ULONG ulSize,
+ FHLOCK fhFileHandleLockID);
+ULONG DosProtectWrite (HFILE hFile, CPVOID pBuffer, ULONG ulLength,
+ PULONG pulBytesWritten, FHLOCK fhFileHandleLockID);
+ULONG DosQueryCurrentDir (ULONG ulDrive, PBYTE pPath, PULONG pulPathLength);
+ULONG DosQueryCurrentDisk (PULONG pulDrive, PULONG pulLogical);
+ULONG DosQueryFHState (HFILE hFile, PULONG pulMode);
+ULONG DosQueryFileInfo (HFILE hFile, ULONG ulInfoLevel, PVOID pInfoBuffer,
+ ULONG ulInfoLength);
+ULONG DosQueryFSAttach (PCSZ pszDeviceName, ULONG ulOrdinal,
+ ULONG ulFSAInfoLevel, PFSQBUFFER2 pfsqb, PULONG pulBufLength);
+ULONG DosQueryFSInfo (ULONG ulDrive, ULONG ulInfoLevel, PVOID pBuf,
+ ULONG ulBufLength);
+ULONG DosQueryHType (HFILE hFile, PULONG pulType, PULONG pulAttr);
+ULONG DosQueryPathInfo (PCSZ pszPathName, ULONG ulInfoLevel,
+ PVOID pInfoBuffer, ULONG ulInfoLength);
+ULONG DosQueryVerify (PBOOL32 pVerify);
+ULONG DosRead (HFILE hFile, PVOID pBuffer, ULONG ulLength,
+ PULONG pulBytesRead);
+ULONG DosResetBuffer (HFILE hf);
+ULONG DosSetCurrentDir (PCSZ pszDir);
+ULONG DosSetDefaultDisk (ULONG ulDrive);
+ULONG DosSetFHState (HFILE hFile, ULONG ulMode);
+ULONG DosSetFileInfo (HFILE hFile, ULONG ulInfoLevel, PVOID pInfoBuffer,
+ ULONG ulInfoLength);
+ULONG DosSetFileLocks (HFILE hFile, __const__ FILELOCK *pflUnlock,
+ __const__ FILELOCK *pflLock, ULONG ulTimeout, ULONG ulFlags);
+ULONG DosSetFilePtr (HFILE hFile, LONG lOffset, ULONG ulOrigin, PULONG pulPos);
+ULONG DosSetFileSize (HFILE hFile, ULONG ulSize);
+ULONG DosSetFSInfo (ULONG ulDrive, ULONG ulInfoLevel, PVOID pBuf,
+ ULONG ulBufLength);
+ULONG DosSetMaxFH (ULONG ulCount);
+ULONG DosSetPathInfo (PCSZ pszPathName, ULONG ulInfoLevel, PVOID pInfoBuffer,
+ ULONG ulInfoLength, ULONG ulOptions);
+ULONG DosSetRelMaxFH (PLONG pulReqCount, PULONG pulCurMaxFH);
+ULONG DosSetVerify (BOOL32 f32Verify);
+ULONG DosShutdown (ULONG ulReserved);
+ULONG DosWrite (HFILE hFile, CPVOID pBuffer, ULONG ulLength,
+ PULONG pulBytesWritten);
+
+#endif /* INCL_DOSFILEMGR || !INCL_NOCOMMON */
+
+
+#if defined (INCL_DOSMISC)
+ULONG DosSearchPath (ULONG ulControl, PCSZ pszPath, PCSZ pszFilename,
+ PBYTE pBuf, ULONG ulBufLength);
+#endif /* INCL_DOSMISC */
+
+/* ---------------------------- DEVICE I/O -------------------------------- */
+
+#if defined (INCL_DOSDEVICES)
+
+#define DEVINFO_PRINTER 0
+#define DEVINFO_RS232 1
+#define DEVINFO_FLOPPY 2
+#define DEVINFO_COPROCESSOR 3
+#define DEVINFO_SUBMODEL 4
+#define DEVINFO_MODEL 5
+#define DEVINFO_ADAPTER 6
+
+#define INFO_COUNT_PARTITIONABLE_DISKS 1
+#define INFO_GETIOCTLHANDLE 2
+#define INFO_FREEIOCTLHANDLE 3
+
+ULONG DosDevConfig (PVOID pInfo, ULONG ulItem);
+ULONG DosDevIOCtl (HFILE hDevice, ULONG ulCategory, ULONG ulFunction,
+ PVOID pParams, ULONG ulParamsLengthMax, PULONG pulParamsLength,
+ PVOID pData, ULONG ulDataLengthMax, PULONG pulDataLength);
+ULONG DosPhysicalDisk (ULONG ulFunction, PVOID pBuffer, ULONG ulBufferLength,
+ PVOID pParams, ULONG ulParamsLength);
+
+#endif /* INCL_DOSDEVICES */
+
+#if defined (INCL_DOSDEVIOCTL)
+
+#define IOCTL_ASYNC 0x0001
+#define IOCTL_SCR_AND_PTRDRAW 0x0003
+#define IOCTL_KEYBOARD 0x0004
+#define IOCTL_PRINTER 0x0005
+#define IOCTL_LIGHTPEN 0x0006
+#define IOCTL_POINTINGDEVICE 0x0007
+#define IOCTL_DISK 0x0008
+#define IOCTL_PHYSICALDISK 0x0009
+#define IOCTL_MONITOR 0x000a
+#define IOCTL_GENERAL 0x000b
+#define IOCTL_POWER 0x000c
+#define IOCTL_OEMHLP 0x0080
+#define IOCTL_TESTCFG_SYS 0x0080
+#define IOCTL_CDROMDISK 0x0080
+#define IOCTL_CDROMAUDIO 0x0081
+#define IOCTL_TOUCH_DEVDEP 0x0081
+#define IOCTL_TOUCH_DEVINDEP 0x0081
+
+#define ASYNC_SETBAUDRATE 0x0041
+#define ASYNC_SETLINECTRL 0x0042
+#define ASYNC_EXTSETBAUDRATE 0x0043
+#define ASYNC_TRANSMITIMM 0x0044
+#define ASYNC_SETBREAKOFF 0x0045
+#define ASYNC_SETMODEMCTRL 0x0046
+#define ASYNC_STOPTRANSMIT 0x0047
+#define ASYNC_STARTTRANSMIT 0x0048
+#define ASYNC_SETBREAKON 0x004b
+#define ASYNC_SETDCBINFO 0x0053
+#define ASYNC_SETENHANCEDMODEPARMS 0x0054
+#define ASYNC_GETBAUDRATE 0x0061
+#define ASYNC_GETLINECTRL 0x0062
+#define ASYNC_EXTGETBAUDRATE 0x0063
+#define ASYNC_GETCOMMSTATUS 0x0064
+#define ASYNC_GETLINESTATUS 0x0065
+#define ASYNC_GETMODEMOUTPUT 0x0066
+#define ASYNC_GETMODEMINPUT 0x0067
+#define ASYNC_GETINQUECOUNT 0x0068
+#define ASYNC_GETOUTQUECOUNT 0x0069
+#define ASYNC_GETCOMMERROR 0x006d
+#define ASYNC_GETCOMMEVENT 0x0072
+#define ASYNC_GETDCBINFO 0x0073
+#define ASYNC_GETENHANCEDMODEPARMS 0x0074
+
+#define SCR_ALLOCLDT 0x0070
+#define SCR_DEALLOCLDT 0x0071
+#define PTR_GETPTRDRAWADDRESS 0x0072
+#define VID_INITCALLVECTOR 0x0073
+#define SCR_ABIOSPASSTHRU 0x0074
+#define SCR_ALLOCLDTOFF 0x0075
+#define SCR_ALLOCLDTBGVAL 0x0076
+#define SCR_ALLOCVIDEOBUFFER 0x007e
+#define SCR_GETROMFONTADDR 0x007f
+
+#define KBD_SETTRANSTABLE 0x0050
+#define KBD_SETINPUTMODE 0x0051
+#define KBD_SETINTERIMFLAG 0x0052
+#define KBD_SETSHIFTSTATE 0x0053
+#define KBD_SETTYPAMATICRATE 0x0054
+#define KBD_SETFGNDSCREENGRP 0x0055
+#define KBD_SETSESMGRHOTKEY 0x0056
+#define KBD_SETFOCUS 0x0057
+#define KBD_SETKCB 0x0058
+#define KBD_SETREADNOTIFICATION 0x0059
+#define KBD_ALTERKBDLED 0x005a
+#define KBD_SETNLS 0x005c
+#define KBD_CREATE 0x005d
+#define KBD_DESTROY 0x005e
+#define KBD_GETINPUTMODE 0x0071
+#define KBD_GETINTERIMFLAG 0x0072
+#define KBD_GETSHIFTSTATE 0x0073
+#define KBD_READCHAR 0x0074
+#define KBD_PEEKCHAR 0x0075
+#define KBD_GETSESMGRHOTKEY 0x0076
+#define KBD_GETKEYBDTYPE 0x0077
+#define KBD_GETCODEPAGEID 0x0078
+#define KBD_XLATESCAN 0x0079
+#define KBD_QUERYKBDHARDWAREID 0x007a
+#define KBD_QUERYKBDCODEPAGESUPPORT 0x007b
+
+#define PRT_QUERYJOBHANDLE 0x0021
+#define PRT_SETFRAMECTL 0x0042
+#define PRT_SETINFINITERETRY 0x0044
+#define PRT_INITPRINTER 0x0046
+#define PRT_ACTIVATEFONT 0x0048
+#define PRT_SETPRINTJOBTITLE 0x004d
+#define PRT_SETIRQTIMEOUT 0x004e
+#define PRT_GETFRAMECTL 0x0062
+#define PRT_GETINFINITERETRY 0x0064
+#define PRT_GETPRINTERSTATUS 0x0066
+#define PRT_QUERYACTIVEFONT 0x0069
+#define PRT_VERIFYFONT 0x006a
+#define PRT_QUERYIRQTIMEOUT 0x006e
+
+#define MOU_ALLOWPTRDRAW 0x0050
+#define MOU_UPDATEDISPLAYMODE 0x0051
+#define MOU_SCREENSWITCH 0x0052
+#define MOU_SETSCALEFACTORS 0x0053
+#define MOU_SETEVENTMASK 0x0054
+#define MOU_SETHOTKEYBUTTON 0x0055
+#define MOU_REASSIGNTHRESHOLDVALUES 0x0055 /* ? */
+#define MOU_SETPTRSHAPE 0x0056
+#define MOU_DRAWPTR 0x0057
+#define MOU_UNMARKCOLLISIONAREA 0x0057 /* ? */
+#define MOU_REMOVEPTR 0x0058
+#define MOU_MARKCOLLISIONAREA 0x0058 /* ? */
+#define MOU_SETPTRPOS 0x0059
+#define MOU_SETPROTDRAWADDRESS 0x005a
+#define MOU_SETREALDRAWADDRESS 0x005b
+#define MOU_SETMOUSTATUS 0x005c
+#define MOU_DISPLAYMODECHANGE 0x005d
+#define MOU_GETBUTTONCOUNT 0x0060
+#define MOU_GETMICKEYCOUNT 0x0061
+#define MOU_GETMOUSTATUS 0x0062
+#define MOU_READEVENTQUE 0x0063
+#define MOU_GETQUESTATUS 0x0064
+#define MOU_GETEVENTMASK 0x0065
+#define MOU_GETSCALEFACTORS 0x0066
+#define MOU_GETPTRPOS 0x0067
+#define MOU_GETPTRSHAPE 0x0068
+#define MOU_GETHOTKEYBUTTON 0x0069
+#define MOU_QUERYTHRESHOLDVALUES 0x0069 /* ? */
+#define MOU_VER 0x006a
+#define MOU_QUERYPOINTERID 0x006b /* ? */
+
+#define DSK_LOCKDRIVE 0x0000
+#define DSK_UNLOCKDRIVE 0x0001
+#define DSK_REDETERMINEMEDIA 0x0002
+#define DSK_SETLOGICALMAP 0x0003
+#define DSK_BEGINFORMAT 0x0004
+#define DSK_BLOCKREMOVABLE 0x0020
+#define DSK_GETLOGICALMAP 0x0021
+#define DSK_UNLOCKEJECTMEDIA 0x0040
+#define DSK_SETDEVICEPARAMS 0x0043
+#define DSK_WRITETRACK 0x0044
+#define DSK_FORMATVERIFY 0x0045
+#define DSK_DISKETTECONTROL 0x005d
+#define DSK_QUERYMEDIASENSE 0x0060
+#define DSK_GETDEVICEPARAMS 0x0063
+#define DSK_READTRACK 0x0064
+#define DSK_VERIFYTRACK 0x0065
+#define DSK_GETLOCKSTATUS 0x0066
+
+#define PDSK_LOCKPHYSDRIVE 0x0000
+#define PDSK_UNLOCKPHYSDRIVE 0x0001
+#define PDSK_WRITEPHYSTRACK 0x0044
+#define PDSK_GETPHYSDEVICEPARAMS 0x0063
+#define PDSK_READPHYSTRACK 0x0064
+#define PDSK_VERIFYPHYSTRACK 0x0065
+
+#define POWER_SENDPOWEREVENT 0x0040
+#define POWER_SETPOWEREVENTRES 0x0041
+#define POWER_GETPOWERSTATUS 0x0060
+#define POWER_GETPOWEREVENT 0x0061
+#define POWER_GETPOWERINFO 0x0062
+
+#define OEMHLP_GETOEMADAPTIONINFO 0x0000
+#define OEMHLP_GETMACHINEINFO 0x0001
+#define OEMHLP_GETDISPLAYCOMBCODE 0x0002
+#define OEMHLP_GETVIDEOFONTS 0x0003
+#define OEMHLP_READEISACONFIGINFO 0x0004
+#define OEMHLP_GETROMBIOSINFO 0x0005
+#define OEMHLP_GETMISCVIDEOINFO 0x0006
+#define OEMHLP_GETVIDEOADAPTER 0x0007
+#define OEMHLP_GETSVGAINFO 0x0008
+#define OEMHLP_GETMEMINFO 0x0009
+#define OEMHLP_GETDMQSINFO 0x000a
+#define OEMHLP_PCI 0x000b
+
+#define TESTCFG_SYS_GETBIOSADAPTER 0x0040
+#define TESTCFG_SYS_ISSUEINIOINSTR 0x0041
+#define TESTCFG_SYS_ISSUEOUTIOINSTR 0x0042
+#define TESTCFG_SYS_GETBUSARCH 0x0060
+#define TESTCFG_SYS_GETALLPOSIDS 0x0061
+#define TESTCFG_SYS_GETALLEISAIDS 0x0062
+
+#define CDROMDISK_RESETDRIVE 0x0040
+#define CDROMDISK_EJECTDISK 0x0044
+#define CDROMDISK_LOCKUNLOCKDOOR 0x0046
+#define CDROMDISK_SEEK 0x0050
+#define CDROMDISK_DEVICESTATUS 0x0060
+#define CDROMDISK_GETDRIVER 0x0061
+#define CDROMDISK_GETSECTORSIZE 0x0063
+#define CDROMDISK_GETHEADLOC 0x0070
+#define CDROMDISK_READLONG 0x0072
+#define CDROMDISK_GETVOLUMESIZE 0x0078
+#define CDROMDISK_GETUPC 0x0079
+
+#define CDROMAUDIO_SETCHANNELCTRL 0x0040
+#define CDROMAUDIO_PLAYAUDIO 0x0050
+#define CDROMAUDIO_STOPAUDIO 0x0051
+#define CDROMAUDIO_RESUMEAUDIO 0x0052
+#define CDROMAUDIO_GETCHANNEL 0x0060
+#define CDROMAUDIO_GETAUDIODISK 0x0061
+#define CDROMAUDIO_GETAUDIOTRACK 0x0062
+#define CDROMAUDIO_GETSUBCHANNELQ 0x0063
+#define CDROMAUDIO_GETAUDIOSTATUS 0x0065
+
+#define TOUCH_DEVDEP_SETCALIBCONST 0x0052
+#define TOUCH_DEVDEP_READDATA 0x0053
+#define TOUCH_DEVDEP_SETDATAMODE 0x0054
+#define TOUCH_DEVDEP_SETCLICKLOCK 0x0055
+#define TOUCH_DEVDEP_SETTOUCHTHRESHOLD 0x0056
+#define TOUCH_DEVDEP_SETEMULXY 0x0057
+#define TOUCH_DEVDEP_SETDATAREPORTRATE 0x0058
+#define TOUCH_DEVDEP_SETLOWPASSFILTER 0x0059
+#define TOUCH_DEVDEP_WRITEMEMLOC 0x005a
+#define TOUCH_DEVDEP_GETCALIBCONST 0x0060
+#define TOUCH_DEVDEP_GETDATAMODE 0x0061
+#define TOUCH_DEVDEP_GETCLICKLOCK 0x0062
+#define TOUCH_DEVDEP_GETTOUCHTHRESHOLD 0x0063
+#define TOUCH_DEVDEP_GETEMULXY 0x0064
+#define TOUCH_DEVDEP_GETDATAREPORTRATE 0x0065
+#define TOUCH_DEVDEP_GETLOWPASSFILTER 0x0066
+#define TOUCH_DEVDEP_READMEMLOC 0x0067
+
+#define TOUCH_DEVINDEP_SETCOORDSYS 0x0050
+#define TOUCH_DEVINDEP_SETSELECTMECH 0x0052
+#define TOUCH_DEVINDEP_SETEVENTMASK 0x0053
+#define TOUCH_DEVINDEP_SETQUEUESIZE 0x0054
+#define TOUCH_DEVINDEP_SETEMULSTATE 0x0055
+#define TOUCH_DEVINDEP_GETCOORDSYS 0x0060
+#define TOUCH_DEVINDEP_GETSELECTMECH 0x0062
+#define TOUCH_DEVINDEP_GETEVENTMASK 0x0063
+#define TOUCH_DEVINDEP_GETQUEUESIZE 0x0064
+#define TOUCH_DEVINDEP_GETEMULSTATE 0x0065
+#define TOUCH_DEVINDEP_GETREADEVENTQUEUE 0x0066
+
+#define MON_REGISTERMONITOR 0x0040
+
+#define DEV_FLUSHINPUT 0x0001
+#define DEV_FLUSHOUTPUT 0x0002
+#define DEV_SYSTEMNOTIFYPDD 0x0041
+#define DEV_QUERYMONSUPPORT 0x0060
+
+#define RX_QUE_OVERRUN 0x0001
+#define RX_HARDWARE_OVERRUN 0x0002
+#define PARITY_ERROR 0x0004
+#define FRAMING_ERROR 0x0008
+
+#define CHAR_RECEIVED 0x0001
+#define LAST_CHAR_SENT 0x0004
+#define CTS_CHANGED 0x0008
+#define DSR_CHANGED 0x0010
+#define DCD_CHANGED 0x0020
+#define BREAK_DETECTED 0x0040
+#define ERROR_OCCURRED 0x0080
+#define RI_DETECTED 0x0100
+
+#define TX_WAITING_FOR_CTS 0x0001
+#define TX_WAITING_FOR_DSR 0x0002
+#define TX_WAITING_FOR_DCD 0x0004
+#define TX_WAITING_FOR_XON 0x0008
+#define TX_WAITING_TO_SEND_XON 0x0010
+#define TX_WAITING_WHILE_BREAK_ON 0x0020
+#define TX_WAITING_TO_SEND_IMM 0x0040
+#define RX_WAITING_FOR_DSR 0x0080
+
+#define WRITE_REQUEST_QUEUED 0x0001
+#define DATA_IN_TX_QUE 0x0002
+#define HARDWARE_TRANSMITTING 0x0004
+#define CHAR_READY_TO_SEND_IMM 0x0008
+#define WAITING_TO_SEND_XON 0x0010
+#define WAITING_TO_SEND_XOFF 0x0020
+
+#define CTS_ON 0x10
+#define DSR_ON 0x20
+#define RI_ON 0x40
+#define DCD_ON 0x80
+
+#define MODE_DTR_CONTROL 0x01
+#define MODE_DTR_HANDSHAKE 0x02
+#define MODE_CTS_HANDSHAKE 0x08
+#define MODE_DSR_HANDSHAKE 0x10
+#define MODE_DCD_HANDSHAKE 0x20
+#define MODE_DSR_SENSITIVITY 0x40
+
+#define MODE_AUTO_TRANSMIT 0x01
+#define MODE_AUTO_RECEIVE 0x02
+#define MODE_ERROR_CHAR 0x04
+#define MODE_NULL_STRIPPING 0x08
+#define MODE_BREAK_CHAR 0x10
+#define MODE_RTS_CONTROL 0x40
+#define MODE_RTS_HANDSHAKE 0x80
+#define MODE_TRANSMIT_TOGGLE 0xc0
+
+#define MODE_NO_WRITE_TIMEOUT 0x01
+#define MODE_READ_TIMEOUT 0x02
+#define MODE_WAIT_READ_TIMEOUT 0x04
+#define MODE_NOWAIT_READ_TIMEOUT 0x06
+
+#define DTR_ON 0x01
+#define RTS_ON 0x02
+
+#define DTR_OFF 0xfe
+#define RTS_OFF 0xfd
+
+#define ASCII_MODE 0x00
+#define BINARY_MODE 0x80
+
+#define CONVERSION_REQUEST 0x20
+#define INTERIM_CHAR 0x80
+
+#define HOTKEY_MAX_COUNT 0x0000
+#define HOTKEY_CURRENT_COUNT 0x0001
+
+#define KBD_DATA_RECEIVED 0x0001
+#define KBD_DATA_BINARY 0x8000
+
+#define KBD_READ_WAIT 0x0000
+#define KBD_READ_NOWAIT 0x8000
+
+#define SHIFT_REPORT_MODE 0x01
+
+#define RIGHTSHIFT 0x0001
+#define LEFTSHIFT 0x0002
+#define CONTROL 0x0004
+#define ALT 0x0008
+#define SCROLLLOCK_ON 0x0010
+#define NUMLOCK_ON 0x0020
+#define CAPSLOCK_ON 0x0040
+#define INSERT_ON 0x0080
+#define LEFTCONTROL 0x0100
+#define LEFTALT 0x0200
+#define RIGHTCONTROL 0x0400
+#define RIGHTALT 0x0800
+#define SCROLLLOCK 0x1000
+#define NUMLOCK 0x2000
+#define CAPSLOCK 0x4000
+#define SYSREQ 0x8000
+
+#define PRINTER_TIMEOUT 0x0001
+#define PRINTER_IO_ERROR 0x0008
+#define PRINTER_SELECTED 0x0010
+#define PRINTER_OUT_OF_PAPER 0x0020
+#define PRINTER_ACKNOWLEDGED 0x0040
+#define PRINTER_NOT_BUSY 0x0080
+
+#define MOUSE_MOTION 0x0001
+#define MOUSE_MOTION_WITH_BN1_DOWN 0x0002
+#define MOUSE_BN1_DOWN 0x0004
+#define MOUSE_MOTION_WITH_BN2_DOWN 0x0008
+#define MOUSE_BN2_DOWN 0x0010
+#define MOUSE_MOTION_WITH_BN3_DOWN 0x0020
+#define MOUSE_BN3_DOWN 0x0040
+
+#define MHK_BUTTON1 0x0001
+#define MHK_BUTTON2 0x0002
+#define MHK_BUTTON3 0x0004
+
+#define MOU_NOWAIT 0x0000
+#define MOU_WAIT 0x0001
+
+#define MHK_NO_HOTKEY 0x0000
+
+#define MOUSE_QUEUEBUSY 0x0001
+#define MOUSE_BLOCKREAD 0x0002
+#define MOUSE_FLUSH 0x0004
+#define MOUSE_UNSUPPORTED_MODE 0x0008
+#define MOUSE_DISABLED 0x0100
+#define MOUSE_MICKEYS 0x0200
+
+#define BUILD_BPB_FROM_MEDIUM 0x00
+#define REPLACE_BPB_FOR_DEVICE 0x01
+#define REPLACE_BPB_FOR_MEDIUM 0x02
+
+#define DEVTYPE_48TPI 0x0000
+#define DEVTYPE_96TPI 0x0001
+#define DEVTYPE_35 0x0002
+#define DEVTYPE_8SD 0x0003
+#define DEVTYPE_8DD 0x0004
+#define DEVTYPE_FIXED 0x0005
+#define DEVTYPE_TAPE 0x0006
+#define DEVTYPE_UNKNOWN 0x0007
+
+#define SCREENDD_GETCURRENTBANK 0x00
+#define SCREENDD_SETCURRENTBANK 0x01
+#define SCREENDD_SVGA_ID 0x08
+#define SCREENDD_SVGA_OEM 0x09
+#define SCREENDD_UPDATEMEMORY 0x0a
+#define SCREENDD_GETLINEARACCESS 0x0b
+#define SCREENDD_GETGLOBALACCESS 0x0c
+#define SCREENDD_FREEGLOBALACCESS 0x0d
+#define SCREENDD_REGISTER_RING0_CALLER 0x0e
+#define SCREENDD_WAIT_ON_RING0_CALLER 0x0f
+#define SCREENDD_CATEGORY 0x80
+#define SCREENDD_NAME "SCREEN$"
+
+#define GETLINEAR_FLAG_MAPPHYSICAL 0x00000010
+#define GETLINEAR_FLAG_MAPPROCESS 0x00000020
+#define GETLINEAR_FLAG_MAPSHARED 0x00000400
+#define GETLINEAR_FLAG_MAPATTACH 0x80000000
+
+#define EGA_BIT 4
+#define VGA_BIT 8
+#define EGAVGA_BIT (EGA_BIT|VGA_BIT)
+
+#define READ_BANK 0
+#define WRITE_BANK 1
+#define MODE_TEXT 0
+#define MODE_PLANAR 1
+#define MODE_LINEAR 2
+
+typedef struct _DCBINFO
+{
+ USHORT usWriteTimeout;
+ USHORT usReadTimeout;
+ BYTE fbCtlHndShake;
+ BYTE fbFlowReplace;
+ BYTE fbTimeout;
+ BYTE bErrorReplacementChar;
+ BYTE bBreakReplacementChar;
+ BYTE bXONChar;
+ BYTE bXOFFChar;
+} DCBINFO;
+typedef DCBINFO *PDCBINFO;
+
+typedef struct _LINECONTROL
+{
+ BYTE bDataBits;
+ BYTE bParity;
+ BYTE bStopBits;
+ BYTE fTransBreak;
+} LINECONTROL;
+typedef LINECONTROL *PLINECONTROL;
+
+typedef struct _MODEMSTATUS
+{
+ BYTE fbModemOn;
+ BYTE fbModemOff;
+} MODEMSTATUS;
+typedef MODEMSTATUS *PMODEMSTATUS;
+
+typedef struct _KBDTYPE
+{
+ USHORT usType;
+ USHORT reserved1;
+ USHORT reserved2;
+} KBDTYPE;
+typedef KBDTYPE *PKBDTYPE;
+
+typedef struct _RATEDELAY
+{
+ USHORT usDelay;
+ USHORT usRate;
+} RATEDELAY;
+typedef RATEDELAY *PRATEDELAY;
+
+typedef struct _CODEPAGEINFO
+{
+ PBYTE pbTransTable;
+ USHORT idCodePage;
+ USHORT idTable;
+} CODEPAGEINFO;
+typedef CODEPAGEINFO *PCODEPAGEINFO;
+
+typedef struct _CPID
+{
+ USHORT idCodePage;
+ USHORT Reserved;
+} CPID;
+typedef CPID *PCPID;
+
+typedef struct _SHIFTSTATE
+{
+ USHORT fsState;
+ BYTE fNLS;
+} SHIFTSTATE;
+typedef SHIFTSTATE *PSHIFTSTATE;
+
+typedef struct _HOTKEY
+{
+ USHORT fsHotKey;
+ UCHAR uchScancodeMake;
+ UCHAR uchScancodeBreak;
+ USHORT idHotKey;
+} HOTKEY;
+typedef HOTKEY *PHOTKEY;
+
+typedef struct _PTRDRAWFUNCTION
+{
+ USHORT usReturnCode;
+ PFN pfnDraw;
+ PCH pchDataSeg;
+} PTRDRAWFUNCTION;
+typedef PTRDRAWFUNCTION *PPTRDRAWFUNCTION;
+
+typedef struct _PTRDRAWADDRESS
+{
+ USHORT reserved;
+ PTRDRAWFUNCTION ptrdfnc;
+} PTRDRAWADDRESS;
+typedef PTRDRAWADDRESS *PPTRDRAWADDRESS;
+
+typedef struct _PTRDRAWDATA
+{
+ USHORT cb;
+ USHORT usConfig;
+ USHORT usFlag;
+} PTRDRAWDATA;
+typedef PTRDRAWDATA *PPTRDRAWDATA;
+
+typedef struct _TRACKLAYOUT
+{
+ BYTE bCommand;
+ USHORT usHead;
+ USHORT usCylinder;
+ USHORT usFirstSector;
+ USHORT cSectors;
+ struct
+ {
+ USHORT usSectorNumber;
+ USHORT usSectorSize;
+ } TrackTable[1];
+} TRACKLAYOUT;
+typedef TRACKLAYOUT *PTRACKLAYOUT;
+
+typedef struct _TRACKFORMAT
+{
+ BYTE bCommand;
+ USHORT usHead;
+ USHORT usCylinder;
+ USHORT usReserved;
+ USHORT cSectors;
+ struct
+ {
+ BYTE bCylinder;
+ BYTE bHead;
+ BYTE idSector;
+ BYTE bBytesSector;
+ } FormatTable[1];
+} TRACKFORMAT;
+typedef TRACKFORMAT *PTRACKFORMAT;
+
+typedef struct _BIOSPARAMETERBLOCK
+{
+ USHORT usBytesPerSector;
+ BYTE bSectorsPerCluster;
+ USHORT usReservedSectors;
+ BYTE cFATs;
+ USHORT cRootEntries;
+ USHORT cSectors;
+ BYTE bMedia;
+ USHORT usSectorsPerFAT;
+ USHORT usSectorsPerTrack;
+ USHORT cHeads;
+ ULONG cHiddenSectors;
+ ULONG cLargeSectors;
+ BYTE abReserved[6];
+ USHORT cCylinders;
+ BYTE bDeviceType;
+ USHORT fsDeviceAttr;
+} BIOSPARAMETERBLOCK;
+typedef BIOSPARAMETERBLOCK *PBIOSPARAMETERBLOCK;
+
+typedef struct _DEVICEPARAMETERBLOCK
+{
+ USHORT reserved1;
+ USHORT cCylinders;
+ USHORT cHeads;
+ USHORT cSectorsPerTrack;
+ USHORT reserved2;
+ USHORT reserved3;
+ USHORT reserved4;
+ USHORT reserved5;
+} DEVICEPARAMETERBLOCK;
+typedef DEVICEPARAMETERBLOCK *PDEVICEPARAMETERBLOCK;
+
+typedef struct _MONITORPOSITION
+{
+ USHORT fPosition;
+ USHORT index;
+ ULONG pbInBuf;
+ USHORT offOutBuf;
+} MONITORPOSITION;
+typedef MONITORPOSITION *PMONITORPOSITION;
+
+typedef struct _FRAME
+{
+ BYTE bCharsPerLine;
+ BYTE bLinesPerInch;
+} FRAME;
+typedef FRAME *PFRAME;
+
+typedef struct _LDTADDRINFO
+{
+ PULONG pulPhysAddr;
+ USHORT cb;
+} LDTADDRINFO;
+typedef LDTADDRINFO *PLDTADDRINFO;
+
+typedef struct _SCREENGROUP
+{
+ USHORT idScreenGrp;
+ USHORT fTerminate;
+} SCREENGROUP;
+typedef SCREENGROUP *PSCREENGROUP;
+
+typedef struct _RXQUEUE
+{
+ USHORT cch;
+ USHORT cb;
+} RXQUEUE;
+typedef RXQUEUE *PRXQUEUE;
+
+typedef struct _GETLINIOCTLDATA
+{
+ ULONG PacketLength;
+ ULONG PhysicalAddress;
+ ULONG ApertureSize;
+ PBYTE LinearAddress;
+ ULONG LinearFlags;
+} GETLINIOCTLDATA;
+typedef GETLINIOCTLDATA *PGETLINIOCTLDATA;
+
+typedef struct _BANKINFO
+{
+ ULONG ulBankLength;
+ USHORT usBank;
+ USHORT usVideoModeType;
+ USHORT usReadWriteMode;
+} BANKINFO;
+
+typedef struct _GLOBALIOCTLDATA
+{
+ ULONG ProcessAddress;
+ ULONG AddressLength;
+ ULONG GlobalAddress;
+} GLOBALIOCTLDATA;
+
+typedef struct _OEMSVGAINFO
+{
+ USHORT AdapterType;
+ USHORT ChipType;
+ ULONG Memory;
+} OEMSVGAINFO;
+
+typedef struct _OEMINFO
+{
+ ULONG OEMLength;
+ USHORT Manufacturer;
+ ULONG ManufacturerData;
+} OEMINFO;
+
+typedef struct _GETGLOBALPACKET
+{
+ ULONG GlobalPktLength;
+ GLOBALIOCTLDATA GlobalPktData[1];
+} GETGLOBALPACKET;
+
+#endif /* INCL_DOSDEVIOCTL */
+
+/* -------------------- NATIONAL LANGUAGE SUPPORT ------------------------- */
+
+#if defined (INCL_DOSNLS)
+
+typedef struct _COUNTRYCODE
+{
+ ULONG country;
+ ULONG codepage;
+} COUNTRYCODE;
+typedef COUNTRYCODE *PCOUNTRYCODE;
+
+typedef struct _COUNTRYINFO
+{
+ ULONG country;
+ ULONG codepage;
+ ULONG fsDateFmt;
+ CHAR szCurrency[5];
+ CHAR szThousandsSeparator[2];
+ CHAR szDecimal[2];
+ CHAR szDateSeparator[2];
+ CHAR szTimeSeparator[2];
+ UCHAR fsCurrencyFmt;
+ UCHAR cDecimalPlace;
+ UCHAR fsTimeFmt;
+ USHORT abReserved1[2];
+ CHAR szDataSeparator[2];
+ USHORT abReserved2[5];
+} COUNTRYINFO;
+typedef COUNTRYINFO *PCOUNTRYINFO;
+
+
+ULONG DosMapCase (ULONG ulLength, __const__ COUNTRYCODE *pCountryCode,
+ PCHAR pchString);
+ULONG DosQueryCollate (ULONG ulLength, __const__ COUNTRYCODE *pCountryCode,
+ PCHAR pchBuffer, PULONG pulDataLength);
+ULONG DosQueryCp (ULONG ulLength, PULONG pCodePageList, PULONG pDataLength);
+ULONG DosQueryCtryInfo (ULONG ulLength, PCOUNTRYCODE pCountryCode,
+ PCOUNTRYINFO pCountryInfo, PULONG pulDataLength);
+ULONG DosQueryDBCSEnv (ULONG ulLength, PCOUNTRYCODE pCountryCode, PCHAR pBuf);
+ULONG DosSetProcessCp (ULONG ulCodePage);
+
+#endif /* INCL_DOSNLS */
+
+/* -------------------------- DYNAMIC LINKING ----------------------------- */
+
+#if defined (INCL_DOSMODULEMGR)
+
+#define PT_16BIT 0
+#define PT_32BIT 1
+
+
+ULONG DosFreeModule (HMODULE hmod);
+ULONG DosLoadModule (PSZ pszObject, ULONG uObjectLen, PCSZ pszModule,
+ PHMODULE phmod);
+ULONG DosQueryModuleHandle (PCSZ pszModname, PHMODULE phmod);
+ULONG DosQueryModuleName (HMODULE hmod, ULONG ulNameLength, PCHAR pNameBuf);
+ULONG DosQueryProcAddr (HMODULE hmod, ULONG ulOrdinal, PCSZ pszProcName,
+ PPFN pProcAddr);
+ULONG DosQueryProcType (HMODULE hmod, ULONG ulOrdinal, PCSZ pszProcName,
+ PULONG pulProcType);
+
+#endif /* INCL_DOSMODULEMGR */
+
+/* ----------------------------- RESOURCES -------------------------------- */
+
+#if defined (INCL_DOSRESOURCES) || !defined (INCL_NOCOMMON)
+
+#define RT_POINTER 1
+#define RT_BITMAP 2
+#define RT_MENU 3
+#define RT_DIALOG 4
+#define RT_STRING 5
+#define RT_FONTDIR 6
+#define RT_FONT 7
+#define RT_ACCELTABLE 8
+#define RT_RCDATA 9
+#define RT_MESSAGE 10
+#define RT_DLGINCLUDE 11
+#define RT_VKEYTBL 12
+#define RT_KEYTBL 13
+#define RT_CHARTBL 14
+#define RT_DISPLAYINFO 15
+#define RT_FKASHORT 16
+#define RT_FKALONG 17
+#define RT_HELPTABLE 18
+#define RT_HELPSUBTABLE 19
+#define RT_FDDIR 20
+#define RT_FD 21
+#define RT_MAX 22
+
+#define RF_ORDINALID 0x80000000L
+
+
+ULONG DosFreeResource (PVOID pResAddr);
+ULONG DosGetResource (HMODULE hmod, ULONG ulTypeID, ULONG ulNameID,
+ PPVOID pOffset);
+ULONG DosQueryResourceSize (HMODULE hmod, ULONG ulTypeID, ULONG ulNameID,
+ PULONG pulSize);
+
+#endif /* INCL_DOSRESOURCES || !INCL_NOCOMMON */
+
+/* -------------------------------- TASKS --------------------------------- */
+
+#if defined (INCL_DOSPROCESS) || !defined (INCL_NOCOMMON)
+
+#define EXIT_THREAD 0
+#define EXIT_PROCESS 1
+
+ULONG DosBeep (ULONG ulFrequency, ULONG ulDuration);
+VOID DosExit (ULONG ulAction, ULONG ulResult) __attribute__ ((__noreturn__));
+
+#endif /* INCL_DOSPROCESS || !defined (INCL_NOCOMMON) */
+
+
+#if defined (INCL_DOSPROCESS)
+
+#define CREATE_READY 0
+#define CREATE_SUSPENDED 1
+
+#define STACK_SPARSE 0
+#define STACK_COMMITTED 2
+
+#define DCWA_PROCESS 0
+#define DCWA_PROCESSTREE 1
+
+#define DCWW_WAIT 0
+#define DCWW_NOWAIT 1
+
+#define DKP_PROCESSTREE 0
+#define DKP_PROCESS 1
+
+#define EXEC_SYNC 0
+#define EXEC_ASYNC 1
+#define EXEC_ASYNCRESULT 2
+#define EXEC_TRACE 3
+#define EXEC_BACKGROUND 4
+#define EXEC_LOAD 5
+#define EXEC_ASYNCRESULTDB 6
+
+#define EXLST_ADD 1
+#define EXLST_REMOVE 2
+#define EXLST_EXIT 3
+
+#define PRTYC_NOCHANGE 0
+#define PRTYC_IDLETIME 1
+#define PRTYC_REGULAR 2
+#define PRTYC_TIMECRITICAL 3
+#define PRTYC_FOREGROUNDSERVER 4
+
+#define PRTYD_MINIMUM (-31)
+#define PRTYD_MAXIMUM 31
+
+#define PRTYS_PROCESS 0
+#define PRTYS_PROCESSTREE 1
+#define PRTYS_THREAD 2
+
+#define TC_EXIT 0
+#define TC_HARDERROR 1
+#define TC_TRAP 2
+#define TC_KILLPROCESS 3
+#define TC_EXCEPTION 4
+
+
+typedef struct _RESULTCODES
+{
+ ULONG codeTerminate;
+ ULONG codeResult;
+} RESULTCODES;
+typedef RESULTCODES *PRESULTCODES;
+
+typedef struct tib2_s
+{
+ ULONG tib2_ultid;
+ ULONG tib2_ulpri;
+ ULONG tib2_version;
+ USHORT tib2_usMCCount;
+ USHORT tib2_fMCForceFlag;
+} TIB2;
+typedef TIB2 *PTIB2;
+
+typedef struct tib_s
+{
+ PVOID tib_pexchain;
+ PVOID tib_pstack;
+ PVOID tib_pstacklimit;
+ PTIB2 tib_ptib2;
+ ULONG tib_version;
+ ULONG tib_ordinal;
+} TIB;
+typedef TIB *PTIB;
+
+typedef struct pib_s
+{
+ ULONG pib_ulpid;
+ ULONG pib_ulppid;
+ ULONG pib_hmte;
+ PCHAR pib_pchcmd;
+ PCHAR pib_pchenv;
+ ULONG pib_flstatus;
+ ULONG pib_ultype;
+} PIB;
+typedef PIB *PPIB;
+
+typedef VOID (*PFNTHREAD)(ULONG ulThreadArg);
+typedef VOID (*PFNEXITLIST)(ULONG ulArg);
+
+
+ULONG DosAllocThreadLocalMemory (ULONG cb, PULONG *p);
+ULONG DosCreateThread (PTID ptidThreadID, PFNTHREAD pfnThreadAddr,
+ ULONG ulThreadArg, ULONG ulFlags, ULONG ulStackSize);
+ULONG DosEnterCritSec (VOID);
+ULONG DosExecPgm (PCHAR pObjname, LONG lObjnameLength, ULONG ulFlagS,
+ PCSZ pszArg, PCSZ pszEnv, PRESULTCODES pReturnCodes, PCSZ pszName);
+ULONG DosExitCritSec (VOID);
+ULONG DosExitList (ULONG ulOrder, PFNEXITLIST pfn);
+ULONG DosFreeThreadLocalMemory (ULONG *p);
+ULONG DosGetInfoBlocks (PTIB *ptib, PPIB *ppib);
+ULONG DosKillProcess (ULONG ulAction, PID pid);
+ULONG DosKillThread (TID tid);
+ULONG DosResumeThread (TID tid);
+ULONG DosSetPriority (ULONG ulScope, ULONG ulClass, LONG lDelta, ULONG ulID);
+
+#define STDCALL __attribute__ ((stdcall))
+//#define CDECL __attribute__ ((cdecl))
+//#define CALLBACK WINAPI
+//#define PASCAL WINAPI
+
+#define WINAPI STDCALL
+//#define APIENTRY STDCALL
+
+//ULONG WINAPI DosSleep (ULONG ulInterval);
+ULONG DosSleep (ULONG ulInterval);
+
+ULONG DosSuspendThread (TID tid);
+ULONG DosVerifyPidTid (PID pid, TID tid);
+ULONG DosWaitChild (ULONG ulAction, ULONG ulWait, PRESULTCODES pReturnCodes,
+ PPID ppidOut, PID pidIn);
+ULONG DosWaitThread (PTID ptid, ULONG ulWait);
+
+#endif /* INCL_DOSPROCESS */
+
+/* ------------------------------ SESSIONS -------------------------------- */
+
+#if defined (INCL_DOSSESMGR) || defined (INCL_DOSFILEMGR)
+
+#define FAPPTYP_NOTSPEC 0x0000
+#define FAPPTYP_NOTWINDOWCOMPAT 0x0001
+#define FAPPTYP_WINDOWCOMPAT 0x0002
+#define FAPPTYP_WINDOWAPI 0x0003
+#define FAPPTYP_BOUND 0x0008
+#define FAPPTYP_DLL 0x0010
+#define FAPPTYP_DOS 0x0020
+#define FAPPTYP_PHYSDRV 0x0040
+#define FAPPTYP_VIRTDRV 0x0080
+#define FAPPTYP_PROTDLL 0x0100
+#define FAPPTYP_WINDOWSREAL 0x0200
+#define FAPPTYP_WINDOWSPROT 0x0400
+#define FAPPTYP_WINDOWSPROT31 0x1000
+#define FAPPTYP_32BIT 0x4000
+#define FAPPTYP_EXETYPE 0x0003
+#define FAPPTYP_RESERVED (~(FAPPTYP_WINDOWAPI | FAPPTYP_BOUND | \
+ FAPPTYP_DLL | FAPPTYP_DOS | \
+ FAPPTYP_PHYSDRV | FAPPTYP_VIRTDRV | \
+ FAPPTYP_PROTDLL | FAPPTYP_32BIT))
+
+#endif /* INCL_DOSSESMGR || INCL_DOSFILEMGR */
+
+#if defined (INCL_DOSSESMGR)
+
+#define SET_SESSION_UNCHANGED 0
+#define SET_SESSION_SELECTABLE 1
+#define SET_SESSION_NON_SELECTABLE 2
+#define SET_SESSION_BOND 1
+#define SET_SESSION_NO_BOND 2
+
+#define SSF_RELATED_INDEPENDENT 0
+#define SSF_RELATED_CHILD 1
+
+#define SSF_FGBG_FORE 0
+#define SSF_FGBG_BACK 1
+
+#define SSF_TRACEOPT_NONE 0
+#define SSF_TRACEOPT_TRACE 1
+#define SSF_TRACEOPT_TRACEALL 2
+
+#define SSF_INHERTOPT_SHELL 0
+#define SSF_INHERTOPT_PARENT 1
+
+#define SSF_TYPE_DEFAULT 0
+#define SSF_TYPE_FULLSCREEN 1
+#define SSF_TYPE_WINDOWABLEVIO 2
+#define SSF_TYPE_PM 3
+#define SSF_TYPE_VDM 4
+#define SSF_TYPE_GROUP 5
+#define SSF_TYPE_DLL 6
+#define SSF_TYPE_WINDOWEDVDM 7
+#define SSF_TYPE_PDD 8
+#define SSF_TYPE_VDD 9
+
+#define SSF_CONTROL_VISIBLE 0x0000
+#define SSF_CONTROL_INVISIBLE 0x0001
+#define SSF_CONTROL_MAXIMIZE 0x0002
+#define SSF_CONTROL_MINIMIZE 0x0004
+#define SSF_CONTROL_NOAUTOCLOSE 0x0008
+#define SSF_CONTROL_SETPOS 0x8000
+
+#define STOP_SESSION_SPECIFIED 0
+#define STOP_SESSION_ALL 1
+
+typedef struct _STARTDATA
+{
+ USHORT Length;
+ USHORT Related;
+ USHORT FgBg;
+ USHORT TraceOpt;
+ PSZ PgmTitle;
+ PSZ PgmName;
+ PBYTE PgmInputs;
+ PBYTE TermQ;
+ PBYTE Environment;
+ USHORT InheritOpt;
+ USHORT SessionType;
+ PSZ IconFile;
+ ULONG PgmHandle;
+ USHORT PgmControl;
+ USHORT InitXPos;
+ USHORT InitYPos;
+ USHORT InitXSize;
+ USHORT InitYSize;
+ USHORT Reserved;
+ PSZ ObjectBuffer;
+ ULONG ObjectBuffLen;
+} STARTDATA;
+typedef STARTDATA *PSTARTDATA;
+
+typedef struct _STATUSDATA
+{
+ USHORT Length;
+ USHORT SelectInd;
+ USHORT BondInd;
+} STATUSDATA;
+typedef STATUSDATA *PSTATUSDATA;
+
+ULONG DosQueryAppType (PCSZ pszName, PULONG pulFlags);
+ULONG DosSelectSession (ULONG ulIDSession);
+ULONG DosSetSession (ULONG ulIDSession, PSTATUSDATA psd);
+ULONG DosStartSession (PSTARTDATA psd, PULONG pulIDSession, PPID ppid);
+ULONG DosStopSession (ULONG ulScope, ULONG ulIDSession);
+
+#endif /* INCL_DOSSESMGR */
+
+/* ----------------------------- SEMAPHORES ------------------------------- */
+
+#if defined (INCL_DOSSEMAPHORES) || !defined (INCL_NOCOMMON)
+
+#define DC_SEM_SHARED 0x01
+#define DCMW_WAIT_ANY 0x02
+#define DCMW_WAIT_ALL 0x04
+
+#define SEM_INDEFINITE_WAIT ((ULONG)-1)
+#define SEM_IMMEDIATE_RETURN 0
+
+typedef ULONG HEV;
+typedef HEV *PHEV;
+
+typedef struct _PSEMRECORD /* Note 1 */
+{
+ HSEM hsemCur;
+ ULONG ulUser;
+} SEMRECORD;
+typedef SEMRECORD *PSEMRECORD;
+
+#endif /* INCL_DOSSEMAPHORES || !INCL_NOCOMMON */
+
+#if defined (INCL_DOSSEMAPHORES)
+
+ULONG DosCloseEventSem (HEV hev);
+ULONG DosCreateEventSem (PCSZ pszName, PHEV phev, ULONG ulAttr, BOOL32 fState);
+ULONG DosOpenEventSem (PCSZ pszName, PHEV phev);
+ULONG DosPostEventSem (HEV hev);
+ULONG DosQueryEventSem (HEV hev, PULONG pulCount);
+ULONG DosResetEventSem (HEV hev, PULONG pulCount);
+ULONG DosWaitEventSem (HEV hev, ULONG ulTimeout);
+
+ULONG DosCloseMutexSem (HMTX hmtx);
+ULONG DosCreateMutexSem (PCSZ pszName, PHMTX phmtx, ULONG ulAttr,
+ BOOL32 fState);
+ULONG DosOpenMutexSem (PCSZ pszName, PHMTX phmtx);
+ULONG DosQueryMutexSem (HMTX hmtx, PPID ppid, PTID ptid, PULONG pulCount);
+ULONG DosReleaseMutexSem (HMTX hmtx);
+ULONG DosRequestMutexSem (HMTX hmtx, ULONG ulTimeout);
+
+ULONG DosAddMuxWaitSem (HMUX hmux, PSEMRECORD pSemRec);
+ULONG DosCloseMuxWaitSem (HMUX hmux);
+ULONG DosCreateMuxWaitSem (PCSZ pszName, PHMUX phmux, ULONG ulcSemRec,
+ PSEMRECORD pSemRec, ULONG ulAttr);
+ULONG DosDeleteMuxWaitSem (HMUX hmux, HSEM hSem);
+ULONG DosOpenMuxWaitSem (PCSZ pszName, PHMUX phmux);
+ULONG DosQueryMuxWaitSem (HMUX hmux, PULONG pulcSemRec, PSEMRECORD pSemRec,
+ PULONG pulAttr);
+ULONG DosWaitMuxWaitSem (HMUX hmux, ULONG ulTimeout, PULONG pulUser);
+
+#endif /* INCL_DOSSEMAPHORES */
+
+/* ---------------------------- NAMED PIPES ------------------------------- */
+
+#define NP_INDEFINITE_WAIT ((ULONG)-1)
+#define NP_DEFAULT_WAIT 0
+
+#define NP_STATE_DISCONNECTED 1
+#define NP_STATE_LISTENING 2
+#define NP_STATE_CONNECTED 3
+#define NP_STATE_CLOSING 4
+
+#define NP_ACCESS_INBOUND 0x0000
+#define NP_ACCESS_OUTBOUND 0x0001
+#define NP_ACCESS_DUPLEX 0x0002
+#define NP_INHERIT 0x0000
+#define NP_NOINHERIT 0x0080
+#define NP_WRITEBEHIND 0x0000
+#define NP_NOWRITEBEHIND 0x4000
+
+#define NP_READMODE_BYTE 0x0000
+#define NP_READMODE_MESSAGE 0x0100
+#define NP_TYPE_BYTE 0x0000
+#define NP_TYPE_MESSAGE 0x0400
+#define NP_END_CLIENT 0x0000
+#define NP_END_SERVER 0x4000
+#define NP_WAIT 0x0000
+#define NP_NOWAIT 0x8000
+#define NP_UNLIMITED_INSTANCES 0x00ff
+
+#define NP_NBLK NO_WAIT
+#define NP_SERVER NP_END_SERVER
+#define NP_WMESG NP_TYPE_MESSAGE
+#define NP_RMESG NP_READMODE_MESSAGE
+#define NP_ICOUNT 0x00ff
+
+#define NPSS_EOI 0
+#define NPSS_RDATA 1
+#define NPSS_WSPACE 2
+#define NPSS_CLOSE 3
+
+#define NPSS_WAIT 0x0001
+
+typedef struct _AVAILDATA
+{
+ USHORT cbpipe;
+ USHORT cbmessage;
+} AVAILDATA;
+typedef AVAILDATA *PAVAILDATA;
+
+typedef struct _PIPEINFO
+{
+ USHORT cbOut;
+ USHORT cbIn;
+ BYTE cbMaxInst;
+ BYTE cbCurInst;
+ BYTE cbName;
+ CHAR szName[1];
+} PIPEINFO;
+typedef PIPEINFO *PPIPEINFO;
+
+typedef struct _PIPESEMSTATE
+{
+ BYTE fStatus;
+ BYTE fFlag;
+ USHORT usKey;
+ USHORT usAvail;
+} PIPESEMSTATE;
+typedef PIPESEMSTATE *PPIPESEMSTATE;
+
+ULONG DosCallNPipe (PCSZ pszName, PVOID pInbuf, ULONG ulInbufLength,
+ PVOID pOutbuf, ULONG ulOutbufSize, PULONG pulActualLength,
+ ULONG ulTimeout);
+ULONG DosConnectNPipe (HPIPE hpipe);
+ULONG DosCreateNPipe (PCSZ pszName, PHPIPE phpipe, ULONG ulOpenMode,
+ ULONG ulPipeMode, ULONG ulInbufLength, ULONG ulOutbufLength,
+ ULONG ulTimeout);
+ULONG DosDisConnectNPipe (HPIPE hpipe);
+ULONG DosPeekNPipe (HPIPE hpipe, PVOID pBuf, ULONG ulBufLength,
+ PULONG pulActualLength, PAVAILDATA pAvail, PULONG pulState);
+ULONG DosQueryNPHState (HPIPE hpipe, PULONG pulState);
+ULONG DosQueryNPipeInfo (HPIPE hpipe, ULONG ulInfoLevel, PVOID pBuf,
+ ULONG ulBufLength);
+ULONG DosQueryNPipeSemState (HSEM hsem, PPIPESEMSTATE pState,
+ ULONG ulBufLength);
+ULONG DosRawReadNPipe (PCSZ pszName, ULONG ulCount, PULONG pulLength,
+ PVOID pBuf);
+ULONG DosRawWriteNPipe (PCSZ pszName, ULONG ulCount);
+ULONG DosSetNPHState (HPIPE hpipe, ULONG ulState);
+ULONG DosSetNPipeSem (HPIPE hpipe, HSEM hsem, ULONG ulKey);
+ULONG DosTransactNPipe (HPIPE hpipe, PVOID pOutbuf, ULONG ulOutbufLength,
+ PVOID pInbuf, ULONG ulInbufLength, PULONG pulBytesRead);
+ULONG DosWaitNPipe (PCSZ pszName, ULONG ulTimeout);
+
+/* ------------------------------- QUEUES --------------------------------- */
+
+#if defined (INCL_DOSQUEUES)
+
+#define QUE_FIFO 0x0000
+#define QUE_LIFO 0x0001
+#define QUE_PRIORITY 0x0002
+#define QUE_NOCONVERT_ADDRESS 0x0000
+#define QUE_CONVERT_ADDRESS 0x0004
+
+typedef struct _REQUESTDATA
+{
+ PID pid;
+ ULONG ulData;
+} REQUESTDATA;
+typedef REQUESTDATA *PREQUESTDATA;
+
+ULONG DosCreatePipe (PHFILE phfReadHandle, PHFILE phfWriteHandle,
+ ULONG ulPipeSize);
+
+ULONG DosCloseQueue (HQUEUE hq);
+ULONG DosCreateQueue (PHQUEUE phq, ULONG ulPriority, PCSZ pszName);
+ULONG DosOpenQueue (PPID ppid, PHQUEUE phq, PCSZ pszName);
+ULONG DosPeekQueue (HQUEUE hq, PREQUESTDATA pRequest, PULONG pulDataLength,
+ PPVOID pDataAddress, PULONG pulElement, BOOL32 fNowait, PBYTE pPriority,
+ HEV hsem);
+ULONG DosPurgeQueue (HQUEUE hq);
+ULONG DosQueryQueue (HQUEUE hq, PULONG pulCount);
+ULONG DosReadQueue (HQUEUE hq, PREQUESTDATA pRequest, PULONG pulDataLength,
+ PPVOID pDataAddress, ULONG pulElement, BOOL32 fNowait, PBYTE pPriority,
+ HEV hsem);
+ULONG DosWriteQueue (HQUEUE hq, ULONG ulRequest, ULONG ulDataLength,
+ PVOID pData, ULONG ulPriority);
+
+#endif /* INCL_DOSQUEUES */
+
+/* --------------------------- EXCEPTIONS --------------------------------- */
+
+#if defined (INCL_DOSEXCEPTIONS)
+
+#define CONTEXT_CONTROL 0x0001
+#define CONTEXT_INTEGER 0x0002
+#define CONTEXT_SEGMENTS 0x0004
+#define CONTEXT_FLOATING_POINT 0x0008
+#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | \
+ CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT)
+
+#define EH_NONCONTINUABLE 0x0001
+#define EH_UNWINDING 0x0002
+#define EH_EXIT_UNWIND 0x0004
+#define EH_STACK_INVALID 0x0008
+#define EH_NESTED_CALL 0x0010
+
+#define SIG_UNSETFOCUS 0
+#define SIG_SETFOCUS 1
+
+#define UNWIND_ALL 0
+
+#define XCPT_CONTINUE_SEARCH 0x00000000
+#define XCPT_CONTINUE_EXECUTION 0xffffffff
+#define XCPT_CONTINUE_STOP 0x00716668
+
+#define XCPT_SIGNAL_INTR 1
+#define XCPT_SIGNAL_KILLPROC 3
+#define XCPT_SIGNAL_BREAK 4
+
+#define XCPT_FATAL_EXCEPTION 0xc0000000
+#define XCPT_SEVERITY_CODE 0xc0000000
+#define XCPT_CUSTOMER_CODE 0x20000000
+#define XCPT_FACILITY_CODE 0x1fff0000
+#define XCPT_EXCEPTION_CODE 0x0000ffff
+
+#define XCPT_UNKNOWN_ACCESS 0x00000000
+#define XCPT_READ_ACCESS 0x00000001
+#define XCPT_WRITE_ACCESS 0x00000002
+#define XCPT_EXECUTE_ACCESS 0x00000004
+#define XCPT_SPACE_ACCESS 0x00000008
+#define XCPT_LIMIT_ACCESS 0x00000010
+#define XCPT_DATA_UNKNOWN 0xffffffff
+
+#define XCPT_GUARD_PAGE_VIOLATION 0x80000001
+#define XCPT_UNABLE_TO_GROW_STACK 0x80010001
+#define XCPT_ACCESS_VIOLATION 0xc0000005
+#define XCPT_IN_PAGE_ERROR 0xc0000006
+#define XCPT_ILLEGAL_INSTRUCTION 0xc000001c
+#define XCPT_INVALID_LOCK_SEQUENCE 0xc000001d
+#define XCPT_NONCONTINUABLE_EXCEPTION 0xc0000024
+#define XCPT_INVALID_DISPOSITION 0xc0000025
+#define XCPT_UNWIND 0xc0000026
+#define XCPT_BAD_STACK 0xc0000027
+#define XCPT_INVALID_UNWIND_TARGET 0xc0000028
+#define XCPT_ARRAY_BOUNDS_EXCEEDED 0xc0000093
+#define XCPT_FLOAT_DENORMAL_OPERAND 0xc0000094
+#define XCPT_FLOAT_DIVIDE_BY_ZERO 0xc0000095
+#define XCPT_FLOAT_INEXACT_RESULT 0xc0000096
+#define XCPT_FLOAT_INVALID_OPERATION 0xc0000097
+#define XCPT_FLOAT_OVERFLOW 0xc0000098
+#define XCPT_FLOAT_STACK_CHECK 0xc0000099
+#define XCPT_FLOAT_UNDERFLOW 0xc000009a
+#define XCPT_INTEGER_DIVIDE_BY_ZERO 0xc000009b
+#define XCPT_INTEGER_OVERFLOW 0xc000009c
+#define XCPT_PRIVILEGED_INSTRUCTION 0xc000009d
+#define XCPT_DATATYPE_MISALIGNMENT 0xc000009e
+#define XCPT_BREAKPOINT 0xc000009f
+#define XCPT_SINGLE_STEP 0xc00000a0
+#define XCPT_PROCESS_TERMINATE 0xc0010001
+#define XCPT_ASYNC_PROCESS_TERMINATE 0xc0010002
+#define XCPT_SIGNAL 0xc0010003
+
+typedef struct _fpreg /* Note 1 */
+{
+ ULONG losig;
+ ULONG hisig;
+ USHORT signexp;
+} FPREG;
+typedef FPREG *PFPREG;
+
+typedef struct _CONTEXT /* Note 1 */
+{
+ ULONG ContextFlags;
+ ULONG ctx_env[7];
+ FPREG ctx_stack[8];
+ ULONG ctx_SegGs;
+ ULONG ctx_SegFs;
+ ULONG ctx_SegEs;
+ ULONG ctx_SegDs;
+ ULONG ctx_RegEdi;
+ ULONG ctx_RegEsi;
+ ULONG ctx_RegEax;
+ ULONG ctx_RegEbx;
+ ULONG ctx_RegEcx;
+ ULONG ctx_RegEdx;
+ ULONG ctx_RegEbp;
+ ULONG ctx_RegEip;
+ ULONG ctx_SegCs;
+ ULONG ctx_EFlags;
+ ULONG ctx_RegEsp;
+ ULONG ctx_SegSs;
+} CONTEXTRECORD;
+typedef CONTEXTRECORD *PCONTEXTRECORD;
+
+#define EXCEPTION_MAXIMUM_PARAMETERS 4
+
+typedef struct _EXCEPTIONREPORTRECORD
+{
+ ULONG ExceptionNum;
+ ULONG fHandlerFlags;
+ struct _EXCEPTIONREPORTRECORD * NestedExceptionReportRecord;
+ PVOID ExceptionAddress;
+ ULONG cParameters;
+ ULONG ExceptionInfo[EXCEPTION_MAXIMUM_PARAMETERS];
+} EXCEPTIONREPORTRECORD;
+typedef EXCEPTIONREPORTRECORD *PEXCEPTIONREPORTRECORD;
+
+struct _EXCEPTIONREGISTRATIONRECORD;
+
+typedef ULONG _ERR (PEXCEPTIONREPORTRECORD pReport,
+ struct _EXCEPTIONREGISTRATIONRECORD *pRegistration,
+ PCONTEXTRECORD pContext, PVOID pWhatever);
+typedef _ERR *ERR;
+
+typedef struct _EXCEPTIONREGISTRATIONRECORD
+{
+ struct _EXCEPTIONREGISTRATIONRECORD * __volatile__ prev_structure;
+ ERR __volatile__ ExceptionHandler;
+} EXCEPTIONREGISTRATIONRECORD;
+typedef EXCEPTIONREGISTRATIONRECORD *PEXCEPTIONREGISTRATIONRECORD;
+
+#define END_OF_CHAIN ((PEXCEPTIONREGISTRATIONRECORD)(-1))
+
+ULONG DosAcknowledgeSignalException (ULONG ulSignal);
+ULONG DosEnterMustComplete (PULONG pulNesting);
+ULONG DosExitMustComplete (PULONG pulNesting);
+ULONG DosQueryThreadContext (TID tid, ULONG ulLevel, PCONTEXTRECORD pContext);
+ULONG DosRaiseException (PEXCEPTIONREPORTRECORD pXRepRec);
+ULONG DosSendSignalException (PID pid, ULONG ulSignal);
+ULONG DosSetExceptionHandler (PEXCEPTIONREGISTRATIONRECORD pXRegRec);
+ULONG DosSetSignalExceptionFocus (BOOL32 flag, PULONG pulTimes);
+ULONG DosUnsetExceptionHandler (PEXCEPTIONREGISTRATIONRECORD pXRegRec);
+ULONG DosUnwindException (PEXCEPTIONREGISTRATIONRECORD pXRegRec,
+ PVOID pJumpThere, PEXCEPTIONREPORTRECORD pXRepRec);
+
+#endif /* INCL_DOSEXCEPTIONS */
+
+/* --------------------------- INFORMATION -------------------------------- */
+
+#if defined (INCL_DOSMISC)
+
+#define QSV_MAX_PATH_LENGTH 1
+#define QSV_MAX_TEXT_SESSIONS 2
+#define QSV_MAX_PM_SESSIONS 3
+#define QSV_MAX_VDM_SESSIONS 4
+#define QSV_BOOT_DRIVE 5
+#define QSV_DYN_PRI_VARIATION 6
+#define QSV_MAX_WAIT 7
+#define QSV_MIN_SLICE 8
+#define QSV_MAX_SLICE 9
+#define QSV_PAGE_SIZE 10
+#define QSV_VERSION_MAJOR 11
+#define QSV_VERSION_MINOR 12
+#define QSV_VERSION_REVISION 13
+#define QSV_MS_COUNT 14
+#define QSV_TIME_LOW 15
+#define QSV_TIME_HIGH 16
+#define QSV_TOTPHYSMEM 17
+#define QSV_TOTRESMEM 18
+#define QSV_TOTAVAILMEM 19
+#define QSV_MAXPRMEM 20
+#define QSV_MAXSHMEM 21
+#define QSV_TIMER_INTERVAL 22
+#define QSV_MAX_COMP_LENGTH 23
+#define QSV_FOREGROUND_FS_SESSION 24
+#define QSV_FOREGROUND_PROCESS 25
+#define QSV_MAX QSV_FOREGROUND_PROCESS
+
+#define SIS_MMIOADDR 0
+#define SIS_MEC_TABLE 1
+#define SIS_SYS_LOG 2
+
+ULONG DosQuerySysInfo (ULONG ulStart, ULONG ulLast, PVOID pBuf,
+ ULONG ulBufLength);
+ULONG DosScanEnv (PCSZ pszName, PSZ *pszValue);
+ULONG DosQueryRASInfo (ULONG Index, PPVOID Addr);
+
+#endif /* INCL_DOSMISC */
+
+/* ---------------------------- TIMERS ------------------------------------ */
+
+#if defined (INCL_DOSDATETIME) || !defined (INCL_NOCOMMON)
+
+typedef struct _DATETIME
+{
+ UCHAR hours;
+ UCHAR minutes;
+ UCHAR seconds;
+ UCHAR hundredths;
+ UCHAR day;
+ UCHAR month;
+ USHORT year;
+ SHORT timezone;
+ UCHAR weekday;
+} DATETIME;
+typedef DATETIME *PDATETIME;
+
+ULONG DosGetDateTime (PDATETIME pdt);
+ULONG DosSetDateTime (__const__ DATETIME *pdt);
+
+#endif /* INCL_DOSDATETIME || !INCL_NOCOMMON */
+
+
+#if defined (INCL_DOSDATETIME)
+
+typedef LHANDLE HTIMER;
+typedef HTIMER *PHTIMER;
+
+ULONG DosAsyncTimer (ULONG ulMilliSec, HSEM hsem, PHTIMER phtimer);
+ULONG DosStartTimer (ULONG ulMilliSec, HSEM hsem, PHTIMER phtimer);
+ULONG DosStopTimer (HTIMER htimer);
+
+#endif /* INCL_DOSDATETIME */
+
+#if defined (INCL_DOSPROFILE)
+
+typedef struct _QWORD
+{
+ ULONG ulLo;
+ ULONG ulHi;
+} QWORD;
+typedef QWORD *PQWORD;
+
+ULONG DosTmrQueryFreq (PULONG pulTmrFreq);
+ULONG DosTmrQueryTime (PQWORD pqwTmrTime);
+
+#endif /* INCL_DOSPROFILE */
+
+/* ---------------------- VIRTUAL DOS MACHINES----------------------------- */
+
+typedef USHORT SGID;
+
+#if defined (INCL_DOSMVDM)
+
+typedef LHANDLE HVDD;
+typedef HVDD *PHVDD;
+
+ULONG DosCloseVDD (HVDD hvdd);
+ULONG DosOpenVDD (PCSZ pszVDD, PHVDD phvdd);
+ULONG DosQueryDOSProperty (SGID sgidSesssionID, PCSZ pszName,
+ ULONG ulBufferLength, PSZ pBuffer);
+ULONG DosRequestVDD (HVDD hvdd, SGID sgidSessionID, ULONG ulCommand,
+ ULONG ulInputBufferLength, PVOID pInputBuffer,
+ ULONG ulOutputBufferLength, PVOID pOutputBuffer);
+ULONG DosSetDOSProperty (SGID sgidSessionID, PCSZ pszName,
+ ULONG ulBufferLength, PCSZ pBuffer);
+
+#endif /* INCL_DOSMVDM */
+
+/* --------------------------- DEBUGGING ---------------------------------- */
+
+#if defined (INCL_DOSPROCESS)
+
+#define DBG_C_Null 0
+#define DBG_C_ReadMem 1
+#define DBG_C_ReadMem_I 1
+#define DBG_C_ReadMem_D 2
+#define DBG_C_ReadReg 3
+#define DBG_C_WriteMem 4
+#define DBG_C_WriteMem_I 4
+#define DBG_C_WriteMem_D 5
+#define DBG_C_WriteReg 6
+#define DBG_C_Go 7
+#define DBG_C_Term 8
+#define DBG_C_SStep 9
+#define DBG_C_Stop 10
+#define DBG_C_Freeze 11
+#define DBG_C_Resume 12
+#define DBG_C_NumToAddr 13
+#define DBG_C_ReadCoRegs 14
+#define DBG_C_WriteCoRegs 15
+#define DBG_C_ThrdStat 17
+#define DBG_C_MapROAlias 18
+#define DBG_C_MapRWAlias 19
+#define DBG_C_UnMapAlias 20
+#define DBG_C_Connect 21
+#define DBG_C_ReadMemBuf 22
+#define DBG_C_WriteMemBuf 23
+#define DBG_C_SetWatch 24
+#define DBG_C_ClearWatch 25
+#define DBG_C_RangeStep 26
+#define DBG_C_Continue 27
+#define DBG_C_AddrToObject 28
+#define DBG_C_XchngOpcode 29
+#define DBG_C_LinToSel 30
+#define DBG_C_SelToLin 31
+
+#define DBG_N_Success 0
+#define DBG_N_Error (-1)
+#define DBG_N_ProcTerm (-6)
+#define DBG_N_Exception (-7)
+#define DBG_N_ModuleLoad (-8)
+#define DBG_N_CoError (-9)
+#define DBG_N_ThreadTerm (-10)
+#define DBG_N_AsyncStop (-11)
+#define DBG_N_NewProc (-12)
+#define DBG_N_AliasFree (-13)
+#define DBG_N_Watchpoint (-14)
+#define DBG_N_ThreadCreate (-15)
+#define DBG_N_ModuleFree (-16)
+#define DBG_N_RangeStep (-17)
+
+#define DBG_D_Thawed 0
+#define DBG_D_Frozen 1
+
+#define DBG_T_Runnable 0
+#define DBG_T_Suspended 1
+#define DBG_T_Blocked 2
+#define DBG_T_CritSec 3
+
+#define DBG_L_386 1
+
+#define DBG_LEN_387 108
+
+#define DBG_CO_387 1
+
+#define DBG_O_OBJMTE 0x10000000
+
+#define DBG_W_Global 0x00000001
+#define DBG_W_Local 0x00000002
+#define DBG_W_Execute 0x00010000
+#define DBG_W_Write 0x00020000
+#define DBG_W_ReadWrite 0x00030000
+
+#define DBG_X_PRE_FIRST_CHANCE 0x00000000
+#define DBG_X_FIRST_CHANCE 0x00000001
+#define DBG_X_LAST_CHANCE 0x00000002
+#define DBG_X_STACK_INVALID 0x00000003
+
+typedef struct _TStat
+{
+ UCHAR DbgState;
+ UCHAR TState;
+ USHORT TPriority;
+} TStat_t;
+
+typedef struct _uDB
+{
+ ULONG Pid;
+ ULONG Tid;
+ LONG Cmd;
+ LONG Value;
+ ULONG Addr;
+ ULONG Buffer;
+ ULONG Len;
+ ULONG Index;
+ ULONG MTE;
+ ULONG EAX;
+ ULONG ECX;
+ ULONG EDX;
+ ULONG EBX;
+ ULONG ESP;
+ ULONG EBP;
+ ULONG ESI;
+ ULONG EDI;
+ ULONG EFlags;
+ ULONG EIP;
+ ULONG CSLim;
+ ULONG CSBase;
+ UCHAR CSAcc;
+ UCHAR CSAtr;
+ USHORT CS;
+ ULONG DSLim;
+ ULONG DSBase;
+ UCHAR DSAcc;
+ UCHAR DSAtr;
+ USHORT DS;
+ ULONG ESLim;
+ ULONG ESBase;
+ UCHAR ESAcc;
+ UCHAR ESAtr;
+ USHORT ES;
+ ULONG FSLim;
+ ULONG FSBase;
+ UCHAR FSAcc;
+ UCHAR FSAtr;
+ USHORT FS;
+ ULONG GSLim;
+ ULONG GSBase;
+ UCHAR GSAcc;
+ UCHAR GSAtr;
+ USHORT GS;
+ ULONG SSLim;
+ ULONG SSBase;
+ UCHAR SSAcc;
+ UCHAR SSAtr;
+ USHORT SS;
+} uDB_t;
+
+ULONG DosDebug (uDB_t *pDebugBuffer);
+
+#endif /* INCL_DOSPROCESS */
+
+/* ---------------------------- MESSAGES ---------------------------------- */
+
+#if defined (INCL_DOSMISC)
+
+ULONG DosGetMessage (PCHAR *pTable, ULONG ulTableEntries,
+ PCHAR pBuffer, ULONG ulBufferLengthMax, ULONG ulMsgnNumber,
+ PCSZ pszFile, PULONG pulBufferLength);
+ULONG DosInsertMessage (PCHAR *pTable, ULONG ulCount, PCSZ pszMsg,
+ ULONG ulMsgLength, PCHAR pBuffer, ULONG ulBufferLengthMax,
+ PULONG pulBufferLength);
+ULONG DosPutMessage (HFILE hfile, ULONG ulMessageLength, PCHAR pMessage);
+ULONG DosQueryMessageCP (PCHAR pBuffer, ULONG ulBufferLengthMax,
+ PCSZ pszFilename, PULONG pulBufferLength);
+
+#endif /* INCL_DOSMISC */
+
+/* ----------------------------- RAS -------------------------------------- */
+
+#if defined (INCL_DOSRAS)
+
+#define DDP_DISABLEPROCDUMP 0
+#define DDP_ENABLEPROCDUMP 1
+#define DDP_PERFORMPROCDUMP 2
+
+#define LF_LOGENABLE 0x0001
+#define LF_LOGAVAILABLE 0x0002
+
+#define SIS_MMIOADDR 0
+#define SIS_MEC_TABLE 1
+#define SIS_SYS_LOG 2
+
+#define SPU_DISABLESUPPRESSION 0
+#define SPU_ENABLESUPPRESSION 1
+
+ULONG DosDumpProcess (ULONG ulFlag, ULONG ulDrive, PID pid);
+ULONG DosForceSystemDump (ULONG ulReserved);
+ULONG DosQueryRASInfo (ULONG ulIndex, PPVOID addr);
+ULONG DosSuppressPopUps (ULONG ulFlag, ULONG ulDrive);
+
+#endif /* INCL_DOSRAS */
+
+/* ---------------------------- REXX -------------------------------------- */
+
+#define RXAUTOBUFLEN 256
+
+typedef struct _RXSTRING
+{
+ ULONG strlength;
+ PCH strptr;
+} RXSTRING;
+typedef RXSTRING *PRXSTRING;
+
+typedef struct _RXSYSEXIT
+{
+ PSZ sysexit_name;
+ LONG sysexit_code;
+} RXSYSEXIT;
+typedef RXSYSEXIT *PRXSYSEXIT;
+
+#define RXNULLSTRING(r) ((r).strptr == (PCH)0)
+#define RXZEROLENSTRING(r) ((r).strptr != (PCH)0 && (r).strlength == 0)
+#define RXVALIDSTRING(r) ((r).strptr != (PCH)0 && (r).strlength != 0)
+#define RXSTRLEN(r) (RXNULLSTRING(r) ? 0 : (r).strlength)
+#define RXSTRPTR(r) (r).strptr
+#define MAKERXSTRING(r,p,l) \
+ ((r).strptr = (PCH)p, (r).strlength = (ULONG)l)
+
+#define RXCOMMAND 0
+#define RXSUBROUTINE 1
+#define RXFUNCTION 2
+
+#if defined (INCL_RXSUBCOM)
+
+#define RXSUBCOM_DROPPABLE 0x0000
+#define RXSUBCOM_NONDROP 0x0001
+
+#define RXSUBCOM_ISREG 0x0001
+#define RXSUBCOM_ERROR 0x0001
+#define RXSUBCOM_FAILURE 0x0002
+
+#define RXSUBCOM_BADENTRY 1001
+#define RXSUBCOM_NOEMEM 1002
+#define RXSUBCOM_BADTYPE 1003
+#define RXSUBCOM_NOTINIT 1004
+
+#define RXSUBCOM_OK 0
+#define RXSUBCOM_DUP 10
+#define RXSUBCOM_MAXREG 20
+#define RXSUBCOM_NOTREG 30
+#define RXSUBCOM_NOCANDROP 40
+#define RXSUBCOM_LOADERR 50
+#define RXSUBCOM_NOPROC 127
+
+typedef ULONG RexxSubcomHandler (PRXSTRING prxCommand, PUSHORT pusFlags,
+ PRXSTRING prxResult);
+
+ULONG RexxDeregisterSubcom (PCSZ pszEnvName, PCSZ pszModuleName);
+ULONG RexxQuerySubcom (PCSZ pszEnvName, PCSZ pszModuleName, PUSHORT pusFlags,
+ PUCHAR pUserWord);
+ULONG RexxRegisterSubcomDll (PCSZ pszEnvName, PCSZ pszModuleName,
+ PCSZ pszEntryPoint, PUCHAR pUserArea, ULONG ulDropAuth);
+ULONG RexxRegisterSubcomExe (PCSZ pszEnvName, PFN pfnEntryPoint,
+ PUCHAR pUserArea);
+
+#define REXXDEREGISTERSUBCOM RexxDeregisterSubcom
+#define REXXREGISTERSUBCOMDLL RexxRegisterSubcomDll
+#define REXXREGISTERSUBCOMEXE RexxRegisterSubcomExe
+#define REXXQUERYSUBCOM RexxQuerySubcom
+
+#endif /* INCL_RXSUBCOM */
+
+#if defined (INCL_RXSHV)
+
+#define RXSHV_SET 0x0000
+#define RXSHV_FETCH 0x0001
+#define RXSHV_DROPV 0x0002
+#define RXSHV_SYSET 0x0003
+#define RXSHV_SYFET 0x0004
+#define RXSHV_SYDRO 0x0005
+#define RXSHV_NEXTV 0x0006
+#define RXSHV_PRIV 0x0007
+#define RXSHV_EXIT 0x0008
+
+#define RXSHV_NOAVL 144
+
+#define RXSHV_OK 0x0000
+#define RXSHV_NEWV 0x0001
+#define RXSHV_LVAR 0x0002
+#define RXSHV_TRUNC 0x0004
+#define RXSHV_BADN 0x0008
+#define RXSHV_MEMFL 0x0010
+#define RXSHV_BADF 0x0080
+
+typedef struct _SHVBLOCK
+{
+ struct _SHVBLOCK *shvnext;
+ RXSTRING shvname;
+ RXSTRING shvvalue;
+ ULONG shvnamelen;
+ ULONG shvvaluelen;
+ UCHAR shvcode;
+ UCHAR shvret;
+} SHVBLOCK;
+typedef SHVBLOCK *PSHVBLOCK;
+
+ULONG RexxVariablePool (PSHVBLOCK pRequest);
+
+#define REXXVARIABLEPOOL RexxVariablePool
+
+#endif /* INCL_RXSHV */
+
+#if defined (INCL_RXFUNC)
+
+#define RXFUNC_DYNALINK 1
+#define RXFUNC_CALLENTRY 2
+
+#define RXFUNC_OK 0
+#define RXFUNC_DEFINED 10
+#define RXFUNC_NOMEM 20
+#define RXFUNC_NOTREG 30
+#define RXFUNC_MODNOTFND 40
+#define RXFUNC_ENTNOTFND 50
+#define RXFUNC_NOTINIT 60
+#define RXFUNC_BADTYPE 70
+
+typedef ULONG RexxFunctionHandler (PCSZ pszName, ULONG ulArgCount,
+ PRXSTRING prxArgList, PCSZ pszQueueName, PRXSTRING prxResult);
+
+ULONG RexxDeregisterFunction (PCSZ pszFuncName);
+ULONG RexxQueryFunction (PCSZ pszFuncName);
+ULONG RexxRegisterFunctionDll (PCSZ pszFuncName, PCSZ pszModuleName,
+ PCSZ pszEntryPoint);
+ULONG RexxRegisterFunctionExe (PCSZ pszFuncName,
+ RexxFunctionHandler *pfnEntryPoint);
+
+#define REXXDEREGISTERFUNCTION RexxDeregisterFunction
+#define REXXQUERYFUNCTION RexxQueryFunction
+#define REXXREGISTERFUNCTIONDLL RexxRegisterFunctionDll
+#define REXXREGISTERFUNCTIONEXE RexxRegisterFunctionExe
+
+#endif /* INCL_RXFUNC */
+
+#if defined (INCL_RXSYSEXIT)
+
+#define RXEXIT_DROPPABLE 0x0000
+#define RXEXIT_NONDROP 0x0001
+
+#define RXEXIT_HANDLED 0
+#define RXEXIT_NOT_HANDLED 1
+#define RXEXIT_RAISE_ERROR (-1)
+
+#define RXEXIT_ISREG 0x0001
+#define RXEXIT_ERROR 0x0001
+#define RXEXIT_FAILURE 0x0002
+
+#define RXEXIT_BADENTRY 1001
+#define RXEXIT_NOEMEM 1002
+#define RXEXIT_BADTYPE 1003
+#define RXEXIT_NOTINIT 1004
+
+#define RXEXIT_OK 0
+#define RXEXIT_DUP 10
+#define RXEXIT_MAXREG 20
+#define RXEXIT_NOTREG 30
+#define RXEXIT_NOCANDROP 40
+#define RXEXIT_LOADERR 50
+#define RXEXIT_NOPROC 127
+
+#define RXENDLST 0
+
+#define RXFNC 2
+#define RXFNCCAL 1
+
+#define RXCMD 3
+#define RXCMDHST 1
+
+#define RXMSQ 4
+#define RXMSQPLL 1
+#define RXMSQPSH 2
+#define RXMSQSIZ 3
+#define RXMSQNAM 20
+
+#define RXSIO 5
+#define RXSIOSAY 1
+#define RXSIOTRC 2
+#define RXSIOTRD 3
+#define RXSIODTR 4
+#define RXSIOTLL 5
+
+#define RXHLT 7
+#define RXHLTCLR 1
+#define RXHLTTST 2
+
+#define RXTRC 8
+#define RXTRCTST 1
+
+#define RXINI 9
+#define RXINIEXT 1
+
+#define RXTER 10
+#define RXTEREXT 1
+
+#define RXNOOFEXITS 11
+
+typedef PUCHAR PEXIT;
+
+typedef struct _RXFNC_FLAGS
+{
+ ULONG rxfferr : 1;
+ ULONG rxffnfnd : 1;
+ ULONG rxffsub : 1;
+} RXFNC_FLAGS;
+
+typedef struct _RXFNCCAL_PARM
+{
+ RXFNC_FLAGS rxfnc_flags;
+ PUCHAR rxfnc_name;
+ USHORT rxfnc_namel;
+ PUCHAR rxfnc_que;
+ USHORT rxfnc_quel;
+ USHORT rxfnc_argc;
+ PRXSTRING rxfnc_argv;
+ RXSTRING rxfnc_retc;
+} RXFNCCAL_PARM;
+
+typedef struct _RXCMD_FLAGS
+{
+ ULONG rxfcfail : 1;
+ ULONG rxfcerr : 1;
+} RXCMD_FLAGS;
+
+typedef struct _RXCMDHST_PARM
+{
+ RXCMD_FLAGS rxcmd_flags;
+ PUCHAR rxcmd_address;
+ USHORT rxcmd_addressl;
+ PUCHAR rxcmd_dll;
+ USHORT rxcmd_dll_len;
+ RXSTRING rxcmd_command;
+ RXSTRING rxcmd_retc;
+} RXCMDHST_PARM;
+
+typedef struct _RXMSQPLL_PARM
+{
+ RXSTRING rxmsq_retc;
+} RXMSQPLL_PARM;
+
+typedef struct _RXMSQ_FLAGS
+{
+ ULONG rxfmlifo : 1;
+} RXMSQ_FLAGS;
+
+typedef struct _RXMSQPSH_PARM
+{
+ RXMSQ_FLAGS rxmsq_flags;
+ RXSTRING rxmsq_value;
+} RXMSQPSH_PARM;
+
+typedef struct _RXMSQSIZ_PARM
+{
+ ULONG rxmsq_size;
+} RXMSQSIZ_PARM;
+
+typedef struct _RXMSQNAM_PARM
+{
+ RXSTRING rxmsq_name;
+} RXMSQNAM_PARM;
+
+typedef struct _RXSIOSAY_PARM
+{
+ RXSTRING rxsio_string;
+} RXSIOSAY_PARM;
+
+typedef struct _RXSIOTRC_PARM
+{
+ RXSTRING rxsio_string;
+} RXSIOTRC_PARM;
+
+typedef struct _RXSIOTRD_PARM
+{
+ RXSTRING rxsiotrd_retc;
+} RXSIOTRD_PARM;
+
+typedef struct _RXSIODR_PARM
+{
+ RXSTRING rxsiodtr_retc;
+} RXSIODTR_PARM;
+
+typedef struct _RXHLT_FLAGS
+{
+ ULONG rxfhhalt : 1;
+} RXHLT_FLAGS;
+
+typedef struct _RXHLTTST_PARM
+{
+ RXHLT_FLAGS rxhlt_flags;
+} RXHLTTST_PARM;
+
+typedef struct _RXTRC_FLAGS
+{
+ ULONG rxftrace : 1;
+} RXTRC_FLAGS;
+
+typedef struct _RXTRCTST_PARM
+{
+ RXTRC_FLAGS rxtrc_flags;
+} RXTRCTST_PARM;
+
+typedef LONG RexxExitHandler (LONG lExitNumber, LONG lSubfunction,
+ PEXIT pParmBlock);
+
+ULONG RexxDeregisterExit (PCSZ pszEnvName, PCSZ pszModuleName);
+ULONG RexxQueryExit (PCSZ pszEnvName, PCSZ pszModuleName, PUSHORT pusFlag,
+ PUCHAR pUserWord);
+ULONG RexxRegisterExitDll (PCSZ pszEnvName, PCSZ pszModuleName,
+ PCSZ pszEntryName, PUCHAR pUserArea, ULONG ulDropAuth);
+ULONG RexxRegisterExitExe (PCSZ pszEnvName, PFN pfnEntryPoint,
+ PUCHAR pUserArea);
+
+#define REXXDEREGISTEREXIT RexxDeregisterExit
+#define REXXQUERYEXIT RexxQueryExit
+#define REXXREGISTEREXITDLL RexxRegisterExitDll
+#define REXXREGISTEREXITEXE RexxRegisterExitExe
+
+#endif /* INCL_RXSYSEXIT */
+
+#if defined (INCL_RXARI)
+
+#define RXARI_OK 0
+#define RXARI_NOT_FOUND 1
+#define RXARI_PROCESSING_ERROR 2
+
+ULONG RexxResetTrace (PID pid, TID tid);
+ULONG RexxSetHalt (PID pid, TID tid);
+ULONG RexxSetTrace (PID pid, TID tid);
+
+#define REXXRESETTRACE RexxResetTrace
+#define REXXSETHALT RexxSetHalt
+#define REXXSETTRACE RexxSetTrace
+
+#endif /* INCL_RXARI */
+
+#if defined (INCL_RXMACRO)
+
+#define RXMACRO_SEARCH_BEFORE 1
+#define RXMACRO_SEARCH_AFTER 2
+
+#define RXMACRO_OK 0
+#define RXMACRO_NO_STORAGE 1
+#define RXMACRO_NOT_FOUND 2
+#define RXMACRO_EXTENSION_REQUIRED 3
+#define RXMACRO_ALREADY_EXISTS 4
+#define RXMACRO_FILE_ERROR 5
+#define RXMACRO_SIGNATURE_ERROR 6
+#define RXMACRO_SOURCE_NOT_FOUND 7
+#define RXMACRO_INVALID_POSITION 8
+#define RXMACRO_NOT_INIT 9
+
+ULONG RexxAddMacro (PCSZ pszFuncName, PCSZ pszSourceFile, ULONG ulPosition);
+ULONG RexxClearMacroSpace (VOID);
+ULONG RexxDropMacro (PCSZ pszFuncName);
+ULONG RexxLoadMacroSpace (ULONG ulFuncCout, PCSZ *apszFuncNames,
+ PCSZ pszMacroLibFile);
+ULONG RexxQueryMacro (PCSZ pszFuncName, PUSHORT pusPosition);
+ULONG RexxReorderMacro(PCSZ pszFuncName, ULONG ulPosition);
+ULONG RexxSaveMacroSpace (ULONG ulFuncCount, PCSZ *apszFuncNames,
+ PCSZ pszMacroLibFile);
+
+#define REXXADDMACRO RexxAddMacro
+#define REXXCLEARMACROSPACE RexxClearMacroSpace
+#define REXXDROPMACRO RexxDropMacro
+#define REXXSAVEMACROSPACE RexxSaveMacroSpace
+#define REXXLOADMACROSPACE RexxLoadMacroSpace
+#define REXXQUERYMACRO RexxQueryMacro
+#define REXXREORDERMACRO RexxReorderMacro
+
+#endif /* INCL_RXMACRO */
+
+LONG RexxStart (LONG lArgCount, PRXSTRING prxArgList, PCSZ pszProgramName,
+ PRXSTRING prxInstore, PCSZ pszEnvName, LONG lCallType, PRXSYSEXIT pExits,
+ PSHORT psReturnCode, PRXSTRING prxResult);
+
+#define REXXSTART RexxStart
+
+/* ----------------------- PRESENTATION MANAGER --------------------------- */
+
+#define CTLS_WM_BIDI_FIRST 0x390
+#define CTLS_WM_BIDI_LAST 0x39f
+
+#if defined (INCL_NLS)
+#define WM_DBCSFIRST 0x00b0
+#define WM_DBCSLAST 0x00cf
+#endif /* INCL_NLS */
+
+#define WC_FRAME ((PSZ)0xffff0001)
+#define WC_COMBOBOX ((PSZ)0xffff0002)
+#define WC_BUTTON ((PSZ)0xffff0003)
+#define WC_MENU ((PSZ)0xffff0004)
+#define WC_STATIC ((PSZ)0xffff0005)
+#define WC_ENTRYFIELD ((PSZ)0xffff0006)
+#define WC_LISTBOX ((PSZ)0xffff0007)
+#define WC_SCROLLBAR ((PSZ)0xffff0008)
+#define WC_TITLEBAR ((PSZ)0xffff0009)
+#define WC_MLE ((PSZ)0xffff000a)
+#define WC_APPSTAT ((PSZ)0xffff0010)
+#define WC_KBDSTAT ((PSZ)0xffff0011)
+#define WC_PECIC ((PSZ)0xffff0012)
+#define WC_DBE_KKPOPUP ((PSZ)0xffff0013)
+#define WC_SPINBUTTON ((PSZ)0xffff0020)
+#define WC_CONTAINER ((PSZ)0xffff0025)
+#define WC_SLIDER ((PSZ)0xffff0026)
+#define WC_VALUESET ((PSZ)0xffff0027)
+#define WC_NOTEBOOK ((PSZ)0xffff0028)
+#define WC_PENFIRST ((PSZ)0xffff0029)
+#define WC_PENLAST ((PSZ)0xffff002c)
+#define WC_MMPMFIRST ((PSZ)0xffff0040)
+#define WC_CIRCULARSLIDER ((PSZ)0xffff0041)
+#define WC_MMPMLAST ((PSZ)0xffff004f)
+
+#define WS_VISIBLE 0x80000000
+#define WS_DISABLED 0x40000000
+#define WS_CLIPCHILDREN 0x20000000
+#define WS_CLIPSIBLINGS 0x10000000
+#define WS_PARENTCLIP 0x08000000
+#define WS_SAVEBITS 0x04000000
+#define WS_SYNCPAINT 0x02000000
+#define WS_MINIMIZED 0x01000000
+#define WS_MAXIMIZED 0x00800000
+#define WS_ANIMATE 0x00400000
+#define WS_GROUP 0x00010000
+#define WS_TABSTOP 0x00020000
+#define WS_MULTISELECT 0x00040000
+
+#define CS_MOVENOTIFY 0x00000001
+#define CS_SIZEREDRAW 0x00000004
+#define CS_HITTEST 0x00000008
+#define CS_PUBLIC 0x00000010
+#define CS_FRAME 0x00000020
+#define CS_CLIPCHILDREN 0x20000000
+#define CS_CLIPSIBLINGS 0x10000000
+#define CS_PARENTCLIP 0x08000000
+#define CS_SAVEBITS 0x04000000
+#define CS_SYNCPAINT 0x02000000
+
+#define MID_NONE (-1)
+#define MID_ERROR (-1)
+
+#define DB_PATCOPY 0x0000
+#define DB_PATINVERT 0x0001
+#define DB_DESTINVERT 0x0002
+#define DB_AREAMIXMODE 0x0003
+
+#define DB_ROP 0x0007
+#define DB_INTERIOR 0x0008
+#define DB_AREAATTRS 0x0010
+#define DB_STANDARD 0x0100
+#define DB_DLGBORDER 0x0200
+
+#define DBM_NORMAL 0x0000
+#define DBM_INVERT 0x0001
+#define DBM_HALFTONE 0x0002
+#define DBM_STRETCH 0x0004
+#define DBM_IMAGEATTRS 0x0008
+
+#define DT_LEFT 0x00000000
+#define DT_QUERYEXTENT 0x00000002
+#define DT_UNDERSCORE 0x00000010
+#define DT_STRIKEOUT 0x00000020
+#define DT_TEXTATTRS 0x00000040
+#define DT_EXTERNALLEADING 0x00000080
+#define DT_CENTER 0x00000100
+#define DT_RIGHT 0x00000200
+#define DT_TOP 0x00000000
+#define DT_VCENTER 0x00000400
+#define DT_BOTTOM 0x00000800
+#define DT_HALFTONE 0x00001000
+#define DT_MNEMONIC 0x00002000
+#define DT_WORDBREAK 0x00004000
+#define DT_ERASERECT 0x00008000
+
+#define QW_NEXT 0
+#define QW_PREV 1
+#define QW_TOP 2
+#define QW_BOTTOM 3
+#define QW_OWNER 4
+#define QW_PARENT 5
+#define QW_NEXTTOP 6
+#define QW_PREVTOP 7
+#define QW_FRAMEOWNER 8
+
+#define SWP_SIZE 0x0001
+#define SWP_MOVE 0x0002
+#define SWP_ZORDER 0x0004
+#define SWP_SHOW 0x0008
+#define SWP_HIDE 0x0010
+#define SWP_NOREDRAW 0x0020
+#define SWP_NOADJUST 0x0040
+#define SWP_ACTIVATE 0x0080
+#define SWP_DEACTIVATE 0x0100
+#define SWP_EXTSTATECHANGE 0x0200
+#define SWP_MINIMIZE 0x0400
+#define SWP_MAXIMIZE 0x0800
+#define SWP_RESTORE 0x1000
+#define SWP_FOCUSACTIVATE 0x2000
+#define SWP_FOCUSDEACTIVATE 0x4000
+#define SWP_NOAUTOCLOSE 0x8000
+
+#define AWP_MINIMIZED 0x00010000
+#define AWP_MAXIMIZED 0x00020000
+#define AWP_RESTORED 0x00040000
+#define AWP_ACTIVATE 0x00080000
+#define AWP_DEACTIVATE 0x00100000
+
+#define HWND_DESKTOP ((HWND)1)
+#define HWND_OBJECT ((HWND)2)
+#define HWND_TOP ((HWND)3)
+#define HWND_BOTTOM ((HWND)4)
+#define HWND_THREADCAPTURE ((HWND)5)
+
+#define EAF_DEFAULTOWNER 0x0001
+#define EAF_UNCHANGEABLE 0x0002
+#define EAF_REUSEICON 0x0004
+
+#define ICON_FILE 1
+#define ICON_RESOURCE 2
+#define ICON_DATA 3
+#define ICON_CLEAR 4
+
+#define SZDDEFMT_RTF "Rich Text Format"
+#define SZDDEFMT_PTRPICT "Printer_Picture"
+
+#define STR_DLLNAME "keyremap"
+
+#if defined (INCL_WINERRORS)
+
+#define PMERR_INVALID_HWND 0x1001
+#define PMERR_INVALID_HMQ 0x1002
+#define PMERR_PARAMETER_OUT_OF_RANGE 0x1003
+#define PMERR_WINDOW_LOCK_UNDERFLOW 0x1004
+#define PMERR_WINDOW_LOCK_OVERFLOW 0x1005
+#define PMERR_BAD_WINDOW_LOCK_COUNT 0x1006
+#define PMERR_WINDOW_NOT_LOCKED 0x1007
+#define PMERR_INVALID_SELECTOR 0x1008
+#define PMERR_CALL_FROM_WRONG_THREAD 0x1009
+#define PMERR_RESOURCE_NOT_FOUND 0x100a
+#define PMERR_INVALID_STRING_PARM 0x100b
+#define PMERR_INVALID_HHEAP 0x100c
+#define PMERR_INVALID_HEAP_POINTER 0x100d
+#define PMERR_INVALID_HEAP_SIZE_PARM 0x100e
+#define PMERR_INVALID_HEAP_SIZE 0x100f
+#define PMERR_INVALID_HEAP_SIZE_WORD 0x1010
+#define PMERR_HEAP_OUT_OF_MEMORY 0x1011
+#define PMERR_HEAP_MAX_SIZE_REACHED 0x1012
+#define PMERR_INVALID_HATOMTBL 0x1013
+#define PMERR_INVALID_ATOM 0x1014
+#define PMERR_INVALID_ATOM_NAME 0x1015
+#define PMERR_INVALID_INTEGER_ATOM 0x1016
+#define PMERR_ATOM_NAME_NOT_FOUND 0x1017
+#define PMERR_QUEUE_TOO_LARGE 0x1018
+#define PMERR_INVALID_FLAG 0x1019
+#define PMERR_INVALID_HACCEL 0x101a
+#define PMERR_INVALID_HPTR 0x101b
+#define PMERR_INVALID_HENUM 0x101c
+#define PMERR_INVALID_SRC_CODEPAGE 0x101d
+#define PMERR_INVALID_DST_CODEPAGE 0x101e
+#define PMERR_UNKNOWN_COMPONENT_ID 0x101f
+#define PMERR_UNKNOWN_ERROR_CODE 0x1020
+#define PMERR_SEVERITY_LEVELS 0x1021
+#define PMERR_INVALID_RESOURCE_FORMAT 0x1034
+#define PMERR_NO_MSG_QUEUE 0x1036
+#define PMERR_CANNOT_SET_FOCUS 0x1037
+#define PMERR_QUEUE_FULL 0x1038
+#define PMERR_LIBRARY_LOAD_FAILED 0x1039
+#define PMERR_PROCEDURE_LOAD_FAILED 0x103a
+#define PMERR_LIBRARY_DELETE_FAILED 0x103b
+#define PMERR_PROCEDURE_DELETE_FAILED 0x103c
+#define PMERR_ARRAY_TOO_LARGE 0x103d
+#define PMERR_ARRAY_TOO_SMALL 0x103e
+#define PMERR_DATATYPE_ENTRY_BAD_INDEX 0x103f
+#define PMERR_DATATYPE_ENTRY_CTL_BAD 0x1040
+#define PMERR_DATATYPE_ENTRY_CTL_MISS 0x1041
+#define PMERR_DATATYPE_ENTRY_INVALID 0x1042
+#define PMERR_DATATYPE_ENTRY_NOT_NUM 0x1043
+#define PMERR_DATATYPE_ENTRY_NOT_OFF 0x1044
+#define PMERR_DATATYPE_INVALID 0x1045
+#define PMERR_DATATYPE_NOT_UNIQUE 0x1046
+#define PMERR_DATATYPE_TOO_LONG 0x1047
+#define PMERR_DATATYPE_TOO_SMALL 0x1048
+#define PMERR_DIRECTION_INVALID 0x1049
+#define PMERR_INVALID_HAB 0x104a
+#define PMERR_INVALID_HSTRUCT 0x104d
+#define PMERR_LENGTH_TOO_SMALL 0x104e
+#define PMERR_MSGID_TOO_SMALL 0x104f
+#define PMERR_NO_HANDLE_ALLOC 0x1050
+#define PMERR_NOT_IN_A_PM_SESSION 0x1051
+#define PMERR_MSG_QUEUE_ALREADY_EXISTS 0x1052
+#define PMERR_SEND_MSG_TIMEOUT 0x1053
+#define PMERROR_SEND_MSG_FAILED 0x1054
+#define PMERR_OLD_RESOURCE 0x1055
+#define PMERR_WPDSERVER_IS_ACTIVE 0x1056
+#define PMERR_WPDSERVER_NOT_STARTED 0x1057
+#define PMERR_SOMDD_IS_ACTIVE 0x1058
+#define PMERR_SOMDD_NOT_STARTED 0x1059
+
+#define PMERR_BIDI_FIRST 0x10f0
+#define PMERR_BIDI_LAST 0x10ff
+
+#endif /* INCL_WINERRORS */
+
+#if defined (INCL_SHLERRORS)
+
+#define PMERR_INVALID_PIB 0x1101
+#define PMERR_INSUFF_SPACE_TO_ADD 0x1102
+#define PMERR_INVALID_GROUP_HANDLE 0x1103
+#define PMERR_DUPLICATE_TITLE 0x1104
+#define PMERR_INVALID_TITLE 0x1105
+#define PMERR_HANDLE_NOT_IN_GROUP 0x1107
+#define PMERR_INVALID_TARGET_HANDLE 0x1106
+#define PMERR_INVALID_PATH_STATEMENT 0x1108
+#define PMERR_NO_PROGRAM_FOUND 0x1109
+#define PMERR_INVALID_BUFFER_SIZE 0x110a
+#define PMERR_BUFFER_TOO_SMALL 0x110b
+#define PMERR_PL_INITIALISATION_FAIL 0x110c
+#define PMERR_CANT_DESTROY_SYS_GROUP 0x110d
+#define PMERR_INVALID_TYPE_CHANGE 0x110e
+#define PMERR_INVALID_PROGRAM_HANDLE 0x110f
+#define PMERR_NOT_CURRENT_PL_VERSION 0x1110
+#define PMERR_INVALID_CIRCULAR_REF 0x1111
+#define PMERR_MEMORY_ALLOCATION_ERR 0x1112
+#define PMERR_MEMORY_DEALLOCATION_ERR 0x1113
+#define PMERR_TASK_HEADER_TOO_BIG 0x1114
+#define PMERR_INVALID_INI_FILE_HANDLE 0x1115
+#define PMERR_MEMORY_SHARE 0x1116
+#define PMERR_OPEN_QUEUE 0x1117
+#define PMERR_CREATE_QUEUE 0x1118
+#define PMERR_WRITE_QUEUE 0x1119
+#define PMERR_READ_QUEUE 0x111a
+#define PMERR_CALL_NOT_EXECUTED 0x111b
+#define PMERR_UNKNOWN_APIPKT 0x111c
+#define PMERR_INITHREAD_EXISTS 0x111d
+#define PMERR_CREATE_THREAD 0x111e
+#define PMERR_NO_HK_PROFILE_INSTALLED 0x111f
+#define PMERR_INVALID_DIRECTORY 0x1120
+#define PMERR_WILDCARD_IN_FILENAME 0x1121
+#define PMERR_FILENAME_BUFFER_FULL 0x1122
+#define PMERR_FILENAME_TOO_LONG 0x1123
+#define PMERR_INI_FILE_IS_SYS_OR_USER 0x1124
+#define PMERR_BROADCAST_PLMSG 0x1125
+#define PMERR_190_INIT_DONE 0x1126
+#define PMERR_HMOD_FOR_PMSHAPI 0x1127
+#define PMERR_SET_HK_PROFILE 0x1128
+#define PMERR_API_NOT_ALLOWED 0x1129
+#define PMERR_INI_STILL_OPEN 0x112a
+#define PMERR_PROGDETAILS_NOT_IN_INI 0x112b
+#define PMERR_PIBSTRUCT_NOT_IN_INI 0x112c
+#define PMERR_INVALID_DISKPROGDETAILS 0x112d
+#define PMERR_PROGDETAILS_READ_FAILURE 0x112e
+#define PMERR_PROGDETAILS_WRITE_FAILURE 0x112f
+#define PMERR_PROGDETAILS_QSIZE_FAILURE 0x1130
+#define PMERR_INVALID_PROGDETAILS 0x1131
+#define PMERR_SHEPROFILEHOOK_NOT_FOUND 0x1132
+#define PMERR_190PLCONVERTED 0x1133
+#define PMERR_FAILED_TO_CONVERT_INI_PL 0x1134
+#define PMERR_PMSHAPI_NOT_INITIALISED 0x1135
+#define PMERR_INVALID_SHELL_API_HOOK_ID 0x1136
+#define PMERR_DOS_ERROR 0x1200
+#define PMERR_NO_SPACE 0x1201
+#define PMERR_INVALID_SWITCH_HANDLE 0x1202
+#define PMERR_NO_HANDLE 0x1203
+#define PMERR_INVALID_PROCESS_ID 0x1204
+#define PMERR_NOT_SHELL 0x1205
+#define PMERR_INVALID_WINDOW 0x1206
+#define PMERR_INVALID_POST_MSG 0x1207
+#define PMERR_INVALID_PARAMETERS 0x1208
+#define PMERR_INVALID_PROGRAM_TYPE 0x1209
+#define PMERR_NOT_EXTENDED_FOCUS 0x120a
+#define PMERR_INVALID_SESSION_ID 0x120b
+#define PMERR_SMG_INVALID_ICON_FILE 0x120c
+#define PMERR_SMG_ICON_NOT_CREATED 0x120d
+#define PMERR_SHL_DEBUG 0x120e
+#define PMERR_OPENING_INI_FILE 0x1301
+#define PMERR_INI_FILE_CORRUPT 0x1302
+#define PMERR_INVALID_PARM 0x1303
+#define PMERR_NOT_IN_IDX 0x1304
+#define PMERR_NO_ENTRIES_IN_GROUP 0x1305
+#define PMERR_INI_WRITE_FAIL 0x1306
+#define PMERR_IDX_FULL 0x1307
+#define PMERR_INI_PROTECTED 0x1308
+#define PMERR_MEMORY_ALLOC 0x1309
+#define PMERR_INI_INIT_ALREADY_DONE 0x130a
+#define PMERR_INVALID_INTEGER 0x130b
+#define PMERR_INVALID_ASCIIZ 0x130c
+#define PMERR_CAN_NOT_CALL_SPOOLER 0x130d
+#define PMERR_VALIDATION_REJECTED 0x130d /*!*/
+#define PMERR_WARNING_WINDOW_NOT_KILLED 0x1401
+#define PMERR_ERROR_INVALID_WINDOW 0x1402
+#define PMERR_ALREADY_INITIALIZED 0x1403
+#define PMERR_MSG_PROG_NO_MOU 0x1405
+#define PMERR_MSG_PROG_NON_RECOV 0x1406
+#define PMERR_WINCONV_INVALID_PATH 0x1407
+#define PMERR_PI_NOT_INITIALISED 0x1408
+#define PMERR_PL_NOT_INITIALISED 0x1409
+#define PMERR_NO_TASK_MANAGER 0x140a
+#define PMERR_SAVE_NOT_IN_PROGRESS 0x140b
+#define PMERR_NO_STACK_SPACE 0x140c
+#define PMERR_INVALID_COLR_FIELD 0x140d
+#define PMERR_INVALID_COLR_VALUE 0x140e
+#define PMERR_COLR_WRITE 0x140f
+#define PMERR_TARGET_FILE_EXISTS 0x1501
+#define PMERR_SOURCE_SAME_AS_TARGET 0x1502
+#define PMERR_SOURCE_FILE_NOT_FOUND 0x1503
+#define PMERR_INVALID_NEW_PATH 0x1504
+#define PMERR_TARGET_FILE_NOT_FOUND 0x1505
+#define PMERR_INVALID_DRIVE_NUMBER 0x1506
+#define PMERR_NAME_TOO_LONG 0x1507
+#define PMERR_NOT_ENOUGH_ROOM_ON_DISK 0x1508
+#define PMERR_NOT_ENOUGH_MEM 0x1509
+#define PMERR_LOG_DRV_DOES_NOT_EXIST 0x150b
+#define PMERR_INVALID_DRIVE 0x150c
+#define PMERR_ACCESS_DENIED 0x150d
+#define PMERR_NO_FIRST_SLASH 0x150e
+#define PMERR_READ_ONLY_FILE 0x150f
+#define PMERR_GROUP_PROTECTED 0x151f
+#define PMERR_INVALID_PROGRAM_CATEGORY 0x152f
+#define PMERR_INVALID_APPL 0x1530
+#define PMERR_CANNOT_START 0x1531
+#define PMERR_STARTED_IN_BACKGROUND 0x1532
+#define PMERR_INVALID_HAPP 0x1533
+#define PMERR_CANNOT_STOP 0x1534
+#define PMERR_INVALID_FREE_MESSAGE_ID 0x1630
+#define PMERR_FUNCTION_NOT_SUPPORTED 0x1641
+#define PMERR_INVALID_ARRAY_COUNT 0x1642
+#define PMERR_INVALID_LENGTH 0x1643
+#define PMERR_INVALID_BUNDLE_TYPE 0x1644
+#define PMERR_INVALID_PARAMETER 0x1645
+#define PMERR_INVALID_NUMBER_OF_PARMS 0x1646
+#define PMERR_GREATER_THAN_64K 0x1647
+#define PMERR_INVALID_PARAMETER_TYPE 0x1648
+#define PMERR_NEGATIVE_STRCOND_DIM 0x1649
+#define PMERR_INVALID_NUMBER_OF_TYPES 0x164a
+#define PMERR_INCORRECT_HSTRUCT 0x164b
+#define PMERR_INVALID_ARRAY_SIZE 0x164c
+#define PMERR_INVALID_CONTROL_DATATYPE 0x164d
+#define PMERR_INCOMPLETE_CONTROL_SEQU 0x164e
+#define PMERR_INVALID_DATATYPE 0x164f
+#define PMERR_INCORRECT_DATATYPE 0x1650
+#define PMERR_NOT_SELF_DESCRIBING_DTYP 0x1651
+#define PMERR_INVALID_CTRL_SEQ_INDEX 0x1652
+#define PMERR_INVALID_TYPE_FOR_LENGTH 0x1653
+#define PMERR_INVALID_TYPE_FOR_OFFSET 0x1654
+#define PMERR_INVALID_TYPE_FOR_MPARAM 0x1655
+#define PMERR_INVALID_MESSAGE_ID 0x1656
+#define PMERR_C_LENGTH_TOO_SMALL 0x1657
+#define PMERR_APPL_STRUCTURE_TOO_SMALL 0x1658
+#define PMERR_INVALID_ERRORINFO_HANDLE 0x1659
+#define PMERR_INVALID_CHARACTER_INDEX 0x165a
+
+#endif /* INCL_SHLERRORS */
+
+#if defined (INCL_GPIERRORS)
+
+#define PMERR_OK 0x0000
+#define PMERR_ALREADY_IN_AREA 0x2001
+#define PMERR_ALREADY_IN_ELEMENT 0x2002
+#define PMERR_ALREADY_IN_PATH 0x2003
+#define PMERR_ALREADY_IN_SEG 0x2004
+#define PMERR_AREA_INCOMPLETE 0x2005
+#define PMERR_BASE_ERROR 0x2006
+#define PMERR_BITBLT_LENGTH_EXCEEDED 0x2007
+#define PMERR_BITMAP_IN_USE 0x2008
+#define PMERR_BITMAP_IS_SELECTED 0x2009
+#define PMERR_BITMAP_NOT_FOUND 0x200a
+#define PMERR_BITMAP_NOT_SELECTED 0x200b
+#define PMERR_BOUNDS_OVERFLOW 0x200c
+#define PMERR_CALLED_SEG_IS_CHAINED 0x200d
+#define PMERR_CALLED_SEG_IS_CURRENT 0x200e
+#define PMERR_CALLED_SEG_NOT_FOUND 0x200f
+#define PMERR_CANNOT_DELETE_ALL_DATA 0x2010
+#define PMERR_CANNOT_REPLACE_ELEMENT_0 0x2011
+#define PMERR_COL_TABLE_NOT_REALIZABLE 0x2012
+#define PMERR_COL_TABLE_NOT_REALIZED 0x2013
+#define PMERR_COORDINATE_OVERFLOW 0x2014
+#define PMERR_CORR_FORMAT_MISMATCH 0x2015
+#define PMERR_DATA_TOO_LONG 0x2016
+#define PMERR_DC_IS_ASSOCIATED 0x2017
+#define PMERR_DESC_STRING_TRUNCATED 0x2018
+#define PMERR_DEVICE_DRIVER_ERROR_1 0x2019
+#define PMERR_DEVICE_DRIVER_ERROR_2 0x201a
+#define PMERR_DEVICE_DRIVER_ERROR_3 0x201b
+#define PMERR_DEVICE_DRIVER_ERROR_4 0x201c
+#define PMERR_DEVICE_DRIVER_ERROR_5 0x201d
+#define PMERR_DEVICE_DRIVER_ERROR_6 0x201e
+#define PMERR_DEVICE_DRIVER_ERROR_7 0x201f
+#define PMERR_DEVICE_DRIVER_ERROR_8 0x2020
+#define PMERR_DEVICE_DRIVER_ERROR_9 0x2021
+#define PMERR_DEVICE_DRIVER_ERROR_10 0x2022
+#define PMERR_DEV_FUNC_NOT_INSTALLED 0x2023
+#define PMERR_DOSOPEN_FAILURE 0x2024
+#define PMERR_DOSREAD_FAILURE 0x2025
+#define PMERR_DRIVER_NOT_FOUND 0x2026
+#define PMERR_DUP_SEG 0x2027
+#define PMERR_DYNAMIC_SEG_SEQ_ERROR 0x2028
+#define PMERR_DYNAMIC_SEG_ZERO_INV 0x2029
+#define PMERR_ELEMENT_INCOMPLETE 0x202a
+#define PMERR_ESC_CODE_NOT_SUPPORTED 0x202b
+#define PMERR_EXCEEDS_MAX_SEG_LENGTH 0x202c
+#define PMERR_FONT_AND_MODE_MISMATCH 0x202d
+#define PMERR_FONT_FILE_NOT_LOADED 0x202e
+#define PMERR_FONT_NOT_LOADED 0x202f
+#define PMERR_FONT_TOO_BIG 0x2030
+#define PMERR_HARDWARE_INIT_FAILURE 0x2031
+#define PMERR_HBITMAP_BUSY 0x2032
+#define PMERR_HDC_BUSY 0x2033
+#define PMERR_HRGN_BUSY 0x2034
+#define PMERR_HUGE_FONTS_NOT_SUPPORTED 0x2035
+#define PMERR_ID_HAS_NO_BITMAP 0x2036
+#define PMERR_IMAGE_INCOMPLETE 0x2037
+#define PMERR_INCOMPAT_COLOR_FORMAT 0x2038
+#define PMERR_INCOMPAT_COLOR_OPTIONS 0x2039
+#define PMERR_INCOMPATIBLE_BITMAP 0x203a
+#define PMERR_INCOMPATIBLE_METAFILE 0x203b
+#define PMERR_INCORRECT_DC_TYPE 0x203c
+#define PMERR_INSUFFICIENT_DISK_SPACE 0x203d
+#define PMERR_INSUFFICIENT_MEMORY 0x203e
+#define PMERR_INV_ANGLE_PARM 0x203f
+#define PMERR_INV_ARC_CONTROL 0x2040
+#define PMERR_INV_AREA_CONTROL 0x2041
+#define PMERR_INV_ARC_POINTS 0x2042
+#define PMERR_INV_ATTR_MODE 0x2043
+#define PMERR_INV_BACKGROUND_COL_ATTR 0x2044
+#define PMERR_INV_BACKGROUND_MIX_ATTR 0x2045
+#define PMERR_INV_BITBLT_MIX 0x2046
+#define PMERR_INV_BITBLT_STYLE 0x2047
+#define PMERR_INV_BITMAP_DIMENSION 0x2048
+#define PMERR_INV_BOX_CONTROL 0x2049
+#define PMERR_INV_BOX_ROUNDING_PARM 0x204a
+#define PMERR_INV_CHAR_ANGLE_ATTR 0x204b
+#define PMERR_INV_CHAR_DIRECTION_ATTR 0x204c
+#define PMERR_INV_CHAR_MODE_ATTR 0x204d
+#define PMERR_INV_CHAR_POS_OPTIONS 0x204e
+#define PMERR_INV_CHAR_SET_ATTR 0x204f
+#define PMERR_INV_CHAR_SHEAR_ATTR 0x2050
+#define PMERR_INV_CLIP_PATH_OPTIONS 0x2051
+#define PMERR_INV_CODEPAGE 0x2052
+#define PMERR_INV_COLOR_ATTR 0x2053
+#define PMERR_INV_COLOR_DATA 0x2054
+#define PMERR_INV_COLOR_FORMAT 0x2055
+#define PMERR_INV_COLOR_INDEX 0x2056
+#define PMERR_INV_COLOR_OPTIONS 0x2057
+#define PMERR_INV_COLOR_START_INDEX 0x2058
+#define PMERR_INV_COORD_OFFSET 0x2059
+#define PMERR_INV_COORD_SPACE 0x205a
+#define PMERR_INV_COORDINATE 0x205b
+#define PMERR_INV_CORRELATE_DEPTH 0x205c
+#define PMERR_INV_CORRELATE_TYPE 0x205d
+#define PMERR_INV_CURSOR_BITMAP 0x205e
+#define PMERR_INV_DC_DATA 0x205f
+#define PMERR_INV_DC_TYPE 0x2060
+#define PMERR_INV_DEVICE_NAME 0x2061
+#define PMERR_INV_DEV_MODES_OPTIONS 0x2062
+#define PMERR_INV_DRAW_CONTROL 0x2063
+#define PMERR_INV_DRAW_VALUE 0x2064
+#define PMERR_INV_DRAWING_MODE 0x2065
+#define PMERR_INV_DRIVER_DATA 0x2066
+#define PMERR_INV_DRIVER_NAME 0x2067
+#define PMERR_INV_DRAW_BORDER_OPTION 0x2068
+#define PMERR_INV_EDIT_MODE 0x2069
+#define PMERR_INV_ELEMENT_OFFSET 0x206a
+#define PMERR_INV_ELEMENT_POINTER 0x206b
+#define PMERR_INV_END_PATH_OPTIONS 0x206c
+#define PMERR_INV_ESC_CODE 0x206d
+#define PMERR_INV_ESCAPE_DATA 0x206e
+#define PMERR_INV_EXTENDED_LCID 0x206f
+#define PMERR_INV_FILL_PATH_OPTIONS 0x2070
+#define PMERR_INV_FIRST_CHAR 0x2071
+#define PMERR_INV_FONT_ATTRS 0x2072
+#define PMERR_INV_FONT_FILE_DATA 0x2073
+#define PMERR_INV_FOR_THIS_DC_TYPE 0x2074
+#define PMERR_INV_FORMAT_CONTROL 0x2075
+#define PMERR_INV_FORMS_CODE 0x2076
+#define PMERR_INV_FONTDEF 0x2077
+#define PMERR_INV_GEOM_LINE_WIDTH_ATTR 0x2078
+#define PMERR_INV_GETDATA_CONTROL 0x2079
+#define PMERR_INV_GRAPHICS_FIELD 0x207a
+#define PMERR_INV_HBITMAP 0x207b
+#define PMERR_INV_HDC 0x207c
+#define PMERR_INV_HJOURNAL 0x207d
+#define PMERR_INV_HMF 0x207e
+#define PMERR_INV_HPS 0x207f
+#define PMERR_INV_HRGN 0x2080
+#define PMERR_INV_ID 0x2081
+#define PMERR_INV_IMAGE_DATA_LENGTH 0x2082
+#define PMERR_INV_IMAGE_DIMENSION 0x2083
+#define PMERR_INV_IMAGE_FORMAT 0x2084
+#define PMERR_INV_IN_AREA 0x2085
+#define PMERR_INV_IN_CALLED_SEG 0x2086
+#define PMERR_INV_IN_CURRENT_EDIT_MODE 0x2087
+#define PMERR_INV_IN_DRAW_MODE 0x2088
+#define PMERR_INV_IN_ELEMENT 0x2089
+#define PMERR_INV_IN_IMAGE 0x208a
+#define PMERR_INV_IN_PATH 0x208b
+#define PMERR_INV_IN_RETAIN_MODE 0x208c
+#define PMERR_INV_IN_SEG 0x208d
+#define PMERR_INV_IN_VECTOR_SYMBOL 0x208e
+#define PMERR_INV_INFO_TABLE 0x208f
+#define PMERR_INV_JOURNAL_OPTION 0x2090
+#define PMERR_INV_KERNING_FLAGS 0x2091
+#define PMERR_INV_LENGTH_OR_COUNT 0x2092
+#define PMERR_INV_LINE_END_ATTR 0x2093
+#define PMERR_INV_LINE_JOIN_ATTR 0x2094
+#define PMERR_INV_LINE_TYPE_ATTR 0x2095
+#define PMERR_INV_LINE_WIDTH_ATTR 0x2096
+#define PMERR_INV_LOGICAL_ADDRESS 0x2097
+#define PMERR_INV_MARKER_BOX_ATTR 0x2098
+#define PMERR_INV_MARKER_SET_ATTR 0x2099
+#define PMERR_INV_MARKER_SYMBOL_ATTR 0x209a
+#define PMERR_INV_MATRIX_ELEMENT 0x209b
+#define PMERR_INV_MAX_HITS 0x209c
+#define PMERR_INV_METAFILE 0x209d
+#define PMERR_INV_METAFILE_LENGTH 0x209e
+#define PMERR_INV_METAFILE_OFFSET 0x209f
+#define PMERR_INV_MICROPS_DRAW_CONTROL 0x20a0
+#define PMERR_INV_MICROPS_FUNCTION 0x20a1
+#define PMERR_INV_MICROPS_ORDER 0x20a2
+#define PMERR_INV_MIX_ATTR 0x20a3
+#define PMERR_INV_MODE_FOR_OPEN_DYN 0x20a4
+#define PMERR_INV_MODE_FOR_REOPEN_SEG 0x20a5
+#define PMERR_INV_MODIFY_PATH_MODE 0x20a6
+#define PMERR_INV_MULTIPLIER 0x20a7
+#define PMERR_INV_NESTED_FIGURES 0x20a8
+#define PMERR_INV_OR_INCOMPAT_OPTIONS 0x20a9
+#define PMERR_INV_ORDER_LENGTH 0x20aa
+#define PMERR_INV_ORDERING_PARM 0x20ab
+#define PMERR_INV_OUTSIDE_DRAW_MODE 0x20ac
+#define PMERR_INV_PAGE_VIEWPORT 0x20ad
+#define PMERR_INV_PATH_ID 0x20ae
+#define PMERR_INV_PATH_MODE 0x20af
+#define PMERR_INV_PATTERN_ATTR 0x20b0
+#define PMERR_INV_PATTERN_REF_PT_ATTR 0x20b1
+#define PMERR_INV_PATTERN_SET_ATTR 0x20b2
+#define PMERR_INV_PATTERN_SET_FONT 0x20b3
+#define PMERR_INV_PICK_APERTURE_OPTION 0x20b4
+#define PMERR_INV_PICK_APERTURE_POSN 0x20b5
+#define PMERR_INV_PICK_APERTURE_SIZE 0x20b6
+#define PMERR_INV_PICK_NUMBER 0x20b7
+#define PMERR_INV_PLAY_METAFILE_OPTION 0x20b8
+#define PMERR_INV_PRIMITIVE_TYPE 0x20b9
+#define PMERR_INV_PS_SIZE 0x20ba
+#define PMERR_INV_PUTDATA_FORMAT 0x20bb
+#define PMERR_INV_QUERY_ELEMENT_NO 0x20bc
+#define PMERR_INV_RECT 0x20bd
+#define PMERR_INV_REGION_CONTROL 0x20be
+#define PMERR_INV_REGION_MIX_MODE 0x20bf
+#define PMERR_INV_REPLACE_MODE_FUNC 0x20c0
+#define PMERR_INV_RESERVED_FIELD 0x20c1
+#define PMERR_INV_RESET_OPTIONS 0x20c2
+#define PMERR_INV_RGBCOLOR 0x20c3
+#define PMERR_INV_SCAN_START 0x20c4
+#define PMERR_INV_SEG_ATTR 0x20c5
+#define PMERR_INV_SEG_ATTR_VALUE 0x20c6
+#define PMERR_INV_SEG_CH_LENGTH 0x20c7
+#define PMERR_INV_SEG_NAME 0x20c8
+#define PMERR_INV_SEG_OFFSET 0x20c9
+#define PMERR_INV_SETID 0x20ca
+#define PMERR_INV_SETID_TYPE 0x20cb
+#define PMERR_INV_SET_VIEWPORT_OPTION 0x20cc
+#define PMERR_INV_SHARPNESS_PARM 0x20cd
+#define PMERR_INV_SOURCE_OFFSET 0x20ce
+#define PMERR_INV_STOP_DRAW_VALUE 0x20cf
+#define PMERR_INV_TRANSFORM_TYPE 0x20d0
+#define PMERR_INV_USAGE_PARM 0x20d1
+#define PMERR_INV_VIEWING_LIMITS 0x20d2
+#define PMERR_JFILE_BUSY 0x20d3
+#define PMERR_JNL_FUNC_DATA_TOO_LONG 0x20d4
+#define PMERR_KERNING_NOT_SUPPORTED 0x20d5
+#define PMERR_LABEL_NOT_FOUND 0x20d6
+#define PMERR_MATRIX_OVERFLOW 0x20d7
+#define PMERR_METAFILE_INTERNAL_ERROR 0x20d8
+#define PMERR_METAFILE_IN_USE 0x20d9
+#define PMERR_METAFILE_LIMIT_EXCEEDED 0x20da
+#define PMERR_NAME_STACK_FULL 0x20db
+#define PMERR_NOT_CREATED_BY_DEVOPENDC 0x20dc
+#define PMERR_NOT_IN_AREA 0x20dd
+#define PMERR_NOT_IN_DRAW_MODE 0x20de
+#define PMERR_NOT_IN_ELEMENT 0x20df
+#define PMERR_NOT_IN_IMAGE 0x20e0
+#define PMERR_NOT_IN_PATH 0x20e1
+#define PMERR_NOT_IN_RETAIN_MODE 0x20e2
+#define PMERR_NOT_IN_SEG 0x20e3
+#define PMERR_NO_BITMAP_SELECTED 0x20e4
+#define PMERR_NO_CURRENT_ELEMENT 0x20e5
+#define PMERR_NO_CURRENT_SEG 0x20e6
+#define PMERR_NO_METAFILE_RECORD_HANDLE 0x20e7
+#define PMERR_ORDER_TOO_BIG 0x20e8
+#define PMERR_OTHER_SET_ID_REFS 0x20e9
+#define PMERR_OVERRAN_SEG 0x20ea
+#define PMERR_OWN_SET_ID_REFS 0x20eb
+#define PMERR_PATH_INCOMPLETE 0x20ec
+#define PMERR_PATH_LIMIT_EXCEEDED 0x20ed
+#define PMERR_PATH_UNKNOWN 0x20ee
+#define PMERR_PEL_IS_CLIPPED 0x20ef
+#define PMERR_PEL_NOT_AVAILABLE 0x20f0
+#define PMERR_PRIMITIVE_STACK_EMPTY 0x20f1
+#define PMERR_PROLOG_ERROR 0x20f2
+#define PMERR_PROLOG_SEG_ATTR_NOT_SET 0x20f3
+#define PMERR_PS_BUSY 0x20f4
+#define PMERR_PS_IS_ASSOCIATED 0x20f5
+#define PMERR_RAM_JNL_FILE_TOO_SMALL 0x20f6
+#define PMERR_REALIZE_NOT_SUPPORTED 0x20f7
+#define PMERR_REGION_IS_CLIP_REGION 0x20f8
+#define PMERR_RESOURCE_DEPLETION 0x20f9
+#define PMERR_SEG_AND_REFSEG_ARE_SAME 0x20fa
+#define PMERR_SEG_CALL_RECURSIVE 0x20fb
+#define PMERR_SEG_CALL_STACK_EMPTY 0x20fc
+#define PMERR_SEG_CALL_STACK_FULL 0x20fd
+#define PMERR_SEG_IS_CURRENT 0x20fe
+#define PMERR_SEG_NOT_CHAINED 0x20ff
+#define PMERR_SEG_NOT_FOUND 0x2100
+#define PMERR_SEG_STORE_LIMIT_EXCEEDED 0x2101
+#define PMERR_SETID_IN_USE 0x2102
+#define PMERR_SETID_NOT_FOUND 0x2103
+#define PMERR_STARTDOC_NOT_ISSUED 0x2104
+#define PMERR_STOP_DRAW_OCCURRED 0x2105
+#define PMERR_TOO_MANY_METAFILES_IN_USE 0x2106
+#define PMERR_TRUNCATED_ORDER 0x2107
+#define PMERR_UNCHAINED_SEG_ZERO_INV 0x2108
+#define PMERR_UNSUPPORTED_ATTR 0x2109
+#define PMERR_UNSUPPORTED_ATTR_VALUE 0x210a
+#define PMERR_ENDDOC_NOT_ISSUED 0x210b
+#define PMERR_PS_NOT_ASSOCIATED 0x210c
+#define PMERR_INV_FLOOD_FILL_OPTIONS 0x210d
+#define PMERR_INV_FACENAME 0x210e
+#define PMERR_PALETTE_SELECTED 0x210f
+#define PMERR_NO_PALETTE_SELECTED 0x2110
+#define PMERR_INV_HPAL 0x2111
+#define PMERR_PALETTE_BUSY 0x2112
+#define PMERR_START_POINT_CLIPPED 0x2113
+#define PMERR_NO_FILL 0x2114
+#define PMERR_INV_FACENAMEDESC 0x2115
+#define PMERR_INV_BITMAP_DATA 0x2116
+#define PMERR_INV_CHAR_ALIGN_ATTR 0x2117
+#define PMERR_INV_HFONT 0x2118
+#define PMERR_HFONT_IS_SELECTED 0x2119
+#define PMERR_DRVR_NOT_SUPPORTED 0x2120
+#define PMERR_INV_INKPS_FUNCTION 0x2121
+
+#endif /* INCL_GPIERRORS */
+
+#if defined (INCL_WPERRORS)
+
+#define WPERR_PROTECTED_CLASS 0x1700
+#define WPERR_INVALID_CLASS 0x1701
+#define WPERR_INVALID_SUPERCLASS 0x1702
+#define WPERR_NO_MEMORY 0x1703
+#define WPERR_SEMAPHORE_ERROR 0x1704
+#define WPERR_BUFFER_TOO_SMALL 0x1705
+#define WPERR_CLSLOADMOD_FAILED 0x1706
+#define WPERR_CLSPROCADDR_FAILED 0x1707
+#define WPERR_OBJWORD_LOCATION 0x1708
+#define WPERR_INVALID_OBJECT 0x1709
+#define WPERR_MEMORY_CLEANUP 0x170a
+#define WPERR_INVALID_MODULE 0x170b
+#define WPERR_INVALID_OLDCLASS 0x170c
+#define WPERR_INVALID_NEWCLASS 0x170d
+#define WPERR_NOT_IMMEDIATE_CHILD 0x170e
+#define WPERR_NOT_WORKPLACE_CLASS 0x170f
+#define WPERR_CANT_REPLACE_METACLS 0x1710
+#define WPERR_INI_FILE_WRITE 0x1711
+#define WPERR_INVALID_FOLDER 0x1712
+#define WPERR_BUFFER_OVERFLOW 0x1713
+#define WPERR_OBJECT_NOT_FOUND 0x1714
+#define WPERR_INVALID_HFIND 0x1715
+#define WPERR_INVALID_COUNT 0x1716
+#define WPERR_INVALID_BUFFER 0x1717
+#define WPERR_ALREADY_EXISTS 0x1718
+#define WPERR_INVALID_FLAGS 0x1719
+#define WPERR_INVALID_OBJECTID 0x1720
+#define WPERR_INVALID_TARGET_OBJECT 0x1721
+
+#endif /* INCL_WPERRORS */
+
+#if defined (INCL_SPLERRORS)
+
+#define PMERR_SPL_DRIVER_ERROR 0x4001
+#define PMERR_SPL_DEVICE_ERROR 0x4002
+#define PMERR_SPL_DEVICE_NOT_INSTALLED 0x4003
+#define PMERR_SPL_QUEUE_ERROR 0x4004
+#define PMERR_SPL_INV_HSPL 0x4005
+#define PMERR_SPL_NO_DISK_SPACE 0x4006
+#define PMERR_SPL_NO_MEMORY 0x4007
+#define PMERR_SPL_PRINT_ABORT 0x4008
+#define PMERR_SPL_SPOOLER_NOT_INSTALLED 0x4009
+#define PMERR_SPL_INV_FORMS_CODE 0x400a
+#define PMERR_SPL_INV_PRIORITY 0x400b
+#define PMERR_SPL_NO_FREE_JOB_ID 0x400c
+#define PMERR_SPL_NO_DATA 0x400d
+#define PMERR_SPL_INV_TOKEN 0x400e
+#define PMERR_SPL_INV_DATATYPE 0x400f
+#define PMERR_SPL_PROCESSOR_ERROR 0x4010
+#define PMERR_SPL_INV_JOB_ID 0x4011
+#define PMERR_SPL_JOB_NOT_PRINTING 0x4012
+#define PMERR_SPL_JOB_PRINTING 0x4013
+#define PMERR_SPL_QUEUE_ALREADY_EXISTS 0x4014
+#define PMERR_SPL_INV_QUEUE_NAME 0x4015
+#define PMERR_SPL_QUEUE_NOT_EMPTY 0x4016
+#define PMERR_SPL_DEVICE_ALREADY_EXISTS 0x4017
+#define PMERR_SPL_DEVICE_LIMIT_REACHED 0x4018
+#define PMERR_SPL_STATUS_STRING_TRUNC 0x4019
+#define PMERR_SPL_INV_LENGTH_OR_COUNT 0x401a
+#define PMERR_SPL_FILE_NOT_FOUND 0x401b
+#define PMERR_SPL_CANNOT_OPEN_FILE 0x401c
+#define PMERR_SPL_DRIVER_NOT_INSTALLED 0x401d
+#define PMERR_SPL_INV_PROCESSOR_DATTYPE 0x401e
+#define PMERR_SPL_INV_DRIVER_DATATYPE 0x401f
+#define PMERR_SPL_PROCESSOR_NOT_INST 0x4020
+#define PMERR_SPL_NO_SUCH_LOG_ADDRESS 0x4021
+#define PMERR_SPL_PRINTER_NOT_FOUND 0x4022
+#define PMERR_SPL_DD_NOT_FOUND 0x4023
+#define PMERR_SPL_QUEUE_NOT_FOUND 0x4024
+#define PMERR_SPL_MANY_QUEUES_ASSOC 0x4025
+#define PMERR_SPL_NO_QUEUES_ASSOCIATED 0x4026
+#define PMERR_SPL_INI_FILE_ERROR 0x4027
+#define PMERR_SPL_NO_DEFAULT_QUEUE 0x4028
+#define PMERR_SPL_NO_CURRENT_FORMS_CODE 0x4029
+#define PMERR_SPL_NOT_AUTHORISED 0x402a
+#define PMERR_SPL_TEMP_NETWORK_ERROR 0x402b
+#define PMERR_SPL_HARD_NETWORK_ERROR 0x402c
+#define PMERR_DEL_NOT_ALLOWED 0x402d
+#define PMERR_CANNOT_DEL_QP_REF 0x402e
+#define PMERR_CANNOT_DEL_QNAME_REF 0x402f
+#define PMERR_CANNOT_DEL_PRINTER_DD_REF 0x4030
+#define PMERR_CANNOT_DEL_PRN_NAME_REF 0x4031
+#define PMERR_CANNOT_DEL_PRN_ADDR_REF 0x4032
+#define PMERR_SPOOLER_QP_NOT_DEFINED 0x4033
+#define PMERR_PRN_NAME_NOT_DEFINED 0x4034
+#define PMERR_PRN_ADDR_NOT_DEFINED 0x4035
+#define PMERR_PRINTER_DD_NOT_DEFINED 0x4036
+#define PMERR_PRINTER_QUEUE_NOT_DEFINED 0x4037
+#define PMERR_PRN_ADDR_IN_USE 0x4038
+#define PMERR_SPL_TOO_MANY_OPEN_FILES 0x4039
+#define PMERR_SPL_CP_NOT_REQD 0x403a
+#define PMERR_SPL_PORT_SHUTDOWN 0x403b
+#define PMERR_SPL_NOT_HANDLED 0x403c
+#define PMERR_SPL_CNV_NOT_INIT 0x403d
+#define PMERR_SPL_INIT_IN_PROGRESS 0x403e
+#define PMERR_SPL_TYPE_NOT_AVAIL 0x403f
+#define PMERR_UNABLE_TO_CLOSE_DEVICE 0x4040
+#define PMERR_SPL_SESSION_TERM 0x4041
+#define PMERR_SPL_NOT_REGISTERED 0x4042
+
+#endif /* INCL_SPLERRORS */
+
+#if defined (INCL_PICERRORS)
+
+#define PMERR_INV_TYPE 0x5001
+#define PMERR_INV_CONV 0x5002
+#define PMERR_INV_SEGLEN 0x5003
+#define PMERR_DUP_SEGNAME 0x5004
+#define PMERR_INV_XFORM 0x5005
+#define PMERR_INV_VIEWLIM 0x5006
+#define PMERR_INV_3DCOORD 0x5007
+#define PMERR_SMB_OVFLOW 0x5008
+#define PMERR_SEG_OVFLOW 0x5009
+#define PMERR_PIC_DUP_FILENAME 0x5010
+
+#endif /* INCL_PICERRORS */
+
+#if defined (INCL_WINERRORS)
+
+#define WINDBG_HWND_NOT_DESTROYED 0x1022
+#define WINDBG_HPTR_NOT_DESTROYED 0x1023
+#define WINDBG_HACCEL_NOT_DESTROYED 0x1024
+#define WINDBG_HENUM_NOT_DESTROYED 0x1025
+#define WINDBG_VISRGN_SEM_BUSY 0x1026
+#define WINDBG_USER_SEM_BUSY 0x1027
+#define WINDBG_DC_CACHE_BUSY 0x1028
+#define WINDBG_HOOK_STILL_INSTALLED 0x1029
+#define WINDBG_WINDOW_STILL_LOCKED 0x102a
+#define WINDBG_UPDATEPS_ASSERTION_FAIL 0x102b
+#define WINDBG_SENDMSG_WITHIN_USER_SEM 0x102c
+#define WINDBG_USER_SEM_NOT_ENTERED 0x102d
+#define WINDBG_PROC_NOT_EXPORTED 0x102e
+#define WINDBG_BAD_SENDMSG_HWND 0x102f
+#define WINDBG_ABNORMAL_EXIT 0x1030
+#define WINDBG_INTERNAL_REVISION 0x1031
+#define WINDBG_INITSYSTEM_FAILED 0x1032
+#define WINDBG_HATOMTBL_NOT_DESTROYED 0x1033
+#define WINDBG_WINDOW_UNLOCK_WAIT 0x1035
+
+#endif /* INCL_WINERRORS */
+
+
+#define WRECT RECTL
+#define PWRECT PRECTL
+
+#define WPOINT POINTL
+#define PWPOINT PPOINTL
+
+
+typedef LHANDLE HACCEL;
+
+typedef LHANDLE HRGN;
+typedef HRGN *PHRGN;
+
+typedef VOID *MRESULT;
+typedef MRESULT *PMRESULT;
+
+typedef VOID *MPARAM;
+typedef MPARAM *PMPARAM;
+
+typedef LHANDLE HPOINTER;
+
+typedef HMODULE HLIB;
+typedef HLIB *PHLIB;
+
+typedef LONG COLOR;
+typedef COLOR *PCOLOR;
+
+typedef LHANDLE HAB;
+typedef HAB *PHAB;
+
+typedef LHANDLE HPS;
+typedef HPS *PHPS;
+
+typedef LHANDLE HDC;
+typedef HDC *PHDC;
+
+typedef LHANDLE HWND;
+typedef HWND *PHWND;
+
+typedef LHANDLE HMQ;
+
+typedef LHANDLE HPAL;
+typedef HPAL *PHPAL;
+
+typedef LHANDLE HBITMAP;
+typedef HBITMAP *PHBITMAP;
+
+typedef ULONG ERRORID;
+typedef ERRORID *PERRORID;
+
+typedef MRESULT FNWP (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
+typedef FNWP *PFNWP;
+
+#define ERRORIDERROR(errid) (LOUSHORT (errid))
+#define ERRORIDSEV(errid) (HIUSHORT (errid))
+#define MAKEERRORID(sev,error) (ERRORID)(MAKEULONG ((error), (sev)))
+
+typedef struct _POINTL
+{
+ LONG x;
+ LONG y;
+} POINTL;
+typedef POINTL *PPOINTL;
+
+typedef struct _POINTS
+{
+ SHORT x;
+ SHORT y;
+} POINTS;
+typedef POINTS *PPOINTS;
+
+typedef struct _RECTL
+{
+ LONG xLeft;
+ LONG yBottom;
+ LONG xRight;
+ LONG yTop;
+} RECTL;
+typedef RECTL *PRECTL;
+
+#if defined (INCL_WINMESSAGEMGR) || !defined (INCL_NOCOMMON)
+
+#define WM_NULL 0x0000
+#define WM_CREATE 0x0001
+#define WM_DESTROY 0x0002
+#define WM_ENABLE 0x0004
+#define WM_SHOW 0x0005
+#define WM_MOVE 0x0006
+#define WM_SIZE 0x0007
+#define WM_ADJUSTWINDOWPOS 0x0008
+#define WM_CALCVALIDRECTS 0x0009
+#define WM_SETWINDOWPARAMS 0x000a
+#define WM_QUERYWINDOWPARAMS 0x000b
+#define WM_HITTEST 0x000c
+#define WM_ACTIVATE 0x000d
+#define WM_SETFOCUS 0x000f
+#define WM_SETSELECTION 0x0010
+#define WM_PPAINT 0x0011
+#define WM_PSETFOCUS 0x0012
+#define WM_PSYSCOLORCHANGE 0x0013
+#define WM_PSIZE 0x0014
+#define WM_PACTIVATE 0x0015
+#define WM_PCONTROL 0x0016
+#define WM_COMMAND 0x0020
+#define WM_SYSCOMMAND 0x0021
+#define WM_HELP 0x0022
+#define WM_PAINT 0x0023
+#define WM_TIMER 0x0024
+#define WM_SEM1 0x0025
+#define WM_SEM2 0x0026
+#define WM_SEM3 0x0027
+#define WM_SEM4 0x0028
+#define WM_CLOSE 0x0029
+#define WM_QUIT 0x002a
+#define WM_SYSCOLORCHANGE 0x002b
+#define WM_SYSVALUECHANGED 0x002d
+#define WM_APPTERMINATENOTIFY 0x002e
+#define WM_PRESPARAMCHANGED 0x002f
+#define WM_CONTROL 0x0030
+#define WM_VSCROLL 0x0031
+#define WM_HSCROLL 0x0032
+#define WM_INITMENU 0x0033
+#define WM_MENUSELECT 0x0034
+#define WM_MENUEND 0x0035
+#define WM_DRAWITEM 0x0036
+#define WM_MEASUREITEM 0x0037
+#define WM_CONTROLPOINTER 0x0038
+#define WM_QUERYDLGCODE 0x003a
+#define WM_INITDLG 0x003b
+#define WM_SUBSTITUTESTRING 0x003c
+#define WM_MATCHMNEMONIC 0x003d
+#define WM_SAVEAPPLICATION 0x003e
+
+#define WM_HELPBASE 0x0f00
+#define WM_HELPTOP 0x0fff
+
+#define WM_USER 0x1000
+
+#define CMDSRC_OTHER 0
+#define CMDSRC_PUSHBUTTON 1
+#define CMDSRC_MENU 2
+#define CMDSRC_ACCELERATOR 3
+#define CMDSRC_FONTDLG 4
+#define CMDSRC_FILEDLG 5
+#define CMDSRC_PRINTDLG 6
+#define CMDSRC_COLORDLG 7
+
+#define PM_NOREMOVE 0x0000
+#define PM_REMOVE 0x0001
+
+#define RUM_IN 1
+#define RUM_OUT 2
+#define RUM_INOUT 3
+
+#define SMD_DELAYED 0x0001
+#define SMD_IMMEDIATE 0x0002
+
+#define SSM_SYNCHRONOUS 0x0001
+#define SSM_ASYNCHRONOUS 0x0002
+#define SSM_MIXED 0x0003
+
+#define WLI_NOBUTTONUP 0x0002
+
+#if defined (INCL_WINTYPES)
+
+#define DTYP_USER 16384
+
+#define DTYP_CTL_ARRAY 1
+#define DTYP_CTL_PARRAY (-1)
+#define DTYP_CTL_OFFSET 2
+#define DTYP_CTL_LENGTH 3
+
+#define DTYP_ACCEL 28
+#define DTYP_ACCELTABLE 29
+#define DTYP_ARCPARAMS 38
+#define DTYP_AREABUNDLE 139
+#define DTYP_ATOM 90
+#define DTYP_BITMAPINFO 60
+#define DTYP_BITMAPINFOHEADER 61
+#define DTYP_BITMAPINFO2 170
+#define DTYP_BITMAPINFOHEADER2 171
+#define DTYP_BIT16 20
+#define DTYP_BIT32 21
+#define DTYP_BIT8 19
+#define DTYP_BOOL 18
+#define DTYP_BTNCDATA 35
+#define DTYP_BYTE 13
+#define DTYP_CATCHBUF 141
+#define DTYP_CHAR 15
+#define DTYP_CHARBUNDLE 135
+#define DTYP_CLASSINFO 95
+#define DTYP_COUNT2 93
+#define DTYP_COUNT2B 70
+#define DTYP_COUNT2CH 82
+#define DTYP_COUNT4 152
+#define DTYP_COUNT4B 42
+#define DTYP_CPID 57
+#define DTYP_CREATESTRUCT 98
+#define DTYP_CURSORINFO 34
+#define DTYP_DEVOPENSTRUC 124
+#define DTYP_DLGTEMPLATE 96
+#define DTYP_DLGTITEM 97
+#define DTYP_ENTRYFDATA 127
+#define DTYP_ERRORID 45
+#define DTYP_FATTRS 75
+#define DTYP_FFDESCS 142
+#define DTYP_FIXED 99
+#define DTYP_FONTMETRICS 74
+#define DTYP_FRAMECDATA 144
+#define DTYP_GRADIENTL 48
+#define DTYP_HAB 10
+#define DTYP_HACCEL 30
+#define DTYP_HAPP 146
+#define DTYP_HATOMTBL 91
+#define DTYP_HBITMAP 62
+#define DTYP_HCINFO 46
+#define DTYP_HDC 132
+#define DTYP_HENUM 117
+#define DTYP_HHEAP 109
+#define DTYP_HINI 53
+#define DTYP_HLIB 147
+#define DTYP_HMF 85
+#define DTYP_HMQ 86
+#define DTYP_HPOINTER 106
+#define DTYP_HPROGRAM 131
+#define DTYP_HPS 12
+#define DTYP_HRGN 116
+#define DTYP_HSEM 140
+#define DTYP_HSPL 32
+#define DTYP_HSWITCH 66
+#define DTYP_HVPS 58
+#define DTYP_HWND 11
+#define DTYP_IDENTITY 133
+#define DTYP_IDENTITY4 169
+#define DTYP_IMAGEBUNDLE 136
+#define DTYP_INDEX2 81
+#define DTYP_IPT 155
+#define DTYP_KERNINGPAIRS 118
+#define DTYP_LENGTH2 68
+#define DTYP_LENGTH4 69
+#define DTYP_LINEBUNDLE 137
+#define DTYP_LONG 25
+#define DTYP_MARKERBUNDLE 138
+#define DTYP_MATRIXLF 113
+#define DTYP_MLECTLDATA 161
+#define DTYP_MLEMARGSTRUCT 157
+#define DTYP_MLEOVERFLOW 158
+#define DTYP_OFFSET2B 112
+#define DTYP_OWNERITEM 154
+#define DTYP_PID 92
+#define DTYP_PIX 156
+#define DTYP_POINTERINFO 105
+#define DTYP_POINTL 77
+#define DTYP_PROGCATEGORY 129
+#define DTYP_PROGRAMENTRY 128
+#define DTYP_PROGTYPE 130
+#define DTYP_PROPERTY2 88
+#define DTYP_PROPERTY4 89
+#define DTYP_QMSG 87
+#define DTYP_RECTL 121
+#define DTYP_RESID 125
+#define DTYP_RGB 111
+#define DTYP_RGNRECT 115
+#define DTYP_SBCDATA 159
+#define DTYP_SEGOFF 126
+#define DTYP_SHORT 23
+#define DTYP_SIZEF 101
+#define DTYP_SIZEL 102
+#define DTYP_STRL 17
+#define DTYP_STR16 40
+#define DTYP_STR32 37
+#define DTYP_STR64 47
+#define DTYP_STR8 33
+#define DTYP_SWBLOCK 63
+#define DTYP_SWCNTRL 64
+#define DTYP_SWENTRY 65
+#define DTYP_SWP 31
+#define DTYP_TID 104
+#define DTYP_TIME 107
+#define DTYP_TRACKINFO 73
+#define DTYP_UCHAR 22
+#define DTYP_ULONG 26
+#define DTYP_USERBUTTON 36
+#define DTYP_USHORT 24
+#define DTYP_WIDTH4 108
+#define DTYP_WNDPARAMS 83
+#define DTYP_WNDPROC 84
+#define DTYP_WPOINT 59
+#define DTYP_WRECT 55
+#define DTYP_XYWINSIZE 52
+
+#define DTYP_PACCEL (-28)
+#define DTYP_PACCELTABLE (-29)
+#define DTYP_PARCPARAMS (-38)
+#define DTYP_PAREABUNDLE (-139)
+#define DTYP_PATOM (-90)
+#define DTYP_PBITMAPINFO (-60)
+#define DTYP_PBITMAPINFOHEADER (-61)
+#define DTYP_PBITMAPINFO2 (-170)
+#define DTYP_PBITMAPINFOHEADER2 (-171)
+#define DTYP_PBIT16 (-20)
+#define DTYP_PBIT32 (-21)
+#define DTYP_PBIT8 (-19)
+#define DTYP_PBOOL (-18)
+#define DTYP_PBTNCDATA (-35)
+#define DTYP_PBYTE (-13)
+#define DTYP_PCATCHBUF (-141)
+#define DTYP_PCHAR (-15)
+#define DTYP_PCHARBUNDLE (-135)
+#define DTYP_PCLASSINFO (-95)
+#define DTYP_PCOUNT2 (-93)
+#define DTYP_PCOUNT2B (-70)
+#define DTYP_PCOUNT2CH (-82)
+#define DTYP_PCOUNT4 (-152)
+#define DTYP_PCOUNT4B (-42)
+#define DTYP_PCPID (-57)
+#define DTYP_PCREATESTRUCT (-98)
+#define DTYP_PCURSORINFO (-34)
+#define DTYP_PDEVOPENSTRUC (-124)
+#define DTYP_PDLGTEMPLATE (-96)
+#define DTYP_PDLGTITEM (-97)
+#define DTYP_PENTRYFDATA (-127)
+#define DTYP_PERRORID (-45)
+#define DTYP_PFATTRS (-75)
+#define DTYP_PFFDESCS (-142)
+#define DTYP_PFIXED (-99)
+#define DTYP_PFONTMETRICS (-74)
+#define DTYP_PFRAMECDATA (-144)
+#define DTYP_PGRADIENTL (-48)
+#define DTYP_PHAB (-10)
+#define DTYP_PHACCEL (-30)
+#define DTYP_PHAPP (-146)
+#define DTYP_PHATOMTBL (-91)
+#define DTYP_PHBITMAP (-62)
+#define DTYP_PHCINFO (-46)
+#define DTYP_PHDC (-132)
+#define DTYP_PHENUM (-117)
+#define DTYP_PHHEAP (-109)
+#define DTYP_PHINI (-53)
+#define DTYP_PHLIB (-147)
+#define DTYP_PHMF (-85)
+#define DTYP_PHMQ (-86)
+#define DTYP_PHPOINTER (-106)
+#define DTYP_PHPROGRAM (-131)
+#define DTYP_PHPS (-12)
+#define DTYP_PHRGN (-116)
+#define DTYP_PHSEM (-140)
+#define DTYP_PHSPL (-32)
+#define DTYP_PHSWITCH (-66)
+#define DTYP_PHVPS (-58)
+#define DTYP_PHWND (-11)
+#define DTYP_PIDENTITY (-133)
+#define DTYP_PIDENTITY4 (-169)
+#define DTYP_PIMAGEBUNDLE (-136)
+#define DTYP_PINDEX2 (-81)
+#define DTYP_PIPT (-155)
+#define DTYP_PKERNINGPAIRS (-118)
+#define DTYP_PLENGTH2 (-68)
+#define DTYP_PLENGTH4 (-69)
+#define DTYP_PLINEBUNDLE (-137)
+#define DTYP_PLONG (-25)
+#define DTYP_PMARKERBUNDLE (-138)
+#define DTYP_PMATRIXLF (-113)
+#define DTYP_PMLECTLDATA (-161)
+#define DTYP_PMLEMARGSTRUCT (-157)
+#define DTYP_PMLEOVERFLOW (-158)
+#define DTYP_POFFSET2B (-112)
+#define DTYP_POWNERITEM (-154)
+#define DTYP_PPID (-92)
+#define DTYP_PPIX (-156)
+#define DTYP_PPOINTERINFO (-105)
+#define DTYP_PPOINTL (-77)
+#define DTYP_PPROGCATEGORY (-129)
+#define DTYP_PPROGRAMENTRY (-128)
+#define DTYP_PPROGTYPE (-130)
+#define DTYP_PPROPERTY2 (-88)
+#define DTYP_PPROPERTY4 (-89)
+#define DTYP_PQMSG (-87)
+#define DTYP_PRECTL (-121)
+#define DTYP_PRESID (-125)
+#define DTYP_PRGB (-111)
+#define DTYP_PRGNRECT (-115)
+#define DTYP_PSBCDATA (-159)
+#define DTYP_PSEGOFF (-126)
+#define DTYP_PSHORT (-23)
+#define DTYP_PSIZEF (-101)
+#define DTYP_PSIZEL (-102)
+#define DTYP_PSTRL (-17)
+#define DTYP_PSTR16 (-40)
+#define DTYP_PSTR32 (-37)
+#define DTYP_PSTR64 (-47)
+#define DTYP_PSTR8 (-33)
+#define DTYP_PSWBLOCK (-63)
+#define DTYP_PSWCNTRL (-64)
+#define DTYP_PSWENTRY (-65)
+#define DTYP_PSWP (-31)
+#define DTYP_PTID (-104)
+#define DTYP_PTIME (-107)
+#define DTYP_PTRACKINFO (-73)
+#define DTYP_PUCHAR (-22)
+#define DTYP_PULONG (-26)
+#define DTYP_PUSERBUTTON (-36)
+#define DTYP_PUSHORT (-24)
+#define DTYP_PWIDTH4 (-108)
+#define DTYP_PWNDPARAMS (-83)
+#define DTYP_PWNDPROC (-84)
+#define DTYP_PWPOINT (-59)
+#define DTYP_PWRECT (-55)
+#define DTYP_PXYWINSIZE (-52)
+
+#endif /* INCL_WINTYPES */
+
+typedef struct _QMSG
+{
+ HWND hwnd;
+ ULONG msg;
+ MPARAM mp1;
+ MPARAM mp2;
+ ULONG time;
+ POINTL ptl;
+ ULONG reserved;
+} QMSG;
+typedef QMSG *PQMSG;
+
+typedef struct _COMMANDMSG
+{
+ USHORT cmd;
+ USHORT unused;
+ USHORT source;
+ USHORT fMouse;
+} CMDMSG;
+typedef CMDMSG *PCMDMSG;
+
+typedef struct _MQINFO
+{
+ ULONG cb;
+ PID pid;
+ TID tid;
+ ULONG cmsgs;
+ PVOID pReserved;
+} MQINFO;
+typedef MQINFO *PMQINFO;
+
+#define COMMANDMSG(pmsg) ((PCMDMSG)((PBYTE)pmsg + sizeof (ULONG)))
+
+
+BOOL WinCancelShutdown (HMQ hmq, BOOL fCancelAlways);
+HMQ WinCreateMsgQueue (HAB hab, LONG cmsg);
+BOOL WinDestroyMsgQueue (HMQ hmq);
+MRESULT WinDispatchMsg (HAB hab, PQMSG pqmsg);
+BOOL WinGetMsg (HAB hab, PQMSG pqmsg, HWND hwndFilter, ULONG msgFilterFirst,
+ ULONG msgFilterLast);
+BOOL WinLockInput (HMQ hmq, ULONG fLock);
+BOOL WinPeekMsg (HAB hab, PQMSG pqmsg, HWND hwndFilter, ULONG msgFilterFirst,
+ ULONG msgFilterLast, ULONG fl);
+BOOL WinPostMsg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
+HMQ WinQueueFromID (HAB hab, PID pid, TID tid);
+BOOL WinQueryQueueInfo (HMQ hmq, PMQINFO pmqi, ULONG cbCopy);
+HMQ WinQuerySendMsg (HAB hab, HMQ hmqSender, HMQ hmqReceiver, PQMSG pqmsg);
+BOOL WinRegisterUserDatatype (HAB hab, LONG datatype, LONG count, PLONG types);
+BOOL WinRegisterUserMsg (HAB hab, ULONG msgid, LONG datatype1, LONG dir1,
+ LONG datatype2, LONG dir2, LONG datatyper);
+BOOL WinReplyMsg (HAB hab, HMQ hmqSender, HMQ hmqReceiver, MRESULT mresult);
+MRESULT WinSendMsg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
+BOOL WinSetMsgMode (HAB hab, PCSZ classname, LONG control);
+BOOL WinSetSynchroMode (HAB hab, LONG mode);
+BOOL WinThreadAssocQueue (HAB hab, HMQ hmq);
+BOOL WinWakeThread (HMQ hmq);
+
+#endif /* INCL_WINMESSAGEMGR || !INCL_NOCOMMON */
+
+typedef struct _SWP
+{
+ ULONG fl;
+ LONG cy;
+ LONG cx;
+ LONG y;
+ LONG x;
+ HWND hwndInsertBehind;
+ HWND hwnd;
+ ULONG ulReserved1;
+ ULONG ulReserved2;
+} SWP;
+typedef SWP *PSWP;
+
+typedef struct _ICONINFO
+{
+ ULONG cb;
+ ULONG fFormat;
+ PSZ pszFileName;
+ HMODULE hmod;
+ ULONG resid;
+ ULONG cbIconData;
+ PVOID pIconData;
+} ICONINFO;
+typedef ICONINFO *PICONINFO;
+
+
+#define MPVOID ((MPARAM)0)
+
+#define MPFROMP(x) ((MPARAM)((ULONG)(x)))
+#define MPFROMHWND(x) ((MPARAM)(HWND)(x))
+#define MPFROMCHAR(x) ((MPARAM)(ULONG)(USHORT)(x))
+#define MPFROMSHORT(x) ((MPARAM)(ULONG)(USHORT)(x))
+#define MPFROM2SHORT(x1,x2) ((MPARAM)MAKELONG (x1, x2))
+#define MPFROMSH2CH(s,c1,c2) ((MPARAM)MAKELONG (s, MAKESHORT (c1, c2)))
+#define MPFROMLONG(x) ((MPARAM)(ULONG)(x))
+
+#define PVOIDFROMMP(mp) ((PVOID)(mp))
+#define HWNDFROMMP(mp) ((HWND)(mp))
+#define CHAR1FROMMP(mp) ((UCHAR)(ULONG)(mp))
+#define CHAR2FROMMP(mp) ((UCHAR)((ULONG)mp >> 8))
+#define CHAR3FROMMP(mp) ((UCHAR)((ULONG)mp >> 16))
+#define CHAR4FROMMP(mp) ((UCHAR)((ULONG)mp >> 24))
+#define SHORT1FROMMP(mp) ((USHORT)(ULONG)(mp))
+#define SHORT2FROMMP(mp) ((USHORT)((ULONG)mp >> 16))
+#define LONGFROMMP(mp) ((ULONG)(mp))
+
+#define MRFROMP(x) ((MRESULT)(PVOID)(x))
+#define MRFROMSHORT(x) ((MRESULT)(ULONG)(USHORT)(x))
+#define MRFROM2SHORT(x1,x2) ((MRESULT)MAKELONG (x1, x2))
+#define MRFROMLONG(x) ((MRESULT)(ULONG)(x))
+
+#define PVOIDFROMMR(mr) ((VOID *)(mr))
+#define SHORT1FROMMR(mr) ((USHORT)((ULONG)mr))
+#define SHORT2FROMMR(mr) ((USHORT)((ULONG)mr >> 16))
+#define LONGFROMMR(mr) ((ULONG)(mr))
+
+
+HWND WinCreateWindow (HWND hwndParent, PCSZ pszClass, PCSZ pszName,
+ ULONG flStyle, LONG x, LONG y, LONG cx, LONG cy, HWND hwndOwner,
+ HWND hwndInsertBehind, ULONG id, PVOID pCtlData, PVOID pPresParams);
+BOOL WinDrawBitmap (HPS hpsDst, HBITMAP hbm, __const__ RECTL *pwrcSrc,
+ __const__ POINTL *pptlDst, LONG clrFore, LONG clrBack, ULONG fl);
+BOOL WinDrawBorder (HPS hps, __const__ RECTL *prcl, LONG cx, LONG cy,
+ LONG clrFore, LONG clrBack, ULONG flCmd);
+LONG WinDrawText (HPS hps, LONG cchText, PCCH lpchText, PRECTL prcl,
+ LONG clrFore, LONG clrBack, ULONG flCmd);
+BOOL WinEnableWindow (HWND hwnd, BOOL fEnable);
+BOOL WinEnableWindowUpdate (HWND hwnd, BOOL fEnable);
+BOOL WinInvalidateRect (HWND hwnd, __const__ RECTL *prcl,
+ BOOL fIncludeChildren);
+BOOL WinInvalidateRegion (HWND hwnd, HRGN hrgn, BOOL fIncludeChildren);
+BOOL WinInvertRect (HPS hps, __const__ RECTL *prcl);
+BOOL WinIsChild (HWND hwnd, HWND hwndParent);
+BOOL WinIsWindow (HAB hab, HWND hwnd);
+BOOL WinIsWindowEnabled (HWND hwnd);
+BOOL WinIsWindowVisible (HWND hwnd);
+LONG WinLoadMessage (HAB hab, HMODULE hmod, ULONG id, LONG cchMax,
+ PSZ pchBuffer);
+LONG WinLoadString (HAB hab, HMODULE hmod, ULONG id, LONG cchMax,
+ PSZ pchBuffer);
+LONG WinMultWindowFromIDs (HWND hwndParent, PHWND prghwnd, ULONG idFirst,
+ ULONG idLast);
+HWND WinQueryDesktopWindow (HAB hab, HDC hdc);
+HWND WinQueryObjectWindow (HWND hwndDesktop);
+HPOINTER WinQueryPointer (HWND hwndDesktop);
+HWND WinQueryWindow (HWND hwnd, LONG cmd);
+BOOL WinQueryWindowPos (HWND hwnd, PSWP pswp);
+BOOL WinQueryWindowProcess (HWND hwnd, PPID ppid, PTID ptid);
+LONG WinQueryWindowText (HWND hwnd, LONG cchBufferMax, PCH pchBuffer);
+LONG WinQueryWindowTextLength (HWND hwnd);
+BOOL WinSetMultWindowPos (HAB hab, __const__ SWP *pswp, ULONG cswp);
+BOOL WinSetOwner (HWND hwnd, HWND hwndNewOwner);
+BOOL WinSetParent (HWND hwnd, HWND hwndNewParent, BOOL fRedraw);
+BOOL WinSetWindowPos (HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y,
+ LONG cx, LONG cy, ULONG fl);
+BOOL WinSetWindowText (HWND hwnd, PCSZ pszText);
+BOOL WinUpdateWindow (HWND hwnd);
+HWND WinWindowFromID (HWND hwndParent, ULONG id);
+
+
+#if defined (INCL_WINFRAMEMGR) || !defined (INCL_NOCOMMON)
+
+#define FCF_TITLEBAR 0x00000001
+#define FCF_SYSMENU 0x00000002
+#define FCF_MENU 0x00000004
+#define FCF_SIZEBORDER 0x00000008
+#define FCF_MINBUTTON 0x00000010
+#define FCF_MAXBUTTON 0x00000020
+#define FCF_MINMAX (FCF_MINBUTTON|FCF_MAXBUTTON)
+#define FCF_VERTSCROLL 0x00000040
+#define FCF_HORZSCROLL 0x00000080
+#define FCF_DLGBORDER 0x00000100
+#define FCF_BORDER 0x00000200
+#define FCF_SHELLPOSITION 0x00000400
+#define FCF_TASKLIST 0x00000800
+#define FCF_NOBYTEALIGN 0x00001000
+#define FCF_NOMOVEWITHOWNER 0x00002000
+#define FCF_ICON 0x00004000
+#define FCF_ACCELTABLE 0x00008000
+#define FCF_SYSMODAL 0x00010000
+#define FCF_SCREENALIGN 0x00020000
+#define FCF_MOUSEALIGN 0x00040000
+#define FCF_PALETTE_NORMAL 0x00080000
+#define FCF_PALETTE_HELP 0x00100000
+#define FCF_PALETTE_POPUPODD 0x00200000
+#define FCF_PALETTE_POPUPEVEN 0x00400000
+#define FCF_HIDEBUTTON 0x01000000
+#define FCF_HIDEMAX 0x01000020
+#define FCF_AUTOICON 0x40000000
+#if defined (INCL_NLS)
+#define FCF_DBE_APPSTAT 0x80000000
+#endif /* INCL_NLS */
+
+#define FCF_STANDARD 0x0000cc3f
+
+#define FF_FLASHWINDOW 0x0001
+#define FF_ACTIVE 0x0002
+#define FF_FLASHHILITE 0x0004
+#define FF_OWNERHIDDEN 0x0008
+#define FF_DLGDISMISSED 0x0010
+#define FF_OWNERDISABLED 0x0020
+#define FF_SELECTED 0x0040
+#define FF_NOACTIVATESWP 0x0080
+#define FF_DIALOGBOX 0x0100
+
+#define FS_ICON 0x00000001
+#define FS_ACCELTABLE 0x00000002
+#define FS_SHELLPOSITION 0x00000004
+#define FS_TASKLIST 0x00000008
+#define FS_NOBYTEALIGN 0x00000010
+#define FS_NOMOVEWITHOWNER 0x00000020
+#define FS_SYSMODAL 0x00000040
+#define FS_DLGBORDER 0x00000080
+#define FS_BORDER 0x00000100
+#define FS_SCREENALIGN 0x00000200
+#define FS_MOUSEALIGN 0x00000400
+#define FS_SIZEBORDER 0x00000800
+#define FS_AUTOICON 0x00001000
+#if defined (INCL_NLS)
+#define FS_DBE_APPSTAT 0x00008000
+#endif /* INCL_NLS */
+
+#define FS_STANDARD 0x0000000f
+
+typedef struct _FRAMECDATA
+{
+ USHORT cb;
+ ULONG flCreateFlags;
+ USHORT hmodResources;
+ USHORT idResources;
+} FRAMECDATA;
+typedef FRAMECDATA *PFRAMECDATA;
+
+HWND WinCreateStdWindow (HWND hwndParent, ULONG flStyle,
+ PULONG pflCreateFlags, PCSZ pszClientClass, PCSZ pszTitle,
+ ULONG styleClient, HMODULE hmod, ULONG idResources, PHWND phwndClient);
+
+#endif /* INCL_WINFRAMEMGR || !INCL_NOCOMMON */
+
+#if defined (INCL_WINFRAMEMGR)
+
+#define WM_FLASHWINDOW 0x0040
+#define WM_FORMATFRAME 0x0041
+#define WM_UPDATEFRAME 0x0042
+#define WM_FOCUSCHANGE 0x0043
+#define WM_SETBORDERSIZE 0x0044
+#define WM_TRACKFRAME 0x0045
+#define WM_MINMAXFRAME 0x0046
+#define WM_SETICON 0x0047
+#define WM_QUERYICON 0x0048
+#define WM_SETACCELTABLE 0x0049
+#define WM_QUERYACCELTABLE 0x004a
+#define WM_TRANSLATEACCEL 0x004b
+#define WM_QUERYTRACKINFO 0x004c
+#define WM_QUERYBORDERSIZE 0x004d
+#define WM_NEXTMENU 0x004e
+#define WM_ERASEBACKGROUND 0x004f
+#define WM_QUERYFRAMEINFO 0x0050
+#define WM_QUERYFOCUSCHAIN 0x0051
+#define WM_OWNERPOSCHANGE 0x0052
+#define WM_CALCFRAMERECT 0x0053
+#define WM_WINDOWPOSCHANGED 0x0055
+#define WM_ADJUSTFRAMEPOS 0x0056
+#define WM_QUERYFRAMECTLCOUNT 0x0059
+#define WM_QUERYHELPINFO 0x005b
+#define WM_SETHELPINFO 0x005c
+#define WM_ERROR 0x005d
+#define WM_REALIZEPALETTE 0x005e
+
+#define FI_FRAME 0x00000001
+#define FI_OWNERHIDE 0x00000002
+#define FI_ACTIVATEOK 0x00000004
+#define FI_NOMOVEWITHOWNER 0x00000008
+
+#define FID_SYSMENU 0x8002
+#define FID_TITLEBAR 0x8003
+#define FID_MINMAX 0x8004
+#define FID_MENU 0x8005
+#define FID_VERTSCROLL 0x8006
+#define FID_HORZSCROLL 0x8007
+#define FID_CLIENT 0x8008
+#define FID_DBE_APPSTAT 0x8010
+#define FID_DBE_KBDSTAT 0x8011
+#define FID_DBE_PECIC 0x8012
+#define FID_DBE_KKPOPUP 0x8013
+
+#define SC_SIZE 0x8000
+#define SC_MOVE 0x8001
+#define SC_MINIMIZE 0x8002
+#define SC_MAXIMIZE 0x8003
+#define SC_CLOSE 0x8004
+#define SC_NEXT 0x8005
+#define SC_APPMENU 0x8006
+#define SC_SYSMENU 0x8007
+#define SC_RESTORE 0x8008
+#define SC_NEXTFRAME 0x8009
+#define SC_NEXTWINDOW 0x8010
+#define SC_TASKMANAGER 0x8011
+#define SC_HELPKEYS 0x8012
+#define SC_HELPINDEX 0x8013
+#define SC_HELPEXTENDED 0x8014
+#define SC_SWITCHPANELIDS 0x8015
+#define SC_DBE_FIRST 0x8018
+#define SC_DBE_LAST 0x801f
+#define SC_BEGINDRAG 0x8020
+#define SC_ENDDRAG 0x8021
+#define SC_SELECT 0x8022
+#define SC_OPEN 0x8023
+#define SC_CONTEXTMENU 0x8024
+#define SC_CONTEXTHELP 0x8025
+#define SC_TEXTEDIT 0x8026
+#define SC_BEGINSELECT 0x8027
+#define SC_ENDSELECT 0x8028
+#define SC_WINDOW 0x8029
+#define SC_HIDE 0x802a
+
+typedef LHANDLE HSAVEWP;
+
+BOOL WinCalcFrameRect (HWND hwndFrame, PRECTL prcl, BOOL fClient);
+BOOL WinCreateFrameControls (HWND hwndFrame, PFRAMECDATA pfcdata,
+ PCSZ pszTitle);
+BOOL WinFlashWindow (HWND hwndFrame, BOOL fFlash);
+BOOL WinGetMaxPosition (HWND hwnd, PSWP pswp);
+BOOL WinGetMinPosition (HWND hwnd, PSWP pswp, __const__ POINTL *pptl);
+BOOL WinSaveWindowPos (HSAVEWP hsvwp, PSWP pswp, ULONG cswp);
+
+#endif /* INCL_WINFRAMEMGR */
+
+
+#if defined (INCL_WINWINDOWMGR) || !defined (INCL_NOCOMMON)
+
+#define PSF_LOCKWINDOWUPDATE 0x0001
+#define PSF_CLIPUPWARDS 0x0002
+#define PSF_CLIPDOWNWARDS 0x0004
+#define PSF_CLIPSIBLINGS 0x0008
+#define PSF_CLIPCHILDREN 0x0010
+#define PSF_PARENTCLIP 0x0020
+
+#define QV_OS2 0x0000
+#define QV_CMS 0x0001
+#define QV_TSO 0x0002
+#define QV_TSOBATCH 0x0003
+#define QV_OS400 0x0004
+
+#define SW_SCROLLCHILDREN 0x0001
+#define SW_INVALIDATERGN 0x0002
+
+
+typedef struct _QVERSDATA
+{
+ USHORT environment;
+ USHORT version;
+} QVERSDATA;
+typedef QVERSDATA *PQVERSDATA;
+
+
+HPS WinBeginPaint (HWND hwnd, HPS hps, PRECTL prclPaint);
+MRESULT WinDefWindowProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
+BOOL WinDestroyWindow (HWND hwnd);
+BOOL WinEndPaint (HPS hps);
+BOOL WinFillRect (HPS hps, __const__ RECTL *prcl, LONG lColor);
+HPS WinGetClipPS (HWND hwnd, HWND hwndClip, ULONG fl);
+HPS WinGetPS (HWND hwnd);
+HAB WinInitialize (ULONG fsOptions);
+BOOL WinIsWindowShowing (HWND hwnd);
+HDC WinOpenWindowDC (HWND hwnd);
+HAB WinQueryAnchorBlock (HWND hwnd);
+ULONG WinQueryVersion (HAB hab);
+BOOL WinQueryWindowRect (HWND hwnd, PRECTL prclDest);
+BOOL WinRegisterClass (HAB hab, PCSZ pszClassName, PFNWP pfnWndProc,
+ ULONG flStyle, ULONG cbWindowData);
+BOOL WinReleasePS (HPS hps);
+LONG WinScrollWindow (HWND hwnd, LONG dx, LONG dy, __const__ RECTL *prclScroll,
+ __const__ RECTL *prclClip, HRGN hrgnUpdate, PRECTL prclUpdate,
+ ULONG rgfsw);
+BOOL WinSetActiveWindow (HWND hwndDesktop, HWND hwnd);
+BOOL WinShowWindow (HWND hwnd, BOOL fShow);
+BOOL WinTerminate (HAB hab);
+
+#endif /* INCL_WINWINDOWMGR || !INCL_NOCOMMON */
+
+#if defined (INCL_WINWINDOWMGR)
+
+#define WM_QUERYCONVERTPOS 0x00b0
+
+#define QCP_CONVERT 0x0001
+#define QCP_NOCONVERT 0x0000
+
+#define QWS_USER 0
+#define QWS_ID (-1)
+#define QWS_MIN (-1)
+
+#define QWL_USER 0
+#define QWL_STYLE (-2)
+#define QWP_PFNWP (-3)
+#define QWL_HMQ (-4)
+#define QWL_RESERVED (-5)
+#define QWL_PENDATA (-7)
+#define QWL_BD_ATTR (-9)
+#define QWL_BD_STAT (-10)
+#define QWL_KBDLAYER (-11)
+#define QWL_MIN (-11)
+
+#define QWL_HHEAP 0x0004
+#define QWL_HWNDFOCUSSAVE 0x0018
+#define QWL_DEFBUTTON 0x0040
+#define QWL_PSSCBLK 0x0048
+#define QWL_PFEPBLK 0x004c
+#define QWL_PSTATBLK 0x0050
+
+#define QWS_FLAGS 0x0008
+#define QWS_RESULT 0x000a
+#define QWS_XRESTORE 0x000c
+#define QWS_YRESTORE 0x000e
+#define QWS_CXRESTORE 0x0010
+#define QWS_CYRESTORE 0x0012
+#define QWS_XMINIMIZE 0x0014
+#define QWS_YMINIMIZE 0x0016
+
+
+typedef struct _CLASSINFO
+{
+ ULONG flClassStyle;
+ PFNWP pfnWindowProc;
+ ULONG cbWindowData;
+} CLASSINFO;
+typedef CLASSINFO *PCLASSINFO;
+
+typedef struct _CREATESTRUCT
+{
+ PVOID pPresParams;
+ PVOID pCtlData;
+ ULONG id;
+ HWND hwndInsertBehind;
+ HWND hwndOwner;
+ LONG cy;
+ LONG cx;
+ LONG y;
+ LONG x;
+ ULONG flStyle;
+ PSZ pszText;
+ PSZ pszClass;
+ HWND hwndParent;
+} CREATESTRUCT;
+typedef CREATESTRUCT *PCREATESTRUCT;
+
+typedef LHANDLE HENUM;
+
+
+HENUM WinBeginEnumWindows (HWND hwnd);
+BOOL WinEndEnumWindows (HENUM henum);
+LONG WinExcludeUpdateRegion (HPS hps, HWND hwnd);
+HWND WinGetNextWindow (HENUM henum);
+HPS WinGetScreenPS (HWND hwndDesktop);
+BOOL WinIsThreadActive (HAB hab);
+BOOL WinLockVisRegions (HWND hwndDesktop, BOOL fLock);
+BOOL WinLockWindowUpdate (HWND hwndDesktop, HWND hwndLockUpdate);
+BOOL WinMapWindowPoints (HWND hwndFrom, HWND hwndTo, PPOINTL prgptl,
+ LONG cwpt);
+HWND WinQueryActiveWindow (HWND hwndDesktop);
+BOOL WinQueryClassInfo (HAB hab, PCSZ pszClassName, PCLASSINFO pClassInfo);
+LONG WinQueryClassName (HWND hwnd, LONG cchMax, PCH pch);
+BOOL WinQueryUpdateRect (HWND hwnd, PRECTL prcl);
+LONG WinQueryUpdateRegion (HWND hwnd, HRGN hrgn);
+HWND WinQuerySysModalWindow (HWND hwndDesktop);
+HDC WinQueryWindowDC (HWND hwnd);
+PVOID WinQueryWindowPtr (HWND hwnd, LONG index);
+ULONG WinQueryWindowULong (HWND hwnd, LONG index);
+USHORT WinQueryWindowUShort (HWND hwnd, LONG index);
+BOOL WinSetSysModalWindow (HWND hwndDesktop, HWND hwnd);
+BOOL WinSetWindowBits (HWND hwnd, LONG index, ULONG flData, ULONG flMask);
+BOOL WinSetWindowPtr (HWND hwnd, LONG index, PVOID p);
+BOOL WinSetWindowULong (HWND hwnd, LONG index, ULONG ul);
+BOOL WinSetWindowUShort (HWND hwnd, LONG index, USHORT us);
+PFNWP WinSubclassWindow (HWND hwnd, PFNWP pfnwp);
+BOOL WinValidateRect (HWND hwnd, __const__ RECTL *prcl, BOOL fIncludeChildren);
+BOOL WinValidateRegion (HWND hwnd, HRGN hrgn, BOOL fIncludeChildren);
+HWND WinWindowFromDC (HDC hdc);
+HWND WinWindowFromPoint (HWND hwnd, __const__ POINTL *pptl, BOOL fChildren);
+
+#endif /* INCL_WINWINDOWMGR */
+
+
+#if defined (INCL_WINACCELERATORS)
+
+#define AF_CHAR 0x0001
+#define AF_VIRTUALKEY 0x0002
+#define AF_SCANCODE 0x0004
+#define AF_SHIFT 0x0008
+#define AF_CONTROL 0x0010
+#define AF_ALT 0x0020
+#define AF_LONEKEY 0x0040
+#define AF_SYSCOMMAND 0x0100
+#define AF_HELP 0x0200
+
+typedef struct _ACCEL
+{
+ USHORT fs;
+ USHORT key;
+ USHORT cmd;
+} ACCEL;
+typedef ACCEL *PACCEL;
+
+typedef struct _ACCELTABLE
+{
+ USHORT cAccel;
+ USHORT codepage;
+ ACCEL aaccel[1];
+} ACCELTABLE;
+typedef ACCELTABLE *PACCELTABLE;
+
+ULONG WinCopyAccelTable (HACCEL haccel, PACCELTABLE pAccelTable,
+ ULONG cbCopyMax);
+HACCEL WinCreateAccelTable (HAB hab, PACCELTABLE pAccelTable);
+BOOL WinDestroyAccelTable (HACCEL haccel);
+HACCEL WinLoadAccelTable (HAB hab, HMODULE hmod, ULONG idAccelTable);
+HACCEL WinQueryAccelTable (HAB hab, HWND hwndFrame);
+BOOL WinSetAccelTable (HAB hab, HACCEL haccel, HWND hwndFrame);
+BOOL WinTranslateAccel (HAB hab, HWND hwnd, HACCEL haccel, PQMSG pqmsg);
+
+#endif /* INCL_WINACCELERATORS */
+
+
+#if defined (INCL_WINATOM)
+
+typedef LHANDLE HATOMTBL;
+typedef ULONG ATOM;
+
+#define MAKEINTATOM(x) ((PCH)MAKEULONG (x, 0xffff))
+
+ATOM WinAddAtom (HATOMTBL hAtomTbl, PCSZ pszAtomName);
+HATOMTBL WinCreateAtomTable (ULONG cbInitial, ULONG cBuckets);
+ATOM WinDeleteAtom (HATOMTBL hAtomTbl, ATOM atom);
+HATOMTBL WinDestroyAtomTable (HATOMTBL hAtomTbl);
+ATOM WinFindAtom (HATOMTBL hAtomTbl, PCSZ pszAtomName);
+ULONG WinQueryAtomLength (HATOMTBL hAtomTbl, ATOM atom);
+ULONG WinQueryAtomName (HATOMTBL hAtomTbl, ATOM atom, PSZ pchBuffer,
+ ULONG cchBufferMax);
+ULONG WinQueryAtomUsage (HATOMTBL hAtomTbl, ATOM atom);
+HATOMTBL WinQuerySystemAtomTable (VOID);
+
+#endif /* INCL_WINATOM */
+
+
+#if defined (INCL_WINBUTTONS)
+
+#define BDS_HILITED 0x0100
+#define BDS_DISABLED 0x0200
+#define BDS_DEFAULT 0x0400
+
+#define BM_CLICK 0x0120
+#define BM_QUERYCHECKINDEX 0x0121
+#define BM_QUERYHILITE 0x0122
+#define BM_SETHILITE 0x0123
+#define BM_QUERYCHECK 0x0124
+#define BM_SETCHECK 0x0125
+#define BM_SETDEFAULT 0x0126
+
+#define BN_CLICKED 1
+#define BN_DBLCLICKED 2
+#define BN_PAINT 3
+
+#define BS_PUSHBUTTON 0
+#define BS_CHECKBOX 1
+#define BS_AUTOCHECKBOX 2
+#define BS_RADIOBUTTON 3
+#define BS_AUTORADIOBUTTON 4
+#define BS_3STATE 5
+#define BS_AUTO3STATE 6
+#define BS_USERBUTTON 7
+
+#define BS_PRIMARYSTYLES 0x000f
+#define BS_TEXT 0x0010
+#define BS_MINIICON 0x0020
+#define BS_BITMAP 0x0040
+#define BS_ICON 0x0080
+#define BS_HELP 0x0100
+#define BS_SYSCOMMAND 0x0200
+#define BS_DEFAULT 0x0400
+#define BS_NOPOINTERFOCUS 0x0800
+#define BS_NOBORDER 0x1000
+#define BS_NOCURSORSELECT 0x2000
+#define BS_AUTOSIZE 0x4000
+
+typedef struct _BTNCDATA
+{
+ USHORT cb;
+ USHORT fsCheckState;
+ USHORT fsHiliteState;
+ LHANDLE hImage;
+} BTNCDATA;
+typedef BTNCDATA *PBTNCDATA;
+
+typedef struct _USERBUTTON
+{
+ HWND hwnd;
+ HPS hps;
+ ULONG fsState;
+ ULONG fsStateOld;
+} USERBUTTON;
+typedef USERBUTTON *PUSERBUTTON;
+
+
+#endif /* INCL_WINBUTTONS */
+
+
+#if defined (INCL_WINCLIPBOARD) || defined (INCL_WINDDE)
+
+#define WM_RENDERFMT 0x0060
+#define WM_RENDERALLFMTS 0x0061
+#define WM_DESTROYCLIPBOARD 0x0062
+#define WM_PAINTCLIPBOARD 0x0063
+#define WM_SIZECLIPBOARD 0x0064
+#define WM_HSCROLLCLIPBOARD 0x0065
+#define WM_VSCROLLCLIPBOARD 0x0066
+#define WM_DRAWCLIPBOARD 0x0067
+
+#define CF_TEXT 1
+#define CF_BITMAP 2
+#define CF_DSPTEXT 3
+#define CF_DSPBITMAP 4
+#define CF_METAFILE 5
+#define CF_DSPMETAFILE 6
+#define CF_PALETTE 9
+#define CF_MMPMFIRST 10
+#define CF_MMPMLAST 19
+
+#define SZFMT_TEXT "#1"
+#define SZFMT_BITMAP "#2"
+#define SZFMT_DSPTEXT "#3"
+#define SZFMT_DSPBITMAP "#4"
+#define SZFMT_METAFILE "#5"
+#define SZFMT_DSPMETAFILE "#6"
+#define SZFMT_PALETTE "#9"
+#define SZFMT_SYLK "Sylk"
+#define SZFMT_DIF "Dif"
+#define SZFMT_TIFF "Tiff"
+#define SZFMT_OEMTEXT "OemText"
+#define SZFMT_DIB "Dib"
+#define SZFMT_OWNERDISPLAY "OwnerDisplay"
+#define SZFMT_LINK "Link"
+#define SZFMT_METAFILEPICT "MetaFilePict"
+#define SZFMT_DSPMETAFILEPICT "DspMetaFilePict"
+#define SZFMT_CPTEXT "Codepage Text"
+
+typedef struct _CPTEXT
+{
+ USHORT idCountry;
+ USHORT usCodepage;
+ USHORT usLangID;
+ USHORT usSubLangID;
+ BYTE abText[1];
+} CPTEXT;
+typedef CPTEXT *PCPTEXT;
+
+typedef struct _MFP
+{
+ POINTL sizeBounds;
+ POINTL sizeMM;
+ ULONG cbLength;
+ USHORT mapMode;
+ USHORT reserved;
+ BYTE abData[1];
+} MFP;
+typedef MFP *PMFP;
+
+#endif /* INCL_WINCLIPBOARD || INCL_WINDDE */
+
+#if defined (INCL_WINCLIPBOARD)
+
+#define CFI_OWNERFREE 0x0001
+#define CFI_OWNERDISPLAY 0x0002
+#define CFI_HANDLE 0x0200
+#define CFI_POINTER 0x0400
+
+BOOL WinCloseClipbrd (HAB hab);
+BOOL WinEmptyClipbrd (HAB hab);
+ULONG WinEnumClipbrdFmts (HAB hab, ULONG fmt);
+BOOL WinOpenClipbrd (HAB hab);
+ULONG WinQueryClipbrdData (HAB hab, ULONG fmt);
+BOOL WinQueryClipbrdFmtInfo (HAB hab, ULONG fmt, PULONG prgfFmtInfo);
+HWND WinQueryClipbrdOwner (HAB hab);
+HWND WinQueryClipbrdViewer (HAB hab);
+BOOL WinSetClipbrdData (HAB hab, ULONG ulData, ULONG fmt, ULONG rgfFmtInfo);
+BOOL WinSetClipbrdOwner (HAB hab, HWND hwnd);
+BOOL WinSetClipbrdViewer (HAB hab, HWND hwndNewClipViewer);
+
+#endif /* INCL_WINCLIPBOARD */
+
+
+#if defined (INCL_WINDDE)
+
+#define WM_DDE_FIRST 0x00a0
+#define WM_DDE_INITIATE 0x00a0
+#define WM_DDE_REQUEST 0x00a1
+#define WM_DDE_ACK 0x00a2
+#define WM_DDE_DATA 0x00a3
+#define WM_DDE_ADVISE 0x00a4
+#define WM_DDE_UNADVISE 0x00a5
+#define WM_DDE_POKE 0x00a6
+#define WM_DDE_EXECUTE 0x00a7
+#define WM_DDE_TERMINATE 0x00a8
+#define WM_DDE_INITIATEACK 0x00a9
+#define WM_DDE_LAST 0x00af
+
+#define DDE_FACK 0x0001
+#define DDE_FBUSY 0x0002
+#define DDE_FNODATA 0x0004
+#define DDE_FACKREQ 0x0008
+#define DDE_FRESPONSE 0x0010
+#define DDE_NOTPROCESSED 0x0020
+#define DDE_FRESERVED 0x00c0
+#define DDE_FAPPSTATUS 0xff00
+
+#define DDECTXT_CASESENSITIVE 0x0001
+
+#define DDEFMT_TEXT 0x0001
+
+#define DDEPM_RETRY 0x0001
+#define DDEPM_NOFREE 0x0002
+
+#define SZDDESYS_TOPIC "System"
+#define SZDDESYS_ITEM_TOPICS "Topics"
+#define SZDDESYS_ITEM_SYSITEMS "SysItems"
+#define SZDDESYS_ITEM_RTNMSG "ReturnMessage"
+#define SZDDESYS_ITEM_STATUS "Status"
+#define SZDDESYS_ITEM_FORMATS "Formats"
+#define SZDDESYS_ITEM_SECURITY "Security"
+#define SZDDESYS_ITEM_ITEMFORMATS "ItemFormats"
+#define SZDDESYS_ITEM_HELP "Help"
+#define SZDDESYS_ITEM_PROTOCOLS "Protocols"
+#define SZDDESYS_ITEM_RESTART "Restart"
+
+typedef struct _CONVCONTEXT
+{
+ ULONG cb;
+ ULONG fsContext;
+ ULONG idCountry;
+ ULONG usCodepage;
+ ULONG usLangID;
+ ULONG usSubLangID;
+} CONVCONTEXT;
+typedef CONVCONTEXT *PCONVCONTEXT;
+
+typedef struct _DDEINIT
+{
+ ULONG cb;
+ PSZ pszAppName;
+ PSZ pszTopic;
+ ULONG offConvContext;
+} DDEINIT;
+typedef DDEINIT *PDDEINIT;
+
+typedef struct _DDESTRUCT
+{
+ ULONG cbData;
+ USHORT fsStatus;
+ USHORT usFormat;
+ USHORT offszItemName;
+ USHORT offabData;
+} DDESTRUCT;
+typedef DDESTRUCT *PDDESTRUCT;
+
+#define DDES_PSZITEMNAME(pddes) \
+ (((PSZ)pddes) + ((PDDESTRUCT)pddes)->offszItemName)
+
+#define DDES_PABDATA(pddes) \
+ (((PBYTE)pddes) + ((PDDESTRUCT)pddes)->offabData)
+
+#define DDEI_PCONVCONTEXT(pddei) \
+ ((PCONVCONTEXT)((PBYTE)pddei + pddei->offConvContext))
+
+BOOL WinDdeInitiate (HWND hwndClient, PCSZ pszAppName, PCSZ pszTopicName,
+ __const__ CONVCONTEXT *pcctxt);
+BOOL WinDdePostMsg (HWND hwndTo, HWND hwndFrom, ULONG wm,
+ __const__ DDESTRUCT *pddest, ULONG flOptions);
+MRESULT WinDdeRespond (HWND hwndClient, HWND hwndServer, PCSZ pszAppName,
+ PCSZ pszTopicName, __const__ CONVCONTEXT *pcctxt);
+
+#endif /* INCL_WINDDE */
+
+
+#if defined (INCL_WINCOUNTRY)
+
+#define WCS_ERROR 0
+#define WCS_EQ 1
+#define WCS_LT 2
+#define WCS_GT 3
+
+ULONG WinCompareStrings (HAB hab, ULONG idcp, ULONG idcc, PCSZ psz1,
+ PCSZ psz2, ULONG reserved);
+UCHAR WinCpTranslateChar (HAB hab, ULONG cpSrc, UCHAR chSrc, ULONG cpDst);
+BOOL WinCpTranslateString (HAB hab, ULONG cpSrc, PCSZ pszSrc, ULONG cpDst,
+ ULONG cchDestMax, PSZ pchDest);
+PSZ WinNextChar (HAB hab, ULONG idcp, ULONG idcc, PCSZ psz);
+PSZ WinPrevChar (HAB hab, ULONG idcp, ULONG idcc, PCSZ pszStart,
+ PCSZ psz);
+ULONG WinQueryCp (HMQ hmq);
+ULONG WinQueryCpList (HAB hab, ULONG ccpMax, PULONG prgcp);
+BOOL WinSetCp (HMQ hmq, ULONG idCodePage);
+ULONG WinUpper (HAB hab, ULONG idcp, ULONG idcc, PSZ psz);
+ULONG WinUpperChar (HAB hab, ULONG idcp, ULONG idcc, ULONG c);
+
+#endif /* INCL_WINCOUNTRY */
+
+
+#if defined (INCL_WINCURSORS) || !defined (INCL_NOCOMMON)
+
+#define CURSOR_SOLID 0x0000
+#define CURSOR_HALFTONE 0x0001
+#define CURSOR_FRAME 0x0002
+#define CURSOR_FLASH 0x0004
+#define CURSOR_BIDI_FIRST 0x0100
+#define CURSOR_BIDI_LAST 0x0200
+#define CURSOR_SETPOS 0x8000
+
+BOOL WinCreateCursor (HWND hwnd, LONG x, LONG y, LONG cx, LONG cy,
+ ULONG fs, PRECTL prclClip);
+BOOL WinDestroyCursor (HWND hwnd);
+BOOL WinShowCursor (HWND hwnd, BOOL fShow);
+
+#endif /* INCL_WINCURSORS || !INCL_NOCOMMON */
+
+#if defined (INCL_WINCURSORS)
+
+typedef struct _CURSORINFO
+{
+ HWND hwnd;
+ LONG x;
+ LONG y;
+ LONG cx;
+ LONG cy;
+ ULONG fs;
+ RECTL rclClip;
+} CURSORINFO;
+typedef CURSORINFO *PCURSORINFO;
+
+BOOL WinQueryCursorInfo (HWND hwndDesktop, PCURSORINFO pCursorInfo);
+
+#endif /* INCL_WINCURSORS */
+
+
+#if defined (INCL_WINDESKTOP)
+
+#define SDT_DESTROY 0x0001
+#define SDT_NOBKGND 0x0002
+#define SDT_TILE 0x0004
+#define SDT_SCALE 0x0008
+#define SDT_PATTERN 0x0010
+#define SDT_CENTER 0x0020
+#define SDT_RETAIN 0x0040
+#define SDT_LOADFILE 0x0080
+
+typedef struct _DESKTOP
+{
+ ULONG cbSize;
+ HBITMAP hbm;
+ LONG x;
+ LONG y;
+ ULONG fl;
+ LONG lTileCount;
+ CHAR szFile[260];
+} DESKTOP;
+typedef DESKTOP *PDESKTOP;
+
+BOOL WinQueryDesktopBkgnd (HWND hwndDesktop, PDESKTOP pdsk);
+HBITMAP WinSetDesktopBkgnd (HWND hwndDesktop, __const__ DESKTOP *pdskNew);
+
+#endif /* INCL_WINDESKTOP */
+
+
+#if defined (INCL_WINDIALOGS) || !defined (INCL_NOCOMMON)
+
+#define DID_OK 1
+#define DID_CANCEL 2
+#define DID_ERROR 0xffff
+
+#define MB_OK 0x0000
+#define MB_OKCANCEL 0x0001
+#define MB_RETRYCANCEL 0x0002
+#define MB_ABORTRETRYIGNORE 0x0003
+#define MB_YESNO 0x0004
+#define MB_YESNOCANCEL 0x0005
+#define MB_CANCEL 0x0006
+#define MB_ENTER 0x0007
+#define MB_ENTERCANCEL 0x0008
+
+#define MB_NOICON 0x0000
+#define MB_CUANOTIFICATION 0x0000
+#define MB_ICONQUESTION 0x0010
+#define MB_ICONEXCLAMATION 0x0020
+#define MB_CUAWARNING 0x0020
+#define MB_ICONASTERISK 0x0030
+#define MB_ICONHAND 0x0040
+#define MB_CUACRITICAL 0x0040
+#define MB_QUERY MB_ICONQUESTION
+#define MB_WARNING MB_CUAWARNING
+#define MB_INFORMATION MB_ICONASTERISK
+#define MB_CRITICAL MB_CUACRITICAL
+#define MB_ERROR MB_CRITICAL
+#define MB_CUSTOMICON 0x0080
+
+#define MB_DEFBUTTON1 0x0000
+#define MB_DEFBUTTON2 0x0100
+#define MB_DEFBUTTON3 0x0200
+
+#define MB_APPLMODAL 0x0000
+#define MB_SYSTEMMODAL 0x1000
+#define MB_HELP 0x2000
+#define MB_MOVEABLE 0x4000
+#define MB_NONMODAL 0x8000
+
+#define MBID_OK 1
+#define MBID_CANCEL 2
+#define MBID_ABORT 3
+#define MBID_RETRY 4
+#define MBID_IGNORE 5
+#define MBID_YES 6
+#define MBID_NO 7
+#define MBID_HELP 8
+#define MBID_ENTER 9
+#define MBID_ERROR 0xffff
+
+#define WA_WARNING 0
+#define WA_NOTE 1
+#define WA_ERROR 2
+#define WA_CDEFALARMS 3
+
+#if 0 /* Multimedia */
+#define WA_WINDOWOPEN 3
+#define WA_WINDOWCLOSE 4
+#define WA_BEGINDRAG 5
+#define WA_ENDDRAG 6
+#define WA_STARTUP 7
+#define WA_SHUTDOWN 8
+#define WA_SHRED 9
+#define WA_CWINALARMS 13
+#endif /* 0 */
+
+#define MAX_MBDTEXT 70
+
+typedef struct _MB2D
+{
+ CHAR achText[MAX_MBDTEXT+1];
+ CHAR _pad[1];
+ ULONG idButton;
+ LONG flStyle;
+} MB2D;
+typedef MB2D *PMB2D;
+
+typedef struct _MB2INFO
+{
+ ULONG cb;
+ HPOINTER hIcon;
+ ULONG cButtons;
+ ULONG flStyle;
+ HWND hwndNotify;
+ MB2D mb2d[1];
+} MB2INFO;
+
+typedef MB2INFO *PMB2INFO;
+
+
+#define WinCheckButton(hwndDlg,id,usCheckState) \
+ ((ULONG)WinSendDlgItemMsg (hwndDlg, id, BM_SETCHECK, \
+ MPFROMSHORT (usCheckState), (MPARAM)NULL))
+
+#define WinEnableControl(hwndDlg,id,fEnable) \
+ WinEnableWindow (WinWindowFromID (hwndDlg, id), fEnable)
+
+#define WinIsControlEnabled(hwndDlg,id) \
+ ((BOOL)WinIsWindowEnabled (WinWindowFromID (hwndDlg, id)))
+
+#define WinQueryButtonCheckstate(hwndDlg,id) \
+ ((ULONG)WinSendDlgItemMsg (hwndDlg, id, BM_QUERYCHECK, \
+ (MPARAM)NULL, (MPARAM)NULL))
+
+
+BOOL WinAlarm (HWND hwndDesktop, ULONG rgfType);
+MRESULT WinDefDlgProc (HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
+BOOL WinDismissDlg (HWND hwndDlg, ULONG usResult);
+ULONG WinDlgBox (HWND hwndParent, HWND hwndOwner, PFNWP pfnDlgProc,
+ HMODULE hmod, ULONG idDlg, PVOID pCreateParams);
+BOOL WinGetDlgMsg (HWND hwndDlg, PQMSG pqmsg);
+HWND WinLoadDlg (HWND hwndParent, HWND hwndOwner, PFNWP pfnDlgProc,
+ HMODULE hmod, ULONG idDlg, PVOID pCreateParams);
+ULONG WinMessageBox (HWND hwndParent, HWND hwndOwner, PCSZ pszText,
+ PCSZ pszCaption, ULONG idWindow, ULONG flStyle);
+ULONG WinMessageBox2 (HWND hwndParent, HWND hwndOwner, PCSZ pszText,
+ PCSZ pszCaption, ULONG idWindow, PMB2INFO pmb2info);
+BOOL WinQueryDlgItemShort (HWND hwndDlg, ULONG idItem, PSHORT pResult,
+ BOOL fSigned);
+ULONG WinQueryDlgItemText (HWND hwndDlg, ULONG idItem, LONG cchBufferMax,
+ PSZ pchBuffer);
+LONG WinQueryDlgItemTextLength (HWND hwndDlg, ULONG idItem);
+BOOL WinSetDlgItemShort (HWND hwndDlg, ULONG idItem, USHORT usValue,
+ BOOL fSigned);
+BOOL WinSetDlgItemText (HWND hwndDlg, ULONG idItem, PCSZ pszText);
+
+#endif /* INCL_WINDIALOGS || !defined (INCL_NOCOMMON) */
+
+
+#if defined (INCL_WINDIALOGS)
+
+#define DLGC_ENTRYFIELD 0x0001
+#define DLGC_BUTTON 0x0002
+#define DLGC_RADIOBUTTON 0x0004
+#define DLGC_STATIC 0x0008
+#define DLGC_DEFAULT 0x0010
+#define DLGC_PUSHBUTTON 0x0020
+#define DLGC_CHECKBOX 0x0040
+#define DLGC_SCROLLBAR 0x0080
+#define DLGC_MENU 0x0100
+#define DLGC_TABONCLICK 0x0200
+#define DLGC_MLE 0x0400
+
+#define EDI_FIRSTTABITEM 0
+#define EDI_LASTTABITEM 1
+#define EDI_NEXTTABITEM 2
+#define EDI_PREVTABITEM 3
+#define EDI_FIRSTGROUPITEM 4
+#define EDI_LASTGROUPITEM 5
+#define EDI_NEXTGROUPITEM 6
+#define EDI_PREVGROUPITEM 7
+
+typedef struct _DLGTITEM
+{
+ USHORT fsItemStatus;
+ USHORT cChildren;
+ USHORT cchClassName;
+ USHORT offClassName;
+ USHORT cchText;
+ USHORT offText;
+ ULONG flStyle;
+ SHORT x;
+ SHORT y;
+ SHORT cx;
+ SHORT cy;
+ USHORT id;
+ USHORT offPresParams;
+ USHORT offCtlData;
+} DLGTITEM;
+typedef DLGTITEM *PDLGTITEM;
+
+typedef struct _DLGTEMPLATE
+{
+ USHORT cbTemplate;
+ USHORT type;
+ USHORT codepage;
+ USHORT offadlgti;
+ USHORT fsTemplateStatus;
+ USHORT iItemFocus;
+ USHORT coffPresParams;
+ DLGTITEM adlgti[1];
+} DLGTEMPLATE;
+typedef DLGTEMPLATE *PDLGTEMPLATE;
+
+
+HWND WinCreateDlg (HWND hwndParent, HWND hwndOwner, PFNWP pfnDlgProc,
+ PDLGTEMPLATE pdlgt, PVOID pCreateParams);
+HWND WinEnumDlgItem (HWND hwndDlg, HWND hwnd, ULONG code);
+BOOL WinMapDlgPoints (HWND hwndDlg, PPOINTL prgwptl, ULONG cwpt,
+ BOOL fCalcWindowCoords);
+ULONG WinProcessDlg (HWND hwndDlg);
+MRESULT WinSendDlgItemMsg (HWND hwndDlg, ULONG idItem, ULONG msg,
+ MPARAM mp1, MPARAM mp2);
+LONG WinSubstituteStrings (HWND hwnd, PCSZ pszSrc, LONG cchDstMax,
+ PSZ pszDst);
+
+#endif /* INCL_WINDIALOGS */
+
+
+#if defined (INCL_WINENTRYFIELDS)
+
+#define CBID_LIST 0x029a
+#define CBID_EDIT 0x029b
+
+#define CBM_SHOWLIST 0x0170
+#define CBM_HILITE 0x0171
+#define CBM_ISLISTSHOWING 0x0172
+
+#define CBN_EFCHANGE 1
+#define CBN_EFSCROLL 2
+#define CBN_MEMERROR 3
+#define CBN_LBSELECT 4
+#define CBN_LBSCROLL 5
+#define CBN_SHOWLIST 6
+#define CBN_ENTER 7
+
+#define CBS_SIMPLE 0x0001
+#define CBS_DROPDOWN 0x0002
+#define CBS_DROPDOWNLIST 0x0004
+#define CBS_COMPATIBLE 0x0008
+
+#define EM_QUERYCHANGED 0x0140
+#define EM_QUERYSEL 0x0141
+#define EM_SETSEL 0x0142
+#define EM_SETTEXTLIMIT 0x0143
+#define EM_CUT 0x0144
+#define EM_COPY 0x0145
+#define EM_CLEAR 0x0146
+#define EM_PASTE 0x0147
+#define EM_QUERYFIRSTCHAR 0x0148
+#define EM_SETFIRSTCHAR 0x0149
+#define EM_QUERYREADONLY 0x014a
+#define EM_SETREADONLY 0x014b
+#define EM_SETINSERTMODE 0x014c
+
+#define EN_SETFOCUS 0x0001
+#define EN_KILLFOCUS 0x0002
+#define EN_CHANGE 0x0004
+#define EN_SCROLL 0x0008
+#define EN_MEMERROR 0x0010
+#define EN_OVERFLOW 0x0020
+#define EN_INSERTMODETOGGLE 0x0040
+
+#define ES_LEFT 0x0000
+#define ES_CENTER 0x0001
+#define ES_RIGHT 0x0002
+#define ES_AUTOSCROLL 0x0004
+#define ES_MARGIN 0x0008
+#define ES_AUTOTAB 0x0010
+#define ES_READONLY 0x0020
+#define ES_COMMAND 0x0040
+#define ES_UNREADABLE 0x0080
+#define ES_AUTOSIZE 0x0200
+
+#if defined (INCL_NLS)
+#define ES_ANY 0x0000
+#define ES_SBCS 0x1000
+#define ES_DBCS 0x2000
+#define ES_MIXED 0x3000
+#endif /* INCL_NLS */
+
+typedef struct _COMBOCDATA
+{
+ ULONG cbSize;
+ ULONG reserved;
+ PVOID pHWXCtlData;
+} COMBOCDATA;
+typedef COMBOCDATA *PCOMBOCDATA;
+
+typedef struct _ENTRYFDATA
+{
+ USHORT cb;
+ USHORT cchEditLimit;
+ USHORT ichMinSel;
+ USHORT ichMaxSel;
+ PVOID pHWXCtlData;
+} ENTRYFDATA;
+typedef ENTRYFDATA *PENTRYFDATA;
+
+#endif /* INCL_WINENTRYFIELDS */
+
+
+#if defined (INCL_WINERRORS)
+
+typedef struct _ERRINFO
+{
+ ULONG cbFixedErrInfo;
+ ERRORID idError;
+ ULONG cDetailLevel;
+ ULONG offaoffszMsg;
+ ULONG offBinaryData;
+} ERRINFO;
+typedef ERRINFO *PERRINFO;
+
+ERRORID WinGetLastError (HAB hab);
+BOOL WinFreeErrorInfo (PERRINFO perrinfo);
+PERRINFO WinGetErrorInfo (HAB hab);
+
+#endif /* INCL_WINERRORS */
+
+
+#if defined (INCL_WINFRAMECTLS)
+
+#define TBM_SETHILITE 0x01e3
+#define TBM_QUERYHILITE 0x01e4
+
+#endif /* INCL_WINFRAMECTLS */
+
+
+#if defined (INCL_WINHOOKS)
+
+#define HK_SENDMSG 0
+#define HK_INPUT 1
+#define HK_MSGFILTER 2
+#define HK_JOURNALRECORD 3
+#define HK_JOURNALPLAYBACK 4
+#define HK_HELP 5
+#define HK_LOADER 6
+#define HK_REGISTERUSERMSG 7
+#define HK_MSGCONTROL 8
+#define HK_PLIST_ENTRY 9
+#define HK_PLIST_EXIT 10
+#define HK_FINDWORD 11
+#define HK_CODEPAGECHANGED 12
+#define HK_WINDOWDC 15
+#define HK_DESTROYWINDOW 16
+#define HK_CHECKMSGFILTER 20
+#define HK_MSGINPUT 21
+#define HK_ALARM 22
+#define HK_LOCKUP 23
+#define HK_FLUSHBUF 24
+
+#define HLPM_FRAME (-1)
+#define HLPM_WINDOW (-2)
+#define HLPM_MENU (-3)
+
+#define HMQ_CURRENT ((HMQ)1)
+
+#define LHK_DELETEPROC 1
+#define LHK_DELETELIB 2
+#define LHK_LOADPROC 3
+#define LHK_LOADLIB 4
+
+#define MCHK_MSGINTEREST 1
+#define MCHK_CLASSMSGINTEREST 2
+#define MCHK_SYNCHRONISATION 3
+#define MCHK_MSGMODE 4
+
+#define MSGF_DIALOGBOX 1
+#define MSGF_MESSAGEBOX 2
+#define MSGF_DDEPOSTMSG 3
+#define MSGF_TRACK 8
+
+#define PM_MODEL_1X 0
+#define PM_MODEL_2X 1
+
+#define RUMHK_DATATYPE 1
+#define RUMHK_MSG 2
+
+
+typedef struct _SMHSTRUCT
+{
+ MPARAM mp2;
+ MPARAM mp1;
+ ULONG msg;
+ HWND hwnd;
+ ULONG model;
+} SMHSTRUCT;
+typedef SMHSTRUCT *PSMHSTRUCT;
+
+
+BOOL WinCallMsgFilter (HAB hab, PQMSG pqmsg, ULONG msgf);
+BOOL WinReleaseHook (HAB hab, HMQ hmq, LONG iHook, PFN pfnHook, HMODULE hmod);
+BOOL WinSetHook (HAB hab, HMQ hmq, LONG iHook, PFN pfnHook, HMODULE hmod);
+
+#endif /* INCL_WINHOOKS */
+
+
+#if defined (INCL_WININPUT) || !defined (INCL_NOCOMMON)
+
+#define FC_NOSETFOCUS 0x0001
+#define FC_NOBRINGTOTOP 0x0001 /*!*/
+#define FC_NOLOSEFOCUS 0x0002
+#define FC_NOBRINGTOPFIRSTWINDOW 0x0002 /*!*/
+#define FC_NOSETACTIVE 0x0004
+#define FC_NOLOSEACTIVE 0x0008
+#define FC_NOSETSELECTION 0x0010
+#define FC_NOLOSESELECTION 0x0020
+
+#define QFC_NEXTINCHAIN 0x0001
+#define QFC_ACTIVE 0x0002
+#define QFC_FRAME 0x0003
+#define QFC_SELECTACTIVE 0x0004
+#define QFC_PARTOFCHAIN 0x0005
+
+BOOL WinFocusChange (HWND hwndDesktop, HWND hwndSetFocus, ULONG flFocusChange);
+BOOL WinLockupSystem (HAB hab);
+BOOL WinSetFocus (HWND hwndDesktop, HWND hwndSetFocus);
+BOOL WinUnlockSystem (HAB hab, PCSZ pszPassword);
+
+#endif /* INCL_WININPUT || !INCL_NOCOMMON */
+
+
+#if defined (INCL_WININPUT)
+
+#define WM_MOUSEFIRST 0x0070
+#define WM_MOUSEMOVE 0x0070
+#define WM_BUTTONCLICKFIRST 0x0071
+#define WM_BUTTON1DOWN 0x0071
+#define WM_BUTTON1UP 0x0072
+#define WM_BUTTON1DBLCLK 0x0073
+#define WM_BUTTON2DOWN 0x0074
+#define WM_BUTTON2UP 0x0075
+#define WM_BUTTON2DBLCLK 0x0076
+#define WM_BUTTON3DOWN 0x0077
+#define WM_BUTTON3UP 0x0078
+#define WM_BUTTON3DBLCLK 0x0079
+#define WM_BUTTONCLICKLAST 0x0079
+#define WM_MOUSELAST 0x0079
+#define WM_CHAR 0x007a
+#define WM_VIOCHAR 0x007b
+#define WM_JOURNALNOTIFY 0x007c
+#define WM_MOUSEMAP 0x007d
+#define WM_VRNDISABLED 0x007e
+#define WM_VRNENABLED 0x007f
+
+#define WM_EXTMOUSEFIRST 0x0410
+#define WM_CHORD 0x0410
+#define WM_BUTTON1MOTIONSTART 0x0411
+#define WM_BUTTON1MOTIONEND 0x0412
+#define WM_BUTTON1CLICK 0x0413
+#define WM_BUTTON2MOTIONSTART 0x0414
+#define WM_BUTTON2MOTIONEND 0x0415
+#define WM_BUTTON2CLICK 0x0416
+#define WM_BUTTON3MOTIONSTART 0x0417
+#define WM_BUTTON3MOTIONEND 0x0418
+#define WM_BUTTON3CLICK 0x0419
+#define WM_EXTMOUSELAST 0x0419
+
+#define WM_MOUSETRANSLATEFIRST 0x0420
+#define WM_BEGINDRAG 0x0420
+#define WM_ENDDRAG 0x0421
+#define WM_SINGLESELECT 0x0422
+#define WM_OPEN 0x0423
+#define WM_CONTEXTMENU 0x0424
+#define WM_CONTEXTHELP 0x0425
+#define WM_TEXTEDIT 0x0426
+#define WM_BEGINSELECT 0x0427
+#define WM_ENDSELECT 0x0428
+#define WM_MOUSETRANSLATELAST 0x0428
+#define WM_PICKUP 0x0429
+
+#define WM_PENFIRST 0x0481
+#define WM_PENLAST 0x049f
+
+#define WM_MMPMFIRST 0x0500
+#define WM_MMPMLAST 0x05ff
+
+#define WM_BIDI_FIRST 0x0bd0
+#define WM_BIDI_LAST 0x0bff
+
+#define INP_NONE 0x0000
+#define INP_KBD 0x0001
+#define INP_MULT 0x0002
+#define INP_RES2 0x0004
+#define INP_SHIFT 0x0008
+#define INP_CTRL 0x0010
+#define INP_ALT 0x0020
+#define INP_RES3 0x0040
+#define INP_RES4 0x0080
+#define INP_IGNORE 0xffff
+
+#define JRN_QUEUESTATUS 0x0001
+#define JRN_PHYSKEYSTATE 0x0002
+
+#define KC_NONE 0x0000
+#define KC_CHAR 0x0001
+#define KC_VIRTUALKEY 0x0002
+#define KC_SCANCODE 0x0004
+#define KC_SHIFT 0x0008
+#define KC_CTRL 0x0010
+#define KC_ALT 0x0020
+#define KC_KEYUP 0x0040
+#define KC_PREVDOWN 0x0080
+#define KC_LONEKEY 0x0100
+#define KC_DEADKEY 0x0200
+#define KC_COMPOSITE 0x0400
+#define KC_INVALIDCOMP 0x0800
+#define KC_TOGGLE 0x1000
+#define KC_INVALIDCHAR 0x2000
+#define KC_DBCSRSRVD1 0x4000
+#define KC_DBCSRSRVD2 0x8000
+
+#define VK_BUTTON1 0x0001
+#define VK_BUTTON2 0x0002
+#define VK_BUTTON3 0x0003
+#define VK_BREAK 0x0004
+#define VK_BACKSPACE 0x0005
+#define VK_TAB 0x0006
+#define VK_BACKTAB 0x0007
+#define VK_NEWLINE 0x0008
+#define VK_SHIFT 0x0009
+#define VK_CTRL 0x000a
+#define VK_ALT 0x000b
+#define VK_ALTGRAF 0x000c
+#define VK_PAUSE 0x000d
+#define VK_CAPSLOCK 0x000e
+#define VK_ESC 0x000f
+#define VK_SPACE 0x0010
+#define VK_PAGEUP 0x0011
+#define VK_PAGEDOWN 0x0012
+#define VK_END 0x0013
+#define VK_HOME 0x0014
+#define VK_LEFT 0x0015
+#define VK_UP 0x0016
+#define VK_RIGHT 0x0017
+#define VK_DOWN 0x0018
+#define VK_PRINTSCRN 0x0019
+#define VK_INSERT 0x001a
+#define VK_DELETE 0x001b
+#define VK_SCRLLOCK 0x001c
+#define VK_NUMLOCK 0x001d
+#define VK_ENTER 0x001e
+#define VK_SYSRQ 0x001f
+#define VK_F1 0x0020
+#define VK_F2 0x0021
+#define VK_F3 0x0022
+#define VK_F4 0x0023
+#define VK_F5 0x0024
+#define VK_F6 0x0025
+#define VK_F7 0x0026
+#define VK_F8 0x0027
+#define VK_F9 0x0028
+#define VK_F10 0x0029
+#define VK_F11 0x002a
+#define VK_F12 0x002b
+#define VK_F13 0x002c
+#define VK_F14 0x002d
+#define VK_F15 0x002e
+#define VK_F16 0x002f
+#define VK_F17 0x0030
+#define VK_F18 0x0031
+#define VK_F19 0x0032
+#define VK_F20 0x0033
+#define VK_F21 0x0034
+#define VK_F22 0x0035
+#define VK_F23 0x0036
+#define VK_F24 0x0037
+#define VK_ENDDRAG 0x0038
+#define VK_CLEAR 0x0039
+#define VK_EREOF 0x003a
+#define VK_PA1 0x003b
+#define VK_ATTN 0x003c
+#define VK_CRSEL 0x003d
+#define VK_EXSEL 0x003e
+#define VK_COPY 0x003f
+#define VK_BLK1 0x0040
+#define VK_BLK2 0x0041
+
+#define VK_MENU VK_F10
+
+#if defined (INCL_NLS)
+#define VK_DBCSFIRST 0x0080
+#define VK_DBCSLAST 0x00ff
+#define VK_BIDI_FIRST 0x00e0
+#define VK_BIDI_LAST 0x00ff
+#endif /* INCL_NLS */
+
+#define VK_USERFIRST 0x0100
+#define VK_USERLAST 0x01ff
+
+typedef struct _CHARMSG
+{
+ USHORT fs;
+ UCHAR cRepeat;
+ UCHAR scancode;
+ USHORT chr;
+ USHORT vkey;
+} CHRMSG;
+typedef CHRMSG *PCHRMSG;
+
+typedef struct _MOUSEMSG
+{
+ SHORT x;
+ SHORT y;
+ USHORT codeHitTest;
+ USHORT fsInp;
+} MSEMSG;
+typedef MSEMSG *PMSEMSG;
+
+#define CHARMSG(pmsg) ((PCHRMSG)((PBYTE)pmsg + sizeof (ULONG)))
+#define MOUSEMSG(pmsg) ((PMSEMSG)((PBYTE)pmsg + sizeof (ULONG)))
+
+BOOL WinCheckInput (HAB hab);
+BOOL WinEnablePhysInput (HWND hwndDesktop, BOOL fEnable);
+LONG WinGetKeyState (HWND hwndDesktop, LONG vkey);
+LONG WinGetPhysKeyState (HWND hwndDesktop, LONG sc);
+BOOL WinIsPhysInputEnabled (HWND hwndDesktop);
+HWND WinQueryCapture (HWND hwndDesktop);
+HWND WinQueryFocus (HWND hwndDesktop);
+ULONG WinQueryVisibleRegion (HWND hwnd, HRGN hrgn);
+BOOL WinSetCapture (HWND hwndDesktop, HWND hwnd);
+BOOL WinSetKeyboardStateTable (HWND hwndDesktop, PBYTE pKeyStateTable,
+ BOOL fSet);
+BOOL WinSetVisibleRegionNotify (HWND hwnd, BOOL fEnable);
+
+#endif /* INCL_WININPUT */
+
+
+#if defined (INCL_WINLISTBOXES)
+
+#define LS_MULTIPLESEL 0x0001
+#define LS_OWNERDRAW 0x0002
+#define LS_NOADJUSTPOS 0x0004
+#define LS_HORZSCROLL 0x0008
+#define LS_EXTENDEDSEL 0x0010
+
+#define LN_SELECT 1
+#define LN_SETFOCUS 2
+#define LN_KILLFOCUS 3
+#define LN_SCROLL 4
+#define LN_ENTER 5
+
+#define LM_QUERYITEMCOUNT 0x0160
+#define LM_INSERTITEM 0x0161
+#define LM_SETTOPINDEX 0x0162
+#define LM_DELETEITEM 0x0163
+#define LM_SELECTITEM 0x0164
+#define LM_QUERYSELECTION 0x0165
+#define LM_SETITEMTEXT 0x0166
+#define LM_QUERYITEMTEXTLENGTH 0x0167
+#define LM_QUERYITEMTEXT 0x0168
+#define LM_SETITEMHANDLE 0x0169
+#define LM_QUERYITEMHANDLE 0x016a
+#define LM_SEARCHSTRING 0x016b
+#define LM_SETITEMHEIGHT 0x016c
+#define LM_QUERYTOPINDEX 0x016d
+#define LM_DELETEALL 0x016e
+#define LM_INSERTMULTITEMS 0x016f
+#define LM_SETITEMWIDTH 0x0660 /* ? */
+
+#define LIT_CURSOR (-4)
+#define LIT_ERROR (-3)
+#define LIT_MEMERROR (-2)
+#define LIT_NONE (-1)
+#define LIT_FIRST (-1)
+
+#define LIT_END (-1)
+#define LIT_SORTASCENDING (-2)
+#define LIT_SORTDESCENDING (-3)
+
+#define LSS_SUBSTRING 0x0001
+#define LSS_PREFIX 0x0002
+#define LSS_CASESENSITIVE 0x0004
+
+
+typedef struct _LBOXINFO
+{
+ LONG lItemIndex;
+ ULONG ulItemCount;
+ ULONG reserved;
+ ULONG reserved2;
+} LBOXINFO;
+typedef LBOXINFO *PLBOXINFO;
+
+
+#define WinDeleteLboxItem(hwndLbox,index) \
+ ((LONG)WinSendMsg (hwndLbox, LM_DELETEITEM, MPFROMLONG (index), \
+ (MPARAM)NULL))
+
+#define WinInsertLboxItem(hwndLbox,index,psz) \
+ ((LONG)WinSendMsg (hwndLbox, LM_INSERTITEM, MPFROMLONG(index), \
+ MPFROMP (psz)))
+
+#define WinQueryLboxCount(hwndLbox) \
+ ((LONG)WinSendMsg (hwndLbox, LM_QUERYITEMCOUNT, (MPARAM)NULL, \
+ (MPARAM)NULL))
+
+#define WinQueryLboxItemText(hwndLbox,index,psz,cchMax) \
+ ((LONG)WinSendMsg (hwndLbox, LM_QUERYITEMTEXT, \
+ MPFROM2SHORT((index), (cchMax)), MPFROMP (psz)))
+
+#define WinQueryLboxItemTextLength(hwndLbox,index) \
+ ((SHORT)WinSendMsg (hwndLbox, LM_QUERYITEMTEXTLENGTH, \
+ MPFROMSHORT (index), (MPARAM)NULL))
+
+#define WinQueryLboxSelectedItem(hwndLbox) \
+ ((LONG)WinSendMsg (hwndLbox, LM_QUERYSELECTION, MPFROMLONG (LIT_FIRST), \
+ (MPARAM)NULL))
+
+#define WinSetLboxItemText(hwndLbox,index,psz) \
+ ((BOOL)WinSendMsg (hwndLbox, LM_SETITEMTEXT, \
+ MPFROMLONG (index), MPFROMP (psz)))
+
+#endif /* INCL_WINLISTBOXES */
+
+
+#if defined (INCL_WINLOAD)
+
+BOOL WinDeleteLibrary (HAB hab, HLIB libhandle);
+BOOL WinDeleteProcedure (HAB hab, PFNWP wndproc);
+HLIB WinLoadLibrary (HAB hab, PCSZ libname);
+PFNWP WinLoadProcedure (HAB hab, HLIB libhandle, PSZ procname);
+
+#endif /* INCL_WINLOAD */
+
+
+#if defined (INCL_WINMENUS)
+
+#define MIA_NODISMISS 0x0020
+#define MIA_FRAMED 0x1000
+#define MIA_CHECKED 0x2000
+#define MIA_DISABLED 0x4000
+#define MIA_HILITED 0x8000
+
+#define MIS_TEXT 0x0001
+#define MIS_BITMAP 0x0002
+#define MIS_SEPARATOR 0x0004
+#define MIS_OWNERDRAW 0x0008
+#define MIS_SUBMENU 0x0010
+#define MIS_MULTMENU 0x0020
+#define MIS_SYSCOMMAND 0x0040
+#define MIS_HELP 0x0080
+#define MIS_STATIC 0x0100
+#define MIS_BUTTONSEPARATOR 0x0200
+#define MIS_BREAK 0x0400
+#define MIS_BREAKSEPARATOR 0x0800
+#define MIS_GROUP 0x1000
+#define MIS_SINGLE 0x2000
+
+#define MIT_END (-1)
+#define MIT_NONE (-1)
+#define MIT_MEMERROR (-1)
+#define MIT_ERROR (-1)
+#define MIT_FIRST (-2)
+#define MIT_LAST (-3)
+
+#define MM_INSERTITEM 0x0180
+#define MM_DELETEITEM 0x0181
+#define MM_QUERYITEM 0x0182
+#define MM_SETITEM 0x0183
+#define MM_QUERYITEMCOUNT 0x0184
+#define MM_STARTMENUMODE 0x0185
+#define MM_ENDMENUMODE 0x0186
+#define MM_REMOVEITEM 0x0188
+#define MM_SELECTITEM 0x0189
+#define MM_QUERYSELITEMID 0x018a
+#define MM_QUERYITEMTEXT 0x018b
+#define MM_QUERYITEMTEXTLENGTH 0x018c
+#define MM_SETITEMHANDLE 0x018d
+#define MM_SETITEMTEXT 0x018e
+#define MM_ITEMPOSITIONFROMID 0x018f
+#define MM_ITEMIDFROMPOSITION 0x0190
+#define MM_QUERYITEMATTR 0x0191
+#define MM_SETITEMATTR 0x0192
+#define MM_ISITEMVALID 0x0193
+#define MM_QUERYITEMRECT 0x0194
+
+#define MM_QUERYDEFAULTITEMID 0x0431
+#define MM_SETDEFAULTITEMID 0x0432
+
+#define MS_ACTIONBAR 0x0001
+#define MS_TITLEBUTTON 0x0002
+#define MS_VERTICALFLIP 0x0004
+#define MS_CONDITIONALCASCADE 0x0040
+
+#define PU_POSITIONONITEM 0x0001
+#define PU_HCONSTRAIN 0x0002
+#define PU_VCONSTRAIN 0x0004
+#define PU_NONE 0x0000
+#define PU_MOUSEBUTTON1DOWN 0x0008
+#define PU_MOUSEBUTTON2DOWN 0x0010
+#define PU_MOUSEBUTTON3DOWN 0x0018
+#define PU_SELECTITEM 0x0020
+#define PU_MOUSEBUTTON1 0x0040
+#define PU_MOUSEBUTTON2 0x0080
+#define PU_MOUSEBUTTON3 0x0100
+#define PU_KEYBOARD 0x0200
+
+typedef struct _MENUITEM
+{
+ SHORT iPosition;
+ USHORT afStyle;
+ USHORT afAttribute;
+ USHORT id;
+ HWND hwndSubMenu;
+ ULONG hItem;
+} MENUITEM;
+typedef MENUITEM *PMENUITEM;
+
+typedef struct _mti /* Note 1 */
+{
+ USHORT afStyle;
+ USHORT pad;
+ USHORT idItem;
+ CHAR c[2];
+} MTI;
+
+typedef struct _mt /* Note 1 */
+{
+ ULONG len;
+ USHORT codepage;
+ USHORT reserved;
+ USHORT cMti;
+ MTI rgMti[1];
+} MT;
+typedef MT *LPMT;
+
+typedef struct _OWNERITEM
+{
+ HWND hwnd;
+ HPS hps;
+ ULONG fsState;
+ ULONG fsAttribute;
+ ULONG fsStateOld;
+ ULONG fsAttributeOld;
+ RECTL rclItem;
+ LONG idItem;
+ ULONG hItem;
+} OWNERITEM;
+typedef OWNERITEM *POWNERITEM;
+
+
+#define WinCheckMenuItem(hwndMenu,id,fcheck) \
+ ((BOOL)WinSendMsg (hwndMenu, MM_SETITEMATTR, \
+ MPFROM2SHORT (id, TRUE), \
+ MPFROM2SHORT (MIA_CHECKED, \
+ ((USHORT)(fcheck) ? MIA_CHECKED : 0))))
+
+#define WinEnableMenuItem(hwndMenu,id,fEnable) \
+ ((BOOL)WinSendMsg (hwndMenu, MM_SETITEMATTR, MPFROM2SHORT (id, TRUE), \
+ MPFROM2SHORT (MIA_DISABLED, \
+ ((USHORT)(fEnable) ? 0 : MIA_DISABLED))))
+
+#define WinIsMenuItemChecked(hwndMenu,id) \
+ ((BOOL)WinSendMsg (hwndMenu, MM_QUERYITEMATTR, \
+ MPFROM2SHORT (id, TRUE), \
+ MPFROMLONG (MIA_CHECKED)))
+
+#define WinIsMenuItemEnabled(hwndMenu,id) \
+ (!(BOOL)WinSendMsg (hwndMenu, MM_QUERYITEMATTR, \
+ MPFROM2SHORT (id, TRUE), \
+ MPFROMLONG (MIA_DISABLED)))
+
+#define WinIsMenuItemValid(hwndMenu,id) \
+ ((BOOL)WinSendMsg (hwndMenu, MM_ISITEMVALID, \
+ MPFROM2SHORT (id, TRUE), MPFROMLONG (FALSE)))
+
+#define WinSetMenuItemText(hwndMenu,id,psz) \
+ ((BOOL)WinSendMsg (hwndMenu, MM_SETITEMTEXT, \
+ MPFROMLONG (id), MPFROMP (psz)))
+
+
+HWND WinCreateMenu (HWND hwndParent, CPVOID lpmt);
+HWND WinLoadMenu (HWND hwndFrame, HMODULE hmod, ULONG idMenu);
+BOOL WinPopupMenu (HWND hwndParent, HWND hwndOwner, HWND hwndMenu,
+ LONG x, LONG y, LONG idItem, ULONG fs);
+
+#endif /* INCL_WINMENUS */
+
+
+#if defined (INCL_WINMESSAGEMGR)
+
+#define BMSG_POST 0x0000
+#define BMSG_SEND 0x0001
+#define BMSG_POSTQUEUE 0x0002
+#define BMSG_DESCENDANTS 0x0004
+#define BMSG_FRAMEONLY 0x0008
+
+#define CVR_ALIGNLEFT 0x0001
+#define CVR_ALIGNBOTTOM 0x0002
+#define CVR_ALIGNRIGHT 0x0004
+#define CVR_ALIGNTOP 0x0008
+#define CVR_REDRAW 0x0010
+
+#define HT_NORMAL 0
+#define HT_TRANSPARENT (-1)
+#define HT_DISCARD (-2)
+#define HT_ERROR (-3)
+
+#define QS_KEY 0x0001
+#define QS_MOUSEBUTTON 0x0002
+#define QS_MOUSEMOVE 0x0004
+#define QS_MOUSE 0x0006
+#define QS_TIMER 0x0008
+#define QS_PAINT 0x0010
+#define QS_POSTMSG 0x0020
+#define QS_SEM1 0x0040
+#define QS_SEM2 0x0080
+#define QS_SEM3 0x0100
+#define QS_SEM4 0x0200
+#define QS_SENDMSG 0x0400
+#define QS_MSGINPUT 0x0800
+
+#define SMIM_ALL 0x0eff
+#define SMI_NOINTEREST 0x0001
+#define SMI_INTEREST 0x0002
+#define SMI_RESET 0x0004
+#define SMI_AUTODISPATCH 0x0008
+
+#define WPM_TEXT 0x0001
+#define WPM_CTLDATA 0x0002
+#define WPM_PRESPARAMS 0x0004
+#define WPM_CCHTEXT 0x0008
+#define WPM_CBCTLDATA 0x0010
+#define WPM_CBPRESPARAMS 0x0020
+
+
+typedef struct _WNDPARAMS
+{
+ ULONG fsStatus;
+ ULONG cchText;
+ PSZ pszText;
+ ULONG cbPresParams;
+ PVOID pPresParams;
+ ULONG cbCtlData;
+ PVOID pCtlData;
+} WNDPARAMS;
+typedef WNDPARAMS *PWNDPARAMS;
+
+BOOL WinBroadcastMsg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2, ULONG rgf);
+BOOL WinInSendMsg (HAB hab);
+BOOL WinPostQueueMsg (HMQ hmq, ULONG msg, MPARAM mp1, MPARAM mp2);
+BOOL WinQueryMsgPos (HAB hab, PPOINTL pptl);
+ULONG WinQueryMsgTime (HAB hab);
+ULONG WinQueryQueueStatus (HWND hwndDesktop);
+ULONG WinRequestMutexSem (HMTX hmtx, ULONG ulTimeout);
+BOOL WinSetClassMsgInterest (HAB hab, PCSZ pszClassName, ULONG msg_class,
+ LONG control);
+BOOL WinSetMsgInterest (HWND hwnd, ULONG msg_class, LONG control);
+ULONG WinWaitEventSem (HEV hev, ULONG ulTimeout);
+BOOL WinWaitMsg (HAB hab, ULONG msgFirst, ULONG msgLast);
+ULONG WinWaitMuxWaitSem (HMUX hmux, ULONG ulTimeout, PULONG pulUser);
+
+#endif /* INCL_WINMESSAGEMGR */
+
+
+#if defined (INCL_WINPALETTE)
+
+LONG WinRealizePalette (HWND hwnd, HPS hps, PULONG pcclr);
+
+#endif /* INCL_WINPALETTE */
+
+
+#if defined (INCL_WINPOINTERS)
+
+#define DP_NORMAL 0x0000
+#define DP_HALFTONED 0x0001
+#define DP_INVERTED 0x0002
+#define DP_MINI 0x0004
+
+#define SBMP_OLD_SYSMENU 1
+#define SBMP_OLD_SBUPARROW 2
+#define SBMP_OLD_SBDNARROW 3
+#define SBMP_OLD_SBRGARROW 4
+#define SBMP_OLD_SBLFARROW 5
+#define SBMP_MENUCHECK 6
+#define SBMP_OLD_CHECKBOXES 7
+#define SBMP_BTNCORNERS 8
+#define SBMP_OLD_MINBUTTON 9
+#define SBMP_OLD_MAXBUTTON 10
+#define SBMP_OLD_RESTOREBUTTON 11
+#define SBMP_OLD_CHILDSYSMENU 12
+#define SBMP_DRIVE 15
+#define SBMP_FILE 16
+#define SBMP_FOLDER 17
+#define SBMP_TREEPLUS 18
+#define SBMP_TREEMINUS 19
+#define SBMP_PROGRAM 22
+#define SBMP_MENUATTACHED 23
+#define SBMP_SIZEBOX 24
+#define SBMP_SYSMENU 25
+#define SBMP_MINBUTTON 26
+#define SBMP_MAXBUTTON 27
+#define SBMP_RESTOREBUTTON 28
+#define SBMP_CHILDSYSMENU 29
+#define SBMP_SYSMENUDEP 30
+#define SBMP_MINBUTTONDEP 31
+#define SBMP_MAXBUTTONDEP 32
+#define SBMP_RESTOREBUTTONDEP 33
+#define SBMP_CHILDSYSMENUDEP 34
+#define SBMP_SBUPARROW 35
+#define SBMP_SBDNARROW 36
+#define SBMP_SBLFARROW 37
+#define SBMP_SBRGARROW 38
+#define SBMP_SBUPARROWDEP 39
+#define SBMP_SBDNARROWDEP 40
+#define SBMP_SBLFARROWDEP 41
+#define SBMP_SBRGARROWDEP 42
+#define SBMP_SBUPARROWDIS 43
+#define SBMP_SBDNARROWDIS 44
+#define SBMP_SBLFARROWDIS 45
+#define SBMP_SBRGARROWDIS 46
+#define SBMP_COMBODOWN 47
+#define SBMP_CHECKBOXES 48
+#define SBMP_HIDE 50
+#define SBMP_HIDEDEP 51
+#define SBMP_CLOSE 52
+#define SBMP_CLOSEDEP 53
+
+#define SPTR_ARROW 1
+#define SPTR_TEXT 2
+#define SPTR_WAIT 3
+#define SPTR_SIZE 4
+#define SPTR_MOVE 5
+#define SPTR_SIZENWSE 6
+#define SPTR_SIZENESW 7
+#define SPTR_SIZEWE 8
+#define SPTR_SIZENS 9
+#define SPTR_APPICON 10
+#define SPTR_ICONINFORMATION 11
+#define SPTR_ICONQUESTION 12
+#define SPTR_ICONERROR 13
+#define SPTR_ICONWARNING 14
+#define SPTR_ILLEGAL 18
+#define SPTR_FILE 19
+#define SPTR_FOLDER 20
+#define SPTR_MULTFILE 21
+#define SPTR_PROGRAM 22
+#define SPTR_DISPLAY_PTRS 22
+
+#define SPTR_PENFIRST 23
+#define SPTR_PENLAST 39
+#define SPTR_CPTR 39
+
+#define SPTR_HANDICON SPTR_ICONERROR
+#define SPTR_QUESICON SPTR_ICONQUESTION
+#define SPTR_BANGICON SPTR_ICONWARNING
+#define SPTR_NOTEICON SPTR_ICONINFORMATION
+
+typedef struct _POINTERINFO
+{
+ ULONG fPointer;
+ LONG xHotspot;
+ LONG yHotspot;
+ HBITMAP hbmPointer;
+ HBITMAP hbmColor;
+ HBITMAP hbmMiniPointer;
+ HBITMAP hbmMiniColor;
+} POINTERINFO;
+typedef POINTERINFO *PPOINTERINFO;
+
+
+HPOINTER WinCreatePointer (HWND hwndDesktop, HBITMAP hbmPointer, BOOL fPointer,
+ LONG xHotspot, LONG yHotspot);
+HPOINTER WinCreatePointerIndirect (HWND hwndDesktop,
+ __const__ POINTERINFO *pptri);
+BOOL WinDestroyPointer (HPOINTER hptr);
+BOOL WinDrawPointer (HPS hps, LONG x, LONG y, HPOINTER hptr, ULONG fs);
+HBITMAP WinGetSysBitmap (HWND hwndDesktop, ULONG ibm);
+HPOINTER WinLoadPointer (HWND hwndDesktop, HMODULE hmod, ULONG idres);
+BOOL WinLockPointerUpdate (HWND hwndDesktop, HPOINTER hptrNew,
+ ULONG ulTimeInterval);
+BOOL WinQueryPointerPos (HWND hwndDesktop, PPOINTL pptl);
+BOOL WinQueryPointerInfo (HPOINTER hptr, PPOINTERINFO pPointerInfo);
+HPOINTER WinQuerySysPointer (HWND hwndDesktop, LONG lId, BOOL fCopy);
+BOOL WinQuerySysPointerData (HWND hwndDesktop, ULONG ulId,
+ PICONINFO pIconInfo);
+BOOL WinSetPointer (HWND hwndDesktop, HPOINTER hptrNew);
+BOOL WinSetPointerOwner (HPOINTER hptr, PID pid, BOOL fDestroy);
+BOOL WinSetPointerPos (HWND hwndDesktop, LONG x, LONG y);
+BOOL WinSetSysPointerData (HWND hwndDesktop, ULONG ulId,
+ __const__ ICONINFO *pIconInfo);
+BOOL WinShowPointer (HWND hwndDesktop, BOOL fShow);
+
+#endif /* INCL_WINPOINTERS */
+
+
+#if defined (INCL_WINRECTANGLES)
+
+BOOL WinCopyRect (HAB hab, PRECTL prclDst, __const__ RECTL *prclSrc);
+BOOL WinEqualRect (HAB hab, __const__ RECTL *prcl1, __const__ RECTL *prcl2);
+BOOL WinInflateRect (HAB hab, PRECTL prcl, LONG cx, LONG cy);
+BOOL WinIntersectRect (HAB hab, PRECTL prclDst, __const__ RECTL *prclSrc1,
+ __const__ RECTL *prclSrc2);
+BOOL WinIsRectEmpty (HAB hab, __const__ RECTL *prcl);
+BOOL WinMakePoints (HAB hab, PPOINTL pwpt, ULONG cwpt);
+BOOL WinMakeRect (HAB hab, PRECTL pwrc);
+BOOL WinOffsetRect (HAB hab, PRECTL prcl, LONG cx, LONG cy);
+BOOL WinPtInRect (HAB hab, __const__ RECTL *prcl, __const__ POINTL *pptl);
+BOOL WinSetRect (HAB hab, PRECTL prcl, LONG xLeft, LONG yBottom, LONG xRight,
+ LONG yTop);
+BOOL WinSetRectEmpty (HAB hab, PRECTL prcl);
+BOOL WinSubtractRect (HAB hab, PRECTL prclDst, __const__ RECTL *prclSrc1,
+ __const__ RECTL *prclSrc2);
+BOOL WinUnionRect (HAB hab, PRECTL prclDst, __const__ RECTL *prclSrc1,
+ __const__ RECTL *prclSrc2);
+
+#endif /* INCL_WINRECTANGLES */
+
+
+#if defined (INCL_WINSCROLLBARS)
+
+#define SB_LINEUP 1
+#define SB_LINEDOWN 2
+#define SB_LINELEFT 1
+#define SB_LINERIGHT 2
+#define SB_PAGEUP 3
+#define SB_PAGEDOWN 4
+#define SB_PAGELEFT 3
+#define SB_PAGERIGHT 4
+#define SB_SLIDERTRACK 5
+#define SB_SLIDERPOSITION 6
+#define SB_ENDSCROLL 7
+
+#define SBM_SETSCROLLBAR 0x01a0
+#define SBM_SETPOS 0x01a1
+#define SBM_QUERYPOS 0x01a2
+#define SBM_QUERYRANGE 0x01a3
+#define SBM_SETTHUMBSIZE 0x01a6
+
+#define SBS_HORZ 0
+#define SBS_VERT 1
+#define SBS_THUMBSIZE 2
+#define SBS_AUTOTRACK 4
+#define SBS_AUTOSIZE 0x2000
+
+typedef struct _SBCDATA
+{
+ USHORT cb;
+ USHORT sHilite;
+ SHORT posFirst;
+ SHORT posLast;
+ SHORT posThumb;
+ SHORT cVisible;
+ SHORT cTotal;
+} SBCDATA;
+typedef SBCDATA *PSBCDATA;
+
+#endif /* INCL_WINSCROLLBARS */
+
+
+#if defined (INCL_WINSTATICS)
+
+#define SM_SETHANDLE 0x0100
+#define SM_QUERYHANDLE 0x0101
+
+#define SS_TEXT 0x0001
+#define SS_GROUPBOX 0x0002
+#define SS_ICON 0x0003
+#define SS_BITMAP 0x0004
+#define SS_FGNDRECT 0x0005
+#define SS_HALFTONERECT 0x0006
+#define SS_BKGNDRECT 0x0007
+#define SS_FGNDFRAME 0x0008
+#define SS_HALFTONEFRAME 0x0009
+#define SS_BKGNDFRAME 0x000a
+#define SS_SYSICON 0x000b
+#define SS_AUTOSIZE 0x0040
+
+#define WM_MSGBOXINIT 0x010e
+#define WM_MSGBOXDISMISS 0x010f
+
+#endif /* INCL_WINSTATICS */
+
+
+#if defined (INCL_WINSYS)
+
+#define CCF_GLOBAL 0x0000
+#define CCF_APPLICATION 0x0001
+#define CCF_COUNTCOLORS 0x0010
+#define CCF_ALLCOLORS 0x0020
+
+#define CCI_FOREGROUND 1
+#define CCI_FOREGROUNDREADONLY 2
+#define CCI_BACKGROUND 3
+#define CCI_BACKGROUNDDIALOG 4
+#define CCI_DISABLEDFOREGROUND 5
+#define CCI_DISABLEDFOREGROUNDREADONLY 6
+#define CCI_DISABLEDBACKGROUND 7
+#define CCI_DISABLEDBACKGROUNDDIALOG 8
+#define CCI_HIGHLIGHTFOREGROUND 9
+#define CCI_HIGHLIGHTBACKGROUND 10
+#define CCI_HIGHLIGHTBACKGROUNDDIALOG 11
+#define CCI_INACTIVEFOREGROUND 12
+#define CCI_INACTIVEFOREGROUNDDIALOG 13
+#define CCI_INACTIVEBACKGROUND 14
+#define CCI_INACTIVEBACKGROUNDTEXT 15
+#define CCI_ACTIVEFOREGROUND 16
+#define CCI_ACTIVEFOREGROUNDDIALOG 17
+#define CCI_ACTIVEBACKGROUND 18
+#define CCI_ACTIVEBACKGROUNDTEXT 19
+#define CCI_PAGEBACKGROUND 20
+#define CCI_PAGEFOREGROUND 21
+#define CCI_FIELDBACKGROUND 22
+#define CCI_BORDER 23
+#define CCI_BORDERLIGHT 24
+#define CCI_BORDERDARK 25
+#define CCI_BORDER2 26
+#define CCI_BORDER2LIGHT 27
+#define CCI_BORDER2DARK 28
+#define CCI_BORDERDEFAULT 29
+#define CCI_BUTTONBACKGROUND 30
+#define CCI_BUTTONFOREGROUND 31
+#define CCI_BUTTONBORDERLIGHT 32
+#define CCI_BUTTONBORDERDARK 33
+#define CCI_ARROW 34
+#define CCI_DISABLEDARROW 35
+#define CCI_ARROWBORDERLIGHT 36
+#define CCI_ARROWBORDERDARK 37
+#define CCI_CHECKLIGHT 38
+#define CCI_CHECKMIDDLE 39
+#define CCI_CHECKDARK 40
+#define CCI_ICONFOREGROUND 41
+#define CCI_ICONBACKGROUND 42
+#define CCI_ICONBACKGROUNDDESKTOP 43
+#define CCI_ICONHILITEFOREGROUND 44
+#define CCI_ICONHILITEBACKGROUND 45
+#define CCI_MAJORTABFOREGROUND 46
+#define CCI_MAJORTABBACKGROUND 47
+#define CCI_MINORTABFOREGROUND 48
+#define CCI_MINORTABBACKGROUND 49
+#define CCI_MAXINDEX 49
+
+#define CCT_STATIC 1
+#define CCT_STATICTEXT 2
+#define CCT_GROUPBOX 3
+#define CCT_PUSHBUTTON 4
+#define CCT_CHECKBOX 5
+#define CCT_RADIOBUTTON 6
+#define CCT_ENTRYFIELD 7
+#define CCT_LISTBOX 8
+#define CCT_COMBOBOX 9
+#define CCT_SCROLLBAR 10
+#define CCT_FRAME 11
+#define CCT_MENU 12
+#define CCT_TITLEBAR 13
+#define CCT_SPINBUTTON 14
+#define CCT_SLIDER 15
+#define CCT_CIRCULARSLIDER 16
+#define CCT_VALUESET 17
+#define CCT_MLE 18
+#define CCT_CONTAINER 19
+#define CCT_NOTEBOOK 20
+#define CCT_MAXTYPE 20
+
+#define CCV_NOTFOUND (-1)
+#define CCV_IGNORE (-2)
+#define CCV_DEFAULT (-3)
+
+#define PP_FOREGROUNDCOLOR 1
+#define PP_FOREGROUNDCOLORINDEX 2
+#define PP_BACKGROUNDCOLOR 3
+#define PP_BACKGROUNDCOLORINDEX 4
+#define PP_HILITEFOREGROUNDCOLOR 5
+#define PP_HILITEFOREGROUNDCOLORINDEX 6
+#define PP_HILITEBACKGROUNDCOLOR 7
+#define PP_HILITEBACKGROUNDCOLORINDEX 8
+#define PP_DISABLEDFOREGROUNDCOLOR 9
+#define PP_DISABLEDFOREGROUNDCOLORINDEX 10
+#define PP_DISABLEDBACKGROUNDCOLOR 11
+#define PP_DISABLEDBACKGROUNDCOLORINDEX 12
+#define PP_BORDERCOLOR 13
+#define PP_BORDERCOLORINDEX 14
+#define PP_FONTNAMESIZE 15
+#define PP_FONTHANDLE 16
+#define PP_RESERVED 17
+#define PP_ACTIVECOLOR 18
+#define PP_ACTIVECOLORINDEX 19
+#define PP_INACTIVECOLOR 20
+#define PP_INACTIVECOLORINDEX 21
+#define PP_ACTIVETEXTFGNDCOLOR 22
+#define PP_ACTIVETEXTFGNDCOLORINDEX 23
+#define PP_ACTIVETEXTBGNDCOLOR 24
+#define PP_ACTIVETEXTBGNDCOLORINDEX 25
+#define PP_INACTIVETEXTFGNDCOLOR 26
+#define PP_INACTIVETEXTFGNDCOLORINDEX 27
+#define PP_INACTIVETEXTBGNDCOLOR 28
+#define PP_INACTIVETEXTBGNDCOLORINDEX 29
+#define PP_SHADOW 30
+#define PP_MENUFOREGROUNDCOLOR 31
+#define PP_MENUFOREGROUNDCOLORINDEX 32
+#define PP_MENUBACKGROUNDCOLOR 33
+#define PP_MENUBACKGROUNDCOLORINDEX 34
+#define PP_MENUHILITEFGNDCOLOR 35
+#define PP_MENUHILITEFGNDCOLORINDEX 36
+#define PP_MENUHILITEBGNDCOLOR 37
+#define PP_MENUHILITEBGNDCOLORINDEX 38
+#define PP_MENUDISABLEDFGNDCOLOR 39
+#define PP_MENUDISABLEDFGNDCOLORINDEX 40
+#define PP_MENUDISABLEDBGNDCOLOR 41
+#define PP_MENUDISABLEDBGNDCOLORINDEX 42
+#define PP_SHADOWTEXTCOLOR 43
+#define PP_SHADOWTEXTCOLORINDEX 44
+#define PP_SHADOWHILITEFGNDCOLOR 45
+#define PP_SHADOWHILITEFGNDCOLORINDEX 46
+#define PP_SHADOWHILITEBGNDCOLOR 47
+#define PP_SHADOWHILITEBGNDCOLORINDEX 48
+#define PP_ICONTEXTBACKGROUNDCOLOR 49
+#define PP_ICONTEXTBACKGROUNDCOLORINDEX 50
+#define PP_BORDERLIGHTCOLOR 51
+#define PP_BORDERDARKCOLOR 52
+#define PP_BORDER2COLOR 53
+#define PP_BORDER2LIGHTCOLOR 54
+#define PP_BORDER2DARKCOLOR 55
+#define PP_BORDERDEFAULTCOLOR 56
+#define PP_FIELDBACKGROUNDCOLOR 57
+#define PP_BUTTONBACKGROUNDCOLOR 58
+#define PP_BUTTONBORDERLIGHTCOLOR 59
+#define PP_BUTTONBORDERDARKCOLOR 60
+#define PP_ARROWCOLOR 61
+#define PP_ARROWBORDERLIGHTCOLOR 62
+#define PP_ARROWBORDERDARKCOLOR 63
+#define PP_ARROWDISABLEDCOLOR 64
+#define PP_CHECKLIGHTCOLOR 65
+#define PP_CHECKMIDDLECOLOR 66
+#define PP_CHECKDARKCOLOR 67
+#define PP_PAGEFOREGROUNDCOLOR 68
+#define PP_PAGEBACKGROUNDCOLOR 69
+#define PP_MAJORTABFOREGROUNDCOLOR 70
+#define PP_MAJORTABBACKGROUNDCOLOR 71
+#define PP_MINORTABFOREGROUNDCOLOR 72
+#define PP_MINORTABBACKGROUNDCOLOR 73
+
+#define PP_BIDI_FIRST 0x0100
+#define PP_BIDI_LAST 0x012f
+#define PP_USER 0x8000
+
+#define QPF_NOINHERIT 0x0001
+#define QPF_ID1COLORINDEX 0x0002
+#define QPF_ID2COLORINDEX 0x0004
+#define QPF_PURERGBCOLOR 0x0008
+#define QPF_VALIDFLAGS 0x000f
+
+#define SV_SWAPBUTTON 0
+#define SV_DBLCLKTIME 1
+#define SV_CXDBLCLK 2
+#define SV_CYDBLCLK 3
+#define SV_CXSIZEBORDER 4
+#define SV_CYSIZEBORDER 5
+#define SV_ALARM 6
+#define SV_CURSORRATE 9
+#define SV_FIRSTSCROLLRATE 10
+#define SV_SCROLLRATE 11
+#define SV_NUMBEREDLISTS 12
+#define SV_WARNINGFREQ 13
+#define SV_NOTEFREQ 14
+#define SV_ERRORFREQ 15
+#define SV_WARNINGDURATION 16
+#define SV_NOTEDURATION 17
+#define SV_ERRORDURATION 18
+#define SV_CXSCREEN 20
+#define SV_CYSCREEN 21
+#define SV_CXVSCROLL 22
+#define SV_CYHSCROLL 23
+#define SV_CYVSCROLLARROW 24
+#define SV_CXHSCROLLARROW 25
+#define SV_CXBORDER 26
+#define SV_CYBORDER 27
+#define SV_CXDLGFRAME 28
+#define SV_CYDLGFRAME 29
+#define SV_CYTITLEBAR 30
+#define SV_CYVSLIDER 31
+#define SV_CXHSLIDER 32
+#define SV_CXMINMAXBUTTON 33
+#define SV_CYMINMAXBUTTON 34
+#define SV_CYMENU 35
+#define SV_CXFULLSCREEN 36
+#define SV_CYFULLSCREEN 37
+#define SV_CXICON 38
+#define SV_CYICON 39
+#define SV_CXPOINTER 40
+#define SV_CYPOINTER 41
+#define SV_DEBUG 42
+#define SV_CMOUSEBUTTONS 43
+#define SV_CPOINTERBUTTONS 43
+#define SV_POINTERLEVEL 44
+#define SV_CURSORLEVEL 45
+#define SV_TRACKRECTLEVEL 46
+#define SV_CTIMERS 47
+#define SV_MOUSEPRESENT 48
+#define SV_CXBYTEALIGN 49
+#define SV_CXALIGN 49
+#define SV_CYBYTEALIGN 50
+#define SV_CYALIGN 50
+#define SV_DESKTOPWORKAREAYTOP 51
+#define SV_DESKTOPWORKAREAYBOTTOM 52
+#define SV_DESKTOPWORKAREAXRIGHT 53
+#define SV_DESKTOPWORKAREAXLEFT 54
+#define SV_NOTRESERVED 56
+#define SV_EXTRAKEYBEEP 57
+#define SV_SETLIGHTS 58
+#define SV_INSERTMODE 59
+#define SV_MENUROLLDOWNDELAY 64
+#define SV_MENUROLLUPDELAY 65
+#define SV_ALTMNEMONIC 66
+#define SV_TASKLISTMOUSEACCESS 67
+#define SV_CXICONTEXTWIDTH 68
+#define SV_CICONTEXTLINES 69
+#define SV_CHORDTIME 70
+#define SV_CXCHORD 71
+#define SV_CYCHORD 72
+#define SV_CXMOTIONSTART 73
+#define SV_CYMOTIONSTART 74
+#define SV_BEGINDRAG 75
+#define SV_ENDDRAG 76
+#define SV_SINGLESELECT 77
+#define SV_OPEN 78
+#define SV_CONTEXTMENU 79
+#define SV_CONTEXTHELP 80
+#define SV_TEXTEDIT 81
+#define SV_BEGINSELECT 82
+#define SV_ENDSELECT 83
+#define SV_BEGINDRAGKB 84
+#define SV_ENDDRAGKB 85
+#define SV_SELECTKB 86
+#define SV_OPENKB 87
+#define SV_CONTEXTMENUKB 88
+#define SV_CONTEXTHELPKB 89
+#define SV_TEXTEDITKB 90
+#define SV_BEGINSELECTKB 91
+#define SV_ENDSELECTKB 92
+#define SV_ANIMATION 93
+#define SV_ANIMATIONSPEED 94
+#define SV_MONOICONS 95
+#define SV_KBDALTERED 96
+#define SV_PRINTSCREEN 97
+#define SV_LOCKSTARTINPUT 98
+#define SV_DYNAMICDRAG 99
+#define SV_CSYSVALUES 100
+
+#define SYSCLR_SHADOWHILITEBGND (-50)
+#define SYSCLR_SHADOWHILITEFGND (-49)
+#define SYSCLR_SHADOWTEXT (-48)
+#define SYSCLR_ENTRYFIELD (-47)
+#define SYSCLR_MENUDISABLEDTEXT (-46)
+#define SYSCLR_MENUHILITE (-45)
+#define SYSCLR_MENUHILITEBGND (-44)
+#define SYSCLR_PAGEBACKGROUND (-43)
+#define SYSCLR_FIELDBACKGROUND (-42)
+#define SYSCLR_BUTTONLIGHT (-41)
+#define SYSCLR_BUTTONMIDDLE (-40)
+#define SYSCLR_BUTTONDARK (-39)
+#define SYSCLR_BUTTONDEFAULT (-38)
+#define SYSCLR_TITLEBOTTOM (-37)
+#define SYSCLR_SHADOW (-36)
+#define SYSCLR_ICONTEXT (-35)
+#define SYSCLR_DIALOGBACKGROUND (-34)
+#define SYSCLR_HILITEFOREGROUND (-33)
+#define SYSCLR_HILITEBACKGROUND (-32)
+#define SYSCLR_INACTIVETITLETEXTBGND (-31)
+#define SYSCLR_ACTIVETITLETEXTBGND (-30)
+#define SYSCLR_INACTIVETITLETEXT (-29)
+#define SYSCLR_ACTIVETITLETEXT (-28)
+#define SYSCLR_OUTPUTTEXT (-27)
+#define SYSCLR_WINDOWSTATICTEXT (-26)
+#define SYSCLR_SCROLLBAR (-25)
+#define SYSCLR_BACKGROUND (-24)
+#define SYSCLR_ACTIVETITLE (-23)
+#define SYSCLR_INACTIVETITLE (-22)
+#define SYSCLR_MENU (-21)
+#define SYSCLR_WINDOW (-20)
+#define SYSCLR_WINDOWFRAME (-19)
+#define SYSCLR_MENUTEXT (-18)
+#define SYSCLR_WINDOWTEXT (-17)
+#define SYSCLR_TITLETEXT (-16)
+#define SYSCLR_ACTIVEBORDER (-15)
+#define SYSCLR_INACTIVEBORDER (-14)
+#define SYSCLR_APPWORKSPACE (-13)
+#define SYSCLR_HELPBACKGROUND (-12)
+#define SYSCLR_HELPTEXT (-11)
+#define SYSCLR_HELPHILITE (-10)
+
+#define SYSCLR_CSYSCOLORS 41
+
+#define WM_CTLCOLORCHANGE 0x0129
+#define WM_QUERYCTLTYPE 0x0130 /*0x012a?*/
+
+
+typedef struct _CTLCOLOR
+{
+ LONG clrIndex;
+ LONG clrValue;
+} CTLCOLOR;
+typedef CTLCOLOR *PCTLCOLOR;
+
+typedef struct _PARAM
+{
+ ULONG id;
+ ULONG cb;
+ BYTE ab[1];
+} PARAM;
+typedef PARAM *NPPARAM;
+typedef PARAM *PPARAM;
+
+typedef struct _PRESPARAMS
+{
+ ULONG cb;
+ PARAM aparam[1];
+} PRESPARAMS;
+typedef PRESPARAMS *NPPRESPARAMS;
+typedef PRESPARAMS *PPRESPARAMS;
+
+
+LONG WinQueryControlColors (HWND hwnd, LONG clrType, ULONG flCtlColor,
+ ULONG cCtlColor, PCTLCOLOR pCtlColor);
+ULONG WinQueryPresParam (HWND hwnd, ULONG id1, ULONG id2, PULONG pulId,
+ ULONG cbBuf, PVOID pbBuf, ULONG fs);
+LONG WinQuerySysColor (HWND hwndDesktop, LONG clr, LONG lReserved);
+LONG WinQuerySysValue (HWND hwndDesktop, LONG iSysValue);
+BOOL WinRemovePresParam (HWND hwnd, ULONG id);
+LONG WinSetControlColors (HWND hwnd, LONG clrType, ULONG flCtlColor,
+ ULONG cCtlColor, PCTLCOLOR pCtlColor);
+BOOL WinSetPresParam (HWND hwnd, ULONG id, ULONG cbParam, PVOID pbParam);
+BOOL WinSetSysColors (HWND hwndDesktop, ULONG flOptions, ULONG flFormat,
+ LONG clrFirst, ULONG cclr, __const__ LONG *pclr);
+BOOL WinSetSysValue (HWND hwndDesktop, LONG iSysValue, LONG lValue);
+
+#endif /* INCL_WINSYS */
+
+
+#if defined (INCL_WINTHUNKAPI)
+
+PFN WinQueryClassThunkProc (PCSZ pszClassname);
+LONG WinQueryWindowModel (HWND hwnd);
+PFN WinQueryWindowThunkProc (HWND hwnd);
+BOOL WinSetClassThunkProc (PCSZ pszClassname, PFN pfnThunkProc);
+BOOL WinSetWindowThunkProc (HWND hwnd, PFN pfnThunkProc);
+
+#endif /* INCL_WINTHUNKAPI */
+
+
+#if defined (INCL_WINTIMER)
+
+#define TID_CURSOR 0xffff
+#define TID_SCROLL 0xfffe
+#define TID_FLASHWINDOW 0xfffd
+#define TID_USERMAX 0x7fff
+
+ULONG WinGetCurrentTime (HAB hab);
+ULONG WinStartTimer (HAB hab, HWND hwnd, ULONG idTimer, ULONG dtTimeout);
+BOOL WinStopTimer (HAB hab, HWND hwnd, ULONG idTimer);
+
+#endif /* INCL_WINTIMER */
+
+#if defined (INCL_WINTRACKRECT)
+
+#define TF_LEFT 0x0001
+#define TF_TOP 0x0002
+#define TF_RIGHT 0x0004
+#define TF_BOTTOM 0x0008
+#define TF_SETPOINTERPOS 0x0010
+#define TF_GRID 0x0020
+#define TF_STANDARD 0x0040
+#define TF_ALLINBOUNDARY 0x0080
+#define TF_VALIDATETRACKRECT 0x0100
+#define TF_PARTINBOUNDARY 0x0200
+
+#define TF_MOVE 0x000f
+
+typedef struct _TRACKINFO
+{
+ LONG cxBorder;
+ LONG cyBorder;
+ LONG cxGrid;
+ LONG cyGrid;
+ LONG cxKeyboard;
+ LONG cyKeyboard;
+ RECTL rclTrack;
+ RECTL rclBoundary;
+ POINTL ptlMinTrackSize;
+ POINTL ptlMaxTrackSize;
+ ULONG fs;
+} TRACKINFO;
+typedef TRACKINFO *PTRACKINFO;
+
+BOOL WinShowTrackRect (HWND hwnd, BOOL fShow);
+BOOL WinTrackRect (HWND hwnd, HPS hps, PTRACKINFO pti);
+
+#endif /* INCL_WINTRACKRECT */
+
+/* -------------------- MULTIPLE LINE ENTRIES ----------------------------- */
+
+#if defined (INCL_WINMLE)
+
+#define MLS_WORDWRAP 0x0001
+#define MLS_BORDER 0x0002
+#define MLS_VSCROLL 0x0004
+#define MLS_HSCROLL 0x0008
+#define MLS_READONLY 0x0010
+#define MLS_IGNORETAB 0x0020
+#define MLS_DISABLEUNDO 0x0040
+
+#define MLFFMTRECT_FORMATRECT 0x0007
+#define MLFFMTRECT_LIMITHORZ 0x0001
+#define MLFFMTRECT_LIMITVERT 0x0002
+#define MLFFMTRECT_MATCHWINDOW 0x0004
+
+#define MLFIE_CFTEXT 0
+#define MLFIE_NOTRANS 1
+#define MLFIE_WINFMT 2
+#define MLFIE_RTF 3
+
+#define MLFEFR_RESIZE 0x0001
+#define MLFEFR_TABSTOP 0x0002
+#define MLFEFR_FONT 0x0004
+#define MLFEFR_TEXT 0x0008
+#define MLFEFR_WORDWRAP 0x0010
+#define MLFETL_TEXTBYTES 0x0020
+
+#define MLFMARGIN_LEFT 0x0001
+#define MLFMARGIN_BOTTOM 0x0002
+#define MLFMARGIN_RIGHT 0x0003
+#define MLFMARGIN_TOP 0x0004
+
+#define MLFQS_MINMAXSEL 0
+#define MLFQS_MINSEL 1
+#define MLFQS_MAXSEL 2
+#define MLFQS_ANCHORSEL 3
+#define MLFQS_CURSORSEL 4
+
+#define MLFCLPBD_TOOMUCHTEXT 0x0001
+#define MLFCLPBD_ERROR 0x0002
+
+#define MLFSEARCH_CASESENSITIVE 0x0001
+#define MLFSEARCH_SELECTMATCH 0x0002
+#define MLFSEARCH_CHANGEALL 0x0004
+
+#define MLM_SETTEXTLIMIT 0x01b0
+#define MLM_QUERYTEXTLIMIT 0x01b1
+#define MLM_SETFORMATRECT 0x01b2
+#define MLM_QUERYFORMATRECT 0x01b3
+#define MLM_SETWRAP 0x01b4
+#define MLM_QUERYWRAP 0x01b5
+#define MLM_SETTABSTOP 0x01b6
+#define MLM_QUERYTABSTOP 0x01b7
+#define MLM_SETREADONLY 0x01b8
+#define MLM_QUERYREADONLY 0x01b9
+
+#define MLM_QUERYCHANGED 0x01ba
+#define MLM_SETCHANGED 0x01bb
+#define MLM_QUERYLINECOUNT 0x01bc
+#define MLM_CHARFROMLINE 0x01bd
+#define MLM_LINEFROMCHAR 0x01be
+#define MLM_QUERYLINELENGTH 0x01bf
+#define MLM_QUERYTEXTLENGTH 0x01c0
+
+#define MLM_FORMAT 0x01c1
+#define MLM_SETIMPORTEXPORT 0x01c2
+#define MLM_IMPORT 0x01c3
+#define MLM_EXPORT 0x01c4
+#define MLM_DELETE 0x01c6
+#define MLM_QUERYFORMATLINELENGTH 0x01c7
+#define MLM_QUERYFORMATTEXTLENGTH 0x01c8
+#define MLM_INSERT 0x01c9
+
+#define MLM_SETSEL 0x01ca
+#define MLM_QUERYSEL 0x01cb
+#define MLM_QUERYSELTEXT 0x01cc
+
+#define MLM_QUERYUNDO 0x01cd
+#define MLM_UNDO 0x01ce
+#define MLM_RESETUNDO 0x01cf
+
+#define MLM_QUERYFONT 0x01d0
+#define MLM_SETFONT 0x01d1
+#define MLM_SETTEXTCOLOR 0x01d2
+#define MLM_QUERYTEXTCOLOR 0x01d3
+#define MLM_SETBACKCOLOR 0x01d4
+#define MLM_QUERYBACKCOLOR 0x01d5
+
+#define MLM_QUERYFIRSTCHAR 0x01d6
+#define MLM_SETFIRSTCHAR 0x01d7
+
+#define MLM_CUT 0x01d8
+#define MLM_COPY 0x01d9
+#define MLM_PASTE 0x01da
+#define MLM_CLEAR 0x01db
+
+#define MLM_ENABLEREFRESH 0x01dc
+#define MLM_DISABLEREFRESH 0x01dd
+
+#define MLM_SEARCH 0x01de
+#define MLM_QUERYIMPORTEXPORT 0x01df
+
+#define MLN_OVERFLOW 0x0001
+#define MLN_PIXHORZOVERFLOW 0x0002
+#define MLN_PIXVERTOVERFLOW 0x0003
+#define MLN_TEXTOVERFLOW 0x0004
+#define MLN_VSCROLL 0x0005
+#define MLN_HSCROLL 0x0006
+#define MLN_CHANGE 0x0007
+#define MLN_SETFOCUS 0x0008
+#define MLN_KILLFOCUS 0x0009
+#define MLN_MARGIN 0x000a
+#define MLN_SEARCHPAUSE 0x000b
+#define MLN_MEMERROR 0x000c
+#define MLN_UNDOOVERFLOW 0x000d
+#define MLN_CLPBDFAIL 0x000f
+
+
+typedef LONG IPT;
+typedef IPT *PIPT;
+typedef LONG PIX;
+typedef ULONG LINE;
+
+
+typedef struct _FORMATRECT /* Note 1 */
+{
+ LONG cxFormat;
+ LONG cyFormat;
+} MLEFORMATRECT;
+typedef MLEFORMATRECT *PFORMATRECT;
+
+typedef struct _MLECTLDATA
+{
+ USHORT cbCtlData;
+ USHORT afIEFormat;
+ ULONG cchText;
+ IPT iptAnchor;
+ IPT iptCursor;
+ LONG cxFormat;
+ LONG cyFormat;
+ ULONG afFormatFlags;
+ PVOID pHWXCtlData;
+} MLECTLDATA;
+typedef MLECTLDATA *PMLECTLDATA;
+
+typedef struct _MLEOVERFLOW
+{
+ ULONG afErrInd;
+ LONG nBytesOver;
+ LONG pixHorzOver;
+ LONG pixVertOver;
+} MLEOVERFLOW;
+typedef MLEOVERFLOW *POVERFLOW;
+
+typedef struct _MLEMARGSTRUCT
+{
+ USHORT afMargins;
+ USHORT usMouMsg;
+ IPT iptNear;
+} MLEMARGSTRUCT;
+typedef MLEMARGSTRUCT *PMARGSTRUCT;
+
+typedef struct _SEARCH /* Note 1 */
+{
+ USHORT cb;
+ USHORT _pad;
+ PCHAR pchFind;
+ PCHAR pchReplace;
+ SHORT cchFind;
+ SHORT cchReplace;
+ IPT iptStart;
+ IPT iptStop;
+ USHORT cchFound;
+} MLE_SEARCHDATA;
+typedef MLE_SEARCHDATA *PMLE_SEARCHDATA;
+
+#endif /* INCL_WINMLE */
+
+/* --------------- GRAPHICS PROGRAMMING INTERFACE ------------------------- */
+
+#define GPI_ERROR 0
+#define GPI_OK 1
+#define GPI_ALTERROR (-1)
+
+#define HRGN_ERROR ((HRGN)(-1))
+
+#define CLR_ERROR (-255)
+#define CLR_NOINDEX (-254)
+#define CLR_FALSE (-5)
+#define CLR_TRUE (-4)
+#define CLR_DEFAULT (-3)
+#define CLR_WHITE (-2)
+#define CLR_BLACK (-1)
+#define CLR_BACKGROUND 0
+#define CLR_BLUE 1
+#define CLR_RED 2
+#define CLR_PINK 3
+#define CLR_GREEN 4
+#define CLR_CYAN 5
+#define CLR_YELLOW 6
+#define CLR_NEUTRAL 7
+#define CLR_DARKGRAY 8
+#define CLR_DARKBLUE 9
+#define CLR_DARKRED 10
+#define CLR_DARKPINK 11
+#define CLR_DARKGREEN 12
+#define CLR_DARKCYAN 13
+#define CLR_BROWN 14
+#define CLR_PALEGRAY 15
+
+#define RGB_ERROR (-255)
+#define RGB_BLACK 0x00000000
+#define RGB_BLUE 0x000000ff
+#define RGB_GREEN 0x0000ff00
+#define RGB_CYAN 0x0000ffff
+#define RGB_RED 0x00ff0000
+#define RGB_PINK 0x00ff00ff
+#define RGB_YELLOW 0x00ffff00
+#define RGB_WHITE 0x00ffffff
+
+#define PRIM_LINE 1
+#define PRIM_CHAR 2
+#define PRIM_MARKER 3
+#define PRIM_AREA 4
+#define PRIM_IMAGE 5
+
+#define AM_ERROR (-1)
+#define AM_PRESERVE 0
+#define AM_NOPRESERVE 1
+
+#define FM_ERROR (-1)
+#define FM_DEFAULT 0
+#define FM_OR 1
+#define FM_OVERPAINT 2
+#define FM_LEAVEALONE 5
+
+#define FM_XOR 4
+#define FM_AND 6
+#define FM_SUBTRACT 7
+#define FM_MASKSRCNOT 8
+#define FM_ZERO 9
+#define FM_NOTMERGESRC 10
+#define FM_NOTXORSRC 11
+#define FM_INVERT 12
+#define FM_MERGESRCNOT 13
+#define FM_NOTCOPYSRC 14
+#define FM_MERGENOTSRC 15
+#define FM_NOTMASKSRC 16
+#define FM_ONE 17
+
+#define BM_ERROR (-1)
+#define BM_DEFAULT 0
+#define BM_OR 1
+#define BM_OVERPAINT 2
+#define BM_LEAVEALONE 5
+
+#define BM_XOR 4
+#define BM_AND 6
+#define BM_SUBTRACT 7
+#define BM_MASKSRCNOT 8
+#define BM_ZERO 9
+#define BM_NOTMERGESRC 10
+#define BM_NOTXORSRC 11
+#define BM_INVERT 12
+#define BM_MERGESRCNOT 13
+#define BM_NOTCOPYSRC 14
+#define BM_MERGENOTSRC 15
+#define BM_NOTMASKSRC 16
+#define BM_ONE 17
+#define BM_SRCTRANSPARENT 18
+#define BM_DESTTRANSPARENT 19
+
+#define LINETYPE_ERROR (-1)
+#define LINETYPE_DEFAULT 0
+#define LINETYPE_DOT 1
+#define LINETYPE_SHORTDASH 2
+#define LINETYPE_DASHDOT 3
+#define LINETYPE_DOUBLEDOT 4
+#define LINETYPE_LONGDASH 5
+#define LINETYPE_DASHDOUBLEDOT 6
+#define LINETYPE_SOLID 7
+#define LINETYPE_INVISIBLE 8
+#define LINETYPE_ALTERNATE 9
+
+#define LINEWIDTH_ERROR (-1)
+#define LINEWIDTH_DEFAULT 0L
+#define LINEWIDTH_NORMAL 0x00010000
+#define LINEWIDTH_THICK 0x00020000
+
+#define LINEWIDTHGEOM_ERROR (-1)
+
+#define LINEEND_ERROR (-1)
+#define LINEEND_DEFAULT 0
+#define LINEEND_FLAT 1
+#define LINEEND_SQUARE 2
+#define LINEEND_ROUND 3
+
+#define LINEJOIN_ERROR (-1)
+#define LINEJOIN_DEFAULT 0
+#define LINEJOIN_BEVEL 1
+#define LINEJOIN_ROUND 2
+#define LINEJOIN_MITRE 3
+
+#define CHDIRN_ERROR (-1)
+#define CHDIRN_DEFAULT 0
+#define CHDIRN_LEFTRIGHT 1
+#define CHDIRN_TOPBOTTOM 2
+#define CHDIRN_RIGHTLEFT 3
+#define CHDIRN_BOTTOMTOP 4
+
+#define TA_NORMAL_HORIZ 0x0001
+#define TA_LEFT 0x0002
+#define TA_CENTER 0x0003
+#define TA_RIGHT 0x0004
+#define TA_STANDARD_HORIZ 0x0005
+#define TA_NORMAL_VERT 0x0100
+#define TA_TOP 0x0200
+#define TA_HALF 0x0300
+#define TA_BASE 0x0400
+#define TA_BOTTOM 0x0500
+#define TA_STANDARD_VERT 0x0600
+
+#define CM_ERROR (-1)
+#define CM_DEFAULT 0
+#define CM_MODE1 1
+#define CM_MODE2 2
+#define CM_MODE3 3
+
+#define MARKSYM_ERROR (-1)
+#define MARKSYM_DEFAULT 0
+#define MARKSYM_CROSS 1
+#define MARKSYM_PLUS 2
+#define MARKSYM_DIAMOND 3
+#define MARKSYM_SQUARE 4
+#define MARKSYM_SIXPOINTSTAR 5
+#define MARKSYM_EIGHTPOINTSTAR 6
+#define MARKSYM_SOLIDDIAMOND 7
+#define MARKSYM_SOLIDSQUARE 8
+#define MARKSYM_DOT 9
+#define MARKSYM_SMALLCIRCLE 10
+#define MARKSYM_BLANK 64
+
+#define TXTBOX_TOPLEFT 0
+#define TXTBOX_BOTTOMLEFT 1
+#define TXTBOX_TOPRIGHT 2
+#define TXTBOX_BOTTOMRIGHT 3
+#define TXTBOX_CONCAT 4
+#define TXTBOX_COUNT 5
+
+#define PVIS_ERROR 0
+#define PVIS_INVISIBLE 1
+#define PVIS_VISIBLE 2
+
+#define RVIS_ERROR 0
+#define RVIS_INVISIBLE 1
+#define RVIS_PARTIAL 2
+#define RVIS_VISIBLE 3
+
+#define FONT_DEFAULT 1
+#define FONT_MATCH 2
+
+#define LCIDT_FONT 6
+#define LCIDT_BITMAP 7
+
+#define LCID_ALL (-1)
+
+#define CHS_OPAQUE 0x0001
+#define CHS_VECTOR 0x0002
+#define CHS_LEAVEPOS 0x0008
+#define CHS_CLIP 0x0010
+#define CHS_UNDERSCORE 0x0200
+#define CHS_STRIKEOUT 0x0400
+
+#define FWEIGHT_DONT_CARE 0
+#define FWEIGHT_ULTRA_LIGHT 1
+#define FWEIGHT_EXTRA_LIGHT 2
+#define FWEIGHT_LIGHT 3
+#define FWEIGHT_SEMI_LIGHT 4
+#define FWEIGHT_NORMAL 5
+#define FWEIGHT_SEMI_BOLD 6
+#define FWEIGHT_BOLD 7
+#define FWEIGHT_EXTRA_BOLD 8
+#define FWEIGHT_ULTRA_BOLD 9
+
+#define FWIDTH_DONT_CARE 0
+#define FWIDTH_ULTRA_CONDENSED 1
+#define FWIDTH_EXTRA_CONDENSED 2
+#define FWIDTH_CONDENSED 3
+#define FWIDTH_SEMI_CONDENSED 4
+#define FWIDTH_NORMAL 5
+#define FWIDTH_SEMI_EXPANDED 6
+#define FWIDTH_EXPANDED 7
+#define FWIDTH_EXTRA_EXPANDED 8
+#define FWIDTH_ULTRA_EXPANDED 9
+
+#define FTYPE_ITALIC 0x0001
+#define FTYPE_ITALIC_DONT_CARE 0x0002
+#define FTYPE_OBLIQUE 0x0004
+#define FTYPE_OBLIQUE_DONT_CARE 0x0008
+#define FTYPE_ROUNDED 0x0010
+#define FTYPE_ROUNDED_DONT_CARE 0x0020
+
+#define QFA_PUBLIC 1
+#define QFA_PRIVATE 2
+#define QFA_ERROR GPI_ALTERROR
+
+#define QF_PUBLIC 0x0001
+#define QF_PRIVATE 0x0002
+#define QF_NO_GENERIC 0x0004
+#define QF_NO_DEVICE 0x0008
+
+#define QCD_LCT_FORMAT 0
+#define QCD_LCT_LOINDEX 1
+#define QCD_LCT_HIINDEX 2
+#define QCD_LCT_OPTIONS 3
+
+#define QLCT_ERROR (-1)
+#define QLCT_RGB (-2)
+
+#define QLCT_NOTLOADED (-1)
+
+#define PAL_ERROR (-1)
+
+#define PC_RESERVED 0x01
+#define PC_EXPLICIT 0x02
+#define PC_NOCOLLAPSE 0x04
+
+#define SCP_ALTERNATE 0
+#define SCP_WINDING 2
+#define SCP_AND 4
+#define SCP_RESET 0
+#define SCP_INCL 0
+#define SCP_EXCL 8
+
+#define MPATH_STROKE 6
+
+#define FPATH_ALTERNATE 0
+#define FPATH_WINDING 2
+#define FPATH_INCL 0
+#define FPATH_EXCL 8
+
+#define CVTC_WORLD 1
+#define CVTC_MODEL 2
+#define CVTC_DEFAULTPAGE 3
+#define CVTC_PAGE 4
+#define CVTC_DEVICE 5
+
+#define TRANSFORM_REPLACE 0
+#define TRANSFORM_ADD 1
+#define TRANSFORM_PREEMPT 2
+
+#define SEGEM_ERROR 0
+#define SEGEM_INSERT 1
+#define SEGEM_REPLACE 2
+
+#define POLYGON_NOBOUNDARY 0x0000
+#define POLYGON_BOUNDARY 0x0001
+
+#define POLYGON_ALTERNATE 0x0000
+#define POLYGON_WINDING 0x0002
+
+#define POLYGON_INCL 0x0000
+#define POLYGON_EXCL 0x0008
+
+#define POLYGON_FILL 0x0000
+#define POLYGON_NOFILL 0x0010
+
+#define LCOL_RESET 0x0001
+#define LCOL_REALIZABLE 0x0002
+#define LCOL_PURECOLOR 0x0004
+#define LCOL_OVERRIDE_DEFAULT_COLORS 0x0008
+#define LCOL_REALIZED 0x0010
+
+#define LCOLF_DEFAULT 0
+#define LCOLF_INDRGB 1
+#define LCOLF_CONSECRGB 2
+#define LCOLF_RGB 3
+#define LCOLF_PALETTE 4
+
+#define LCOLOPT_REALIZED 0x0001
+#define LCOLOPT_INDEX 0x0002
+
+#define BA_NOBOUNDARY 0
+#define BA_BOUNDARY 0x0001
+
+#define BA_ALTERNATE 0
+#define BA_WINDING 0x0002
+
+#define BA_INCL 0
+#define BA_EXCL 8
+
+#define DRO_FILL 1
+#define DRO_OUTLINE 2
+#define DRO_OUTLINEFILL 3
+
+#define PATSYM_ERROR (-1)
+#define PATSYM_DEFAULT 0
+#define PATSYM_DENSE1 1
+#define PATSYM_DENSE2 2
+#define PATSYM_DENSE3 3
+#define PATSYM_DENSE4 4
+#define PATSYM_DENSE5 5
+#define PATSYM_DENSE6 6
+#define PATSYM_DENSE7 7
+#define PATSYM_DENSE8 8
+#define PATSYM_VERT 9
+#define PATSYM_HORIZ 10
+#define PATSYM_DIAG1 11
+#define PATSYM_DIAG2 12
+#define PATSYM_DIAG3 13
+#define PATSYM_DIAG4 14
+#define PATSYM_NOSHADE 15
+#define PATSYM_SOLID 16
+#define PATSYM_HALFTONE 17
+#define PATSYM_HATCH 18
+#define PATSYM_DIAGHATCH 19
+#define PATSYM_BLANK 64
+
+#define LCID_ERROR (-1)
+#define LCID_DEFAULT 0
+
+#define CRGN_OR 1
+#define CRGN_COPY 2
+#define CRGN_XOR 4
+#define CRGN_AND 6
+#define CRGN_DIFF 7
+
+#define RGN_ERROR 0
+#define RGN_NULL 1
+#define RGN_RECT 2
+#define RGN_COMPLEX 3
+
+#define PRGN_ERROR 0
+#define PRGN_OUTSIDE 1
+#define PRGN_INSIDE 2
+
+#define RRGN_ERROR 0
+#define RRGN_OUTSIDE 1
+#define RRGN_PARTIAL 2
+#define RRGN_INSIDE 3
+
+#define EQRGN_ERROR 0
+#define EQRGN_NOTEQUAL 1
+#define EQRGN_EQUAL 2
+
+#define RECTDIR_LFRT_TOPBOT 1
+#define RECTDIR_RTLF_TOPBOT 2
+#define RECTDIR_LFRT_BOTTOP 3
+#define RECTDIR_RTLF_BOTTOP 4
+
+#define PMF_SEGBASE 0
+#define PMF_LOADTYPE 1
+#define PMF_RESOLVE 2
+#define PMF_LCIDS 3
+#define PMF_RESET 4
+#define PMF_SUPPRESS 5
+#define PMF_COLORTABLES 6
+#define PMF_COLORREALIZABLE 7
+#define PMF_DEFAULTS 8
+#define PMF_DELETEOBJECTS 9
+
+#define RS_DEFAULT 0
+#define RS_NODISCARD 1
+#define LC_DEFAULT 0
+#define LC_NOLOAD 1
+#define LC_LOADDISC 3
+#define LT_DEFAULT 0
+#define LT_NOMODIFY 1
+#define LT_ORIGINALVIEW 4
+#define RES_DEFAULT &nbs