From c4458148407d9a38909d24d963ca9900939be137 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 22 Mar 2001 03:42:08 +0000 Subject: * autoload.cc (kernel32_init): New function for kernel32 autoload initialization. (SignalObjectAndWait): Add conditional load of this function when it is available. --- winsup/cygwin/autoload.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'winsup/cygwin/autoload.cc') diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc index 850c020ef..c4b37117a 100644 --- a/winsup/cygwin/autoload.cc +++ b/winsup/cygwin/autoload.cc @@ -226,6 +226,21 @@ LoadDLLinitfunc (ole32) return 0; } +LoadDLLinitfunc (kernel32) +{ + extern void wsock_init (); + HANDLE h; + + if ((h = LoadLibrary ("kernel32.dll")) != NULL) + kernel32_handle = h; + else if (!kernel32_handle) + api_fatal ("could not load wsock32.dll. Is TCP/IP installed?"); + else + return 0; /* Already done by another thread? */ + + return 0; +} + static void __stdcall dummy_autoload (void) __attribute__ ((unused)); static void __stdcall dummy_autoload (void) @@ -374,5 +389,8 @@ LoadDLLinit (ole32) LoadDLLfunc (CoInitialize, 4, ole32) LoadDLLfunc (CoUninitialize, 0, ole32) LoadDLLfunc (CoCreateInstance, 20, ole32) + +LoadDLLinit (kernel32) +LoadDLLfuncEx (SignalObjectAndWait, 16, kernel32, 1) } } -- cgit v1.2.3