Microsoft KB Archive/101893: Difference between revisions

From BetaArchive Wiki
m (1 revision imported: importing part 2)
m (Text replacement - """ to """)
Line 22: Line 22:
== SUMMARY ==
== 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."
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."


<br />
<br />
Line 68: Line 68:
dwFlags = GetWinFlags();
dwFlags = GetWinFlags();


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


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


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


len = sprintf(szBuf, &quot;%s WLO&quot;,
len = sprintf(szBuf, "%s WLO",
     (dwFlags &amp; WF_WLO) ? &quot;using&quot; : &quot;not using&quot;);
     (dwFlags &amp; WF_WLO) ? "using" : "not using");
TextOut(hdc, 10, 60, szBuf, len); </pre>
TextOut(hdc, 10, 60, szBuf, len); </pre>
Additional query words: 3.10 3.50
Additional query words: 3.10 3.50

Revision as of 08:22, 20 July 2020

Determining Whether a WOW App is Running in Enhanced Mode

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 :
Issue type :
Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch kbWin32SDKNT310 kbWin32SDKNT350


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