コード例 #1
0
ファイル: module.c プロジェクト: AmesianX/RosWine
static void init_pointers(void)
{
    HMODULE hKernel32 = GetModuleHandleA("kernel32.dll");

#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hKernel32, #f))
    MAKEFUNC(GetDllDirectoryA);
    MAKEFUNC(GetDllDirectoryW);
    MAKEFUNC(SetDllDirectoryA);
    MAKEFUNC(GetModuleHandleExA);
    MAKEFUNC(GetModuleHandleExW);
#undef MAKEFUNC
}
コード例 #2
0
ファイル: writer.c プロジェクト: Happy-Ferret/MacawX
static BOOL init_pointers(void)
{
    /* don't free module here, it's to be unloaded on exit */
    HMODULE mod = LoadLibraryA("xmllite.dll");

    if (!mod)
    {
        win_skip("xmllite library not available\n");
        return FALSE;
    }

#define MAKEFUNC(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return FALSE;
    MAKEFUNC(CreateXmlWriter);
    MAKEFUNC(CreateXmlWriterOutputWithEncodingName);
#undef MAKEFUNC

    return TRUE;
}
コード例 #3
0
ファイル: module.c プロジェクト: AmesianX/wine
static void init_pointers(void)
{
    HMODULE hKernel32 = GetModuleHandleA("kernel32.dll");

#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hKernel32, #f))
    MAKEFUNC(GetDllDirectoryA);
    MAKEFUNC(GetDllDirectoryW);
    MAKEFUNC(SetDllDirectoryA);
    MAKEFUNC(GetModuleHandleExA);
    MAKEFUNC(GetModuleHandleExW);
    MAKEFUNC(K32GetModuleInformation);
#undef MAKEFUNC

    /* not all Windows versions export this in kernel32 */
    if (!pK32GetModuleInformation)
    {
        HMODULE hPsapi = LoadLibraryA("psapi.dll");
        if (hPsapi)
        {
            pK32GetModuleInformation = (void *)GetProcAddress(hPsapi, "GetModuleInformation");
            if (!pK32GetModuleInformation) FreeLibrary(hPsapi);
        }
    }

}