Determining Whether a WOW App is Running in Enhanced Mode

ID: Q101893


The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) for Windows NT, versions 3.1, 3.5


SUMMARY

Windows NT and Windows NT Advanced Server will run a Windows 3.1 application in 386 enhanced mode on X86 machines (standard mode on RISC machines). The proper way to determine whether a Windows 3.1 application is in enhanced mode is to call GetWinFlags() and do a bit test for WF_ENHANCED. This method is described on pages 486-487 in the Windows 3.1 Software Development Kit (SDK) "Programmer's Reference, Volume 2: Functions."


MORE INFORMATION

Calling Interrupt 2F with AX=1600h

This method, which is described in the Windows 3.1 Device Development Kit (DDK) checks to see whether a 386 memory manager is running. If Windows 3.1 is running in enhanced mode, it returns AL = 3 and 2 for standard mode. Windows NT's WOW (Windows 16 on Windows NT) returns AL=0, which means enhanced mode Windows is not running.

DWORD GetWinFlags()

The GetWinFlags() function retrieves the current Windows system and memory configuration.

The configuration returned by GetWinFlags() can be a combination of the following values:

   Value          Meaning
   ----------------------------------------------------------------
   WF_80x87       System contains an Intel math coprocessor.
   WF_CPU286      System CPU is an 80286.
   WF_CPU386      System CPU is an 80386.
   WF_CPU486      System CPU is an i486.
   WF_ENHANCED    Windows is running in 386-enhanced mode. The WF_PMODE
                  flag is always set when WF_ENHANCED is set.
   WF_PAGING      Windows is running on a system with paged memory.
   WF_PMODE       Windows is running in protected mode. In Windows 3.1,
                  this flag is always set.
   WF_STANDARD    Windows is running in standard mode. The WF_PMODE
                  flag is always set when WF_STANDARD is set.
   WF_WIN286      Same as WF_STANDARD.
   WF_WIN386      Same as WF_ENHANCED. 
NOTE: When running in Windows NT, WF_WINNT will also be returned to tell the 16-bit Windows-based application that you are running in Windows NT.

Example:

The following example uses the GetWinFlags() function to display information about the current Windows system configuration:

Sample Code


int len;
char szBuf[80];
DWORD dwFlags;

dwFlags = GetWinFlags();

len = sprintf(szBuf, "system %s a coprocessor",
    (dwFlags & WF_80x87) ? "contains" : "does not contain");
TextOut(hdc, 10, 15, szBuf, len);

len = sprintf(szBuf, "processor is an %s",
    (dwFlags & WF_CPU286) ? "80286" :
    (dwFlags & WF_CPU386) ? "80386" :
    (dwFlags & WF_CPU486) ? "i486" : "unknown");
TextOut(hdc, 10, 30, szBuf, len);

len = sprintf(szBuf, "running in %s mode",
    (dwFlags & WF_ENHANCED) ? "enhanced" : "standard");
TextOut(hdc, 10, 45, szBuf, len);

len = sprintf(szBuf, "%s WLO",
    (dwFlags & WF_WLO) ? "using" : "not using");
TextOut(hdc, 10, 60, szBuf, len); 

Additional query words: 3.10 3.50

Keywords :
Version : NT:3.1,3.5
Platform : NT
Issue type :


Last Reviewed: January 10, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.