1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#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;
}
|