DOCERR: Some CRT BIOS Functions Are Not Windows Compatible

Last reviewed: July 22, 1997
Article ID: Q124192
1.00 1.50 1.51 WINDOWS kbprg kbdocerr

The information in this article applies to:

   The C Run-time (CRT) included with:
     - Microsoft Visual C++ for Windows, versions 1.0, 1.5, and 1.51

SUMMARY

The documentation and online help incorrectly list the following C run-time functions as Windows and DLL compatible:

   bios_disk
   bios_keybrd
   bios_printer
   bios_serialcom.

If any of these functions are called from a Windows-based application or DLL, the error "L2029: unresolved external" occurs at link time.

The most appropriate substitute for _bios_disk() depends on what you are trying to do. Refer to the Windows API DOS3Call() and books such as "Advanced MS-DOS Programming" by Ray Duncan.

MORE INFORMATION

The error occurs because the prototypes for these functions in BIOS.H are contained in #ifndef _WINDOWS blocks. This exclusion is correct because these functions are not Windows or DLL compatible.

It is not possible to support BIOS-level disk access while Windows is running, as there can be conflicts with device drivers working at this level. Page 311 of the Windows SDK "Guide to Programming" states, "Do not use the C run-time BIOS interface routines with Windows." The manual goes on to say that generally the interrupt 21h routines intdos(), intdosx(), and some of the _dos functions such as _dos_getdrive() can be used, but only with caution.


Additional reference words: 1.00 1.50 docerr
KBCategory: kbprg kbdocerr
KBSubcategory: OLDocIss CRTIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.