ReactOS 0.4.15-dev-7953-g1f49173
DefaultActCtx.c
Go to the documentation of this file.
1/*
2 * Test for the default activation context that is active in every process.
3 *
4 * Copyright 2017 Giannis Adamopoulos
5 *
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.
10 *
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.
15 *
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
19 */
20
21#include "precomp.h"
22
23START_TEST(DefaultActCtx)
24{
25 DWORD buffer[256];
26 BOOL res;
27 PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION details = (PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION)buffer;
28 PACTIVATION_CONTEXT_DETAILED_INFORMATION info = (PACTIVATION_CONTEXT_DETAILED_INFORMATION)buffer;
29 HANDLE h;
30 DWORD i;
31 ACTCTX_SECTION_KEYED_DATA KeyedData = { 0 };
32
33 res = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX,
34 NULL,
35 NULL,
36 ActivationContextDetailedInformation,
37 &buffer,
38 sizeof(buffer),
39 NULL);
40 ok(res == TRUE, "Expected success\n");
41 if(res)
42 {
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");
47 }
48 else
49 {
50 skip("ActivationContextDetailedInformation failed\n");
51 }
52
53
54 i = 0;
55 res = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX,
56 NULL,
57 &i,
58 AssemblyDetailedInformationInActivationContext,
59 &buffer,
60 sizeof(buffer),
61 NULL);
62 ok(res == TRUE, "Expected success\n");
63 if (res)
64 {
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);
69 }
70 else
71 {
72 skip("AssemblyDetailedInformationInActivationContext failed\n");
73 }
74
75 i = 1;
76 res = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX,
77 NULL,
78 &i,
79 AssemblyDetailedInformationInActivationContext,
80 &buffer,
81 sizeof(buffer),
82 NULL);
83 ok(res == TRUE, "Expected success\n"); /* This is FALSE in win10 */
84 if (res)
85 {
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);
90 }
91 else
92 {
93 skip("AssemblyDetailedInformationInActivationContext failed\n");
94 }
95
97 ok(res == TRUE, "Expected success\n");
98 ok(h == NULL, "Expected null current context\n");
99
100 KeyedData.cbSize = sizeof(KeyedData);
101 res = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX,
102 NULL,
103 ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION,
104 L"Microsoft.Windows.SysyemCompatible",
105 &KeyedData);
106 ok(res == FALSE, "Expected failure\n");
107
108 KeyedData.cbSize = sizeof(KeyedData);
109 res = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX,
110 NULL,
111 ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION,
112 L"System Default Context",
113 &KeyedData);
114 ok(res == FALSE, "Expected failure\n");
115
116 KeyedData.cbSize = sizeof(KeyedData);
117 res = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX,
118 NULL,
119 ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION,
120 L"Microsoft.Windows.Common-Controls",
121 &KeyedData);
122 ok(res == TRUE, "Expected success\n");
123 if (res)
124 {
125 ok(KeyedData.hActCtx == NULL, "Expected null handle for common control context\n");
126 ok(KeyedData.ulAssemblyRosterIndex != 0, "%lu\n", KeyedData.ulAssemblyRosterIndex);
127 }
128 else
129 {
130 skip("ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION failed\n");
131 }
132
133}
134
136
137START_TEST(ActCtxWithXmlNamespaces)
138{
139 // _CreateActCtxFromFile() contains all the assertions we need.
140 (void)_CreateActCtxFromFile(L"xmlns.manifest", __LINE__);
141}
HANDLE _CreateActCtxFromFile(LPCWSTR FileName, int line)
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI QueryActCtxW(IN DWORD dwFlags, IN HANDLE hActCtx, IN PVOID pvSubInstance, IN ULONG ulInfoClass, IN PVOID pvBuffer, IN SIZE_T cbBuffer, IN OUT SIZE_T *pcbWrittenOrRequired OPTIONAL)
Definition: actctx.c:328
BOOL WINAPI GetCurrentActCtx(OUT PHANDLE phActCtx)
Definition: actctx.c:298
BOOL WINAPI FindActCtxSectionStringW(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, LPCWSTR lpSearchStr, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:156
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int details
Definition: msacm.c:1366
#define L(x)
Definition: ntvdm.h:50
Definition: parser.c:49
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185