|
|
1.1.1.2 ! root 1: DEVTOOLS.TXT File ! 2: README file for Microsoft(R) Windows NT(TM) ! 3: Software Development Kit (BETA) ! 4: ! 5: Development Tools ! 6: (C) Copyright Microsoft Corporation, 1992 1.1 root 7: 1.1.1.2 ! root 8: This document contains release notes for the development tools, C/C++ 1.1 root 9: language, and libraries provided with the Microsoft(R) Windows NT(TM) 1.1.1.2 ! root 10: Software Development Kit (BETA). The information in this document is more ! 11: up to date than that included in the manuals. 1.1 root 12: 13: 1.1.1.2 ! root 14: =============================< Contents >============================= 1.1 root 15: 16: 17: This file has six parts: 18: 1.1.1.2 ! root 19: Part Title ! 20: ---- ----- 1.1 root 21: 1.1.1.2 ! root 22: 1 Additional 32-bit Run-time Functions 1.1 root 23: 1.1.1.2 ! root 24: 2 Notes on the _beginthread function ! 25: ! 26: 3 Notes on "C Language Reference" ! 27: ! 28: 4 Notes on Linker Options ! 29: ! 30: 5 Notes on Building Multithreaded ! 31: Applications and DLLs ! 32: ! 33: 6 The WinDebug Graphical Debugger ! 34: ! 35: 7 Post-Mortem Debugging 1.1 root 36: 37: 38: 39: ===============< Part 1: Additional 32-bit Run-time Functions >========= 40: 1.1.1.2 ! root 41: ! 42: The following functions are specific to 32-bit operating systems. These ! 43: functions are in addition those described in the Appendix to PROGRAMMING ! 44: TECHNIQUES. 1.1 root 45: 46: _find Functions 1.1.1.2 ! root 47: --------------- 1.1 root 48: 49: Description 1.1.1.2 ! root 50: ------------ ! 51: This function find the first matching file, the next matching file, ! 52: or releases resources from previous find operations. 1.1 root 53: 54: #include <io.h> 55: 1.1.1.2 ! root 56: long _findfirst (char *filespec, struct _finddata_t *fileinfo); ! 57: int _findnext (long handle, struct _finddata_t *fileinfo); ! 58: int _findclose (long handle); ! 59: ! 60: filespec The target file specification (may include wildcards) ! 61: ! 62: handle The search handle returned by a previous call to ! 63: _findfirst ! 64: ! 65: fileinfo The file information buffer 1.1 root 66: 67: Remarks 1.1.1.2 ! root 68: -------- ! 69: The _findfirst function provides information about the first instance ! 70: of a filename that matches the file specified in the filename argument. ! 71: Wildcard characters (* and ?) may be used in the filename argument. Any ! 72: wildcard combination supported by the host operating system may be used. ! 73: ! 74: File information is returned in a _finddata_t structure, defined in IO.H. The ! 75: _finddata_t structure includes the following elements: ! 76: ! 77: Element Description ! 78: ------- ------------ ! 79: unsigned attrib File attribute ! 80: ! 81: time_t time_create Time of file creation ! 82: (-1 for FAT file systems) ! 83: ! 84: time_t time_access Time of last file access ! 85: (-1 for FAT file systems) ! 86: ! 87: time_t time_write Time of last write to file ! 88: ! 89: _fsize_t size Length of file in bytes ! 90: ! 91: char name[_MAX_FNAME] Null-terminated name of matched ! 92: file/directory, without the path ! 93: _MAX_FNAME is defined in STDLIB.H. ! 94: ! 95: You cannot specify target attributes (_A_RDONLY) to limit the find ! 96: operation. This attribute is returned in the attrib field of the ! 97: _finddata_t structure and can have the following values ! 98: (defined in IO.H): ! 99: ! 100: Constant Description Value ! 101: -------- ----------- -------- ! 102: _A_ARCH Archive. Set whenever the file 0x20 ! 103: is changed, and cleared by the ! 104: MS-DOS BACKUP command. ! 105: ! 106: _A_HIDDEN Hidden file. Not normally seen 0x02 ! 107: with the MS-DOS DIR command. ! 108: ! 109: _A_NORMAL Normal. File can be read or 0x00 ! 110: written to without restriction. ! 111: ! 112: _A_RDONLY Read-only. File cannot be opened 0x01 ! 113: for writing, and a file with the ! 114: same name cannot be created. ! 115: ! 116: _A_SUBDIR Subdirectory. 0x10 ! 117: ! 118: _A_SYSTEM System file. Not normally seen with 0x04 ! 119: the MS-DOS DIR command. 1.1 root 120: 1.1.1.2 ! root 121: The _findnext function finds the next name, if any that matches the 1.1 root 122: filespec argument specified in a prior call to _findfirst. The fileinfo 123: argument should point to a structure initialized by a previous call to 124: _findfirst. The contents of the structure will be altered as described 125: above if a match is found. 126: 127: The _findclose routine closes the specified search handle and releases 128: associated resources. 129: 130: The _find functions allow nested calls. For example, if the file found 131: by a call to _findfirst or _findnext is a subdirectory, a new search 1.1.1.2 ! root 132: can be initiated with another call to _findfirst or _findnext. 1.1 root 133: 134: Return Value 1.1.1.2 ! root 135: ------------------ 1.1 root 136: If successful, the _findfirst function returns a unique search handle 137: identifying the file or group of files matching the filespec 138: specification which can be used in a subsequent call to _findnext or 139: _findclose. Otherwise, it returns -1 and sets errno to one of the 140: following values: 141: 1.1.1.2 ! root 142: Value Description ! 143: -------- ------------ ! 144: ENOENT File specification that could ! 145: not be matched. 1.1 root 146: 1.1.1.2 ! root 147: ! 148: EINVAL Illegal filename specification 1.1 root 149: 150: If successful, the _findnext and _findclose functions return 0. 151: Otherwise, they return -1 and set errno to ENOENT, indicating that no 1.1.1.2 ! root 152: more matching files could be found. ! 153: 1.1 root 154: 155: _seterrormode 1.1.1.2 ! root 156: ------------- 1.1 root 157: 158: Description 1.1.1.2 ! root 159: ------------ ! 160: This function controls whether the operating system or the calling ! 161: application handles hard errors. 1.1 root 162: 163: #include <stdlib.h> 164: 1.1.1.2 ! root 165: void _seterrormode (int mode); 1.1 root 166: 1.1.1.2 ! root 167: mode Error mode 1.1 root 168: 169: Remarks 1.1.1.2 ! root 170: ------------- 1.1 root 171: The mode argument specifies the error-mode flag. If mode is set to 1.1.1.2 ! root 172: _CRIT_ERROR_PROMPT, the system displays an error message prompt 1.1 root 173: indicating that a hard error has occurred. If mode is set to 174: _CRIT_ERROR_FAIL, the system returns the failed call to the calling 175: application with an error indicating the cause. 176: 177: Return Value 1.1.1.2 ! root 178: ------------------ ! 179: None ! 180: 1.1 root 181: 182: _loaddll 1.1.1.2 ! root 183: -------- 1.1 root 184: 185: Description 1.1.1.2 ! root 186: ----------- ! 187: Loads the specified Dynamic Link Library (DLL) into memory. 1.1 root 188: 189: #include <process.h> 190: 1.1.1.2 ! root 191: int _loaddll (char *dllname); 1.1 root 192: 1.1.1.2 ! root 193: dllname Null-terminated string that names the DLL to ! 194: be loaded. 1.1 root 195: 196: Remarks 1.1.1.2 ! root 197: ------- ! 198: The _loaddll routine loads the specified DLL. If the ! 199: dllname argument does not include a qualified path name, the 1.1 root 200: library is searched for according to the search path specified by the 201: host operating system. 202: 203: Return Value 1.1.1.2 ! root 204: ------------ 1.1 root 205: If successful, the _loaddll routine returns a unique handle to the DLL. 206: Otherwise, it returns 0. 207: 1.1.1.2 ! root 208: 1.1 root 209: _unloaddll 1.1.1.2 ! root 210: ---------- 1.1 root 211: 212: Description 1.1.1.2 ! root 213: ----------- 1.1 root 214: Unloads the specified DLL from the current process. 215: 216: #include <process.h> 217: 1.1.1.2 ! root 218: int _unloaddll (int handle); 1.1 root 219: 1.1.1.2 ! root 220: handle Handle to the loaded DLL, from a previous call ! 221: to _loaddll. 1.1 root 222: 223: Remarks 1.1.1.2 ! root 224: ------- ! 225: The _unloaddll function unloads the specified DLL. If there are no ! 226: other processes using the DLL, its resources may be released. 1.1 root 227: 228: Return Value 1.1.1.2 ! root 229: ------------ 1.1 root 230: If successful, the _unloaddll routine returns 0. Otherwise, it returns 231: an operating system error code. 232: 1.1.1.2 ! root 233: 1.1 root 234: _getdllprocaddr 1.1.1.2 ! root 235: --------------- 1.1 root 236: 237: Description 1.1.1.2 ! root 238: ----------- 1.1 root 239: Returns the address of the specified exported DLL function. 240: 241: #include <process.h> 242: 243: int (* _getdllprocaddr(int handle, char *procname, int ordinal))(); 244: 1.1.1.2 ! root 245: handle Specifies the handle to the DLL module that contains ! 246: the function. (This is returned by previous call to ! 247: _loaddll) ! 248: ! 249: procname This points to the null-terminated string containing ! 250: the function name, or NULL if the function's ! 251: ordinal value is used. 1.1 root 252: 1.1.1.2 ! root 253: ordinal Function's ordinal value, or -1 if the ! 254: function's name is used. 1.1 root 255: 256: Remarks 1.1.1.2 ! root 257: ------------ ! 258: The _getdllprocaddr function retrieves the address of exported 1.1 root 259: functions in DLLs. The function can be specified by name or by ordinal 1.1.1.2 ! root 260: value. Once retrieved, an address can be called as a function pointer. 1.1 root 261: 262: Return Value 1.1.1.2 ! root 263: ------------- 1.1 root 264: If successful, the _getdllprocaddr function returns a pointer to the 265: function's entry point. Otherwise, it returns NULL. 266: 1.1.1.2 ! root 267: 1.1 root 268: _getdiskfree 1.1.1.2 ! root 269: ------------ 1.1 root 270: 271: Description 1.1.1.2 ! root 272: ------------ 1.1 root 273: Retrieves information about the current or specified disk drive, 274: including the amount of free space on the disk. 275: 276: include <direct.h> 277: include <dos.h> 278: 1.1.1.2 ! root 279: int _getdiskfree (unsigned drive, struct _diskfree_t diskinfo); 1.1 root 280: 1.1.1.2 ! root 281: drive This specifies the drive number. The argument is ! 282: 0 for the current drive or 1-26 for another ! 283: specified disk drive. 1.1 root 284: 1.1.1.2 ! root 285: diskinfo Disk information structure 1.1 root 286: 287: Remarks 1.1.1.2 ! root 288: ------- 1.1 root 289: The _getdiskfree function retrieves information about the specified 290: disk drive. This information is returned in a _diskfree_t structure, 291: which is defined in DIRECT.H and has the following fields: 292: 1.1.1.2 ! root 293: Element Description ! 294: ------- ---------------- ! 295: unsigned total_clusters Total number of clusters on the disk 1.1 root 296: 1.1.1.2 ! root 297: unsigned avail_clusters Total number of free clusters on the ! 298: disk 1.1 root 299: 1.1.1.2 ! root 300: unsigned sectors_per_cluster Number of sectors per cluster 1.1 root 301: 1.1.1.2 ! root 302: unsigned bytes_per_sector Number of bytes per sector 1.1 root 303: 304: Return Value 1.1.1.2 ! root 305: ------------ 1.1 root 306: If successful, the _getdiskfree routine returns 0. Otherwise, it 307: returns an operating system error code. 308: 1.1.1.2 ! root 309: 1.1 root 310: _sleep 1.1.1.2 ! root 311: ------ 1.1 root 312: 313: Description 1.1.1.2 ! root 314: ----------- 1.1 root 315: Delays execution of the current thread or process for a specified 316: interval. 317: 318: include <stdlib.h> 319: 1.1.1.2 ! root 320: void _sleep (unsigned long duration); 1.1 root 321: 1.1.1.2 ! root 322: duration Specifies the length of time, in milliseconds, ! 323: of the delay. 1.1 root 324: 325: Remarks 1.1.1.2 ! root 326: -------- ! 327: In multi-threaded operating systems, the _sleep routine causes the 1.1 root 328: current thread to enter a waiting state until the specified interval of 1.1.1.2 ! root 329: time has passed. In single-threaded operating systems, the _sleep 1.1 root 330: routine causes the current process to be delayed. During the delay, 331: other threads or processes can continue execution. With MS-DOS, yield 332: messages are sent periodically which can be handled by Windows or other 1.1.1.2 ! root 333: multi-tasking operating systems. 1.1 root 334: 335: The duration argument indicates the length of the interval in 336: milliseconds. It can also be one of the following two values: 337: 1.1.1.2 ! root 338: Constant Value ! 339: -------- -------- ! 340: _SLEEP_MINIMUM Function returns immediately 1.1 root 341: 1.1.1.2 ! root 342: _SLEEP_FOREVER Infinite delay 1.1 root 343: 344: Note that in non-preemptive multitasking operating systems (such as 345: Windows), the duration may be longer than specified, since other 346: processes may not return control at the end of the delay. 347: 348: Return Value 1.1.1.2 ! root 349: ------------ 1.1 root 350: None. 351: 1.1.1.2 ! root 352: 1.1 root 353: _beep 1.1.1.2 ! root 354: --------- 1.1 root 355: 356: Description 1.1.1.2 ! root 357: ----------- ! 358: Generates a beep on the speaker. 1.1 root 359: 360: #include <stdlib.h> 361: 1.1.1.2 ! root 362: void _beep (unsigned frequency, unsigned duration); 1.1 root 363: 1.1.1.2 ! root 364: frequency Specifies the frequency of the sound in hertz. ! 365: Frequencies between 37 (25 hex) and 32767 ! 366: (07FFF hex) will produce audible sounds ! 367: ! 368: duration Specifies the duration of the sound in ! 369: milliseconds. See the description of the _sleep ! 370: function for possible values. Note that in ! 371: non-preemptive multi-tasking operating systems ! 372: (such as Windows), the duration may be longer ! 373: than specified, since other processes may not ! 374: return control at the end of the delay. 1.1 root 375: 376: Return Value 1.1.1.2 ! root 377: ------------- 1.1 root 378: None. 379: 380: 1.1.1.2 ! root 381: _getsystime ! 382: ----------- 1.1 root 383: Description 1.1.1.2 ! root 384: ----------- 1.1 root 385: Retrieves the current system time. 386: 387: #include <time.h> 388: 1.1.1.2 ! root 389: unsigned _getsystime (struct tm *tmstruct); 1.1 root 390: 1.1.1.2 ! root 391: tmstruct Pointer to a tm time structure containing ! 392: information about the system date and time. 1.1 root 393: 394: Remarks 1.1.1.2 ! root 395: -------- ! 396: The _getsystime function fills in a tm time structure (defined in 1.1 root 397: TIME.H) with information about the system date and time. The routine 398: then returns the fractional portion of the nearest second, in 399: milliseconds. 400: 401: Return Value 1.1.1.2 ! root 402: ------------- 1.1 root 403: The _getsystime function returns the fractional portion of the nearest 404: second, in milliseconds. 405: 1.1.1.2 ! root 406: 1.1 root 407: _setsystime 1.1.1.2 ! root 408: ----------- 1.1 root 409: 410: Description 1.1.1.2 ! root 411: ----------- ! 412: Sets the system time. 1.1 root 413: 414: #include <time.h> 415: 1.1.1.2 ! root 416: unsigned _setsystime (struct tm *tmstruct, unsigned milliseconds); 1.1 root 417: 1.1.1.2 ! root 418: tmstruct Pointer to a tm time structure containing ! 419: information about the system date and time 1.1 root 420: 1.1.1.2 ! root 421: milliseconds Fractional portion of nearest second, in ! 422: milliseconds 1.1 root 423: 424: Remarks 1.1.1.2 ! root 425: ------- ! 426: The setsystime function sets the system time to the specified 1.1 root 427: time. 428: 429: Return Value 1.1.1.2 ! root 430: ------------ 1.1 root 431: If successful, the _setsystime routine returns 0. Otherwise, it 432: returns an operating system error code. 433: 1.1.1.2 ! root 434: 1.1 root 435: _futime 1.1.1.2 ! root 436: -------- 1.1 root 437: 438: Description 1.1.1.2 ! root 439: ----------- 1.1 root 440: Sets the modification time on an open file. 441: 442: #include <\sys\utime.h> 443: 1.1.1.2 ! root 444: int _futime (int handle, struct _utimbuf *filetime); 1.1 root 445: 1.1.1.2 ! root 446: handle Handle to open file 1.1 root 447: 1.1.1.2 ! root 448: filetime Pointer to structure containing new ! 449: modification date 1.1 root 450: 451: Remarks 1.1.1.2 ! root 452: -------- 1.1 root 453: The _futime routine sets the modification date on the open file 454: associated with handle. It is identical to the _utime function, except 455: that its argument is the handle to an open file, rather than the name 456: of a file or a path to a file. Although the _utimbuf structure contains 457: a field for access time, only the modification time is set with systems 458: that do not support access time (such as MS- DOS). 459: 460: Return Value 1.1.1.2 ! root 461: ------------- 1.1 root 462: The _futime function returns 0 if successful. A return value of -1 463: indicates an error; in this case, errno is set to EBADF, indicating an 464: invalid file handle. 465: 1.1.1.2 ! root 466: 1.1 root 467: _getdrives 1.1.1.2 ! root 468: ---------- 1.1 root 469: 470: Description 1.1.1.2 ! root 471: ----------- ! 472: Returns a bitmap representing the currently available disk drives. 1.1 root 473: 474: #include <direct.h> 475: 1.1.1.2 ! root 476: unsigned long _getdrives (void); 1.1 root 477: 478: Return Value 1.1.1.2 ! root 479: ------------ ! 480: The return value is a bitmap with bits set for each currently 1.1 root 481: available disk drive. Bit position 0 (the least-significant bit) is 482: drive A, bit position 1 is drive B, bit position 2 is drive C, and so 483: on. 484: 1.1.1.2 ! root 485: 1.1 root 486: _get_osfhandle 1.1.1.2 ! root 487: -------------- 1.1 root 488: 489: Description 1.1.1.2 ! root 490: ----------- 1.1 root 491: Associates an operating system file handle with an existing C run-time 492: file handle. 493: 494: #include <io.h> 495: 1.1.1.2 ! root 496: long _get_osfhandle (int filehandle); 1.1 root 497: 1.1.1.2 ! root 498: filehandle User file handle 1.1 root 499: 500: Return Value 1.1.1.2 ! root 501: ------------ 1.1 root 502: If successful, the _get_osfhandle routine returns an operating system 503: file handle, corresponding to filehandle. Otherwise, it returns -1 and 504: sets errno to EBADF, indicating an invalid file handle. 505: 1.1.1.2 ! root 506: 1.1 root 507: _open_osfhandle 1.1.1.2 ! root 508: --------------- 1.1 root 509: 510: Description 1.1.1.2 ! root 511: ------------ 1.1 root 512: Associates a C run-time file handle with an existing operating system 513: file handle. 514: 515: #include <io.h> 516: 1.1.1.2 ! root 517: int _open_osfhandle (long osfhandle, int flags); 1.1 root 518: 1.1.1.2 ! root 519: osfhandle Operating system file handle 1.1 root 520: 1.1.1.2 ! root 521: flags Type of operations allowed 1.1 root 522: 523: Remarks 1.1.1.2 ! root 524: -------- 1.1 root 525: The _open_osfhandle routine allocates a C run-time file handle and 526: sets it to point to the operating system file handle specified by 527: osfhandle. The flags argument is an integer expression formed from one 528: or more of the manifest constants defined in FCNTL.H and listed below. 529: When two or more manifest constants are used to form the flags 530: argument, the constants are combined with the bitwise-OR operator (|). 531: 532: The FCNTL.H file defines the following manifest constants: 533: 1.1.1.2 ! root 534: Constant Meaning ! 535: -------- ------------ ! 536: _O_APPEND Repositions the file pointer to the end of the ! 537: file before every write operation. 1.1 root 538: 1.1.1.2 ! root 539: _O_RDONLY Opens file for reading only. 1.1 root 540: 1.1.1.2 ! root 541: _O_TEXT Opens file in text (translated) mode. 1.1 root 542: 543: Return Value 1.1.1.2 ! root 544: ------------- 1.1 root 545: If successful, the _open_osfhandle function returns a C run-time file 546: handle. Otherwise, it returns -1. 547: 548: 1.1.1.2 ! root 549: ============< Part 2: Notes on the _beginthread function >============= ! 550: 1.1 root 551: 552: Windows NT handles the allocation of the stack when the _beginthread 1.1.1.2 ! root 553: routine is called. You do not need to pass the address of the thread ! 554: stack to _beginthread. ! 555: ! 556: The following description of the _beginthread function replaces ! 557: that in the Appendix of the Programming Techniques manual. In addition, ! 558: the description provided in APP.WRI contains the correct information. ! 559: ! 560: unsigned long _beginthread (void (*start_address) (void *) , unsigned ! 561: stack_size, void *arglist); ! 562: ! 563: start_address Starting address of thread ! 564: stack_size Stack size for thread ! 565: arglist Argument list for thread ! 566: ! 567: ! 568: =============< Part 3: Notes on the C Language Reference >============== ! 569: The following 16- and 32-bit specific information replaces the ! 570: information on the corresponding pages of the Microsoft C/C++ C ! 571: Language Reference manual. 1.1 root 572: 573: Page 5 1.1.1.2 ! root 574: --------- ! 575: The following keywords are NOT supported for 32-bit targets: ! 576: __far __fortran __huge ! 577: __interrupt __loadds __pascal ! 578: __saveregs __segment __self ! 579: ! 580: The following keywords are supported ONLY for 32-bit compilations: ! 581: __try __except __finally ! 582: ! 583: LIMITED 32-bit support is available for __based. 1.1 root 584: 585: Page 13 1.1.1.2 ! root 586: ------- 1.1 root 587: For 32-bit targets, the values of long double are the same as for double. 588: 589: Page 48 1.1.1.2 ! root 590: -------- 1.1 root 591: The 32-bit compiler ignores the register keyword. 592: 593: Page 56 1.1.1.2 ! root 594: ------- 1.1 root 595: The 32-bit compiler ignores the use of the __near keyword. 596: 597: Page 57 1.1.1.2 ! root 598: ------- ! 599: The 32-bit compiler does not allow the use of the following keywords: ! 600: __far __huge __fortran ! 601: __pascal ! 602: ! 603: The following keyword: ! 604: __based ! 605: specifies that a pointer is a 32-bit offset from a 32-bit base. 1.1 root 606: 607: 608: Page 58 1.1.1.2 ! root 609: ------- 1.1 root 610: The __cdecl calling convention is the default for 32-bit targets. 611: 1.1.1.2 ! root 612: 1.1 root 613: The 32-bit compiler uses the ECX and EDX registers, but Microsoft 614: reserves the right to change the registers and implementation of the 615: __fastcall calling convention between releases of the compiler. 616: 617: Page 59 1.1.1.2 ! root 618: ------- 1.1 root 619: The __segment keyword is not supported by the 32-bit compiler. 620: 621: Page 70 1.1.1.2 ! root 622: -------- ! 623: The default packing size for 32-bit targets is 4. 1.1 root 624: 625: Page 71 1.1.1.2 ! root 626: ------- 1.1 root 627: Bit fields default to size long for the 32-bit compiler. 628: 629: Page 76 1.1.1.2 ! root 630: ------- 1.1 root 631: For 32-bit targets, size_t is unsigned long and the __huge keyword is 632: not required. 633: 634: Page 80 1.1.1.2 ! root 635: ------- ! 636: The following are not supported by the 32-bit compiler: ! 637: __segment type built-in function __segname 1.1 root 638: 639: Page 82 1.1.1.2 ! root 640: ------- 1.1 root 641: Pointers based on pointers are the only form of the __based keyword 642: valid in 32-bit compilations. In such compilations, they are 32-bit 643: displacements from a 32-bit base. 644: 645: Page 84 1.1.1.2 ! root 646: ------- 1.1 root 647: Pointers based on __self are not available for 32-bit targets. 648: 649: Page 95 1.1.1.2 ! root 650: ------- 1.1 root 651: On 32-bit computers, sizeof is unsigned long. 652: 653: Page 100 1.1.1.2 ! root 654: -------- 1.1 root 655: The 32-bit compiler maps long double to type double. 656: 657: Page 121 1.1.1.2 ! root 658: -------- 1.1 root 659: The base operator is not supported for 32-bit targets. 660: 661: Page 169 1.1.1.2 ! root 662: -------- ! 663: The following keywords are not supported by the 32-bit ! 664: compiler: ! 665: __near __far 1.1 root 666: 667: Page 170 1.1.1.2 ! root 668: -------- ! 669: The following keywords are not supported for 32-bit targets: ! 670: __fortran __pascal 1.1 root 671: 672: Page 175 1.1.1.2 ! root 673: -------- ! 674: The __interrupt keyword is not supported in 32-bit targets. ( ! 675: See Help for more information on writing interrupt functions.) ! 676: ! 677: The __interrupt keyword is used with 16-bit functions, to ! 678: specify that the function is an interrupt handler. ! 679: The compiler generates appropriate entry and 1.1 root 680: exit sequences for the handling function, including saving and 681: restoring all registers and executing an IRET instruction to return. 682: 1.1.1.2 ! root 683: Use the following form to specify an interrupt function: 1.1 root 684: __interrupt declarator 1.1.1.2 ! root 685: (The declarator is the name of the function to be called. 1.1 root 686: 1.1.1.2 ! root 687: An interrupt function must be __far. ! 688: If you are compiling with the small (default) or compact ! 689: memory model, you must explicitly declare the function with ! 690: the __far attribute. ! 691: An interrupt function cannot be declared as an 1.1 root 692: inline function. 693: 1.1.1.2 ! root 694: Interrupt functions must observe the C calling convention. ! 695: If you use the /Gc compiler option (forcing the __pascal or __fortran calling 1.1 root 696: convention) or the /Gr compiler option (forcing the __fastcall calling 697: convention), you must explicitly declare your interrupt-handling 698: function with the __cdecl attribute. 699: 1.1.1.2 ! root 700: You cannot declare an interrupt function using the ! 701: __interrupt attribute with the __saveregs attribute or ! 702: with the __fastcall calling convention. 1.1 root 703: 1.1.1.2 ! root 704: The following example of a statement declares a function ! 705: pointer that can be used to point to an interrupt handler: 1.1 root 706: 1.1.1.2 ! root 707: void (__interrupt __far *oldtime) (void); 1.1 root 708: 709: 710: Page 176 1.1.1.2 ! root 711: --------- ! 712: The following keywords are not supported in 32-bit targets: ! 713: __loadds __saveregs 1.1 root 714: 715: Page 199 1.1.1.2 ! root 716: -------- ! 717: The following predefined macros are supported for ! 718: 16-bit targets only: ! 719: ! 720: Identifier Function ! 721: ---------- --------- ! 722: _DLL Code for run-time library as a dynamic-link ! 723: library. Defined when /MD is specified. ! 724: ! 725: _FAST This Fast-compile macro is defined when /f ! 726: is specified (the default). (__FAST replaces ! 727: __QC, which is still supported but is not ! 728: recommended.) Using /Od causes CL to ! 729: compile your program with /f. The /f option ! 730: compiles source files without default ! 731: optimizations. ! 732: ! 733: M_I8086, _M_I8086 This macro is defined for 8086 and 8088 ! 734: processors(default or /G0 option) ! 735: ! 736: M_I286, _M_I286 This macro is defined for 80286 processor ! 737: (/G1 or /G2 option). ! 738: ! 739: M_I86mM, _M_I86mM This macro, which is always defined, ! 740: identifies the memory model. ! 741: "m' can be any of the following models: ! 742: ! 743: Model Defined by ! 744: ----- ---------- ! 745: T (tiny model) \AT ! 746: S (small model) \AS ! 747: C (compact model) \AC ! 748: M (medium model) \AM ! 749: L (large model) \AL ! 750: H (huge model) \AH ! 751: If the huge model is used, both M_I86LM and ! 752: M_I86HM are defined. The default model is small. ! 753: ! 754: _PCODE This macro is defined for sections of code that ! 755: are compiled as pcode. Defined when /Oq is ! 756: enabled. ! 757: ! 758: _QC This macro is supported for compatibility with ! 759: Microsoft C version 6.0. The _FAST macro ! 760: (or /f) is the default for Microsoft C version ! 761: 8.0, and is the recommended alternative. ! 762: ! 763: _WINDLL This macro, the Windows protected-mode ! 764: dynamic-link library, is selected with /GD. ! 765: ! 766: _WINDOWS This macro sets Windows protected mode. It ! 767: is selected with /GA, /Gn, /GW, /Mq, or /GD. 1.1 root 768: 769: 770: The following predefined macro is for 32-bit targets only: 771: 1.1.1.2 ! root 772: Identifier Function ! 773: ---------- -------- ! 774: _M_IX86 Defined as 300 for the 80386 processor ! 775: (/G3 option) and as 400 for the 80486 ! 776: (/G4) processor. 1.1 root 777: 778: Page 210 1.1.1.2 ! root 779: ------------- ! 780: The following pragmas are supported for 16-bit targets only: 1.1 root 781: 1.1.1.2 ! root 782: #pragma check_pointer ([[{ on | off }]]) 1.1 root 783: 1.1.1.2 ! root 784: #pragma code_seg ([[ "segment-name" [[, "segment-class"]]) ! 785: ! 786: #pragma data_seg ([[ "segment-name"[[, "segment-class"]]) ! 787: ] ! 788: #pragma native_caller ([[ { on | off } ]]) ! 789: ! 790: ! 791: Use the _alloctext pragma: ! 792: ! 793: #pragma alloc_text (textsegment, function1, ...) ! 794: ! 795: to name the location segment of specified function definitions in 32-bit targets. This must occur between a function declarator and the function definition for the named functions. ! 796: ! 797: (The recommended technique for functions in 16-bit targets is to use _based to specify the function location. _based is not supported in 32-bit targets.) 1.1 root 798: 799: 800: 801: Page 211 1.1.1.2 ! root 802: --------- ! 803: #pragma intrinsic (function1 [[, function2, ...]]) 1.1 root 804: 1.1.1.2 ! root 805: This pragama sets calls to the specified functions to intrinsic (a library function known to the compiler). ! 806: The /Oi option can be also be used to make intrinsic the default for ! 807: functions that have intrinsic forms. You can use the function pragma ! 808: to override /Oi for specified functions. This pragma cannot be used ! 809: with/f. This pragma takes effect at the first function defined after the pragma is defined. 1.1 root 810: 811: 1.1.1.2 ! root 812: ! 813: The following functions have intrinsic forms for BOTH 16-bit and 32-bit compilers: ! 814: ! 815: _alloca _disable _enable ! 816: _inp _inpw _lrotl ! 817: _lrotr _outp _outpw ! 818: _rotl _rotr _strset ! 819: abs acos asin ! 820: atan atan2 ceil ! 821: cos cosh exp ! 822: fabs floor fmod ! 823: labs log log10 ! 824: memcmp memcpy memset ! 825: pow sin sinh ! 826: sqrt strcat strcmp ! 827: strcpy strlen tan ! 828: tanh ! 829: ! 830: The following functions have intrinsic forms ! 831: for the 16-bit compiler only: ! 832: ! 833: _acosl _asinl _atanl ! 834: _atan2l _ceill _cosl ! 835: _coshl _expl _floorl ! 836: _fmodl _logl _log10l ! 837: _powl _sinl _sinhl ! 838: _sqrtl _tanl _tanhl ! 839: _fmemcmp _fmemcpy _fmemset ! 840: _fstrcat _fstrcmp _fstrcpy ! 841: _fstrlen _fstrsetu ! 842: 1.1 root 843: 844: Page 212 1.1.1.2 ! root 845: -------- ! 846: ! 847: #pragma optimize ("[[optimization-option-list]]", {off | on }) ! 848: ! 849: This pragma specifies optimizations to be performed. It must appear ! 850: outside of a function. The optimization list for 32-bit targets ! 851: may be zero or more of the following letters: ! 852: a g n p t w ! 853: ! 854: The letters correspond to the /O compilation options. ! 855: The pragma takes effect at the first function defined after the ! 856: pragma is seen. ! 857: ! 858: ! 859: #pragma pack ([[{1 | 2 | 4 | 8 | 16 }]]) ! 860: ! 861: This pragma specifies packing alignment for structure types. ! 862: you can use the /Zp option to specify the same packing ! 863: for all structures in a module. The default is 2 for 16- bit ! 864: targets and 4 for 32-bit targets. 1.1 root 865: 866: When you give the /Zpn option, where n is 1, 2, 4, 8, or 16, each 867: structure member after the first is stored on n-byte boundaries, 1.1.1.2 ! root 868: depending on the number you choose. If you use the /Zp option ! 869: without an argument, structure members are packed on one-byte ! 870: boundaries. No space is allowed between /Zp and its argument. ! 871: This pragma takes effect at the first function defined after the ! 872: pragma is seen. 1.1 root 873: 874: On 32-bit targets, the packing can be set at 8 or 16 as well as 1, 2, 875: or 4 as given for 16-bit targets. 876: 877: Page 240 1.1.1.2 ! root 878: -------- ! 879: Long double and double are the same for the 32-bit compiler. ! 880: ! 881: ===================< Part 4: Notes on Linker Options >================= 1.1 root 882: 1.1.1.2 ! root 883: In Chapter 1, "Building Applications and DLLS" of the Programming ! 884: Techniques manual and Chapter 5 "Linker" of the Tools manual, the ! 885: NOTMAPPED parameter for the LINK and COFF /DEBUG: option is ! 886: incorrectly given as "NOMAPPED." 1.1 root 887: 888: The correct syntax for the /DEBUG option is: 889: 890: /DEBUG:[{MAPPED|NOTMAPPED},]{NONE|MINIMAL|PARTIAL|FULL} 891: 892: 1.1.1.2 ! root 893: ====<Part 5: Notes on Building Multithreaded Applications and DLLs >==== 1.1 root 894: 895: 1.1.1.2 ! root 896: Add the following information should Chapter 1 "Building Applications and DLLS" of the Programming Techniques manual. ! 897: 1.1 root 898: 899: Building Multithreaded Programs 900: ------------------------------- 901: Building a multithreaded program is only slightly different from 902: building a single-threaded program. Two additional parameters must be 903: specified: 904: 905: 1. Compile with the /D_MT option. 906: 907: 2. Link with LIBCMT.LIB (multithread C run-time library) instead 908: of LIBC.LIB (single-thread C run-time library). 909: 910: Using the C Run-Time DLL 1.1.1.2 ! root 911: ------------------------- 1.1 root 912: You can reduce the size of an executable file by using the C run-time 1.1.1.2 ! root 913: DLL instead of linking the C Run-Time libraries to a ! 914: program. The C Run-Time DLL supports both single and multithreaded ! 915: programs. ! 916: Using the C Run-Time DLL may require additional set up time to ! 917: initialize the DLL along with the time required for normal DLL ! 918: calling. ! 919: ! 920: To use the C Run-Time DLL (CRTDLL.DLL) with a single-threaded ! 921: or multithreaded program, link with CRTDLL.LIB. ! 922: Do not link with either LIBC.LIB or LIBCMT.LIB) 1.1 root 923: 924: 1.1.1.2 ! root 925: ========< Part 6: Notes on The WinDebug Graphical Debugger >========= 1.1 root 926: 927: 928: Expression Evaluator 929: -------------------- 930: 931: The expression evaluator in this release of WinDebug cannot 1.1.1.2 ! root 932: evaluate a type-cast followed by the following characters: *, &, ! 933: +, and | unless the casted expression is enclosed in parentheses. 1.1 root 934: 1.1.1.2 ! root 935: For example: ! 936: (char *) &i 1.1 root 937: 938: would become 939: 1.1.1.2 ! root 940: (char *) (&i) 1.1 root 941: 942: 1.1.1.2 ! root 943: Editing the Command Window ! 944: -------------------------- ! 945: You can use editing keys similar to those available from the ! 946: NT command prompt in the Command window. ! 947: Use the up and down-arrow keys to retrieve previously-entered ! 948: WinDebug commands. ! 949: Use the Backspace, Delete, Insert, and You can edit the ! 950: current command line with the Backspace, Delete, Insert, ! 951: and left and right arrow keys. 1.1 root 952: 953: 1.1.1.2 ! root 954: Process Specifiers ! 955: ------------------ ! 956: ! 957: The process-specifier syntax should be as follows: 1.1 root 958: 1.1.1.2 ! root 959: Symbol Description ! 960: ------ ----------- ! 961: |. The current process. 1.1 root 962: 1.1.1.2 ! root 963: |<number> The process number. 1.1 root 964: 1.1.1.2 ! root 965: |* All processes. 1.1 root 966: 967: 1.1.1.2 ! root 968: Set Breakpoint (BP) ! 969: ------------------- 1.1 root 970: 1.1.1.2 ! root 971: The Set Breakpoint (BP) options /M and /H are not available in this ! 972: release. 1.1 root 973: 1.1.1.2 ! root 974: With the /C option, you must enclose the semicolon-separated list ! 975: of multiple commands in quotation marks. 1.1 root 976: 977: 1.1.1.2 ! root 978: Enter ANSI Characters (EA) ! 979: -------------------------- 1.1 root 980: 1.1.1.2 ! root 981: If you want to include space (" ") characters, you must enclose ! 982: the character string in quotation marks (" or '). ! 983: If you enclose the string in double quotation marks, WinDebug will ! 984: automatically null-terminate the string. Single quotation marks (') ! 985: will not add a null character. 1.1 root 986: 1.1.1.2 ! root 987: Display and Entry Commands (D* and E*) ! 988: -------------------------------------- 1.1 root 989: 1.1.1.2 ! root 990: The display and entry commands (such as DD and EB) will use the ! 991: current default radix. You can enter numbers with a different radix ! 992: by using the standard C/C++ radix overrides (such as 0x). 1.1 root 993: 994: 1.1.1.2 ! root 995: Find and Search (F and S) ! 996: ------------------------- 1.1 root 997: 1.1.1.2 ! root 998: These commands are unavailable in this release. 1.1 root 999: 1000: 1.1.1.2 ! root 1001: Display Stack Backtrace (K) ! 1002: --------------------------- 1.1 root 1003: 1.1.1.2 ! root 1004: This command can be used when handling an exception. 1.1 root 1005: 1006: 1.1.1.2 ! root 1007: Set Exceptions (SX*) ! 1008: -------------------- 1.1 root 1009: 1.1.1.2 ! root 1010: The set exception commands can be followed by /C2<commandlist>, ! 1011: where <commandlist> is a quote-enclosed, semicolon-separated ! 1012: list of WinDebug commands to execute after an exception is handled. ! 1013: The SXE command can also be followed by /C<commandlist>, where ! 1014: <commandlist> specifies commands to execute before an exception ! 1015: riggers the debugger. 1.1 root 1016: 1017: 1.1.1.2 ! root 1018: Remote Debugging ! 1019: ---------------- ! 1020: ! 1021: To setup remote debugging: ! 1022: 1. Connect the com ports with an NT standard debug cable. ! 1023: 2. Run "DBTarget.exe tlser.dll com?" on the target machine where ? is the port ! 1024: number. It will pop up a little window in the left top corner of the screen. ! 1025: 3. Run Windbg on your windbg machine as if you were to do local debugging. Use ! 1026: Options+Debug menu to load the remote transport dll "tlser.dll". ! 1027: 4. Enter the com port if not using the defult (com1). Then start the debuggee. ! 1028: ! 1029: It may take a few seconds, but the sybols loading message will appear on the ! 1030: debugger and the app will begin to run on the other machine. You can then ! 1031: debug the application as though you were on the local machine. ! 1032: ! 1033: Notes: ! 1034: ! 1035: 1. You need the binary and the source files on the Windbg machine. ! 1036: The debuggee binary is also needed on the target machine. The absolute ! 1037: path for the location of the src/binary files should be the same on both ! 1038: machines. ! 1039: ! 1040: 2. For convenience, you can save two workspaces for your debuggee. One that uses ! 1041: the local trasport layer, and another one that points to the remote transport ! 1042: tlser.dll. Then you can easily switch between the local and the remote ! 1043: debugging by loading the corresponding workspace for your debuggee. ! 1044: ! 1045: 3. To specify a non-default baudrate, one may specify "com?:####" in place of ! 1046: "com?", where #### is a valid baudrate such as 9600, 2400, etc. ! 1047: ! 1048: ! 1049: ========< Part 7: Post-Mortem Debugging >========= ! 1050: ! 1051: ! 1052: Windows NT allows you to specify a debugger to execute in the event of an ! 1053: application error. Through this mechanism, you can actually connect the ! 1054: debugger to the process which failed. The following is an example of how ! 1055: this is achieved with NTSD. You could alternatively specify any debugger ! 1056: which has the ability to take process ids from the command line. ! 1057: ! 1058: NOTE: Windbg does not currently support this mechanism. ! 1059: ! 1060: When an unhandled exception occurs, an AE popup is displayed. ! 1061: ! 1062: This popup will always provide an OK button. Selecting OK will ! 1063: terminate the application. ! 1064: ! 1065: In some cases, the popup will also provide a CANCEL button. Selecting ! 1066: this button will invoke the debugger of your choice. The way you choose ! 1067: your debugger is adding an AeDebug section in your win.ini file. ! 1068: ! 1069: [AeDebug] ! 1070: Debugger = ntsd -d -p %d -e %d -g ! 1071: ! 1072: The Debugger = line is a sprintf format string. It is sprintf'd into a ! 1073: command line where two parameters are passed. The first parameter is ! 1074: the process id of the process that encountered the exception. The ! 1075: second parameter is the value of an event handle inherited by the ! 1076: debugger. The debugger should signal this event once it has reached an ! 1077: idle state and is ready to see the exception from the application (this ! 1078: usually means that the debugger has fielded the first breakpoint ! 1079: exception from the process).
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.