INFO: Troubleshooting DOS Error 21h Under Win32s

Last reviewed: April 25, 1997
Article ID: Q167300
The information in this article applies to:
  • Microsoft Win32s versions 1.3, 1.3a, 1.3c

SUMMARY

When you start a Win32-based application under Win32s, you encounter the following error:

   DOS Error 21h

There is no further information from the system.

The purpose of this article is to provide you with a list of known reasons for this error under Win32s that have been reported to Microsoft and to suggest a workaround where applicable. Note that Microsoft is not suggesting or indicating that any of the reasons listed below are confirmed problems or bugs in the Win32s product, but we are only publishing customer reports on the DOS Error 21h.

If you are not running the latest Win32s version 1.30c (build 172), it is highly recommended that you upgrade to this build of Win32s. For further information on the Win32s upgrade, search for the PW1118 appnote in the Microsoft Knowledge Base.

MORE INFORMATION

Following are the possible reasons that have been reported to Microsoft for the DOS Error 21h under Win32s.

  1. DOS Error 21h is a generic error produced by the Win32s loader when it cannot find an associated DLL, EXE, or other file that the Win32-based application needs while loading. For example, when you start a Win32- based application, Win32s searches for the necessary Win32s files in the Windows system and the Win32s directories, for any DLLs that the Win32- based application is linking to, and any other files that the application needs to load. If the Win32s loader does not find one of these files, it displays the DOS error 21h message and terminates loading the application. A commonly encountered problem is a missing or an incorrect version of an ODBC DLL that a Win32-based application requires to run. Ensuring that you have all the necessary files on your Win32s machine is the first step in avoiding this error.

  2. If you run a Win32-based application on Win32s version 1.30 (build 166) or earlier on a machine with greater than 32 Megabytes of physical memory (RAM), then Win32s will generate the DOS error 21h. The error occurs because Win32s version 1.30 and earlier do not support a physical memory configuration of greater than or equal to 32 Megabytes. The workaround for this scenario is to limit the size of virtual memory to less than 256 MB. This can be done by reducing the PageOverCommit value in the [386enh] section in the System.ini file. Note that valid settings for this flag are between 1 and 20. Setting PageOverCommit to a value larger than 4 results in less efficient usage of resources and slower execution, but it allows you to run large applications that are otherwise unable to run. Setting PageOverCommit to a value less than 4 does not allow some applications to run if their virtual memory footprint is too high. The following expression should always be true for 1.30 to work:

          (PageOverCommit + 1) * RAM < 256M
    

    NOTE: This problem was fixed in Win32s version 1.30a (build 166) and does not occur in the latest Win32s version 1.30c (build 172).

  3. If you are running Win32s version 1.30 (build 159) or earlier and if your Windows computer has a UMC processor installed, the DOS Error 21h occurs when you run a Win32-based application. Computers with UMC processors are quite common in Canada.

    NOTE: This problem was fixed in Win32s version 1.30a (build 166) and does not occur in the latest Win32s version 1.30c (build 172).

  4. The DOS error 21h also occurs if you have a mix of debug and retail Win32s and OLE files in your Windows 3.1 system directory as a result of upgrading your previous installation of Win32s. Note that the Win32s Setup.exe program is designed to run only under the retail version of Win32s. If you have switched to the debug version of Win32s in the past by using the Switch.bat file in the Win32s\Bin directory and then tried to run the Setup program, Win32s will not be installed properly on your computer (some of the Win32s and OLE files will not be replaced correctly). In this case, the DOS Error 21h is followed by the message "One of System Components is out of date".

    NOTE: Do not use the Switch.bat program to upgrade a previous installation of Win32s.

  5. DOS Error 21h could appear if the Ole32.dll installed on your Win32s machine is an older version, not the one in Win32s version 1.30c. (Note that the OLE version for Win32s 1.30c is 2.3.130.168.). In this case, the error message appears and your application either starts and continues to run, or the application does not start at all.

For more information on items 3, 4, and 5 above, please refer to the following Knowledge Base article:

   ARTICLE ID: Q159263
   TITLE: PRB: "One of your System Components is out of date" Error

  • DOS Error 21h might be due to a bug in Win32s 1.30c that is relevant to Novell networks. If you have a network installation of Windows on a Novell network, and if the Windows system directory is mapped to the root directory of any drive on the Novell network, the DOS error will appear each time you start a Win32s application. However, the application will start and continue to run. The solution is not to map the Windows system directory to the root directory of any drive. Rather, map it to a subdirectory on the drive. For example, if you mapped the Windows system directory to W:\ drive, the workaround is to map the Windows system directory to Z:\System directory on your Novell network.

  • If your Win32-based application is linking to a DLL file that has a long filename (that is not in the 8.3 DOS file format), then Win32s would display the DOS Error 21h message. This is because long filenames are not supported under Windows 3.1.

  • When PC-Anywhere software is installed and/or running on certain Windows 3.1 machines, it has been reported that Win32s displays the DOS Error 21h message. Remove the offending software and see if the problem goes away.

  • If F-PROT Professional virus protection software is running on certain Windows 3.1 machines, it has been reported that Win32s displays the DOS Error 21h message. The presence of F-PROT software is indicated by the following line in the System.ini file:

          device=C:\F-PROT\F-PROTW.386
    

    To work around this, comment the above line in System.ini. Also, F-PROT Professional version 2.19a is reported to be compatible with Win32s, so upgrading to this version should resolve the DOS error 21h message.


  • Additional query words: win32s error21
    Keywords : kberrmsg kbprg kbtshoot w32s w32sSetup kbfaq
    Version : 1.3 1.3a 1.3c
    Platform : WINDOWS
    Issue type : kbinfo


    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: April 25, 1997
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.