summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-05-03 15:28:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-05-03 15:28:37 (GMT)
commitd2f034e206d0c76548eb7ddc4f23ed18bc6ce26c (patch)
tree02ae316b20d098b42b3de470a0d5a895b3ab2ad5
parent126d43773ca468803c238c2deb4c947f80f4f68d (diff)
parentd329be0030f6800be40dc3606491b8880814d336 (diff)
downloadtcl-d2f034e206d0c76548eb7ddc4f23ed18bc6ce26c.zip
tcl-d2f034e206d0c76548eb7ddc4f23ed18bc6ce26c.tar.gz
tcl-d2f034e206d0c76548eb7ddc4f23ed18bc6ce26c.tar.bz2
merge core-8-6-branch
-rw-r--r--tests/fileSystem.test2
-rw-r--r--win/tclWinInit.c20
-rw-r--r--win/tclWinInt.h2
-rw-r--r--win/tclWinPipe.c4
-rw-r--r--win/tclWinReg.c10
5 files changed, 14 insertions, 24 deletions
diff --git a/tests/fileSystem.test b/tests/fileSystem.test
index 4513fcb..4c90376 100644
--- a/tests/fileSystem.test
+++ b/tests/fileSystem.test
@@ -367,7 +367,7 @@ test filesystem-1.51 {file normalisation .. beyond root (Bug 1379287)} {
test filesystem-1.51.1 {file normalisation .. beyond root (Bug 1379287)} {
testPathEqual [file norm /../../] [file norm /]
} ok
-test filesystem-1.52 {bug f9f390d0fa: file join where strep is not canonical} -body {
+test filesystem-1.52 {bug f9f390d0fa: file join where strep is not canonical} -constraints unix -body {
set x //foo
file normalize $x
file join $x bar
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 026fbfc..c590865 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -80,10 +80,7 @@ typedef struct {
/*
* Windows version dependend functions
*/
-static TclWinProcs _tclWinProcs = {
- NULL
-};
-TclWinProcs *tclWinProcs = &_tclWinProcs;
+TclWinProcs tclWinProcs;
/*
* The following arrays contain the human readable strings for the Windows
@@ -141,7 +138,7 @@ TclpInitPlatform(void)
{
WSADATA wsaData;
WORD wVersionRequested = MAKEWORD(2, 2);
- HINSTANCE hInstance;
+ HMODULE handle;
tclPlatform = TCL_PLATFORM_WINDOWS;
@@ -164,12 +161,10 @@ TclpInitPlatform(void)
/*
* Fill available functions depending on windows version
*/
- hInstance = LoadLibraryW(L"kernel32");
- if (hInstance != NULL) {
- _tclWinProcs.cancelSynchronousIo =
- (BOOL (WINAPI *)(HANDLE)) GetProcAddress(hInstance,
+ handle = GetModuleHandle(TEXT("KERNEL32"));
+ tclWinProcs.cancelSynchronousIo =
+ (BOOL (WINAPI *)(HANDLE)) GetProcAddress(handle,
"CancelSynchronousIo");
- }
}
/*
@@ -557,16 +552,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);
diff --git a/win/tclWinInt.h b/win/tclWinInt.h
index 76f5f68..43799d0 100644
--- a/win/tclWinInt.h
+++ b/win/tclWinInt.h
@@ -38,7 +38,7 @@ typedef struct TclWinProcs {
BOOL (WINAPI *cancelSynchronousIo)(HANDLE);
} TclWinProcs;
-MODULE_SCOPE TclWinProcs *tclWinProcs;
+MODULE_SCOPE TclWinProcs tclWinProcs;
/*
* Some versions of Borland C have a define for the OSVERSIONINFO for
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 4a1e75a..3e7e5eb 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -3329,8 +3329,8 @@ TclPipeThreadStop(
/*
* Cancel all sync-IO of this thread (may be blocked there).
*/
- if (tclWinProcs->cancelSynchronousIo) {
- tclWinProcs->cancelSynchronousIo(hThread);
+ if (tclWinProcs.cancelSynchronousIo) {
+ tclWinProcs.cancelSynchronousIo(hThread);
}
/*
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index 5f7fd31..de48b9b 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -1197,14 +1197,12 @@ RecursiveDeleteKey(
*/
if (mode && !checkExProc) {
- HINSTANCE dllH;
+ HMODULE handle;
checkExProc = 1;
- dllH = LoadLibrary(TEXT("advapi32.dll"));
- if (dllH) {
- regDeleteKeyExProc = (FARPROC)
- GetProcAddress(dllH, "RegDeleteKeyExW");
- }
+ handle = GetModuleHandle(TEXT("ADVAPI32"));
+ regDeleteKeyExProc = (FARPROC)
+ GetProcAddress(handle, "RegDeleteKeyExW");
}
if (mode && regDeleteKeyExProc) {
result = regDeleteKeyExProc(startKey, keyName, mode, 0);