comctl32/tests: Manually load comctl32.dll with newly activated context.

This commit is contained in:
Nikolay Sivov 2013-09-09 10:00:47 +04:00 committed by Alexandre Julliard
parent f13d8cc373
commit 88d5cab5e9
5 changed files with 11 additions and 65 deletions

View File

@ -1814,7 +1814,6 @@ START_TEST(header)
HWND parent_hwnd;
ULONG_PTR ctx_cookie;
HANDLE hCtx;
HWND hwnd;
if (!init())
return;
@ -1847,22 +1846,6 @@ START_TEST(header)
return;
}
/* this is a XP SP3 failure workaround */
hwnd = CreateWindowExA(0, WC_HEADER, NULL,
WS_CHILD|WS_BORDER|WS_VISIBLE|HDS_BUTTONS|HDS_HORZ,
0, 0, 100, 100,
parent_hwnd, NULL, GetModuleHandleA(NULL), NULL);
if (!IsWindow(hwnd))
{
win_skip("FIXME: failed to create Header window.\n");
unload_v6_module(ctx_cookie, hCtx);
DestroyWindow(parent_hwnd);
return;
}
else
DestroyWindow(hwnd);
/* comctl32 version 6 tests start here */
test_hdf_fixedwidth(parent_hwnd);
test_hds_nosizing(parent_hwnd);

View File

@ -5554,7 +5554,6 @@ START_TEST(listview)
ULONG_PTR ctx_cookie;
HANDLE hCtx;
HWND hwnd;
hComctl32 = GetModuleHandleA("comctl32.dll");
pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx");
@ -5623,21 +5622,6 @@ START_TEST(listview)
return;
}
/* this is a XP SP3 failure workaround */
hwnd = CreateWindowExA(0, WC_LISTVIEW, "foo",
WS_CHILD | WS_BORDER | WS_VISIBLE | LVS_REPORT,
0, 0, 100, 100,
hwndparent, NULL, GetModuleHandleA(NULL), NULL);
if (!IsWindow(hwnd))
{
win_skip("FIXME: failed to create ListView window.\n");
unload_v6_module(ctx_cookie, hCtx);
DestroyWindow(hwndparent);
return;
}
else
DestroyWindow(hwnd);
/* comctl32 version 6 tests start here */
test_get_set_view();
test_canceleditlabel();

View File

@ -2002,7 +2002,6 @@ START_TEST(monthcal)
BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
INITCOMMONCONTROLSEX iccex;
HMODULE hComctl32;
HWND hwnd;
ULONG_PTR ctx_cookie;
HANDLE hCtx;
@ -2048,21 +2047,6 @@ START_TEST(monthcal)
return;
}
/* this is a XP SP3 failure workaround */
hwnd = CreateWindowExA(0, MONTHCAL_CLASSA, "foo",
WS_CHILD | WS_BORDER | WS_VISIBLE,
0, 0, 100, 100,
parent_wnd, NULL, GetModuleHandleA(NULL), NULL);
if (!IsWindow(hwnd))
{
win_skip("FIXME: failed to create Monthcal window.\n");
unload_v6_module(ctx_cookie, hCtx);
DestroyWindow(parent_wnd);
return;
}
else
DestroyWindow(hwnd);
test_hittest_v6();
test_get_set_border();
test_MCM_SIZERECTTOMIN();

View File

@ -1972,7 +1972,6 @@ START_TEST(treeview)
ULONG_PTR ctx_cookie;
HANDLE hCtx;
HWND hwnd;
hComctl32 = GetModuleHandleA("comctl32.dll");
pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx");
@ -2044,21 +2043,6 @@ START_TEST(treeview)
return;
}
/* this is a XP SP3 failure workaround */
hwnd = CreateWindowExA(0, WC_TREEVIEW, "foo",
WS_CHILD | WS_BORDER | WS_VISIBLE,
0, 0, 100, 100,
hMainWnd, NULL, GetModuleHandleA(NULL), NULL);
if (!IsWindow(hwnd))
{
win_skip("FIXME: failed to create TreeView window.\n");
unload_v6_module(ctx_cookie, hCtx);
DestroyWindow(hMainWnd);
return;
}
else
DestroyWindow(hwnd);
/* comctl32 version 6 tests start here */
test_expandedimage();
test_htreeitem_layout();

View File

@ -82,6 +82,9 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
HANDLE hKernel32;
HANDLE (WINAPI *pCreateActCtxA)(ACTCTXA*);
BOOL (WINAPI *pActivateActCtx)(HANDLE, ULONG_PTR*);
BOOL (WINAPI *pFindActCtxSectionStringA)(DWORD,const GUID *,ULONG,LPCSTR,PACTCTX_SECTION_KEYED_DATA);
ACTCTX_SECTION_KEYED_DATA data;
ACTCTXA ctx;
BOOL ret;
@ -91,6 +94,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
hKernel32 = GetModuleHandleA("kernel32.dll");
pCreateActCtxA = (void*)GetProcAddress(hKernel32, "CreateActCtxA");
pActivateActCtx = (void*)GetProcAddress(hKernel32, "ActivateActCtx");
pFindActCtxSectionStringA = (void*)GetProcAddress(hKernel32, "FindActCtxSectionStringA");
if (!(pCreateActCtxA && pActivateActCtx))
{
win_skip("Activation contexts unsupported. No version 6 tests possible.\n");
@ -135,6 +139,13 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
DeleteFileA(manifest_name);
}
data.cbSize = sizeof(data);
ret = pFindActCtxSectionStringA(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
"comctl32.dll", &data);
ok(ret, "failed to find comctl32.dll in active context, %u\n", GetLastError());
if (ret)
LoadLibraryA("comctl32.dll");
return ret;
}