MS-DOS - Use of Undocumented APIs

Use of Undocumented APIs

Microsoft also used a variety of tactics in MS-DOS and several of their applications and development tools that, while operating perfectly when running on genuine MS-DOS (and PC DOS), would break when run on another vendor's implementation of DOS. Notable examples of this practice included:

  • Microsoft's QuickPascal released in early 1989 was the first MS product that checked for MS-DOS by modifying the program's Program Segment Prefix using undocumented DOS functions, and then checked whether or not the associated value changed in a fixed position within the DOS data segment (also undocumented). This check also made it into later MS products, including Microsoft QuickC v2.5, Programmer's Workbench and Microsoft C v6.0.
  • The (once infamous) AARD code, a block of code in the Windows 3.1 beta installer. It was XOR encrypted, self-modifying, and deliberately obfuscated, using various undocumented DOS structures and functions to determine whether or not Windows really was running on MS-DOS.
    • Note that the Windows 3.0 beta code only gave a warning that Windows would not operate properly on a "foreign" OS. It did in fact run just fine on DR DOS 6.0.
  • Interrupt routines called by Windows to inform MS-DOS that Windows is starting/exiting, information that MS-DOS retained in an IN_WINDOWS flag, in spite of the fact that MS-DOS and Windows were supposed to be two separate products.

Read more about this topic:  MS-DOS