#include "alfpriv.h" ALFCompatFunctions * ALF_CreateCompatFuncTable(void) { ALFCompatFunctions *compatfn = (ALFCompatFunctions*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY|HEAP_GENERATE_EXCEPTIONS, sizeof(ALFCompatFunctions)); #define COMPAT(dll, entrypoint, ordinal) \ do { \ FARPROC p = GetProcAddress(GetModuleHandleA(#dll), #entrypoint); \ if (!p && ordinal) \ p = GetProcAddress(GetModuleHandleA(#dll), (char*)ordinal); \ CopyMemory(&compatfn->entrypoint, &p, sizeof(void*)); \ } while (0) COMPAT(comctl32.dll, SetWindowSubclass, 410); COMPAT(comctl32.dll, DefSubclassProc, 413); COMPAT(comctl32.dll, RemoveWindowSubclass, 412); #undef COMPAT return compatfn; }