Commit d926939b authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32: Export subclass calls by names too.

parent 645f7c62
...@@ -101,10 +101,10 @@ ...@@ -101,10 +101,10 @@
402 stdcall -noname FindMRUStringW(long wstr ptr) 402 stdcall -noname FindMRUStringW(long wstr ptr)
403 stdcall -noname EnumMRUListW(long long ptr long) 403 stdcall -noname EnumMRUListW(long long ptr long)
404 stdcall -noname CreateMRUListLazyW(ptr long long long) 404 stdcall -noname CreateMRUListLazyW(ptr long long long)
410 stdcall -noname SetWindowSubclass(long ptr long long) 410 stdcall -ordinal SetWindowSubclass(long ptr long long)
411 stdcall -noname GetWindowSubclass(long ptr long ptr) 411 stdcall -ordinal GetWindowSubclass(long ptr long ptr)
412 stdcall -noname RemoveWindowSubclass(long ptr long) 412 stdcall -ordinal RemoveWindowSubclass(long ptr long)
413 stdcall -noname DefSubclassProc(long long long long) 413 stdcall -ordinal DefSubclassProc(long long long long)
414 stdcall -noname MirrorIcon(ptr ptr) 414 stdcall -noname MirrorIcon(ptr ptr)
415 stdcall -noname DrawTextWrap(long wstr long ptr long) user32.DrawTextW 415 stdcall -noname DrawTextWrap(long wstr long ptr long) user32.DrawTextW
416 stdcall -noname DrawTextExPrivWrap(long wstr long ptr long ptr) user32.DrawTextExW 416 stdcall -noname DrawTextExPrivWrap(long wstr long ptr long ptr) user32.DrawTextExW
......
...@@ -279,25 +279,50 @@ static BOOL RegisterWindowClasses(void) ...@@ -279,25 +279,50 @@ static BOOL RegisterWindowClasses(void)
return TRUE; return TRUE;
} }
START_TEST(subclass) static int init_function_pointers(void)
{ {
HMODULE hdll; HMODULE hmod;
void *ptr;
hmod = GetModuleHandleA("comctl32.dll");
assert(hmod);
hdll = GetModuleHandleA("comctl32.dll");
assert(hdll);
/* Functions have to be loaded by ordinal. Only XP and W2K3 export /* Functions have to be loaded by ordinal. Only XP and W2K3 export
* them by name. * them by name.
*/ */
pSetWindowSubclass = (void*)GetProcAddress(hdll, (LPSTR)410); #define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord)))
pRemoveWindowSubclass = (void*)GetProcAddress(hdll, (LPSTR)412); MAKEFUNC_ORD(SetWindowSubclass, 410);
pDefSubclassProc = (void*)GetProcAddress(hdll, (LPSTR)413); MAKEFUNC_ORD(RemoveWindowSubclass, 412);
MAKEFUNC_ORD(DefSubclassProc, 413);
#undef MAKEFUNC_ORD
if(!pSetWindowSubclass || !pRemoveWindowSubclass || !pDefSubclassProc) if(!pSetWindowSubclass || !pRemoveWindowSubclass || !pDefSubclassProc)
{ {
win_skip("SetWindowSubclass and friends are not available\n"); win_skip("SetWindowSubclass and friends are not available\n");
return; return 0;
}
/* test named exports */
ptr = GetProcAddress(hmod, "SetWindowSubclass");
ok(broken(ptr == 0) || ptr != 0, "expected named export for SetWindowSubclass\n");
if(ptr)
{
#define TESTNAMED(f) \
ptr = (void*)GetProcAddress(hmod, #f); \
ok(ptr != 0, "expected named export for " #f "\n");
TESTNAMED(RemoveWindowSubclass);
TESTNAMED(DefSubclassProc);
/* GetWindowSubclass exported for V6 only */
#undef TESTNAMED
} }
return 1;
}
START_TEST(subclass)
{
if(!init_function_pointers()) return;
if(!RegisterWindowClasses()) assert(0); if(!RegisterWindowClasses()) assert(0);
test_subclass(); test_subclass();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment