* autoload.cc (kernel32_init): New function for kernel32 autoload

initialization.
(SignalObjectAndWait): Add conditional load of this function when it is
available.
This commit is contained in:
Christopher Faylor 2001-03-22 03:42:08 +00:00
parent 10654b8555
commit c445814840
2 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,10 @@
Wed Mar 21 22:12:36 2001 Christopher Faylor <cgf@cygnus.com>
* autoload.cc (kernel32_init): New function for kernel32 autoload
initialization.
(SignalObjectAndWait): Add conditional load of this function when it is
available.
2001-03-21 Robert Collins <rbtcollins@hotmail.com> 2001-03-21 Robert Collins <rbtcollins@hotmail.com>
* sched.cc: New file. Implement sched*. * sched.cc: New file. Implement sched*.

View File

@ -226,6 +226,21 @@ LoadDLLinitfunc (ole32)
return 0; 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) __attribute__ ((unused));
static void __stdcall static void __stdcall
dummy_autoload (void) dummy_autoload (void)
@ -374,5 +389,8 @@ LoadDLLinit (ole32)
LoadDLLfunc (CoInitialize, 4, ole32) LoadDLLfunc (CoInitialize, 4, ole32)
LoadDLLfunc (CoUninitialize, 0, ole32) LoadDLLfunc (CoUninitialize, 0, ole32)
LoadDLLfunc (CoCreateInstance, 20, ole32) LoadDLLfunc (CoCreateInstance, 20, ole32)
LoadDLLinit (kernel32)
LoadDLLfuncEx (SignalObjectAndWait, 16, kernel32, 1)
} }
} }