Header And Logo

PostgreSQL
| The world's most advanced open source database.

Functions | Variables

mingwcompat.c File Reference

#include "postgres.h"
Include dependency graph for mingwcompat.c:

Go to the source code of this file.

Functions

static void LoadKernel32 ()
 typedef (PHANDLE, HANDLE, WAITORTIMERCALLBACK, PVOID, ULONG, ULONG)
BOOL WINAPI RegisterWaitForSingleObject (PHANDLE phNewWaitObject, HANDLE hObject, WAITORTIMERCALLBACK Callback, PVOID Context, ULONG dwMilliseconds, ULONG dwFlags)

Variables

struct in6_addr in6addr_any = {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}}
static HMODULE kernel32 = NULL
static
__RegisterWaitForSingleObject 
_RegisterWaitForSingleObject = NULL

Function Documentation

static void LoadKernel32 (  )  [static]

Definition at line 37 of file mingwcompat.c.

References ereport, errmsg_internal(), FATAL, kernel32, and NULL.

Referenced by RegisterWaitForSingleObject().

{
    if (kernel32 != NULL)
        return;

    kernel32 = LoadLibraryEx("kernel32.dll", NULL, 0);
    if (kernel32 == NULL)
        ereport(FATAL,
              (errmsg_internal("could not load kernel32.dll: error code %lu",
                               GetLastError())));
}

BOOL WINAPI RegisterWaitForSingleObject ( PHANDLE  phNewWaitObject,
HANDLE  hObject,
WAITORTIMERCALLBACK  Callback,
PVOID  Context,
ULONG  dwMilliseconds,
ULONG  dwFlags 
)

Definition at line 60 of file mingwcompat.c.

References _RegisterWaitForSingleObject, ereport, errmsg_internal(), FATAL, kernel32, LoadKernel32(), and NULL.

{
    if (_RegisterWaitForSingleObject == NULL)
    {
        LoadKernel32();

        _RegisterWaitForSingleObject = (__RegisterWaitForSingleObject)
            GetProcAddress(kernel32, "RegisterWaitForSingleObject");

        if (_RegisterWaitForSingleObject == NULL)
            ereport(FATAL,
                    (errmsg_internal("could not locate RegisterWaitForSingleObject in kernel32.dll: error code %lu",
                                     GetLastError())));
    }

    return (_RegisterWaitForSingleObject)
        (phNewWaitObject, hObject, Callback, Context, dwMilliseconds, dwFlags);
}

typedef ( PHANDLE  ,
HANDLE  ,
WAITORTIMERCALLBACK  ,
PVOID  ,
ULONG  ,
ULONG   
)

Variable Documentation

__RegisterWaitForSingleObject _RegisterWaitForSingleObject = NULL [static]

Definition at line 57 of file mingwcompat.c.

Referenced by RegisterWaitForSingleObject().

struct in6_addr in6addr_any = {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}}

Definition at line 22 of file mingwcompat.c.

Referenced by CheckRADIUSAuth().

HMODULE kernel32 = NULL [static]

Definition at line 30 of file mingwcompat.c.

Referenced by LoadKernel32(), and RegisterWaitForSingleObject().