summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/makefile.vc2
-rw-r--r--win/tclWinInit.c18
2 files changed, 15 insertions, 5 deletions
diff --git a/win/makefile.vc b/win/makefile.vc
index 19b5614..8c65bd0 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -989,7 +989,7 @@ $(TMP_DIR)\tclOOStubLib.obj: $(GENERICDIR)\tclOOStubLib.c
$(TMP_DIR)\tclsh.exe.manifest: $(WINDIR)\tclsh.exe.manifest.in
@nmakehlp -s << $** >$@
@MACHINE@ $(MACHINE:IX86=X86)
-@TCL_WIN_VERSION@ $(TCL_DOTVERSION).0.0
+@TCL_WIN_VERSION@ $(DOTVERSION).0.0
<<
#---------------------------------------------------------------------
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 7b027c5..b3f8f41 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -530,7 +530,8 @@ TclpSetVariables(
SYSTEM_INFO info;
OemId oemId;
} sys;
- OSVERSIONINFOW osInfo;
+ static OSVERSIONINFOW osInfo;
+ static int osInfoInitialized = 0;
Tcl_DString ds;
TCHAR szUserName[UNLEN+1];
DWORD cchUserNameLen = UNLEN;
@@ -538,9 +539,18 @@ TclpSetVariables(
Tcl_SetVar2Ex(interp, "tclDefaultLibrary", NULL,
TclGetProcessGlobalValue(&defaultLibraryDir), TCL_GLOBAL_ONLY);
- osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
- GetVersionExW(&osInfo);
-
+ if (!osInfoInitialized) {
+ HANDLE handle = LoadLibraryW(L"NTDLL");
+ int(*getversion)(void *) = (int(*)(void *))GetProcAddress(handle, "RtlGetVersion");
+ osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
+ if (!getversion || getversion(&osInfo)) {
+ GetVersionExW(&osInfo);
+ }
+ if (handle) {
+ FreeLibrary(handle);
+ }
+ osInfoInitialized = 1;
+ }
GetSystemInfo(&sys.info);
/*