2 * Utility routines for comctl32 v6 tests
4 * Copyright 2006 Mike McCormack for CodeWeavers
5 * Copyright 2007 George Gov
6 * Copyright 2009 Owen Rudge for CodeWeavers
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #elif defined __x86_64__
29 #elif defined __aarch64__
35 static const CHAR manifest_name
[] = "cc6.manifest";
37 static const CHAR manifest
[] =
38 "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
39 "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">\n"
40 " <assemblyIdentity\n"
42 " name=\"Wine.ComCtl32.Tests\"\n"
43 " version=\"1.0.0.0\"\n"
44 " processorArchitecture=\"" ARCH
"\"\n"
46 "<description>Wine comctl32 test suite</description>\n"
48 " <dependentAssembly>\n"
49 " <assemblyIdentity\n"
51 " name=\"microsoft.windows.common-controls\"\n"
52 " version=\"6.0.0.0\"\n"
53 " processorArchitecture=\"" ARCH
"\"\n"
54 " publicKeyToken=\"6595b64144ccf1df\"\n"
57 "</dependentAssembly>\n"
61 static void unload_v6_module(ULONG_PTR cookie
, HANDLE hCtx
)
63 DeactivateActCtx(0, cookie
);
66 DeleteFileA(manifest_name
);
69 static BOOL
load_v6_module(ULONG_PTR
*pcookie
, HANDLE
*hCtx
)
71 ACTCTX_SECTION_KEYED_DATA data
;
79 file
= CreateFileA( manifest_name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
80 if (file
!= INVALID_HANDLE_VALUE
)
82 ret
= (WriteFile( file
, manifest
, sizeof(manifest
)-1, &written
, NULL
) &&
83 written
== sizeof(manifest
)-1);
87 DeleteFileA( manifest_name
);
88 skip("Failed to fill manifest file. Skipping comctl32 V6 tests.\n");
92 trace("created %s\n", manifest_name
);
96 skip("Failed to create manifest file. Skipping comctl32 V6 tests.\n");
100 memset(&ctx
, 0, sizeof(ctx
));
101 ctx
.cbSize
= sizeof(ctx
);
102 ctx
.lpSource
= manifest_name
;
104 *hCtx
= CreateActCtxA(&ctx
);
105 ok(*hCtx
!= 0, "Expected context handle\n");
107 hmod
= GetModuleHandleA("comctl32.dll");
109 ret
= ActivateActCtx(*hCtx
, pcookie
);
110 ok(ret
, "Failed to activate context, error %d.\n", GetLastError());
114 win_skip("A problem during context activation occurred.\n");
115 DeleteFileA(manifest_name
);
118 data
.cbSize
= sizeof(data
);
119 ret
= FindActCtxSectionStringA(0, NULL
, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION
,
120 "comctl32.dll", &data
);
121 ok(ret
, "failed to find comctl32.dll in active context, %u\n", GetLastError());
125 LoadLibraryA("comctl32.dll");