GetWinFlags

3.0

  DWORD GetWinFlags(void)    

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

Parameters

This function has no parameters.

Return Value

The return value specifies the current system and memory configuration if the function is successful.

Comments

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

Value Meaning

WF_80x87 System contains an Intel math coprocessor.
WF_CPU086 System CPU is an 8086. Windows 3.1 will not return this flag.
WF_CPU186 System CPU is an 80186. Windows 3.1 will not return this flag.
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.
WF_WLO Identifies an application running Windows-emulation libraries in a non-Windows operating system.

Example

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

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);