diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-05-01 08:20:54 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-05-01 08:20:54 (GMT) |
commit | b396b6e2533e98a2733a3fa471766e98c2d55088 (patch) | |
tree | 9fa5905059cd915ff7fcd46d8ef1e617bc1242a2 /win/tclWinInit.c | |
parent | 20e304e69bb30dbe0c5d9266d1841d39b6a003f2 (diff) | |
parent | e5766f95f8b74aa6577cf8dff98d48a71ab9d131 (diff) | |
download | tcl-b396b6e2533e98a2733a3fa471766e98c2d55088.zip tcl-b396b6e2533e98a2733a3fa471766e98c2d55088.tar.gz tcl-b396b6e2533e98a2733a3fa471766e98c2d55088.tar.bz2 |
Fix [8bd13f07bde6fb0631f27927e36461fdefe8ca95|8bd13f07bd]: Closing tcl pipes prevents windows threads from starting up. Patch by sebres (Dipl. Ing. Sergey G. Brester)
(also fix duplicate test-case number in link.test)
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r-- | win/tclWinInit.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 8b600f6..f13e314 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -76,6 +76,15 @@ typedef struct { #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF #endif + +/* + * Windows version dependend functions + */ +static TclWinProcs _tclWinProcs = { + NULL +}; +TclWinProcs *tclWinProcs = &_tclWinProcs; + /* * The following arrays contain the human readable strings for the Windows * platform and processor values. @@ -132,6 +141,7 @@ TclpInitPlatform(void) { WSADATA wsaData; WORD wVersionRequested = MAKEWORD(2, 2); + HINSTANCE hInstance; tclPlatform = TCL_PLATFORM_WINDOWS; @@ -150,6 +160,16 @@ TclpInitPlatform(void) TclWinInit(GetModuleHandle(NULL)); #endif + + /* + * Fill available functions depending on windows version + */ + hInstance = LoadLibraryW(L"kernel32"); + if (hInstance != NULL) { + _tclWinProcs.cancelSynchronousIo = + (BOOL (WINAPI *)(HANDLE)) GetProcAddress(hInstance, + "CancelSynchronousIo"); + } } /* |