Changeset 43
- Timestamp:
- 04/05/06 11:05:30 (3 years ago)
- Files:
-
- trunk/win32/basetsd.d (modified) (1 diff)
- trunk/win32/cderr.d (modified) (1 diff)
- trunk/win32/ddeml.d (added)
- trunk/win32/readme.txt (modified) (4 diffs)
- trunk/win32/w32api.d (modified) (1 diff)
- trunk/win32/winbase.d (modified) (14 diffs)
- trunk/win32/windef.d (modified) (2 diffs)
- trunk/win32/winnetwk.d (modified) (4 diffs)
- trunk/win32/winnls.d (modified) (6 diffs)
- trunk/win32/winver.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/win32/basetsd.d
r36 r43 39 39 alias ushort* PUHALF_PTR; 40 40 41 // FIXME: check types (are these necessary anyway?) 42 uint HandleToUlong(HANDLE h) { return cast(uint) h; } 43 int HandleToLong(HANDLE h) { return cast(int) h; } 41 uint HandleToUlong(HANDLE h) { return cast(uint) h; } 42 int HandleToLong(HANDLE h) { return cast(int) h; } 44 43 HANDLE LongToHandle(LONG_PTR h) { return cast(HANDLE) h; } 45 uint PtrToUlong( ULONG_PTR p){ return cast(uint) p; }46 uint PtrToUint( UINT_PTR p){ return cast(uint) p; }47 int PtrToInt( INT_PTR p){ return cast(int) p; }48 ushort PtrToUshort( ULONG_PTR p){ return cast(ushort) p; }49 short PtrToShort( LONG_PTR p){ return cast(short) p; }50 void* IntToPtr(int i) { return cast(void*) i; }51 void* UIntToPtr(uint ui) { return cast(void*) ui; }44 uint PtrToUlong(void* p) { return cast(uint) p; } 45 uint PtrToUint(void* p) { return cast(uint) p; } 46 int PtrToInt(void* p) { return cast(int) p; } 47 ushort PtrToUshort(void* p) { return cast(ushort) p; } 48 short PtrToShort(void* p) { return cast(short) p; } 49 void* IntToPtr(int i) { return cast(void*) i; } 50 void* UIntToPtr(uint ui) { return cast(void*) ui; } 52 51 alias IntToPtr LongToPtr; 53 52 alias UIntToPtr ULongToPtr; trunk/win32/cderr.d
r37 r43 2 2 3 3 enum { 4 CDERR_DIALOGFAILURE = 0xFFFF,5 CDERR_GENERALCODES = 0x0000,6 CDERR_STRUCTSIZE ,7 CDERR_INITIALIZATION ,8 CDERR_NOTEMPLATE ,9 CDERR_NOHINSTANCE ,10 CDERR_LOADSTRFAILURE ,11 CDERR_FINDRESFAILURE ,12 CDERR_LOADRESFAILURE ,13 CDERR_LOCKRESFAILURE ,14 CDERR_MEMALLOCFAILURE ,15 CDERR_MEMLOCKFAILURE ,16 CDERR_NOHOOK ,17 CDERR_REGISTERMSGFAIL ,18 PDERR_PRINTERCODES = 0x1000,19 PDERR_SETUPFAILURE ,20 PDERR_PARSEFAILURE ,21 PDERR_RETDEFFAILURE ,22 PDERR_LOADDRVFAILURE ,23 PDERR_GETDEVMODEFAIL ,24 PDERR_INITFAILURE ,25 PDERR_NODEVICES ,26 PDERR_NODEFAULTPRN ,27 PDERR_DNDMMISMATCH ,28 PDERR_CREATEICFAILURE ,29 PDERR_PRINTERNOTFOUND ,30 PDERR_DEFAULTDIFFERENT ,31 CFERR_CHOOSEFONTCODES = 0x2000,32 CFERR_NOFONTS ,33 CFERR_MAXLESSTHANMIN ,34 FNERR_FILENAMECODES = 0x3000,35 FNERR_SUBCLASSFAILURE ,36 FNERR_INVALIDFILENAME ,37 FNERR_BUFFERTOOSMALL ,38 FRERR_FINDREPLACECODES = 0x4000,39 FRERR_BUFFERLENGTHZERO ,40 CCERR_CHOOSECOLORCODES = 0x50004 CDERR_DIALOGFAILURE = 0xFFFF, 5 CDERR_GENERALCODES = 0x0000, 6 CDERR_STRUCTSIZE, 7 CDERR_INITIALIZATION, 8 CDERR_NOTEMPLATE, 9 CDERR_NOHINSTANCE, 10 CDERR_LOADSTRFAILURE, 11 CDERR_FINDRESFAILURE, 12 CDERR_LOADRESFAILURE, 13 CDERR_LOCKRESFAILURE, 14 CDERR_MEMALLOCFAILURE, 15 CDERR_MEMLOCKFAILURE, 16 CDERR_NOHOOK, 17 CDERR_REGISTERMSGFAIL, 18 PDERR_PRINTERCODES = 0x1000, 19 PDERR_SETUPFAILURE, 20 PDERR_PARSEFAILURE, 21 PDERR_RETDEFFAILURE, 22 PDERR_LOADDRVFAILURE, 23 PDERR_GETDEVMODEFAIL, 24 PDERR_INITFAILURE, 25 PDERR_NODEVICES, 26 PDERR_NODEFAULTPRN, 27 PDERR_DNDMMISMATCH, 28 PDERR_CREATEICFAILURE, 29 PDERR_PRINTERNOTFOUND, 30 PDERR_DEFAULTDIFFERENT, 31 CFERR_CHOOSEFONTCODES = 0x2000, 32 CFERR_NOFONTS, 33 CFERR_MAXLESSTHANMIN, 34 FNERR_FILENAMECODES = 0x3000, 35 FNERR_SUBCLASSFAILURE, 36 FNERR_INVALIDFILENAME, 37 FNERR_BUFFERTOOSMALL, 38 FRERR_FINDREPLACECODES = 0x4000, 39 FRERR_BUFFERLENGTHZERO, 40 CCERR_CHOOSECOLORCODES = 0x5000 41 41 } trunk/win32/readme.txt
r36 r43 107 107 108 108 109 7. Other conditional compilation 109 7. Translate conditional compilation based on Windows version support 110 111 Every module that uses this conditional compilation must privately import win32.w32api, which defines the constants used to set the minimum version of Windows an application supports. 112 113 Unlike with the C headers, the programmer is expected to specify both the minimum Windows 9x version and the minimum Windows NT version, so both _WIN32_WINDOWS and _WIN32_WINNT are defined in any project. Conditional compilation must therefore, in general, involve checking the values of both constants either directly or indirectly. The WINVER and _WIN32_WINNT_ONLY constants are also defined for syntactic sugar. 114 115 Rather than relying on the conditionals in the MinGW headers, it is a good idea to look on http://msdn.microsoft.com/ to see which Windows versions support each entity that is CC'd. 116 117 118 8. Other conditional compilation 110 119 111 120 Use the built-in version (Win32) and version (Win64) to deal with _WIN64 conditional blocks. 112 121 113 For #ifdefs using WINVER, _WIN32_WINDOWS or _WIN32_WINNT, leave the directive in, commented out. This is pending decision on a good way of dealing with these.122 For other #ifdefs designed to be specified by the programmer, leave the directive in, commented out. This is pending decision on which to include and which to leave out, and how to name them. 114 123 115 124 116 8. Convert function-like macros to functions125 9. Convert function-like macros to functions 117 126 118 127 Use the appropriate parameter and return types. If necessary, consult the API docs to find out what these are. (Watch out for parameters that are documented as LPSTR but should actually be LPTSTR!) … … 125 134 126 135 127 9. Remove leftover preprocessor directives136 10. Remove leftover preprocessor directives 128 137 129 138 Remove any preprocessor directives, such as #if..#elseif..#endif and any #defines, that have been deemed unnecessary. 130 139 131 140 132 1 0. Section heading comments (optional)141 11. Section heading comments (optional) 133 142 134 143 Comments may be used to create logical section headings within a module. They shall look like this: … … 138 147 139 148 140 1 1. Deprecate functions (optional)149 12. Deprecate functions (optional) 141 150 142 151 If you discover when reading the documentation for a function, structure, etc. that it is intended only for compatibility with 16-bit Windows versions, you may mark it as deprecated. Group deprecated function prototypes within a block under a deprecated attribute block. Be sure to deprecate the ANSI/Unicode aliases as well. … … 145 154 146 155 147 1 2. Always check that the translated module compiles156 13. Always check that the translated module compiles 148 157 149 158 After translating, compile the module to check for errors. trunk/win32/w32api.d
r37 r43 11 11 module win32.w32api; 12 12 13 enum { 14 __W32API_VERSION = 3.6, 15 __W32API_MAJOR_VERSION = 3, 16 __W32API_MINOR_VERSION = 6 13 const __W32API_VERSION = 3.6; 14 const __W32API_MAJOR_VERSION = 3; 15 const __W32API_MINOR_VERSION = 6; 16 17 /* These version identifiers are used to specify the minimum version of 18 * Windows that an application will support. 19 * 20 * The programmer should set two version identifiers: one for the 21 * minimum Windows NT version and one for the minimum Windows 9x 22 * version. If no Windows NT version is specified, Windows NT 4 is 23 * assumed. If no Windows 9x version is specified, Windows 95 is 24 * assumed, unless WindowsNTonly, WindowsXP or Windows2003 is specified, 25 * implying that the application supports only Windows NT. 26 */ 27 28 // For Windows XP and later, assume no Windows 9x support 29 version (Windows2003) { 30 const uint 31 _WIN32_WINNT = 0x502, 32 _WIN32_WINDOWS = uint.max; 33 34 } else version (WindowsXP) { 35 const uint 36 _WIN32_WINNT = 0x501, 37 _WIN32_WINDOWS = uint.max; 38 39 } else { 40 /* for earlier Windows versions, separate version identifiers into 41 * the NT and 9x lines 42 */ 43 version (Windows2000) { 44 const uint _WIN32_WINNT = 0x500; 45 } else { 46 const uint _WIN32_WINNT = 0x400; 47 } 48 49 version (WindowsNTonly) { 50 const uint _WIN32_WINDOWS = uint.max; 51 } else version (WindowsME) { 52 const uint _WIN32_WINDOWS = 0x500; 53 } else version (Windows98) { 54 const uint _WIN32_WINDOWS = 0x410; 55 } else { 56 const uint _WIN32_WINDOWS = 0x400; 57 } 17 58 } 18 59 19 / * These version identifiers are used to specify the minimum version of20 * Windows that an application will support. Versions would be used to 21 *22 */ 60 // Just a bit of syntactic sugar for the static ifs 61 const uint WINVER = _WIN32_WINDOWS < _WIN32_WINNT ? 62 _WIN32_WINDOWS : _WIN32_WINNT; 63 const bool _WIN32_WINNT_ONLY = _WIN32_WINDOWS == uint.max; 23 64 24 version (Windows2000) { // 0x500 25 version = _Windows2000plus; 26 version = _Windows98or2000plus; 27 version = _WindowsMEor2000plus; 28 version = _NToverride; 65 version (IE6) { 66 const uint _WIN32_IE = 0x600; 67 } else version (IE56) { 68 const uint _WIN32_IE = 0x560; 69 } else version (IE501) { 70 const uint _WIN32_IE = 0x501; 71 } else version (IE5) { 72 const uint _WIN32_IE = 0x500; 73 } else version (IE401) { 74 const uint _WIN32_IE = 0x401; 75 } else version (IE4) { 76 const uint _WIN32_IE = 0x400; 77 } else version (IE3) { 78 const uint _WIN32_IE = 0x400; 79 } else static if (WINVER >= 0x410) { 80 const uint _WIN32_IE = 0x400; 81 } else { 82 const uint _WIN32_IE = 0; 29 83 } 30 84 31 version (WindowsXP) { // 0x501 32 version = _Windows2000plus; 33 version = _WindowsXPplus; 34 version = _Windows98or2000plus; 35 version = _WindowsMEor2000plus; 36 version = _NToverride; 85 unittest { 86 printf("Windows NT version: %03x\n", _WIN32_WINNT); 87 printf("Windows 9x version: %03x\n", _WIN32_WINDOWS); 88 printf("IE version: %03x\n", _WIN32_IE); 37 89 } 38 39 version (Windows2003) { // 0x50240 version = _Windows2000plus;41 version = _WindowsXPplus;42 version = _Windows2003plus;43 version = _Windows98or2000plus;44 version = _WindowsMEor2000plus;45 version = _NToverride;46 }47 48 version (Windows98) { // 0x41049 version = _Windows98plus;50 version = _Windows98or2000plus;51 }52 53 version (WindowsME) { // 0x50054 version = _Windows98plus;55 version = _WindowsMEplus;56 version = _Windows98or2000plus;57 version = _WindowsMEor2000plus;58 version (_NToverride) {} else version = _Windows2000plus;59 }60 61 // 0x60062 version (IE6) version = IE56;63 // 0x56064 version (IE56) version = IE501;65 // 0x50166 version (IE501) version = IE5;67 // 0x50068 version (IE5) version = IE401;69 // 0x40170 version (IE401) version = IE4;71 // 0x40072 version (IE4) version = IE3;73 // 0x300trunk/win32/winbase.d
r40 r43 1 1 // Converted from MINGW w32api\winbase.h 2 2 // Public domain. 3 4 module win32.winbase;5 import win32.winver;6 import win32.windef;7 3 8 4 /* … … 147 143 148 144 enum : DWORD { 149 SP_PARITY =1,150 SP_BAUD =2,151 SP_DATABITS =4,152 SP_STOPBITS =8,153 SP_HANDSHAKING =16,154 SP_PARITY_CHECK =32,155 SP_RLSD =64145 SP_PARITY=1, 146 SP_BAUD=2, 147 SP_DATABITS=4, 148 SP_STOPBITS=8, 149 SP_HANDSHAKING=16, 150 SP_PARITY_CHECK=32, 151 SP_RLSD=64 156 152 } 157 153 158 154 enum : DWORD { 159 DATABITS_5 =1,160 DATABITS_6 =2,161 DATABITS_7 =4,162 DATABITS_8 =8,163 DATABITS_16 =16,164 DATABITS_16X =32155 DATABITS_5=1, 156 DATABITS_6=2, 157 DATABITS_7=4, 158 DATABITS_8=8, 159 DATABITS_16=16, 160 DATABITS_16X=32 165 161 } 166 162 … … 221 217 const DWORD INVALID_SET_FILE_POINTER = -1; 222 218 223 // for OpenFile() 224 deprecated { 225 enum : UINT { 226 OF_READ = 0, 227 OF_WRITE = 1, 228 OF_READWRITE = 2, 229 OF_SHARE_COMPAT = 0, 230 OF_SHARE_DENY_NONE = 64, 231 OF_SHARE_DENY_READ = 48, 232 OF_SHARE_DENY_WRITE = 32, 233 OF_SHARE_EXCLUSIVE = 16, 234 OF_PARSE = 256, 235 OF_DELETE = 512, 236 OF_VERIFY = 1024; 237 OF_CANCEL = 2048, 238 OF_CREATE = 4096, 239 OF_PROMPT = 8192, 240 OF_EXIST = 16384, 241 OF_REOPEN = 32768 242 } 243 } 219 const OF_READ=0; 220 const OF_READWRITE=2; 221 const OF_WRITE=1; 222 const OF_SHARE_COMPAT=0; 223 const OF_SHARE_DENY_NONE=64; 224 const OF_SHARE_DENY_READ=48; 225 const OF_SHARE_DENY_WRITE=32; 226 const OF_SHARE_EXCLUSIVE=16; 227 const OF_CANCEL=2048; 228 const OF_CREATE=4096; 229 const OF_DELETE=512; 230 const OF_EXIST=16384; 231 const OF_PARSE=256; 232 const OF_PROMPT=8192; 233 const OF_REOPEN=32768; 234 const OF_VERIFY=1024; 244 235 245 236 enum : DWORD { … … 300 291 const PIPE_UNLIMITED_INSTANCES=255; 301 292 302 // dwCreationFlags for CreateProcess() and CreateProcessAsUser() 303 enum : DWORD { 304 DEBUG_PROCESS = 0x00000001, 305 DEBUG_ONLY_THIS_PROCESS = 0x00000002, 306 CREATE_SUSPENDED = 0x00000004, 307 DETACHED_PROCESS = 0x00000008, 308 CREATE_NEW_CONSOLE = 0x00000010, 309 NORMAL_PRIORITY_CLASS = 0x00000020, 310 IDLE_PRIORITY_CLASS = 0x00000040, 311 HIGH_PRIORITY_CLASS = 0x00000080, 312 REALTIME_PRIORITY_CLASS = 0x00000100, 313 CREATE_NEW_PROCESS_GROUP = 0x00000200, 314 CREATE_UNICODE_ENVIRONMENT = 0x00000400, 315 CREATE_SEPARATE_WOW_VDM = 0x00000800, 316 CREATE_SHARED_WOW_VDM = 0x00001000, 317 CREATE_FORCEDOS = 0x00002000, 318 BELOW_NORMAL_PRIORITY_CLASS = 0x00004000, 319 ABOVE_NORMAL_PRIORITY_CLASS = 0x00008000, 320 CREATE_BREAKAWAY_FROM_JOB = 0x01000000, 321 CREATE_WITH_USERPROFILE = 0x02000000, 322 CREATE_DEFAULT_ERROR_MODE = 0x04000000, 323 CREATE_NO_WINDOW = 0x08000000, 324 PROFILE_USER = 0x10000000, 325 PROFILE_KERNEL = 0x20000000, 326 PROFILE_SERVER = 0x40000000 327 } 293 const DEBUG_PROCESS=0x00000001; 294 const DEBUG_ONLY_THIS_PROCESS=0x00000002; 295 const CREATE_SUSPENDED=0x00000004; 296 const DETACHED_PROCESS=0x00000008; 297 const CREATE_NEW_CONSOLE=0x00000010; 298 const NORMAL_PRIORITY_CLASS=0x00000020; 299 const IDLE_PRIORITY_CLASS=0x00000040; 300 const HIGH_PRIORITY_CLASS=0x00000080; 301 const REALTIME_PRIORITY_CLASS=0x00000100; 302 const CREATE_NEW_PROCESS_GROUP=0x00000200; 303 const CREATE_UNICODE_ENVIRONMENT=0x00000400; 304 const CREATE_SEPARATE_WOW_VDM=0x00000800; 305 const CREATE_SHARED_WOW_VDM=0x00001000; 306 const CREATE_FORCEDOS=0x00002000; 307 const BELOW_NORMAL_PRIORITY_CLASS=0x00004000; 308 const ABOVE_NORMAL_PRIORITY_CLASS=0x00008000; 309 const CREATE_BREAKAWAY_FROM_JOB=0x01000000; 310 const CREATE_WITH_USERPROFILE=0x02000000; 311 const CREATE_DEFAULT_ERROR_MODE=0x04000000; 312 const CREATE_NO_WINDOW=0x08000000; 313 const PROFILE_USER=0x10000000; 314 const PROFILE_KERNEL=0x20000000; 315 const PROFILE_SERVER=0x40000000; 328 316 329 317 const CONSOLE_TEXTMODE_BUFFER=1; … … 373 361 const MAX_PROFILE_LEN=80; 374 362 375 enum { 376 DOCKINFO_UNDOCKED = 1, 377 DOCKINFO_DOCKED = 2, 378 DOCKINFO_USER_SUPPLIED = 4, 379 DOCKINFO_USER_UNDOCKED = (DOCKINFO_USER_SUPPLIED|DOCKINFO_UNDOCKED), 380 DOCKINFO_USER_DOCKED = (DOCKINFO_USER_SUPPLIED|DOCKINFO_DOCKED) 381 } 363 const DOCKINFO_UNDOCKED=1; 364 const DOCKINFO_DOCKED=2; 365 const DOCKINFO_USER_SUPPLIED=4; 366 const DOCKINFO_USER_UNDOCKED=(DOCKINFO_USER_SUPPLIED|DOCKINFO_UNDOCKED); 367 const DOCKINFO_USER_DOCKED=(DOCKINFO_USER_SUPPLIED|DOCKINFO_DOCKED); 382 368 383 369 enum { … … 438 424 const FS_VOL_IS_COMPRESSED=32768; 439 425 440 // Flags for GlobalAlloc 441 enum : SIZE_T { 442 GMEM_FIXED=0, 443 GMEM_MOVEABLE=2, 444 GMEM_ZEROINIT=64, 445 GPTR = 66, 446 // Used only for GlobalRealloc 447 GMEM_MODIFY = 128 448 449 /+ // Obselete flags (Win16 only) 450 GMEM_NOCOMPACT=16; 451 GMEM_NODISCARD=32; 452 GMEM_DISCARDABLE=256; 453 GMEM_NOT_BANKED=4096; 454 GMEM_LOWER=4096; 455 GMEM_SHARE=8192; 456 GMEM_DDESHARE=8192; 457 458 GMEM_LOCKCOUNT=255; 459 +/ 460 } 461 462 // for GlobalFlags(). 426 const GMEM_FIXED=0; 427 const GMEM_MOVEABLE=2; 428 const GMEM_NOCOMPACT=16; 429 const GMEM_NODISCARD=32; 430 const GMEM_ZEROINIT=64; 431 const GMEM_MODIFY=128; 432 const GMEM_DISCARDABLE=256; 433 const GMEM_LOCKCOUNT=255; 434 const GMEM_NOT_BANKED=4096; 435 const GMEM_LOWER=4096; 436 const GMEM_SHARE=8192; 437 const GMEM_DDESHARE=8192; 463 438 const GMEM_DISCARDED=16384; 439 const GMEM_NOTIFY = 16384; 464 440 const GMEM_INVALID_HANDLE = 32768; 465 466 const GMEM_NOTIFY = 16384;467 441 const GMEM_VALID_FLAGS = 32626; 468 442 469 443 const GPTR = 64; 444 const GHND = 66; 470 445 471 446 const LMEM_FIXED=0; … … 631 606 632 607 /* also in ddk/ntapi.h */ 633 enum { 634 SEM_FAILCRITICALERRORS = 0x0001, 635 SEM_NOGPFAULTERRORBOX = 0x0002, 636 SEM_NOALIGNMENTFAULTEXCEPT = 0x0004, 637 SEM_NOOPENFILEERRORBOX = 0x8000 638 } 608 const SEM_FAILCRITICALERRORS=0x0001; 609 const SEM_NOGPFAULTERRORBOX=0x0002; 610 const SEM_NOALIGNMENTFAULTEXCEPT=0x0004; 611 const SEM_NOOPENFILEERRORBOX=0x8000; 639 612 /* end ntapi.h */ 640 613 641 enum { 642 SLE_ERROR = 1, 643 SLE_MINORERROR, 644 SLE_WARNING 645 } 614 const SLE_ERROR=1; 615 const SLE_MINORERROR=2; 616 const SLE_WARNING=3; 646 617 647 618 const SHUTDOWN_NORETRY=1; … … 657 628 INVALID_ATOM = 0 658 629 } 659 660 630 const IGNORE = 0; 661 631 const INFINITE = 0xFFFFFFFF; … … 743 713 } 744 714 745 enum { 746 STREAM_NORMAL_ATTRIBUTE = 0, 747 STREAM_MODIFIED_WHEN_READ = 1, 748 STREAM_CONTAINS_SECURITY = 2, 749 STREAM_CONTAINS_PROPERTIES = 4 750 } 751 752 enum { 753 STARTF_USESHOWWINDOW = 1, 754 STARTF_USESIZE = 2, 755 STARTF_USEPOSITION = 4, 756 STARTF_USECOUNTCHARS = 8, 757 STARTF_USEFILLATTRIBUTE = 16, 758 STARTF_RUNFULLSCREEN = 32, 759 STARTF_FORCEONFEEDBACK = 64, 760 STARTF_FORCEOFFFEEDBACK = 128, 761 STARTF_USESTDHANDLES = 256, 762 STARTF_USEHOTKEY = 512 763 } 764 765 enum { 766 TC_NORMAL = 0, 767 TC_HARDERR = 1, 768 TC_GP_TRAP = 2, 769 TC_SIGNAL = 3 770 } 771 772 enum { 773 AC_LINE_OFFLINE = 0, 774 AC_LINE_ONLINE = 1, 775 AC_LINE_BACKUP_POWER = 2, 776 AC_LINE_UNKNOWN = 255 777 } 778 779 enum { 780 BATTERY_FLAG_HIGH = 1, 781 BATTERY_FLAG_LOW = 2, 782 BATTERY_FLAG_CRITICAL = 4, 783 BATTERY_FLAG_CHARGING = 8, 784 BATTERY_FLAG_NO_BATTERY = 128, 785 BATTERY_FLAG_UNKNOWN = 255, 786 BATTERY_PERCENTAGE_UNKNOWN = 255, 787 BATTERY_LIFE_UNKNOWN = 0xFFFFFFFF 788 } 715 const STREAM_NORMAL_ATTRIBUTE=0; 716 const STREAM_MODIFIED_WHEN_READ=1; 717 const STREAM_CONTAINS_SECURITY=2; 718 const STREAM_CONTAINS_PROPERTIES=4; 719 720 const STARTF_USESHOWWINDOW=1; 721 const STARTF_USESIZE=2; 722 const STARTF_USEPOSITION=4; 723 const STARTF_USECOUNTCHARS=8; 724 const STARTF_USEFILLATTRIBUTE=16; 725 const STARTF_RUNFULLSCREEN=32; 726 const STARTF_FORCEONFEEDBACK=64; 727 const STARTF_FORCEOFFFEEDBACK=128; 728 const STARTF_USESTDHANDLES=256; 729 const STARTF_USEHOTKEY=512; 730 731 const TC_NORMAL=0; 732 const TC_HARDERR=1; 733 const TC_GP_TRAP=2; 734 const TC_SIGNAL=3; 735 736 const AC_LINE_OFFLINE=0; 737 const AC_LINE_ONLINE=1; 738 const AC_LINE_BACKUP_POWER=2; 739 const AC_LINE_UNKNOWN=255; 740 741 const BATTERY_FLAG_HIGH=1; 742 const BATTERY_FLAG_LOW=2; 743 const BATTERY_FLAG_CRITICAL=4; 744 const BATTERY_FLAG_CHARGING=8; 745 const BATTERY_FLAG_NO_BATTERY=128; 746 const BATTERY_FLAG_UNKNOWN=255; 747 const BATTERY_PERCENTAGE_UNKNOWN=255; 748 const BATTERY_LIFE_UNKNOWN=0xFFFFFFFF; 789 749 790 750 const DDD_RAW_TARGET_PATH=1; … … 1374 1334 alias PROCESS_HEAP_ENTRY * LPPROCESS_HEAP_ENTRY; 1375 1335 1376 deprecated {1377 1378 1336 struct OFSTRUCT{ 1379 1337 BYTE cBytes; … … 1385 1343 } 1386 1344 alias OFSTRUCT * LPOFSTRUCT, POFSTRUCT; 1387 1388 }1389 1345 1390 1346 struct WIN_CERTIFICATE{ … … 1551 1507 BOOL CheckRemoteDebuggerPresent(HANDLE,PBOOL); 1552 1508 } 1553 1554 1509 BOOL ClearCommBreak(HANDLE); 1555 1510 BOOL ClearCommError(HANDLE,PDWORD,LPCOMSTAT); … … 1663 1618 HANDLE CreateWaitableTimerA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR); 1664 1619 HANDLE CreateWaitableTimerW(LPSECURITY_ATTRIBUTES,BOOL,LPCWSTR); 1620 1665 1621 1666 1622 BOOL DebugActiveProcess(DWORD); … … 2190 2146 HANDLE OpenEventLogW(LPCWSTR,LPCWSTR); 2191 2147 HANDLE OpenEventW(DWORD,BOOL,LPCWSTR); 2192 deprecated {2193 2148 HFILE OpenFile(LPCSTR,LPOFSTRUCT,UINT); 2194 }2195 2149 HANDLE OpenFileMappingA(DWORD,BOOL,LPCSTR); 2196 2150 HANDLE OpenFileMappingW(DWORD,BOOL,LPCWSTR); trunk/win32/windef.d
r36 r43 12 12 13 13 import win32.winnt; 14 private import win32. basetsd;14 private import win32.w32api, win32.basetsd; 15 15 16 16 const size_t MAX_PATH = 260; … … 75 75 alias HANDLE* PHKEY; 76 76 77 /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */ 78 /* #if (WINVER >= 0x0500) */ 79 alias HANDLE HMONITOR, HTERMINAL, HWINEVENTHOOK; 80 /* #endif */ 77 static if (WINVER >= 0x0500) { 78 alias HANDLE HMONITOR, HTERMINAL, HWINEVENTHOOK; 79 } 81 80 82 81 alias extern (Windows) int function() FARPROC, NEARPROC, PROC; trunk/win32/winnetwk.d
r37 r43 13 13 private import win32.winbase, win32.winnt; 14 14 15 enum {15 enum : DWORD { 16 16 WNNC_NET_MSNET = 0x00010000, 17 17 WNNC_NET_LANMAN = 0x00020000, … … 86 86 RESOURCEUSAGE_RESERVED = 0x80000000; 87 87 88 enum {88 enum : DWORD { 89 89 RESOURCEDISPLAYTYPE_GENERIC, 90 90 RESOURCEDISPLAYTYPE_DOMAIN, … … 114 114 CONNECT_CURRENT_MEDIA = 512; 115 115 116 const CONNDLG_RO_PATH = 1; 117 const CONNDLG_CONN_POINT = 2; 118 const CONNDLG_USE_MRU = 4; 119 const CONNDLG_HIDE_BOX = 8; 120 const CONNDLG_PERSIST = 16; 121 const CONNDLG_NOT_PERSIST = 32; 122 123 const DISC_UPDATE_PROFILE = 1; 124 const DISC_NO_FORCE = 64; 125 126 const WNFMT_MULTILINE = 1; 127 const WNFMT_ABBREVIATED = 2; 128 const WNFMT_INENUM = 16; 129 const WNFMT_CONNECTION = 32; 116 const DWORD 117 CONNDLG_RO_PATH = 1, 118 CONNDLG_CONN_POINT = 2, 119 CONNDLG_USE_MRU = 4, 120 CONNDLG_HIDE_BOX = 8, 121 CONNDLG_PERSIST = 16, 122 CONNDLG_NOT_PERSIST = 32; 123 124 const DWORD 125 DISC_UPDATE_PROFILE = 1, 126 DISC_NO_FORCE = 64; 127 128 const DWORD 129 WNFMT_MULTILINE = 1, 130 WNFMT_ABBREVIATED = 2, 131 WNFMT_INENUM = 16, 132 WNFMT_CONNECTION = 32; 130 133 131 134 enum : DWORD { … … 177 180 } 178 181 179 const NETINFO_DLL16 = 1; 180 const NETINFO_DISKRED = 4; 181 const NETINFO_PRINTERRED = 8; 182 183 enum { 182 const DWORD 183 NETINFO_DLL16 = 1, 184 NETINFO_DISKRED = 4, 185 NETINFO_PRINTERRED = 8; 186 187 const DWORD 184 188 RP_LOGON = 1, 185 RP_INIFILE = 2 186 } 187 188 const PP_DISPLAYERRORS = 1; 189 190 const WNCON_FORNETCARD = 1; 191 const WNCON_NOTROUTED = 2; 192 const WNCON_SLOWLINK = 4; 193 constWNCON_DYNAMIC = 8;189 RP_INIFILE = 2; 190 191 const DWORD PP_DISPLAYERRORS = 1; 192 193 const DWORD 194 WNCON_FORNETCARD = 1, 195 WNCON_NOTROUTED = 2, 196 WNCON_SLOWLINK = 4, 197 WNCON_DYNAMIC = 8; 194 198 195 199 struct NETRESOURCEA { trunk/win32/winnls.d
r37 r43 11 11 module win32.winnls; 12 12 13 private import win32. basetsd, win32.windef, win32.winbase;13 private import win32.w32api, win32.basetsd, win32.windef, win32.winbase; 14 14 15 15 alias DWORD LCTYPE, CALTYPE, CALID, LGRPID, GEOID, GEOTYPE, GEOCLASS; … … 21 21 MAX_LEADBYTES = 12; 22 22 23 const LOCALE_USE_CP_ACP = 0x40000000; 24 //#if (WINVER >= 0x0400) 23 const LOCALE_USE_CP_ACP = 0x40000000; 25 24 const LOCALE_RETURN_NUMBER = 0x20000000; 26 //#endif27 25 28 26 enum : LCTYPE { … … 469 467 } 470 468 471 //#if (WINVER >= 0x0500) 472 enum : LCTYPE {473 LOCALE_SYEARMONTH = 0x1006,474 LOCALE_SENGCURRNAME = 0x1007,475 LOCALE_SNATIVECURRNAME = 0x1008,476 LOCALE_IDEFAULTEBCDICCODEPAGE = 0x1012,477 LOCALE_SSORTNAME = 0x1013,478 LOCALE_IDIGITSUBSTITUTION = 0x1014,479 LOCALE_IPAPERSIZE = 0x100A480 }481 482 const DWORD483 DATE_YEARMONTH = 8,484 DATE_LTRREADING = 16,485 DATE_RTLREADING = 32;486 487 const DWORD MAP_EXPAND_LIGATURES = 0x2000;488 const DWORD WC_NO_BEST_FIT_CHARS = 1024;489 490 enum {491 CAL_SYEARMONTH = 47,492 CAL_ITWODIGITYEARMAX = 48,493 CAL_NOUSEROVERRIDE = LOCALE_NOUSEROVERRIDE,494 CAL_RETURN_NUMBER = LOCALE_RETURN_NUMBER,495 CAL_USE_CP_ACP = LOCALE_USE_CP_ACP496 }497 //#endif /* (WINVER >= 0x0500) */ 469 static if (WINVER >= 0x500) { 470 enum : LCTYPE { 471 LOCALE_SYEARMONTH = 0x1006, 472 LOCALE_SENGCURRNAME = 0x1007, 473 LOCALE_SNATIVECURRNAME = 0x1008, 474 LOCALE_IDEFAULTEBCDICCODEPAGE = 0x1012, 475 LOCALE_SSORTNAME = 0x1013, 476 LOCALE_IDIGITSUBSTITUTION = 0x1014, 477 LOCALE_IPAPERSIZE = 0x100A 478 } 479 480 const DWORD 481 DATE_YEARMONTH = 8, 482 DATE_LTRREADING = 16, 483 DATE_RTLREADING = 32; 484 485 const DWORD MAP_EXPAND_LIGATURES = 0x2000; 486 const DWORD WC_NO_BEST_FIT_CHARS = 1024; 487 488 enum { 489 CAL_SYEARMONTH = 47, 490 CAL_ITWODIGITYEARMAX = 48, 491 CAL_NOUSEROVERRIDE = LOCALE_NOUSEROVERRIDE, 492 CAL_RETURN_NUMBER = LOCALE_RETURN_NUMBER, 493 CAL_USE_CP_ACP = LOCALE_USE_CP_ACP 494 } 495 } // (WINVER >= 0x500) 498 496 499 497 extern (Windows) { … … 691 689 int WideCharToMultiByte(UINT, DWORD, LPCWSTR, int, LPSTR, int, LPCSTR, 692 690 LPBOOL); 693 //#if (WINVER >= 0x0500) 694 BOOL EnumCalendarInfoExA(CALINFO_ENUMPROCEXA, LCID, CALID, CALTYPE); 695 BOOL EnumCalendarInfoExW(CALINFO_ENUMPROCEXW, LCID, CALID, CALTYPE); 696 BOOL EnumDateFormatsExA(DATEFMT_ENUMPROCEXA, LCID, DWORD); 697 BOOL EnumDateFormatsExW(DATEFMT_ENUMPROCEXW, LCID, DWORD); 698 BOOL EnumSystemLanguageGroupsA(LANGUAGEGROUP_ENUMPROCA, DWORD, LONG_PTR); 699 BOOL EnumSystemLanguageGroupsW(LANGUAGEGROUP_ENUMPROCW, DWORD, LONG_PTR); 700 BOOL EnumLanguageGroupLocalesA(LANGGROUPLOCALE_ENUMPROCA, LGRPID, DWORD, 701 LONG_PTR); 702 BOOL EnumLanguageGroupLocalesW(LANGGROUPLOCALE_ENUMPROCW, LGRPID, DWORD, 703 LONG_PTR); 704 BOOL EnumUILanguagesA(UILANGUAGE_ENUMPROCA, DWORD, LONG_PTR); 705 BOOL EnumUILanguagesW(UILANGUAGE_ENUMPROCW, DWORD, LONG_PTR); 706 LANGID GetSystemDefaultUILanguage(); 707 LANGID GetUserDefaultUILanguage(); 708 BOOL IsValidLanguageGroup(LGRPID, DWORD); 709 //#endif /* (WINVER >= 0x0500) */ 691 692 static if (WINVER >= 0x410) { 693 BOOL EnumCalendarInfoExA(CALINFO_ENUMPROCEXA, LCID, CALID, CALTYPE); 694 BOOL EnumCalendarInfoExW(CALINFO_ENUMPROCEXW, LCID, CALID, CALTYPE); 695 BOOL EnumDateFormatsExA(DATEFMT_ENUMPROCEXA, LCID, DWORD); 696 BOOL EnumDateFormatsExW(DATEFMT_ENUMPROCEXW, LCID, DWORD); 697 BOOL IsValidLanguageGroup(LGRPID, DWORD); 698 } 699 700 static if (WINVER >= 0x500) { 701 LANGID GetSystemDefaultUILanguage(); 702 LANGID GetUserDefaultUILanguage(); 703 704 static if (_WIN32_WINNT_ONLY) { 705 BOOL EnumSystemLanguageGroupsA(LANGUAGEGROUP_ENUMPROCA, DWORD, 706 LONG_PTR); 707 BOOL EnumSystemLanguageGroupsW(LANGUAGEGROUP_ENUMPROCW, DWORD, 708 LONG_PTR); 709 BOOL EnumLanguageGroupLocalesA(LANGGROUPLOCALE_ENUMPROCA, LGRPID, 710 DWORD, LONG_PTR); 711 BOOL EnumLanguageGroupLocalesW(LANGGROUPLOCALE_ENUMPROCW, LGRPID, 712 DWORD, LONG_PTR); 713 BOOL EnumUILanguagesA(UILANGUAGE_ENUMPROCA, DWORD, LONG_PTR); 714 BOOL EnumUILanguagesW(UILANGUAGE_ENUMPROCW, DWORD, LONG_PTR); 715 } 716 } 710 717 } 711 718 … … 745 752 alias SetCalendarInfoW SetCalendarInfo; 746 753 alias SetLocaleInfoW SetLocaleInfo; 747 //#if (WINVER >= 0x0500) 748 alias EnumCalendarInfoExW EnumCalendarInfoEx; 749 alias EnumDateFormatsExW EnumDateFormatsEx; 750 alias EnumSystemLanguageGroupsW EnumSystemLanguageGroups; 751 alias EnumLanguageGroupLocalesW EnumLanguageGroupLocales; 752 alias EnumUILanguagesW EnumUILanguages; 753 //#endif /* (WINVER >= 0x0500) */ 754 755 static if (WINVER >= 0x410) { 756 alias EnumCalendarInfoExW EnumCalendarInfoEx; 757 alias EnumDateFormatsExW EnumDateFormatsEx; 758 } 759 760 static if (_WIN32_WINNT_ONLY && WINVER >= 0x500) { 761 alias EnumSystemLanguageGroupsW EnumSystemLanguageGroups; 762 alias EnumLanguageGroupLocalesW EnumLanguageGroupLocales; 763 alias EnumUILanguagesW EnumUILanguages; 764 } 765 754 766 } else { 755 767 alias CALINFO_ENUMPROCA CALINFO_ENUMPROC; … … 787 799 alias SetCalendarInfoA SetCalendarInfo; 788 800 alias SetLocaleInfoA SetLocaleInfo; 789 //#if (WINVER >= 0x0500) 790 alias EnumCalendarInfoExA EnumCalendarInfoEx; 791 alias EnumDateFormatsExA EnumDateFormatsEx; 792 alias EnumSystemLanguageGroupsA EnumSystemLanguageGroups; 793 alias EnumLanguageGroupLocalesA EnumLanguageGroupLocales; 794 alias EnumUILanguagesA EnumUILanguages; 795 //#endif /* (WINVER >= 0x0500) */ 796 } 801 802 static if (WINVER >= 0x410) { 803 alias EnumCalendarInfoExA EnumCalendarInfoEx; 804 alias EnumDateFormatsExA EnumDateFormatsEx; 805 } 806 807 static if (_WIN32_WINNT_ONLY && WINVER >= 0x500) { 808 alias EnumSystemLanguageGroupsA EnumSystemLanguageGroups; 809 alias EnumLanguageGroupLocalesA EnumLanguageGroupLocales; 810 alias EnumUILanguagesA EnumUILanguages; 811 } 812 } trunk/win32/winver.d
r36 r43 11 11 module win32.winver; 12 12 13 private import win32.windef; 14 15 // FIXME: type weirdness 13 16 enum { 14 VS_FILE_INFO = RT_VERSION,17 VS_FILE_INFO = 16, 15 18 VS_VERSION_INFO = 1, 16 19 VS_USER_DEFINED = 100
