Article ID: 125014
Article Last Modified on 4/15/2004
Win32s Release # Build #
---------------- -------
1.1 1.1.88
1.1a 1.1.89
1.15 1.15.103
1.15a 1.15.111
1.2 1.2.123
1.25 1.2.141
1.25a 1.2.142
1.30 1.2.159
1.30a 1.2.166
1.30c 1.2.172
OLE versions shipped with corresponding Win32s versions:
Release # OLE32 OLE16 --------- ----- ----- 1.2 2.02 2.02 1.25 2.03 2.03 1.25a 2.03a 2.03a 1.30 2.03b 2.03a 1.30a 2.03c 2.03b 1.30c 2.03d 2.03b
// Example of a 16-bit application that indicates whether Win32s is
// installed, and the version number if Win32s is loaded and VxD is
// functional.
//
// NOTE: There is no header file in the SDK which has a definition
// for the WIN32SINFO structure. Include the following structure
// definition into the source code.
typedef struct {
BYTE bMajor;
BYTE bMinor;
WORD wBuildNumber;
BOOL fDebug;
} WIN32SINFO, FAR * LPWIN32SINFO;
BOOL FAR PASCAL IsWin32sLoaded(LPSTR szVersion)
{
BOOL fWin32sLoaded = FALSE;
FARPROC pfnInfo;
HANDLE hWin32sys;
WIN32SINFO Info;
hWin32sys = LoadLibrary("W32SYS.DLL");
if (hWin32sys > HINSTANCE_ERROR) {
pfnInfo = GetProcAddress(hWin32sys, "GETWIN32SINFO");
if (pfnInfo) {
// Win32s version 1.1 is installed
if (!(*pfnInfo)((LPWIN32SINFO) &Info)) {
fWin32sLoaded = TRUE;
wsprintf(szVersion, "%d.%d.%d.0",
Info.bMajor, Info.bMinor, Info.wBuildNumber);
} else
fWin32sLoaded = FALSE; // Win32s VxD not loaded.
} else {
// Win32s version 1.0 is installed.
fWin32sLoaded = TRUE;
lstrcpy( szVersion, "1.0.0.0" );
}
FreeLibrary( hWin32sys );
} else // Win32s not installed.
fWin32sLoaded = FALSE;
return fWin32sLoaded;
}
// Example of a 32-bit code that determines the operating system installed
// and the version number on all platforms: Windows NT, Windows 95, Win32s.
typedef BOOL (*LPFNGETVERSIONEX) (LPOSVERSIONINFO);
BOOL IsWin32sLoaded(char *szVersion)
{
BOOL fWin32sLoaded = FALSE;
DWORD dwGetVer;
HMODULE hKernel32;
OSVERSIONINFO ver;
LPFNGETVERSIONEX lpfnGetVersionEx;
// First, check if Win32s is installed
dwGetVer = GetVersion();
if (!(dwGetVer & 0x80000000))
{
// Windows NT is loaded
// Note, GetVersion will also return version number on Windows NT
return;
}
else if (LOBYTE(LOWORD(dwVersion))< 4)
{
// Win32s is loaded
fWin32sLoaded = TRUE;
}
else {
// Windows 95 is loaded
// Note, GetVersion will also return version number on Windows 95
return;
}
// Now, let's find the version number of Win32s
hKernel32 = GetModuleHandle("Kernel32");
if (hKernel32)
{
lpfnGetVersionEx = (LPFNGETVERSIONEX)GetProcAddress(hKernel32,
"GetVersionExA");
if (lpfnGetVersionEx)
{
// Win32s version 1.15 or later is installed
ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (!(*lpfnGetVersionEx)((LPOSVERSIONINFO) &ver))
DisplayError("GetVersionEx");
else
wsprintf(szVersion, "%d.%d.%d - %s", ver.dwMajorVersion,
ver.dwMinorVersion,
ver.dwBuildNumber, PlatformName(ver.dwPlatformId));
}
else
{
// This failure could mean several things
// 1. On an NT system, it indicates NT version 3.1 because GetVersionEx()
// is only implemented on NT 3.5.
// 2. On Windows 3.1 system, it means either Win32s version 1.1 or 1.0 is
// installed. You can distinguish between 1.1 and 1.0 in two ways:
// a. Get version info from WIN32S16.DLL like File Manager on NT does.
// b. Thunk to 16-bit side and call GetWin32sInfo.
}
}
return (fWin32sLoaded);
}
NOTE: In general, 32-bit applications that use Win32s should always ship
with the latest version of Win32s. Therefore the detection code above can
be greatly simplified if determination of previous versions of Win32s is
not needed.
Additional query words: 1.30 1.30a 1.30c win32s w32s win32 wfw
Keywords: kbenv KB125014