2 * Test for the default activation context that is active in every process.
4 * Copyright 2017 Giannis Adamopoulos
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 START_TEST(DefaultActCtx
)
27 PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION details
= (PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
)buffer
;
28 PACTIVATION_CONTEXT_DETAILED_INFORMATION info
= (PACTIVATION_CONTEXT_DETAILED_INFORMATION
)buffer
;
31 ACTCTX_SECTION_KEYED_DATA KeyedData
= { 0 };
33 res
= QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX
,
36 ActivationContextDetailedInformation
,
40 ok(res
== TRUE
, "Expected success\n");
43 ok(info
->lpRootManifestPath
== NULL
, "Expected null lpRootManifestPath, got %S\n", info
->lpRootManifestPath
);
44 ok(info
->lpRootConfigurationPath
== NULL
, "Expected null lpRootConfigurationPath, got %S\n", info
->lpRootConfigurationPath
);
45 ok(info
->lpAppDirPath
== NULL
, "Expected null lpAppDirPath, got %S\n", info
->lpAppDirPath
);
46 ok(info
->ulAssemblyCount
== 0, "Expected 0 assemblies\n");
50 skip("ActivationContextDetailedInformation failed\n");
55 res
= QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX
,
58 AssemblyDetailedInformationInActivationContext
,
62 ok(res
== TRUE
, "Expected success\n");
65 ok(details
->lpAssemblyEncodedAssemblyIdentity
== NULL
, "Expected null lpAssemblyEncodedAssemblyIdentity, got %S\n", details
->lpAssemblyEncodedAssemblyIdentity
);
66 ok(details
->lpAssemblyManifestPath
== NULL
, "Expected null lpAssemblyManifestPath, got %S\n", details
->lpAssemblyManifestPath
);
67 ok(details
->lpAssemblyPolicyPath
== NULL
, "Expected null lpAssemblyPolicyPath, got %S\n", details
->lpAssemblyPolicyPath
);
68 ok(details
->lpAssemblyDirectoryName
== NULL
, "Expected null lpAssemblyDirectoryName, got %S\n", details
->lpAssemblyDirectoryName
);
72 skip("AssemblyDetailedInformationInActivationContext failed\n");
76 res
= QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX
,
79 AssemblyDetailedInformationInActivationContext
,
83 ok(res
== TRUE
, "Expected success\n"); /* This is FALSE in win10 */
86 ok(details
->lpAssemblyEncodedAssemblyIdentity
== NULL
, "Expected null lpAssemblyEncodedAssemblyIdentity, got %S\n", details
->lpAssemblyEncodedAssemblyIdentity
);
87 ok(details
->lpAssemblyManifestPath
== NULL
, "Expected null lpAssemblyManifestPath, got %S\n", details
->lpAssemblyManifestPath
);
88 ok(details
->lpAssemblyPolicyPath
== NULL
, "Expected null lpAssemblyPolicyPath, got %S\n", details
->lpAssemblyPolicyPath
);
89 ok(details
->lpAssemblyDirectoryName
== NULL
, "Expected null lpAssemblyDirectoryName, got %S\n", details
->lpAssemblyDirectoryName
);
93 skip("AssemblyDetailedInformationInActivationContext failed\n");
96 res
= GetCurrentActCtx (&h
);
97 ok(res
== TRUE
, "Expected success\n");
98 ok(h
== NULL
, "Expected null current context\n");
100 KeyedData
.cbSize
= sizeof(KeyedData
);
101 res
= FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX
,
103 ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION
,
104 L
"Microsoft.Windows.SysyemCompatible",
106 ok(res
== FALSE
, "Expected failure\n");
108 KeyedData
.cbSize
= sizeof(KeyedData
);
109 res
= FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX
,
111 ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION
,
112 L
"System Default Context",
114 ok(res
== FALSE
, "Expected failure\n");
116 KeyedData
.cbSize
= sizeof(KeyedData
);
117 res
= FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX
,
119 ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION
,
120 L
"Microsoft.Windows.Common-Controls",
122 ok(res
== TRUE
, "Expected success\n");
125 ok(KeyedData
.hActCtx
== NULL
, "Expected null handle for common control context\n");
126 ok(KeyedData
.ulAssemblyRosterIndex
!= 0, "%lu\n", KeyedData
.ulAssemblyRosterIndex
);
130 skip("ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION failed\n");