summaryrefslogtreecommitdiffstats
path: root/win/tclWinInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r--win/tclWinInit.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 8b600f6..03ef5df 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");
+ }
}
/*