diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-02-18 10:56:12 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-02-18 10:56:12 (GMT) |
commit | 340a361ed19847861c47b986eb8d522c1a6cc700 (patch) | |
tree | 6b6bdfeebd073f7857ec4893ca9bb3a9b008b3aa /win/tclWinInit.c | |
parent | e810c9099a64e6af0d3aad22f673de6edcb68cd7 (diff) | |
parent | ecc126bc275141ebdaa83e74dd87645d1680d01c (diff) | |
download | tcl-340a361ed19847861c47b986eb8d522c1a6cc700.zip tcl-340a361ed19847861c47b986eb8d522c1a6cc700.tar.gz tcl-340a361ed19847861c47b986eb8d522c1a6cc700.tar.bz2 |
merge novem
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r-- | win/tclWinInit.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c index f552e2c..2c21d38 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -486,13 +486,10 @@ TclpSetInitialEncodings(void) Tcl_DStringFree(&encodingName); } -void -TclpSetInterfaces(void) +void TclWinSetInterfaces( + int dummy) /* Not used. */ { - int useWide; - - useWide = (TclWinGetPlatformId() != VER_PLATFORM_WIN32_WINDOWS); - TclWinSetInterfaces(useWide); + TclpSetInterfaces(); } const char * @@ -533,7 +530,8 @@ TclpSetVariables( SYSTEM_INFO info; OemId oemId; } sys; - OSVERSIONINFOA osInfo; + static OSVERSIONINFOW osInfo; + static int osInfoInitialized = 0; Tcl_DString ds; TCHAR szUserName[UNLEN+1]; DWORD cchUserNameLen = UNLEN; @@ -541,9 +539,19 @@ TclpSetVariables( Tcl_SetVar2Ex(interp, "tclDefaultLibrary", NULL, TclGetProcessGlobalValue(&defaultLibraryDir), TCL_GLOBAL_ONLY); - osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA); - GetVersionExA(&osInfo); - + if (!osInfoInitialized) { + HANDLE handle = LoadLibraryW(L"NTDLL"); + int(__stdcall *getversion)(void *) = + (int(__stdcall *)(void *)) GetProcAddress(handle, "RtlGetVersion"); + osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); + if (!getversion || getversion(&osInfo)) { + GetVersionExW(&osInfo); + } + if (handle) { + FreeLibrary(handle); + } + osInfoInitialized = 1; + } GetSystemInfo(&sys.info); /* |