Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "postgres.h"
00015
00016 #ifndef WIN32_ONLY_COMPILER
00017
00018
00019
00020
00021
00022 const struct in6_addr in6addr_any = {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}};
00023
00024
00025
00026
00027
00028
00029
00030 static HMODULE kernel32 = NULL;
00031
00032
00033
00034
00035
00036 static void
00037 LoadKernel32()
00038 {
00039 if (kernel32 != NULL)
00040 return;
00041
00042 kernel32 = LoadLibraryEx("kernel32.dll", NULL, 0);
00043 if (kernel32 == NULL)
00044 ereport(FATAL,
00045 (errmsg_internal("could not load kernel32.dll: error code %lu",
00046 GetLastError())));
00047 }
00048
00049
00050
00051
00052
00053
00054 typedef
00055 BOOL (WINAPI * __RegisterWaitForSingleObject)
00056 (PHANDLE, HANDLE, WAITORTIMERCALLBACK, PVOID, ULONG, ULONG);
00057 static __RegisterWaitForSingleObject _RegisterWaitForSingleObject = NULL;
00058
00059 BOOL WINAPI
00060 RegisterWaitForSingleObject(PHANDLE phNewWaitObject,
00061 HANDLE hObject,
00062 WAITORTIMERCALLBACK Callback,
00063 PVOID Context,
00064 ULONG dwMilliseconds,
00065 ULONG dwFlags)
00066 {
00067 if (_RegisterWaitForSingleObject == NULL)
00068 {
00069 LoadKernel32();
00070
00071 _RegisterWaitForSingleObject = (__RegisterWaitForSingleObject)
00072 GetProcAddress(kernel32, "RegisterWaitForSingleObject");
00073
00074 if (_RegisterWaitForSingleObject == NULL)
00075 ereport(FATAL,
00076 (errmsg_internal("could not locate RegisterWaitForSingleObject in kernel32.dll: error code %lu",
00077 GetLastError())));
00078 }
00079
00080 return (_RegisterWaitForSingleObject)
00081 (phNewWaitObject, hObject, Callback, Context, dwMilliseconds, dwFlags);
00082 }
00083
00084 #endif