Commit 88d5cab5 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent f13d8cc3
......@@ -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);
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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;
}
......
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