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 | 1c8d056c93bd79b5356acb7646a97a97deb710b5 (patch) | |
tree | a394386b9a80c6ea925e7fbd98fc0072e918e475 /win/tclWinInit.c | |
parent | c0108dceb13e2079a9a4b662d98fa27a8c5d13c0 (diff) | |
download | tcl-1c8d056c93bd79b5356acb7646a97a97deb710b5.zip tcl-1c8d056c93bd79b5356acb7646a97a97deb710b5.tar.gz tcl-1c8d056c93bd79b5356acb7646a97a97deb710b5.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); |