diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-05-03 15:05:41 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-05-03 15:05:41 (GMT) |
commit | 3d65f9905d4ad6e2b7700d7da4e5a1598902b53e (patch) | |
tree | a394386b9a80c6ea925e7fbd98fc0072e918e475 /win/tclWinInit.c | |
parent | ed853e1ffb7933562c641af3d69686df27520a8f (diff) | |
download | tcl-3d65f9905d4ad6e2b7700d7da4e5a1598902b53e.zip tcl-3d65f9905d4ad6e2b7700d7da4e5a1598902b53e.tar.gz tcl-3d65f9905d4ad6e2b7700d7da4e5a1598902b53e.tar.bz2 |
Use GetModuleHandle() in stead of LoadLibrary() when the handle is needed for an already loaded dll.
Fix filesystem-1.52 (only works correctly on UNIX)
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r-- | win/tclWinInit.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 4e860b2..1ba7a31 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -569,16 +569,13 @@ TclpSetVariables( TclGetProcessGlobalValue(&defaultLibraryDir), TCL_GLOBAL_ONLY); if (!osInfoInitialized) { - HANDLE handle = LoadLibraryW(L"NTDLL"); + HMODULE handle = GetModuleHandle(TEXT("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); |