Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e6ae93

Browse files
committed
Moved PyWin_IsWin32s() here.
1 parent 5137ea9 commit 0e6ae93

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

PC/import_nt.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,21 @@
1111
#include <windows.h>
1212
#include "importdl.h"
1313

14-
extern BOOL PyWin_IsWin32s();
14+
/* Return whether this is Win32s, i.e., Win32 API on Win 3.1(1).
15+
This function is exported! */
16+
17+
BOOL PyWin_IsWin32s()
18+
{
19+
static BOOL bIsWin32s = -1; /* flag as "not yet looked" */
20+
21+
if (bIsWin32s == -1) {
22+
OSVERSIONINFO ver;
23+
ver.dwOSVersionInfoSize = sizeof(ver);
24+
GetVersionEx(&ver);
25+
bIsWin32s = ver.dwPlatformId == VER_PLATFORM_WIN32s;
26+
}
27+
return bIsWin32s;
28+
}
1529

1630
FILE *PyWin_FindRegisteredModule( const char *moduleName, struct filedescr **ppFileDesc, char *pathBuf, int pathLen)
1731
{

0 commit comments

Comments
 (0)