ReactOS 0.4.16-dev-2208-g6350669
actctx.c File Reference
#include "ntstatus.h"
#include "wine/test.h"
#include <winbase.h>
#include <windef.h>
#include <winnt.h>
#include <winternl.h>
#include <winnls.h>
#include <stdio.h>
#include "oaidl.h"
#include "initguid.h"
Include dependency graph for actctx.c:

Go to the source code of this file.

Classes

struct  detailed_info_t
 
struct  info_in_assembly
 
struct  runlevel_info_t
 
struct  strsection_header
 
struct  string_index
 
struct  guidsection_header
 
struct  guid_index
 
struct  wndclass_redirect_data
 
struct  dllredirect_data_path
 
struct  dllredirect_data
 
struct  tlibredirect_data
 
struct  progidredirect_data
 
struct  activatable_class_data
 
struct  comclassredirect_data
 
struct  clrclass_data
 
struct  ifacepsredirect_data
 
struct  clrsurrogate_data
 
struct  _test_act_ctx_compat_info
 
struct  old_win10_COMPATIBILITY_CONTEXT_ELEMENT
 
struct  old_win10_test_act_ctx_compat_info
 
struct  sxs_info
 
struct  manifest_res_spec
 
struct  manifest_res_spec_list
 
struct  multiple_manifest_test
 

Macros

#define WIN32_NO_STATUS
 
#define ARCH   "none"
 
#define DLL_REDIRECT_PATH_INCLUDES_BASE_NAME   1
 
#define DLL_REDIRECT_PATH_OMITS_ASSEMBLY_ROOT   2
 
#define DLL_REDIRECT_PATH_EXPAND   4
 
#define DLL_REDIRECT_PATH_SYSTEM_DEFAULT_REDIRECTED_SYSTEM32_DLL   8
 
#define GUIDSECTION_MAGIC   0x64487347 /* dHsG */
 
#define X(f)   if (!(p##f = (void*)GetProcAddress(hLibrary, #f))) return FALSE;
 
#define subtest_manifest_res(d, e, t, l)   subtest_manifest_res_(__LINE__,d,e,t,l)
 
#define LANGID_PREC_MAX_COUNT   5
 

Typedefs

typedef struct _test_act_ctx_compat_info test_act_ctx_compat_info
 

Enumerations

enum  winrt_threading_model { WINRT_THREADING_MODEL_BOTH = 0 , WINRT_THREADING_MODEL_STA = 1 , WINRT_THREADING_MODEL_MTA = 2 }
 
enum  comclass_threadingmodel {
  ThreadingModel_Apartment = 1 , ThreadingModel_Free = 2 , ThreadingModel_No = 3 , ThreadingModel_Both = 4 ,
  ThreadingModel_Neutral = 5 , ThreadingModel_Apartment = 1 , ThreadingModel_Free = 2 , ThreadingModel_No = 3 ,
  ThreadingModel_Both = 4 , ThreadingModel_Neutral = 5 , ThreadingModel_Apartment = 1 , ThreadingModel_Free = 2 ,
  ThreadingModel_No = 3 , ThreadingModel_Both = 4 , ThreadingModel_Neutral = 5
}
 
enum  comclass_miscfields {
  MiscStatus = 1 , MiscStatusIcon = 2 , MiscStatusContent = 4 , MiscStatusThumbnail = 8 ,
  MiscStatusDocPrint = 16 , MiscStatus = 1 , MiscStatusIcon = 2 , MiscStatusContent = 4 ,
  MiscStatusThumbnail = 8 , MiscStatusDocPrint = 16 , MiscStatus = 1 , MiscStatusIcon = 2 ,
  MiscStatusContent = 4 , MiscStatusThumbnail = 8 , MiscStatusDocPrint = 16
}
 
enum  ifaceps_mask { NumMethods = 1 , BaseIface = 2 , NumMethods = 1 , BaseIface = 2 }
 

Functions

static BOOL (WINAPI *pQueryActCtxSettingsW)(DWORD
 
static SIZE_T *static NTSTATUS (NTAPI *pRtlFindActivationContextSectionString)(DWORD
 
static BOOLEAN (NTAPI *pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING
 
static VOID (NTAPI *pRtlFreeUnicodeString)(PUNICODE_STRING)
 
 DEFINE_GUID (IID_CoTest, 0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x11, 0x11, 0x22, 0x22, 0x33, 0x33)
 
 DEFINE_GUID (IID_CoTest2, 0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x11, 0x11, 0x22, 0x22, 0x33, 0x34)
 
 DEFINE_GUID (CLSID_clrclass, 0x22345678, 0x1234, 0x5678, 0x12, 0x34, 0x11, 0x11, 0x22, 0x22, 0x33, 0x33)
 
 DEFINE_GUID (IID_TlibTest, 0x99999999, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55)
 
 DEFINE_GUID (IID_TlibTest2, 0x99999999, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x56)
 
 DEFINE_GUID (IID_TlibTest3, 0x99999999, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x57)
 
 DEFINE_GUID (IID_TlibTest4, 0x99999999, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x58)
 
 DEFINE_GUID (IID_Iifaceps, 0x66666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55)
 
 DEFINE_GUID (IID_Ibifaceps, 0x66666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x57)
 
 DEFINE_GUID (IID_Iifaceps2, 0x76666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55)
 
 DEFINE_GUID (IID_Iifaceps3, 0x86666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55)
 
 DEFINE_GUID (IID_Iiface, 0x96666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55)
 
 DEFINE_GUID (IID_PS32, 0x66666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x56)
 
 DEFINE_GUID (VISTA_COMPAT_GUID, 0xe2011457, 0x1546, 0x43c5, 0xa5, 0xfe, 0x00, 0x8d, 0xee, 0xe3, 0xd3, 0xf0)
 
 DEFINE_GUID (WIN7_COMPAT_GUID, 0x35138b9a, 0x5d96, 0x4fbd, 0x8e, 0x2d, 0xa2, 0x44, 0x02, 0x25, 0xf9, 0x3a)
 
 DEFINE_GUID (WIN8_COMPAT_GUID, 0x4a2f28e3, 0x53b9, 0x4441, 0xba, 0x9c, 0xd6, 0x9d, 0x4a, 0x4a, 0x6e, 0x38)
 
 DEFINE_GUID (WIN81_COMPAT_GUID, 0x1f676c76, 0x80e1, 0x4239, 0x95, 0xbb, 0x83, 0xd0, 0xf6, 0xd0, 0xda, 0x78)
 
 DEFINE_GUID (WIN10_COMPAT_GUID, 0x8e0f7a12, 0xbfb3, 0x4fe8, 0xb9, 0xa5, 0x48, 0xfd, 0x50, 0xa1, 0x5a, 0x9a)
 
 DEFINE_GUID (OTHER_COMPAT_GUID, 0x12345566, 0x1111, 0x2222, 0x33, 0x33, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44)
 
static BOOL create_manifest_file (const char *filename, const char *manifest, int manifest_len, const char *depfile, const char *depmanifest)
 
static BOOL create_wide_manifest (const char *filename, const char *manifest, BOOL fBOM, BOOL fReverse)
 
static HANDLE create_temp_manifest_file (const char *manifest, WCHAR *pathname)
 
static void test_detailed_info (HANDLE handle, const detailed_info_t *exinfo, int line)
 
static void test_info_in_assembly (HANDLE handle, DWORD id, const info_in_assembly *exinfo, int line)
 
static void test_file_info (HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR filename, int line)
 
static void test_runlevel_info (HANDLE handle, const runlevel_info_t *exinfo, int line)
 
static HANDLE test_create (const char *file)
 
static void test_create_and_fail (const char *manifest, const char *depmanifest, int todo, BOOL is_broken)
 
static void test_create_wide_and_fail (const char *manifest, BOOL fBOM)
 
static void test_create_fail (void)
 
static void test_find_dll_redirection (HANDLE handle, LPCWSTR libname, ULONG exid, int line)
 
static void test_find_window_class (HANDLE handle, LPCWSTR clsname, ULONG exid, int line)
 
static void test_find_activatable_class (HANDLE handle, const WCHAR *classid, enum winrt_threading_model threading_model, const WCHAR *file, ULONG exid, int line)
 
static void test_find_string_fail (void)
 
static void test_basic_info (HANDLE handle, int line)
 
static void validate_guid_index (const ACTCTX_SECTION_KEYED_DATA *data, int line)
 
static void test_find_com_redirection (HANDLE handle, const GUID *clsid, const GUID *tlid, const WCHAR *progid, ULONG exid, int line)
 
static void test_find_ifaceps_redirection (HANDLE handle, const GUID *iid, const GUID *tlbid, const GUID *base, const GUID *ps32, ULONG exid, int line)
 
static void test_find_surrogate (HANDLE handle, const GUID *clsid, const WCHAR *name, const WCHAR *version, ULONG exid, int line)
 
static void test_find_progid_redirection (HANDLE handle, const GUID *clsid, const char *progid, ULONG exid, int line)
 
static void test_wndclass_section (void)
 
static void test_dllredirect_section (void)
 
static void test_typelib_section (void)
 
static void test_allowDelayedBinding (void)
 
static void test_actctx (void)
 
static void test_app_manifest (void)
 
static HANDLE create_manifest (const char *filename, const char *data, int line)
 
static void kernel32_find (ULONG section, const char *string_to_find, BOOL should_find, BOOL todo, int line)
 
static void ntdll_find (ULONG section, const char *string_to_find, BOOL should_find, BOOL todo, int line)
 
static void test_findsectionstring (void)
 
static void run_child_process (void)
 
static void init_paths (void)
 
static void write_manifest (const char *filename, const char *manifest)
 
static void delete_manifest_file (const char *filename)
 
static void extract_resource (const char *name, const char *type, const char *path)
 
static void test_CreateActCtx (void)
 
static void test_CreateActCtx_share_mode (void)
 
static BOOL init_funcs (void)
 
static void test_ZombifyActCtx (void)
 
static void test_no_compat (HANDLE handle, int line)
 
static void test_with_compat (HANDLE handle, DWORD num_compat, DWORD num_version, const GUID *expected_compat[], const ULONGLONG expected_version[], int line)
 
static void test_compatibility (void)
 
static void test_settings (void)
 
static BOOL fill_sxs_info (sxs_info *info, const char *temp, const char *path_dll, const char *exe_manifest, const char *dll_manifest, BOOL do_load)
 
static void clean_sxs_info (sxs_info *info)
 
static void get_application_directory (char *buffer, int buffer_size)
 
static void test_two_dlls_at_same_time (void)
 
static void test_one_sxs_and_one_local_1 (void)
 
static void test_one_sxs_and_one_local_2 (void)
 
static void test_one_with_sxs_and_GetModuleHandleA (void)
 
static void test_builtin_sxs (void)
 
static void add_sxs_dll_manifest (const char *pathname, const struct manifest_res_spec_list *res_lists, size_t num_lists, const char *manifest)
 
static DWORD subtest_manifest_res_ (int line, const char *manifest_exe, const char *manifest_dll, const struct multiple_manifest_test *test_data, LANGID lang)
 
static void test_manifest_resources (void)
 
static void get_langid_precedence (LANGID *langs_arr, size_t *lang_count)
 
static void subtest_valid_manifest_resources_locale (LANGID actctx_lang)
 
static void test_valid_manifest_resources_locale (void)
 
static void run_sxs_test (int run)
 
static void run_child_process_two_dll (int run)
 
static void test_manifest_in_module (void)
 
static void test_manifest_resource_name_omitted (void)
 
 START_TEST (actctx)
 

Variables

static HANDLE
 
static LPCWSTR
 
static LPWSTR
 
static SIZE_T
 
static SIZE_T *static const GUID ULONG
 
static SIZE_T *static const GUID PUNICODE_STRING
 
static SIZE_T *static const GUID PACTCTX_SECTION_KEYED_DATA
 
static PCSZ
 
static const char manifest1 []
 
static const char manifest1_1 []
 
static const char manifest2 []
 
static const char manifest3 []
 
static const char manifest_wndcls1 []
 
static const char manifest_wndcls2 []
 
static const char manifest_wndcls_main []
 
static const char manifest4 []
 
static const char manifest5 []
 
static const char manifest6 []
 
static const char manifest7 []
 
static const char manifest8 []
 
static const char manifest9 []
 
static const char manifest10 []
 
static const char manifest11 []
 
static const char testdep_manifest1 []
 
static const char testdep_manifest2 []
 
static const char testdep_manifest3 []
 
static const char wrong_manifest1 []
 
static const char wrong_manifest2 []
 
static const char wrong_manifest3 []
 
static const char wrong_manifest4 []
 
static const char wrong_manifest5 []
 
static const char wrong_manifest6 []
 
static const char wrong_manifest7 []
 
static const char wrong_manifest8 []
 
static const char wrong_manifest9 []
 
static const char wrong_manifest10 []
 
static const char wrong_manifest11 []
 
static const char wrong_depmanifest1 []
 
static const char compat_manifest_no_supportedOs []
 
static const char compat_manifest_vista []
 
static const char compat_manifest_vista_7_8_10_81 []
 
static const char compat_manifest_other_guid []
 
static const char settings_manifest []
 
static const char settings_manifest2 []
 
static const char settings_manifest3 []
 
static const char settings_manifest4 []
 
static const char two_dll_manifest_dll []
 
static const char two_dll_manifest_exe []
 
static const char builtin_dll_manifest []
 
static const char empty_assembly_manifest []
 
static const WCHAR testlib_dll []
 
static const WCHAR testlib2_dll []
 
static const WCHAR wndClassW []
 
static const WCHAR wndClass1W []
 
static const WCHAR wndClass2W []
 
static const WCHAR wndClass3W []
 
static WCHAR app_dir [MAX_PATH]
 
static WCHAR exe_path [MAX_PATH]
 
static WCHAR work_dir [MAX_PATH]
 
static WCHAR work_dir_subdir [MAX_PATH]
 
static WCHAR app_manifest_path [MAX_PATH]
 
static WCHAR manifest_path [MAX_PATH]
 
static WCHAR depmanifest_path [MAX_PATH]
 
static const detailed_info_t detailed_info0
 
static const detailed_info_t detailed_info1
 
static const detailed_info_t detailed_info1_child
 
static const detailed_info_t detailed_info2
 
static const info_in_assembly manifest1_info
 
static const info_in_assembly manifest1_child_info
 
static const info_in_assembly manifest2_info
 
static const info_in_assembly manifest3_info
 
static const info_in_assembly manifest4_info
 
static const info_in_assembly depmanifest1_info
 
static const info_in_assembly depmanifest2_info
 
static const info_in_assembly depmanifest3_info
 
static const info_in_assembly manifest_comctrl_info
 
static const runlevel_info_t runlevel_info0
 
static const runlevel_info_t runlevel_info6
 
static const runlevel_info_t runlevel_info7
 
static const runlevel_info_t runlevel_info8
 
static const runlevel_info_t runlevel_info9
 
static const detailed_info_t detailed_info3
 

Macro Definition Documentation

◆ ARCH

#define ARCH   "none"

Definition at line 47 of file actctx.c.

◆ DLL_REDIRECT_PATH_EXPAND

#define DLL_REDIRECT_PATH_EXPAND   4

Definition at line 1258 of file actctx.c.

◆ DLL_REDIRECT_PATH_INCLUDES_BASE_NAME

#define DLL_REDIRECT_PATH_INCLUDES_BASE_NAME   1

Definition at line 1256 of file actctx.c.

◆ DLL_REDIRECT_PATH_OMITS_ASSEMBLY_ROOT

#define DLL_REDIRECT_PATH_OMITS_ASSEMBLY_ROOT   2

Definition at line 1257 of file actctx.c.

◆ DLL_REDIRECT_PATH_SYSTEM_DEFAULT_REDIRECTED_SYSTEM32_DLL

#define DLL_REDIRECT_PATH_SYSTEM_DEFAULT_REDIRECTED_SYSTEM32_DLL   8

Definition at line 1259 of file actctx.c.

◆ GUIDSECTION_MAGIC

#define GUIDSECTION_MAGIC   0x64487347 /* dHsG */

◆ LANGID_PREC_MAX_COUNT

#define LANGID_PREC_MAX_COUNT   5

Definition at line 4182 of file actctx.c.

◆ subtest_manifest_res

#define subtest_manifest_res (   d,
  e,
  t,
  l 
)    subtest_manifest_res_(__LINE__,d,e,t,l)

Definition at line 3957 of file actctx.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 20 of file actctx.c.

◆ X

#define X (   f)    if (!(p##f = (void*)GetProcAddress(hLibrary, #f))) return FALSE;

Typedef Documentation

◆ test_act_ctx_compat_info

Enumeration Type Documentation

◆ comclass_miscfields

Enumerator
MiscStatus 
MiscStatusIcon 
MiscStatusContent 
MiscStatusThumbnail 
MiscStatusDocPrint 
MiscStatus 
MiscStatusIcon 
MiscStatusContent 
MiscStatusThumbnail 
MiscStatusDocPrint 
MiscStatus 
MiscStatusIcon 
MiscStatusContent 
MiscStatusThumbnail 
MiscStatusDocPrint 

Definition at line 1578 of file actctx.c.

1578 {
1579 MiscStatus = 1,
1580 MiscStatusIcon = 2,
1584};
@ MiscStatusContent
Definition: actctx.c:1581
@ MiscStatusThumbnail
Definition: actctx.c:1582
@ MiscStatus
Definition: actctx.c:1579
@ MiscStatusDocPrint
Definition: actctx.c:1583
@ MiscStatusIcon
Definition: actctx.c:1580

◆ comclass_threadingmodel

Enumerator
ThreadingModel_Apartment 
ThreadingModel_Free 
ThreadingModel_No 
ThreadingModel_Both 
ThreadingModel_Neutral 
ThreadingModel_Apartment 
ThreadingModel_Free 
ThreadingModel_No 
ThreadingModel_Both 
ThreadingModel_Neutral 
ThreadingModel_Apartment 
ThreadingModel_Free 
ThreadingModel_No 
ThreadingModel_Both 
ThreadingModel_Neutral 

Definition at line 1570 of file actctx.c.

1570 {
1576};
@ ThreadingModel_No
Definition: actctx.c:1573
@ ThreadingModel_Both
Definition: actctx.c:1574
@ ThreadingModel_Neutral
Definition: actctx.c:1575
@ ThreadingModel_Free
Definition: actctx.c:1572
@ ThreadingModel_Apartment
Definition: actctx.c:1571

◆ ifaceps_mask

Enumerator
NumMethods 
BaseIface 
NumMethods 
BaseIface 

Definition at line 1778 of file actctx.c.

1779{
1780 NumMethods = 1,
1781 BaseIface = 2
1782};
@ BaseIface
Definition: actctx.c:1781
@ NumMethods
Definition: actctx.c:1780

◆ winrt_threading_model

Enumerator
WINRT_THREADING_MODEL_BOTH 
WINRT_THREADING_MODEL_STA 
WINRT_THREADING_MODEL_MTA 

Definition at line 1440 of file actctx.c.

1441{
1445};
@ WINRT_THREADING_MODEL_BOTH
Definition: actctx.c:1442
@ WINRT_THREADING_MODEL_MTA
Definition: actctx.c:1444
@ WINRT_THREADING_MODEL_STA
Definition: actctx.c:1443

Function Documentation

◆ add_sxs_dll_manifest()

static void add_sxs_dll_manifest ( const char pathname,
const struct manifest_res_spec_list res_lists,
size_t  num_lists,
const char manifest 
)
static

Definition at line 3918 of file actctx.c.

3922{
3923 HANDLE update_h;
3924 BOOL ret;
3925 size_t i, j;
3926
3927 update_h = BeginUpdateResourceA(pathname, FALSE);
3928 ok(update_h != NULL, "BeginUpdateResourceA returned error %lu.\n", GetLastError());
3929
3930 for (i = 0; i < num_lists; i++)
3931 {
3932 for (j = 0; j < res_lists[i].count; j++)
3933 {
3934 const struct manifest_res_spec *res_spec = &res_lists[i].items[j];
3935 const char *cur_manifest = res_spec->override_manifest ? res_spec->override_manifest : manifest;
3936 ret = UpdateResourceA(update_h,
3938 res_spec->name,
3939 res_spec->lang,
3940 (void *)cur_manifest,
3941 strlen(cur_manifest));
3942 ok(ret, "UpdateResourceA returned error %lu.\n", GetLastError());
3943 }
3944 }
3945
3946 ret = EndUpdateResourceA(update_h, FALSE);
3947 ok(ret, "EndUpdateResourceA returned error %lu.\n", GetLastError());
3948}
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
BOOL WINAPI UpdateResourceA(HANDLE hUpdate, LPCSTR lpType, LPCSTR lpName, WORD wLanguage, LPVOID lpData, DWORD cbData)
Definition: res.c:1738
HANDLE WINAPI BeginUpdateResourceA(LPCSTR pFileName, BOOL bDeleteExistingResources)
Definition: res.c:1657
BOOL WINAPI EndUpdateResourceA(HANDLE hUpdate, BOOL fDiscard)
Definition: res.c:1697
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
return ret
Definition: mutex.c:146
unsigned int BOOL
Definition: ntddk_ex.h:94
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
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 GLint GLint j
Definition: glfuncs.h:250
char pathname[512]
Definition: util.h:13
const struct manifest_res_spec * items
Definition: actctx.c:3915
const char * override_manifest
Definition: actctx.c:3909
const char * name
Definition: actctx.c:3907
static const CHAR manifest[]
Definition: v6util.h:41
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define RT_MANIFEST
Definition: winuser.h:625

Referenced by subtest_manifest_res_().

◆ BOOL()

static BOOL ( WINAPI pQueryActCtxSettingsW)
static

◆ BOOLEAN()

static BOOLEAN ( NTAPI pRtlCreateUnicodeStringFromAsciiz)
static

◆ clean_sxs_info()

static void clean_sxs_info ( sxs_info info)
static

Definition at line 3651 of file actctx.c.

3652{
3653 if (info->handle_context)
3654 ReleaseActCtx(info->handle_context);
3655 if (*info->path_dll)
3656 {
3657 BOOL ret = DeleteFileA(info->path_dll);
3658 ok(ret, "DeleteFileA failed for %s: %ld\n", info->path_dll, GetLastError());
3659 }
3660 if (*info->path_manifest_exe)
3661 {
3662 BOOL ret = DeleteFileA(info->path_manifest_exe);
3663 ok(ret, "DeleteFileA failed for %s: %ld\n", info->path_manifest_exe, GetLastError());
3664 }
3665 if (*info->path_manifest_dll)
3666 {
3667 BOOL ret = DeleteFileA(info->path_manifest_dll);
3668 ok(ret, "DeleteFileA failed for %s: %ld\n", info->path_manifest_dll, GetLastError());
3669 }
3670 if (*info->path_tmp)
3671 {
3672 BOOL ret = RemoveDirectoryA(info->path_tmp);
3673 ok(ret, "RemoveDirectoryA failed for %s: %ld\n", info->path_tmp, GetLastError());
3674 }
3675}
VOID WINAPI ReleaseActCtx(IN HANDLE hActCtx)
Definition: actctx.c:208
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714

Referenced by test_one_sxs_and_one_local_1(), test_one_sxs_and_one_local_2(), test_one_with_sxs_and_GetModuleHandleA(), and test_two_dlls_at_same_time().

◆ create_manifest()

static HANDLE create_manifest ( const char filename,
const char data,
int  line 
)
static

Definition at line 2585 of file actctx.c.

2586{
2587 HANDLE handle;
2589
2591 ok_(__FILE__, line)(handle != INVALID_HANDLE_VALUE,
2592 "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2593
2595 return handle;
2596}
#define ok_(x1, x2)
Definition: atltest.h:61
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
const char * filename
Definition: ioapi.h:137
static void test_create(void)
Definition: monthcal.c:1595
static BOOL create_manifest_file(const char *filename, const char *manifest, int manifest_len, const char *depfile, const char *depmanifest)
Definition: actctx.c:589
Definition: parser.c:49

Referenced by test_findsectionstring(), and test_ZombifyActCtx().

◆ create_manifest_file()

static BOOL create_manifest_file ( const char filename,
const char manifest,
int  manifest_len,
const char depfile,
const char depmanifest 
)
static

Definition at line 589 of file actctx.c.

591{
592 DWORD size;
593 HANDLE file;
595
598
599 if (manifest_len == -1)
600 manifest_len = strlen(manifest);
601
604 ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError());
606 return FALSE;
607 WriteFile(file, manifest, manifest_len, &size, NULL);
609
610 if (depmanifest)
611 {
612 MultiByteToWideChar( CP_ACP, 0, depfile, -1, path, MAX_PATH );
616 ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError());
618 return FALSE;
619 WriteFile(file, depmanifest, strlen(depmanifest), &size, NULL);
621 }
622 return TRUE;
623}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:739
#define CP_ACP
Definition: compat.h:109
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define MultiByteToWideChar
Definition: compat.h:110
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
#define CREATE_ALWAYS
Definition: disk.h:72
static WCHAR depmanifest_path[MAX_PATH]
Definition: actctx.c:587
static WCHAR manifest_path[MAX_PATH]
Definition: actctx.c:587
#define GENERIC_WRITE
Definition: nt_native.h:90
Definition: fci.c:127
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by create_manifest(), create_wide_manifest(), fill_sxs_info(), run_child_process(), subtest_manifest_res_(), test_actctx(), test_allowDelayedBinding(), test_builtin_sxs(), test_compatibility(), test_create_and_fail(), test_dllredirect_section(), test_LoadRegTypeLib(), test_settings(), test_typelib_section(), and test_wndclass_section().

◆ create_temp_manifest_file()

static HANDLE create_temp_manifest_file ( const char manifest,
WCHAR pathname 
)
static

Definition at line 644 of file actctx.c.

645{
646 WCHAR tmp_path[MAX_PATH];
647 DWORD size, tmp_path_len;
648 HANDLE file, file_w;
649 UINT unique;
650
651 tmp_path_len = GetTempPathW(ARRAY_SIZE(tmp_path), tmp_path);
652 ok(tmp_path_len != 0, "GetTempPathW returned error %lu\n", GetLastError());
653 ok(tmp_path_len < ARRAY_SIZE(tmp_path), "GetTempPathW return value %lu should be less than %Iu\n",
654 tmp_path_len, ARRAY_SIZE(tmp_path));
655
656 memset(pathname, 0, MAX_PATH * sizeof(WCHAR));
657 unique = GetTempFileNameW(tmp_path, L"tst", 0, pathname);
658 ok(unique != 0, "GetTempFileNameW returned error %lu\n", GetLastError());
659
660 /* Open file handle that will be deleted on close or process termination */
664 NULL,
667 NULL);
668 ok(file != INVALID_HANDLE_VALUE, "CreateFile returned error %lu\n", GetLastError());
669
670 /* Re-open file with write access */
671 file_w = CreateFileW(pathname,
674 NULL,
677 NULL);
678 ok(file_w != INVALID_HANDLE_VALUE, "CreateFile returned error %lu\n", GetLastError());
679
681
682 /* Close file handle that was open for write to avoid sharing violation */
683 CloseHandle(file_w);
684
685 return file;
686}
#define GENERIC_READ
Definition: compat.h:135
#define FILE_SHARE_READ
Definition: compat.h:136
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2080
#define L(x)
Definition: resources.c:13
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
#define TRUNCATE_EXISTING
Definition: disk.h:71
#define FILE_FLAG_DELETE_ON_CLOSE
Definition: disk.h:42
unsigned int UINT
Definition: ndis.h:50
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define DELETE
Definition: nt_native.h:57
#define memset(x, y, z)
Definition: compat.h:39

Referenced by test_CreateActCtx_share_mode().

◆ create_wide_manifest()

static BOOL create_wide_manifest ( const char filename,
const char manifest,
BOOL  fBOM,
BOOL  fReverse 
)
static

Definition at line 625 of file actctx.c.

626{
627 WCHAR *wmanifest = HeapAlloc(GetProcessHeap(), 0, (strlen(manifest)+2) * sizeof(WCHAR));
628 BOOL ret;
629 int offset = (fBOM ? 0 : 1);
630
631 MultiByteToWideChar(CP_ACP, 0, manifest, -1, &wmanifest[1], (strlen(manifest)+1));
632 wmanifest[0] = 0xfeff;
633 if (fReverse)
634 {
635 size_t i;
636 for (i = 0; i < strlen(manifest)+1; i++)
637 wmanifest[i] = (wmanifest[i] << 8) | ((wmanifest[i] >> 8) & 0xff);
638 }
639 ret = create_manifest_file(filename, (char *)&wmanifest[offset], (strlen(manifest)+1-offset) * sizeof(WCHAR), NULL, NULL);
640 HeapFree(GetProcessHeap(), 0, wmanifest);
641 return ret;
642}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
GLintptr offset
Definition: glext.h:5920

Referenced by test_actctx(), and test_create_wide_and_fail().

◆ DEFINE_GUID() [1/19]

DEFINE_GUID ( CLSID_clrclass  ,
0x22345678  ,
0x1234  ,
0x5678  ,
0x12  ,
0x34  ,
0x11  ,
0x11  ,
0x22  ,
0x22  ,
0x33  ,
0x33   
)

◆ DEFINE_GUID() [2/19]

DEFINE_GUID ( IID_CoTest  ,
0x12345678  ,
0x1234  ,
0x5678  ,
0x12  ,
0x34  ,
0x11  ,
0x11  ,
0x22  ,
0x22  ,
0x33  ,
0x33   
)

◆ DEFINE_GUID() [3/19]

DEFINE_GUID ( IID_CoTest2  ,
0x12345678  ,
0x1234  ,
0x5678  ,
0x12  ,
0x34  ,
0x11  ,
0x11  ,
0x22  ,
0x22  ,
0x33  ,
0x34   
)

◆ DEFINE_GUID() [4/19]

DEFINE_GUID ( IID_Ibifaceps  ,
0x66666666  ,
0x8888  ,
0x7777  ,
0x66  ,
0x66  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x57   
)

◆ DEFINE_GUID() [5/19]

DEFINE_GUID ( IID_Iiface  ,
0x96666666  ,
0x8888  ,
0x7777  ,
0x66  ,
0x66  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55   
)

◆ DEFINE_GUID() [6/19]

DEFINE_GUID ( IID_Iifaceps  ,
0x66666666  ,
0x8888  ,
0x7777  ,
0x66  ,
0x66  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55   
)

◆ DEFINE_GUID() [7/19]

DEFINE_GUID ( IID_Iifaceps2  ,
0x76666666  ,
0x8888  ,
0x7777  ,
0x66  ,
0x66  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55   
)

◆ DEFINE_GUID() [8/19]

DEFINE_GUID ( IID_Iifaceps3  ,
0x86666666  ,
0x8888  ,
0x7777  ,
0x66  ,
0x66  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55   
)

◆ DEFINE_GUID() [9/19]

DEFINE_GUID ( IID_PS32  ,
0x66666666  ,
0x8888  ,
0x7777  ,
0x66  ,
0x66  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x56   
)

◆ DEFINE_GUID() [10/19]

DEFINE_GUID ( IID_TlibTest  ,
0x99999999  ,
0x8888  ,
0x7777  ,
0x66  ,
0x66  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55   
)

◆ DEFINE_GUID() [11/19]

DEFINE_GUID ( IID_TlibTest2  ,
0x99999999  ,
0x8888  ,
0x7777  ,
0x66  ,
0x66  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x56   
)

◆ DEFINE_GUID() [12/19]

DEFINE_GUID ( IID_TlibTest3  ,
0x99999999  ,
0x8888  ,
0x7777  ,
0x66  ,
0x66  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x57   
)

◆ DEFINE_GUID() [13/19]

DEFINE_GUID ( IID_TlibTest4  ,
0x99999999  ,
0x8888  ,
0x7777  ,
0x66  ,
0x66  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x55  ,
0x58   
)

◆ DEFINE_GUID() [14/19]

DEFINE_GUID ( OTHER_COMPAT_GUID  ,
0x12345566  ,
0x1111  ,
0x2222  ,
0x33  ,
0x33  ,
0x44  ,
0x44  ,
0x44  ,
0x44  ,
0x44  ,
0x44   
)

◆ DEFINE_GUID() [15/19]

DEFINE_GUID ( VISTA_COMPAT_GUID  ,
0xe2011457  ,
0x1546  ,
0x43c5  ,
0xa5  ,
0xfe  ,
0x00  ,
0x8d  ,
0xee  ,
0xe3  ,
0xd3  ,
0xf0   
)

◆ DEFINE_GUID() [16/19]

DEFINE_GUID ( WIN10_COMPAT_GUID  ,
0x8e0f7a12  ,
0xbfb3  ,
0x4fe8  ,
0xb9  ,
0xa5  ,
0x48  ,
0xfd  ,
0x50  ,
0xa1  ,
0x5a  ,
0x9a   
)

◆ DEFINE_GUID() [17/19]

DEFINE_GUID ( WIN7_COMPAT_GUID  ,
0x35138b9a  ,
0x5d96  ,
0x4fbd  ,
0x8e  ,
0x2d  ,
0xa2  ,
0x44  ,
0x02  ,
0x25  ,
0xf9  ,
0x3a   
)

◆ DEFINE_GUID() [18/19]

DEFINE_GUID ( WIN81_COMPAT_GUID  ,
0x1f676c76  ,
0x80e1  ,
0x4239  ,
0x95  ,
0xbb  ,
0x83  ,
0xd0  ,
0xf6  ,
0xd0  ,
0xda  ,
0x78   
)

◆ DEFINE_GUID() [19/19]

DEFINE_GUID ( WIN8_COMPAT_GUID  ,
0x4a2f28e3  ,
0x53b9  ,
0x4441  ,
0xba  ,
0x9c  ,
0xd6  ,
0x9d  ,
0x4a  ,
0x4a  ,
0x6e  ,
0x38   
)

◆ delete_manifest_file()

static void delete_manifest_file ( const char filename)
static

Definition at line 2790 of file actctx.c.

2791{
2793
2797}
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2054
strcat
Definition: string.h:92
char CHAR
Definition: xmlstorage.h:175

Referenced by test_CreateActCtx().

◆ extract_resource()

static void extract_resource ( const char name,
const char type,
const char path 
)
static

Definition at line 2799 of file actctx.c.

2800{
2801 DWORD written;
2802 HANDLE file;
2803 HRSRC res;
2804 void *ptr;
2805
2807 ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", path, GetLastError());
2808
2810 ok( res != 0, "couldn't find resource\n" );
2813 ok( written == SizeofResource( GetModuleHandleA(NULL), res ), "couldn't write resource\n" );
2814 CloseHandle( file );
2815}
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint res
Definition: glext.h:9613
static PVOID ptr
Definition: dispmode.c:27
Definition: name.c:39

Referenced by fill_sxs_info(), subtest_manifest_res_(), test_CreateActCtx(), test_one_sxs_and_one_local_1(), test_one_sxs_and_one_local_2(), and test_one_with_sxs_and_GetModuleHandleA().

◆ fill_sxs_info()

static BOOL fill_sxs_info ( sxs_info info,
const char temp,
const char path_dll,
const char exe_manifest,
const char dll_manifest,
BOOL  do_load 
)
static

Definition at line 3602 of file actctx.c.

3603{
3604 BOOL success;
3605
3606 GetTempPathA(MAX_PATH, info->path_tmp);
3607 strcat(info->path_tmp, temp);
3608 strcat(info->path_tmp, "\\");
3609 CreateDirectoryA(info->path_tmp, NULL);
3610
3611 sprintf(info->path_dll, "%s%s", info->path_tmp, "sxs_dll.dll");
3612 extract_resource(path_dll, "TESTDLL", info->path_dll);
3613
3614 sprintf(info->path_manifest_exe, "%s%s", info->path_tmp, "exe.manifest");
3615 create_manifest_file(info->path_manifest_exe, exe_manifest, -1, NULL, NULL);
3616
3617 sprintf(info->path_manifest_dll, "%s%s", info->path_tmp, "sxs_dll.manifest");
3618 create_manifest_file(info->path_manifest_dll, dll_manifest, -1, NULL, NULL);
3619
3620 info->context.cbSize = sizeof(ACTCTXA);
3621 info->context.lpSource = info->path_manifest_exe;
3622 info->context.lpAssemblyDirectory = info->path_tmp;
3623 info->context.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
3624
3625 info->handle_context = CreateActCtxA(&info->context);
3626 ok((info->handle_context != NULL && info->handle_context != INVALID_HANDLE_VALUE )
3627 || broken(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX), /* XP doesn't support manifests outside of PE files */
3628 "CreateActCtxA failed: %ld\n", GetLastError());
3630 {
3631 skip("Failed to create activation context.\n");
3632 return FALSE;
3633 }
3634
3635 if (do_load)
3636 {
3637 success = ActivateActCtx(info->handle_context, &info->cookie);
3638 ok(success, "ActivateActCtx failed: %ld\n", GetLastError());
3639
3640 info->module = LoadLibraryA("sxs_dll.dll");
3641 ok(info->module != NULL, "LoadLibrary failed\n");
3642
3643 info->get_path = (void *)GetProcAddress(info->module, "get_path");
3644 ok(info->get_path != NULL, "GetProcAddress failed\n");
3645
3646 DeactivateActCtx(0, info->cookie);
3647 }
3648 return TRUE;
3649}
#define skip(...)
Definition: atltest.h:64
#define broken(x)
Definition: atltest.h:178
#define GetProcAddress(x, y)
Definition: compat.h:753
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
Definition: actctx.c:268
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
Definition: actctx.c:237
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
HANDLE WINAPI CreateActCtxA(PCACTCTXA pActCtx)
Definition: actctx.c:26
#define sprintf
Definition: sprintf.c:45
static void extract_resource(const char *name, const char *type, const char *path)
Definition: actctx.c:2799
static calc_node_t temp
Definition: rpn_ieee.c:38
#define success(from, fromstr, to, tostr)
#define ERROR_SXS_CANT_GEN_ACTCTX
Definition: winerror.h:3095

Referenced by test_one_sxs_and_one_local_1(), test_one_sxs_and_one_local_2(), test_one_with_sxs_and_GetModuleHandleA(), and test_two_dlls_at_same_time().

◆ get_application_directory()

static void get_application_directory ( char buffer,
int  buffer_size 
)
static

Definition at line 3677 of file actctx.c.

3678{
3679 char *end;
3681 end = strrchr(buffer, '\\');
3682 end[1] = 0;
3683}
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
_ACRTIMP char *__cdecl strrchr(const char *, int)
Definition: string.c:3298
GLuint GLuint end
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
wchar_t const *const size_t const buffer_size
Definition: stat.cpp:95

Referenced by test_one_sxs_and_one_local_1(), and test_one_sxs_and_one_local_2().

◆ get_langid_precedence()

static void get_langid_precedence ( LANGID langs_arr,
size_t lang_count 
)
static

Definition at line 4184 of file actctx.c.

4185{
4186 LANGID src_langs[LANGID_PREC_MAX_COUNT];
4187 LANGID user_ui_lang;
4188 size_t i, j, n = 0;
4189
4190 user_ui_lang = GetUserDefaultUILanguage();
4191
4192 src_langs[0] = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL);
4193 src_langs[1] = user_ui_lang;
4194 src_langs[2] = MAKELANGID(PRIMARYLANGID(user_ui_lang), SUBLANG_NEUTRAL);
4195 src_langs[3] = MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT);
4196 src_langs[4] = 0x1; /* least number that is a valid LANGID */
4197
4198 for (i = 0; i < ARRAY_SIZE(src_langs); i++)
4199 {
4200 LANGID item = src_langs[i];
4201 BOOL is_item_duplicate = FALSE;
4202
4203 for (j = 0; j < n; j++)
4204 {
4205 if (langs_arr[j] == item)
4206 {
4207 is_item_duplicate = TRUE;
4208 break;
4209 }
4210 }
4211
4212 if (!is_item_duplicate)
4213 {
4214 langs_arr[n++] = item;
4215 }
4216 }
4217
4218 *lang_count = n;
4219}
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: locale.c:1380
GLdouble n
Definition: glext.h:7729
USHORT LANGID
Definition: mui.h:9
#define LANGID_PREC_MAX_COUNT
Definition: actctx.c:4182
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_ENGLISH
Definition: nls.h:52
#define SUBLANG_NEUTRAL
Definition: nls.h:167
#define SUBLANG_DEFAULT
Definition: nls.h:168
#define PRIMARYLANGID(l)
Definition: nls.h:16

Referenced by subtest_valid_manifest_resources_locale().

◆ init_funcs()

static BOOL init_funcs ( void  )
static

Definition at line 3117 of file actctx.c.

3118{
3119 HMODULE hLibrary = GetModuleHandleA("kernel32.dll");
3120
3121#define X(f) if (!(p##f = (void*)GetProcAddress(hLibrary, #f))) return FALSE;
3122 pQueryActCtxSettingsW = (void *)GetProcAddress( hLibrary, "QueryActCtxSettingsW" );
3123
3124 hLibrary = GetModuleHandleA("ntdll.dll");
3128#undef X
3129
3130 return TRUE;
3131}
HMODULE hLibrary
Definition: odbccp32.c:12
NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG, const GUID *, ULONG, const UNICODE_STRING *, PVOID)
Definition: actctx.c:5874
#define X(f)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)

Referenced by START_TEST().

◆ init_paths()

static void init_paths ( void  )
static

Definition at line 2751 of file actctx.c.

2752{
2753 LPWSTR ptr;
2754
2755 static const WCHAR dot_manifest[] = {'.','M','a','n','i','f','e','s','t',0};
2756 static const WCHAR backslash[] = {'\\',0};
2757 static const WCHAR subdir[] = {'T','e','s','t','S','u','b','d','i','r','\\',0};
2758
2761 for(ptr=app_dir+lstrlenW(app_dir); *ptr != '\\' && *ptr != '/'; ptr--);
2762 ptr[1] = 0;
2763
2765 ptr = work_dir + lstrlenW( work_dir ) - 1;
2766 if (*ptr != '\\' && *ptr != '/')
2767 lstrcatW(work_dir, backslash);
2769 lstrcatW(work_dir_subdir, subdir);
2770
2773}
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static WCHAR work_dir_subdir[MAX_PATH]
Definition: actctx.c:586
static WCHAR exe_path[MAX_PATH]
Definition: actctx.c:586
static WCHAR app_manifest_path[MAX_PATH]
Definition: actctx.c:587
static WCHAR work_dir[MAX_PATH]
Definition: actctx.c:586
static WCHAR app_dir[MAX_PATH]
Definition: actctx.c:586
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by START_TEST().

◆ kernel32_find()

static void kernel32_find ( ULONG  section,
const char string_to_find,
BOOL  should_find,
BOOL  todo,
int  line 
)
static

Definition at line 2598 of file actctx.c.

2599{
2600 UNICODE_STRING string_to_findW;
2601 ACTCTX_SECTION_KEYED_DATA data;
2602 BOOL ret;
2603 DWORD err;
2604
2605 pRtlCreateUnicodeStringFromAsciiz(&string_to_findW, string_to_find);
2606
2607 memset(&data, 0xfe, sizeof(data));
2608 data.cbSize = sizeof(data);
2609
2610 SetLastError(0);
2611 ret = FindActCtxSectionStringA(0, NULL, section, string_to_find, &data);
2612 err = GetLastError();
2613 ok_(__FILE__, line)(ret == should_find,
2614 "FindActCtxSectionStringA: expected ret = %u, got %u\n", should_find, ret);
2616 ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
2617 "FindActCtxSectionStringA: unexpected error %lu\n", err);
2618
2619 memset(&data, 0xfe, sizeof(data));
2620 data.cbSize = sizeof(data);
2621
2622 SetLastError(0);
2623 ret = FindActCtxSectionStringW(0, NULL, section, string_to_findW.Buffer, &data);
2624 err = GetLastError();
2625 ok_(__FILE__, line)(ret == should_find,
2626 "FindActCtxSectionStringW: expected ret = %u, got %u\n", should_find, ret);
2628 ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
2629 "FindActCtxSectionStringW: unexpected error %lu\n", err);
2630
2631 SetLastError(0);
2632 ret = FindActCtxSectionStringA(0, NULL, section, string_to_find, NULL);
2633 err = GetLastError();
2634 ok_(__FILE__, line)(!ret,
2635 "FindActCtxSectionStringA: expected failure, got %u\n", ret);
2636 ok_(__FILE__, line)(err == ERROR_INVALID_PARAMETER,
2637 "FindActCtxSectionStringA: unexpected error %lu\n", err);
2638
2639 SetLastError(0);
2640 ret = FindActCtxSectionStringW(0, NULL, section, string_to_findW.Buffer, NULL);
2641 err = GetLastError();
2642 ok_(__FILE__, line)(!ret,
2643 "FindActCtxSectionStringW: expected failure, got %u\n", ret);
2644 ok_(__FILE__, line)(err == ERROR_INVALID_PARAMETER,
2645 "FindActCtxSectionStringW: unexpected error %lu\n", err);
2646
2647 pRtlFreeUnicodeString(&string_to_findW);
2648}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
BOOL WINAPI FindActCtxSectionStringW(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, LPCWSTR lpSearchStr, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:238
BOOL WINAPI FindActCtxSectionStringA(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, LPCSTR lpSearchStr, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:206
#define todo_wine_if(is_todo)
Definition: minitest.h:81
BOOL todo
Definition: filedlg.c:313
#define err(...)
Definition: parser.c:56
#define ERROR_SXS_KEY_NOT_FOUND
Definition: winerror.h:3101

Referenced by test_findsectionstring().

◆ ntdll_find()

static void ntdll_find ( ULONG  section,
const char string_to_find,
BOOL  should_find,
BOOL  todo,
int  line 
)
static

Definition at line 2650 of file actctx.c.

2651{
2652 UNICODE_STRING string_to_findW;
2653 ACTCTX_SECTION_KEYED_DATA data;
2654 NTSTATUS ret;
2655
2656 pRtlCreateUnicodeStringFromAsciiz(&string_to_findW, string_to_find);
2657
2658 memset(&data, 0xfe, sizeof(data));
2659 data.cbSize = sizeof(data);
2660
2661 ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, &data);
2663 ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
2664 "RtlFindActivationContextSectionString: unexpected status 0x%lx\n", ret);
2665
2666 ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, NULL);
2668 ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
2669 "RtlFindActivationContextSectionString: unexpected status 0x%lx\n", ret);
2670
2671 pRtlFreeUnicodeString(&string_to_findW);
2672}
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_SXS_KEY_NOT_FOUND
Definition: ntstatus.h:1777
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by test_findsectionstring().

◆ NTSTATUS()

static SIZE_T *static NTSTATUS ( NTAPI pRtlFindActivationContextSectionString)
static

◆ run_child_process()

static void run_child_process ( void  )
static

Definition at line 2713 of file actctx.c.

2714{
2715 char cmdline[MAX_PATH];
2716 char path[MAX_PATH];
2717 char **argv;
2719 STARTUPINFOA si = { 0 };
2720 HANDLE file;
2721 FILETIME now;
2722 BOOL ret;
2723
2725 strcat(path, ".manifest");
2727 skip("Could not create manifest file\n");
2728 return;
2729 }
2730
2731 si.cb = sizeof(si);
2733 /* Vista+ seems to cache presence of .manifest files. Change last modified
2734 date to defeat the cache */
2736 NULL, OPEN_EXISTING, 0, NULL);
2737 if (file != INVALID_HANDLE_VALUE) {
2741 }
2742 sprintf(cmdline, "\"%s\" %s manifest1", argv[0], argv[1]);
2743 ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
2744 ok(ret, "Could not create process: %lu\n", GetLastError());
2749}
#define OPEN_EXISTING
Definition: compat.h:775
BOOL WINAPI SetFileTime(IN HANDLE hFile, CONST FILETIME *lpCreationTime OPTIONAL, CONST FILETIME *lpLastAccessTime OPTIONAL, CONST FILETIME *lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:948
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4749
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
time_t now
Definition: finger.c:65
static const char manifest1[]
Definition: actctx.c:50
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
static SYSTEM_INFO si
Definition: virtual.c:39
#define argv
Definition: mplay32.c:18
#define FILE_WRITE_ATTRIBUTES
Definition: nt_native.h:649
int winetest_get_mainargs(char ***pargv)
#define wait_child_process
Definition: test.h:177
TCHAR * cmdline
Definition: stretchblt.cpp:32

Referenced by START_TEST().

◆ run_child_process_two_dll()

static void run_child_process_two_dll ( int  run)
static

Definition at line 4356 of file actctx.c.

4357{
4358 char cmdline[MAX_PATH];
4359 char exe[MAX_PATH];
4360 char **argv;
4362 STARTUPINFOA si = { 0 };
4363 BOOL ret;
4364
4366
4367 if (strstr(argv[0], ".exe"))
4368 sprintf(exe, "%s", argv[0]);
4369 else
4370 sprintf(exe, "%s.exe", argv[0]);
4371 sprintf(cmdline, "\"%s\" %s two_dll %d", argv[0], argv[1], run);
4372
4373 si.cb = sizeof(si);
4374 ret = CreateProcessA(exe, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
4375 ok(ret, "Could not create process: %lu\n", GetLastError());
4376
4378
4381}
_ACRTIMP char *__cdecl strstr(const char *, const char *)
Definition: string.c:3415

Referenced by START_TEST().

◆ run_sxs_test()

static void run_sxs_test ( int  run)
static

Definition at line 4334 of file actctx.c.

4335{
4336 switch(run)
4337 {
4338 case 1:
4340 break;
4341 case 2:
4343 break;
4344 case 3:
4346 break;
4347 case 4:
4349 break;
4350 case 5:
4352 break;
4353 }
4354}
static void test_one_sxs_and_one_local_1(void)
Definition: actctx.c:3714
static void test_one_with_sxs_and_GetModuleHandleA(void)
Definition: actctx.c:3795
static void test_two_dlls_at_same_time(void)
Definition: actctx.c:3686
static void test_builtin_sxs(void)
Definition: actctx.c:3834
static void test_one_sxs_and_one_local_2(void)
Definition: actctx.c:3754

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( actctx  )

Definition at line 4474 of file actctx.c.

4475{
4476 int argc;
4477 char **argv;
4478
4480
4481 if (!init_funcs())
4482 {
4483 win_skip("Needed functions are not available\n");
4484 return;
4485 }
4486 init_paths();
4487
4488 if(argc > 2 && !strcmp(argv[2], "manifest1")) {
4490 return;
4491 }
4492
4493 if (argc > 2 && !strcmp(argv[2], "two_dll"))
4494 {
4495 int run = atoi(argv[3]);
4496 run_sxs_test(run);
4497 return;
4498 }
4499
4504 test_actctx();
4512 test_settings();
4513#ifdef __REACTOS__
4515#endif
4521#ifdef __REACTOS__
4522 }
4523#endif
4524}
static int argc
Definition: ServiceArgs.c:12
#define GetNTVersion()
Definition: apitest.h:17
_ACRTIMP int __cdecl atoi(const char *)
Definition: string.c:1715
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3319
#define win_skip
Definition: minitest.h:67
static void test_CreateActCtx(void)
Definition: actctx.c:2817
static BOOL init_funcs(void)
Definition: actctx.c:3117
static void test_actctx(void)
Definition: actctx.c:2194
static void test_compatibility(void)
Definition: actctx.c:3301
static void test_settings(void)
Definition: actctx.c:3427
static void init_paths(void)
Definition: actctx.c:2751
static void test_manifest_in_module(void)
Definition: actctx.c:4390
static void test_ZombifyActCtx(void)
Definition: actctx.c:3133
static void run_sxs_test(int run)
Definition: actctx.c:4334
static void test_valid_manifest_resources_locale(void)
Definition: actctx.c:4314
static void test_manifest_resources(void)
Definition: actctx.c:4080
static void test_create_fail(void)
Definition: actctx.c:1143
static void test_findsectionstring(void)
Definition: actctx.c:2674
static void run_child_process(void)
Definition: actctx.c:2713
static void test_CreateActCtx_share_mode(void)
Definition: actctx.c:3092
static void test_app_manifest(void)
Definition: actctx.c:2567
static void run_child_process_two_dll(int run)
Definition: actctx.c:4356
static void test_manifest_resource_name_omitted(void)
Definition: actctx.c:4415
#define _WIN32_WINNT_VISTA
Definition: sdkddkver.h:25

◆ subtest_manifest_res_()

static DWORD subtest_manifest_res_ ( int  line,
const char manifest_exe,
const char manifest_dll,
const struct multiple_manifest_test test_data,
LANGID  lang 
)
static

Definition at line 3958 of file actctx.c.

3960{
3961 char path_tmp[MAX_PATH] = "", path_dll[MAX_PATH] = "", path_manifest_exe[MAX_PATH] = "";
3962 static const char path_tmp_suffix[] = "winek32t\\";
3964 struct manifest_res_spec_list res_lists[2];
3965 char path_tmp_lang[MAX_PATH] = "";
3966 static volatile LONG last_uniqid;
3967 DWORD err, prefix_len;
3968 ACTCTXA actctx;
3969 HANDLE handle;
3970 BOOL ret;
3971 int r;
3972
3973 prefix_len = GetTempPathA(MAX_PATH - ARRAY_SIZE(path_tmp_suffix), path_tmp);
3974 ok_(__FILE__, line)(prefix_len > 0, "GetTempPathA returned error %lu.\n", GetLastError());
3975
3976 memcpy(&path_tmp[prefix_len], path_tmp_suffix, sizeof(path_tmp_suffix) - sizeof(*path_tmp_suffix));
3977 ret = CreateDirectoryA(path_tmp, NULL);
3978 ok_(__FILE__, line)(ret || GetLastError() == ERROR_ALREADY_EXISTS,
3979 "CreateDirectoryA returned error %lu.\n", GetLastError());
3980
3981 if (lang)
3982 {
3983#if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
3986 ok(r > 0, "lang 0x%04x, error %lu.\n", lang, GetLastError());
3987#endif
3988 }
3989
3990 if (locale_name[0])
3991 {
3992 r = snprintf(path_tmp_lang, ARRAY_SIZE(path_tmp_lang), "%s%ls\\", path_tmp, locale_name);
3993 ok_(__FILE__, line)(r > 0 && r < ARRAY_SIZE(path_tmp_lang), "got %d\n", r);
3994
3995 ret = CreateDirectoryA(path_tmp_lang, NULL);
3996 ok_(__FILE__, line)(ret || GetLastError() == ERROR_ALREADY_EXISTS,
3997 "CreateDirectoryA returned error %lu.\n", GetLastError());
3998 }
3999 else
4000 {
4001 r = snprintf(path_tmp_lang, ARRAY_SIZE(path_tmp_lang), "%s", path_tmp);
4002 ok_(__FILE__, line)(r > 0 && r < ARRAY_SIZE(path_tmp_lang), "got %d\n", r);
4003 }
4004
4005 r = snprintf(path_dll, ARRAY_SIZE(path_dll), "%s%s", path_tmp_lang, "sxs_dll.dll");
4006 ok_(__FILE__, line)(r > 0 && r < ARRAY_SIZE(path_dll), "got %d\n", r);
4007
4008 r = snprintf(path_manifest_exe, ARRAY_SIZE(path_manifest_exe), "%sexe%08lx.manifest",
4009 path_tmp, InterlockedIncrement(&last_uniqid));
4010 ok_(__FILE__, line)(r > 0 && r < ARRAY_SIZE(path_manifest_exe), "got %d\n", r);
4011 create_manifest_file(path_manifest_exe, manifest_exe, -1, NULL, NULL);
4012
4013 extract_resource("dummy.dll", "TESTDLL", path_dll);
4014
4015 res_lists[0].count = test_data->manifest_inline.name ? 1 : 0;
4016 res_lists[0].items = &test_data->manifest_inline;
4017
4018 if (test_data->manifests)
4019 {
4020 size_t n = 0;
4021
4022 while (test_data->manifests[n].name)
4023 n++;
4024
4025 res_lists[1].count = n;
4026 res_lists[1].items = test_data->manifests;
4027 }
4028 else
4029 {
4030 res_lists[1].count = 0;
4031 res_lists[1].items = NULL;
4032 }
4033
4034 add_sxs_dll_manifest(path_dll, res_lists, ARRAY_SIZE(res_lists), manifest_dll);
4035
4036 memset(&actctx, 0, sizeof(actctx));
4037 actctx.cbSize = sizeof(actctx);
4038 actctx.lpSource = path_manifest_exe;
4039 actctx.lpAssemblyDirectory = path_tmp;
4040 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
4041
4042 SetLastError(0xccccccccUL);
4045 {
4046 err = GetLastError();
4047 ok_(__FILE__, line)(err != ERROR_SUCCESS, "got %#lx.\n", err);
4048 }
4049 else
4050 {
4052 ok_(__FILE__, line)(handle != NULL, "CreateActCtxA returned %p (error %lu)\n", handle, err);
4054 }
4055 ok_(__FILE__, line)(err == test_data->expected_error,
4056 "expected error %lu, got %lu\n", test_data->expected_error, err);
4057
4058 ret = DeleteFileA(path_manifest_exe);
4059 ok_(__FILE__, line)(ret, "DeleteFileA(%s) returned error %lu\n.",
4060 debugstr_a(path_manifest_exe), GetLastError());
4061
4062 ret = DeleteFileA(path_dll);
4063 ok_(__FILE__, line)(ret, "DeleteFileA(%s) returned error %lu\n.", debugstr_a(path_dll), GetLastError());
4064
4065 if (locale_name[0])
4066 {
4067 ret = RemoveDirectoryA(path_tmp_lang);
4068 ok_(__FILE__, line)(ret, "RemoveDirectoryA(%s) returned error %lu\n.",
4069 debugstr_a(path_tmp_lang), GetLastError());
4070 }
4071
4072 ret = RemoveDirectoryA(path_tmp);
4073 ok_(__FILE__, line)(ret, "RemoveDirectoryA(%s) returned error %lu %s\n.",
4074 debugstr_a(path_tmp), GetLastError(), debugstr_a(path_tmp_lang));
4075
4076 return err;
4077}
int WINAPI LCIDToLocaleName(_In_ LCID Locale, _Out_writes_opt_(cchName) LPWSTR lpName, _In_ int cchName, _In_ DWORD dwFlags)
#define InterlockedIncrement
Definition: armddk.h:53
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define debugstr_a
Definition: kernel32.h:31
#define actctx
Definition: kernel32.h:8
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
static void add_sxs_dll_manifest(const char *pathname, const struct manifest_res_spec_list *res_lists, size_t num_lists, const char *manifest)
Definition: actctx.c:3918
#define LOCALE_NAME_MAX_LENGTH
#define SORT_DEFAULT
#define MAKELCID(lgid, srtid)
long LONG
Definition: pedump.c:60
int count
Definition: metadata.c:421
static const WCHAR lang[]
Definition: wbemdisp.c:287
#define LOCALE_ALLOW_NEUTRAL_NAMES
Definition: winnls.h:25
#define snprintf
Definition: wintirpc.h:48

◆ subtest_valid_manifest_resources_locale()

static void subtest_valid_manifest_resources_locale ( LANGID  actctx_lang)
static

Definition at line 4221 of file actctx.c.

4222{
4223 static const char manifest_exe_fmt[] =
4224 "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
4225 "<dependency>"
4226 "<dependentAssembly>"
4227 "<assemblyIdentity type=\"win32\" name=\"sxs_dll\" version=\"1.0.0.0\""
4228 " processorArchitecture=\"" ARCH "\" publicKeyToken=\"0000000000000000\" language=\"%ls\"/>"
4229 "</dependentAssembly>"
4230 "</dependency>"
4231 "</assembly>";
4232 static const char manifest_dll_fmt[] =
4233 "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v3\" manifestVersion=\"1.0\">"
4234 "<assemblyIdentity type=\"win32\" name=\"sxs_dll\" version=\"1.0.0.0\""
4235 " processorArchitecture=\"" ARCH "\" publicKeyToken=\"0000000000000000\" language=\"%ls\"/>"
4236 "</assembly>";
4237 static const char manifest_dll_nofmt[] =
4238 "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v3\" manifestVersion=\"1.0\">"
4239 "<assemblyIdentity type=\"win32\" name=\"sxs_dll\" version=\"1.0.0.0\""
4240 " processorArchitecture=\"" ARCH "\" publicKeyToken=\"0000000000000000\"/>"
4241 "</assembly>";
4242 char manifest_exe[1024], manifest_dll[1024];
4244 UINT16 langs_arr[LANGID_PREC_MAX_COUNT];
4245 size_t lang_count = 0, i, j;
4246 int ret;
4247
4248 if (actctx_lang == MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL))
4249 {
4250 wcscpy(locale_name, L"*");
4251 strcpy(manifest_dll, manifest_dll_nofmt);
4252 }
4253 else
4254 {
4255 actctx_lang = ConvertDefaultLocale(actctx_lang);
4256 ok(actctx_lang != MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
4257 "unexpected neutral locale\n");
4258#if !defined(__REACTOS__) || DLL_EXPORT_VERSION >= 0x600
4259 ret = LCIDToLocaleName(MAKELCID(actctx_lang, SORT_DEFAULT),
4261 ok(ret > 0, "error %lu.\n", GetLastError());
4262#endif
4263
4264 ret = snprintf(manifest_dll, ARRAY_SIZE(manifest_dll), manifest_dll_fmt, locale_name);
4265 ok(ret > 0 && ret < ARRAY_SIZE(manifest_dll), "ret %d.\n", ret);
4266 }
4267
4268 ret = snprintf(manifest_exe, ARRAY_SIZE(manifest_exe), manifest_exe_fmt, locale_name);
4269 ok(ret > 0 && ret < ARRAY_SIZE(manifest_exe), "ret %d.\n", ret);
4270
4271 get_langid_precedence(langs_arr, &lang_count);
4272
4273 for (i = 0; i < lang_count; i++)
4274 {
4275 struct manifest_res_spec specs[ARRAY_SIZE(langs_arr) + 1];
4276 struct multiple_manifest_test test = { { NULL } };
4277 size_t num_specs;
4278 DWORD err;
4279
4280 winetest_push_context("langs[%Id:]", i);
4281
4282 /* Generate manifest spec list from language IDs.
4283 *
4284 * All manifest spec items point to the wrong manifest, expect for the
4285 * current language ID.
4286 */
4287 num_specs = 0;
4288 for (j = i; j < lang_count; j++)
4289 {
4290 struct manifest_res_spec spec = {(char *)2};
4291 spec.lang = langs_arr[j];
4292 if (j != i) spec.override_manifest = wrong_manifest1;
4293 ok(num_specs < ARRAY_SIZE(specs), "overrun\n");
4294 specs[num_specs++] = spec;
4295 }
4296 memset(&specs[num_specs++], 0, sizeof(*specs));
4297
4298 test.manifests = specs;
4299 test.expected_error = ERROR_SUCCESS;
4300 err = subtest_manifest_res(manifest_exe, manifest_dll, &test, actctx_lang);
4301
4302 if (winetest_debug > 1 && err != ERROR_SUCCESS)
4303 {
4304 for (j = 0; j < lang_count; j++)
4305 {
4306 trace("langs[%Id] = 0x%04x %c\n", j, langs_arr[j], j == i ? '<' : ' ');
4307 }
4308 }
4309
4311 }
4312}
unsigned short UINT16
#define trace
Definition: atltest.h:70
LCID WINAPI ConvertDefaultLocale(LCID lcid)
Definition: locale.c:2879
int winetest_debug
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
static const char wrong_manifest1[]
Definition: actctx.c:333
#define subtest_manifest_res(d, e, t, l)
Definition: actctx.c:3957
#define ARCH
Definition: actctx.c:47
static void get_langid_precedence(LANGID *langs_arr, size_t *lang_count)
Definition: actctx.c:4184
#define test
Definition: rosglue.h:37
wcscpy
strcpy
Definition: string.h:131

Referenced by test_valid_manifest_resources_locale().

◆ test_actctx()

static void test_actctx ( void  )
static

Definition at line 2194 of file actctx.c.

2195{
2197 HANDLE handle;
2198 BOOL b;
2199
2200 trace("default actctx\n");
2201
2203 ok(handle == NULL, "handle = %p, expected NULL\n", handle);
2204 ok(b, "GetCurrentActCtx failed: %lu\n", GetLastError());
2205 if(b) {
2206 test_basic_info(handle, __LINE__);
2210 }
2211
2212 /* test for whitespace handling in Eq ::= S? '=' S? */
2213 create_manifest_file("test1_1.manifest", manifest1_1, -1, NULL, NULL);
2214 handle = test_create("test1_1.manifest");
2215 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2216 DeleteFileA("test1_1.manifest");
2218
2219 if(!create_manifest_file("test1.manifest", manifest1, -1, NULL, NULL)) {
2220 skip("Could not create manifest file\n");
2221 return;
2222 }
2223
2224 trace("manifest1\n");
2225
2226 handle = test_create("test1.manifest");
2227 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2228 DeleteFileA("test1.manifest");
2230 test_basic_info(handle, __LINE__);
2233
2234 if (!IsDebuggerPresent())
2235 {
2236 /* CloseHandle will generate an exception if a debugger is present */
2237 b = CloseHandle(handle);
2238 ok(!b, "CloseHandle succeeded\n");
2239 ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() == %lu\n", GetLastError());
2240 }
2241
2243 }
2244
2245 if(!create_manifest_file("test2.manifest", manifest2, -1, "testdep.manifest", testdep_manifest1)) {
2246 skip("Could not create manifest file\n");
2247 return;
2248 }
2249
2250 trace("manifest2 depmanifest1\n");
2251
2252 handle = test_create("test2.manifest");
2253 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2254 DeleteFileA("test2.manifest");
2255 DeleteFileA("testdep.manifest");
2257 test_basic_info(handle, __LINE__);
2262 }
2263
2264 if(!create_manifest_file("test2-2.manifest", manifest2, -1, "testdep.manifest", testdep_manifest2)) {
2265 skip("Could not create manifest file\n");
2266 return;
2267 }
2268
2269 trace("manifest2 depmanifest2\n");
2270
2271 handle = test_create("test2-2.manifest");
2272 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2273 DeleteFileA("test2-2.manifest");
2274 DeleteFileA("testdep.manifest");
2276 test_basic_info(handle, __LINE__);
2280 test_file_info(handle, 1, 0, testlib_dll, __LINE__);
2281 test_file_info(handle, 1, 1, testlib2_dll, __LINE__);
2282
2284 ok(b, "ActivateActCtx failed: %lu\n", GetLastError());
2288 ok(b, "DeactivateActCtx failed: %lu\n", GetLastError());
2289
2291 }
2292
2293 trace("manifest2 depmanifest3\n");
2294
2295 if(!create_manifest_file("test2-3.manifest", manifest2, -1, "testdep.manifest", testdep_manifest3)) {
2296 skip("Could not create manifest file\n");
2297 return;
2298 }
2299
2300 handle = test_create("test2-3.manifest");
2301 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2302 DeleteFileA("test2-3.manifest");
2303 DeleteFileA("testdep.manifest");
2305 test_basic_info(handle, __LINE__);
2309 test_file_info(handle, 1, 0, testlib_dll, __LINE__);
2310 test_file_info(handle, 1, 1, testlib2_dll, __LINE__);
2311
2313 ok(b, "ActivateActCtx failed: %lu\n", GetLastError());
2319 ok(b, "DeactivateActCtx failed: %lu\n", GetLastError());
2320
2322 }
2323
2324 trace("manifest3\n");
2325
2326 if(!create_manifest_file("test3.manifest", manifest3, -1, NULL, NULL)) {
2327 skip("Could not create manifest file\n");
2328 return;
2329 }
2330
2331 handle = test_create("test3.manifest");
2332 ok(handle != INVALID_HANDLE_VALUE || broken(handle == INVALID_HANDLE_VALUE) /* XP pre-SP2, win2k3 w/o SP */,
2333 "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2335 win_skip("Some activation context features not supported, skipping a test (possibly old XP/Win2k3 system\n");
2336 DeleteFileA("test3.manifest");
2338 static const WCHAR nameW[] = {'t','e','s','t','s','u','r','r','o','g','a','t','e',0};
2339 static const WCHAR versionW[] = {'v','2','.','0','.','5','0','7','2','7',0};
2340 static const WCHAR progidW[] = {'P','r','o','g','I','d','.','P','r','o','g','I','d',0};
2341 static const WCHAR clrprogidW[] = {'c','l','r','p','r','o','g','i','d',0};
2342
2343 test_basic_info(handle, __LINE__);
2346 test_file_info(handle, 0, 0, testlib_dll, __LINE__);
2347
2349 ok(b, "ActivateActCtx failed: %lu\n", GetLastError());
2352 test_find_com_redirection(handle, &IID_CoTest, &IID_TlibTest, progidW, 1, __LINE__);
2353 test_find_com_redirection(handle, &IID_CoTest2, NULL, NULL, 1, __LINE__);
2354 test_find_com_redirection(handle, &CLSID_clrclass, &IID_TlibTest, clrprogidW, 1, __LINE__);
2355 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId", 1, __LINE__);
2356 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.1", 1, __LINE__);
2357 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.2", 1, __LINE__);
2358 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.3", 1, __LINE__);
2359 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.4", 1, __LINE__);
2360 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.5", 1, __LINE__);
2361 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.6", 1, __LINE__);
2362 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid", 1, __LINE__);
2363 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.1", 1, __LINE__);
2364 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.2", 1, __LINE__);
2365 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.3", 1, __LINE__);
2366 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.4", 1, __LINE__);
2367 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.5", 1, __LINE__);
2368 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.6", 1, __LINE__);
2369 test_find_surrogate(handle, &IID_Iiface, nameW, versionW, 1, __LINE__);
2370 test_find_ifaceps_redirection(handle, &IID_Iifaceps, &IID_TlibTest4, &IID_Ibifaceps, NULL, 1, __LINE__);
2371 test_find_ifaceps_redirection(handle, &IID_Iifaceps2, &IID_TlibTest4, &IID_Ibifaceps, &IID_PS32, 1, __LINE__);
2372 test_find_ifaceps_redirection(handle, &IID_Iifaceps3, &IID_TlibTest4, &IID_Ibifaceps, NULL, 1, __LINE__);
2374 test_find_activatable_class(handle, L"Wine.Test.Class1", WINRT_THREADING_MODEL_MTA, L"testlib.dll", 1, __LINE__);
2375 test_find_activatable_class(handle, L"Wine.Test.Class2", WINRT_THREADING_MODEL_BOTH, L"testlib.dll", 1, __LINE__);
2376 test_find_activatable_class(handle, L"Wine.Test.Class3", WINRT_THREADING_MODEL_STA, L"testlib.dll", 1, __LINE__);
2377 test_find_activatable_class(handle, L"Wine.Test.Class4", WINRT_THREADING_MODEL_STA, L"Wine.Test.dll", 1, __LINE__);
2378
2380 ok(b, "DeactivateActCtx failed: %lu\n", GetLastError());
2382 }
2383
2384 trace("manifest6\n");
2385
2386 if(create_manifest_file("test6.manifest", manifest6, -1, NULL, NULL)) {
2387 handle = test_create("test6.manifest");
2389 "Unexpected context handle %p.\n", handle);
2390 DeleteFileA("test6.manifest");
2391 DeleteFileA("testdep.manifest");
2393 {
2396 }
2397 }
2398 else
2399 skip("Could not create manifest file 6\n");
2400
2401 trace("manifest7\n");
2402
2403 if(create_manifest_file("test7.manifest", manifest7, -1, NULL, NULL)) {
2404 handle = test_create("test7.manifest");
2405 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2406 DeleteFileA("test7.manifest");
2407 DeleteFileA("testdep.manifest");
2409 {
2412 }
2413 }
2414 else
2415 skip("Could not create manifest file 7\n");
2416
2417 trace("manifest8\n");
2418
2419 if(create_manifest_file("test8.manifest", manifest8, -1, NULL, NULL)) {
2420 handle = test_create("test8.manifest");
2421 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2422 DeleteFileA("test8.manifest");
2423 DeleteFileA("testdep.manifest");
2425 {
2428 }
2429 }
2430 else
2431 skip("Could not create manifest file 8\n");
2432
2433 trace("manifest9\n");
2434
2435 if(create_manifest_file("test9.manifest", manifest9, -1, NULL, NULL)) {
2436 handle = test_create("test9.manifest");
2437 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2438 DeleteFileA("test9.manifest");
2439 DeleteFileA("testdep.manifest");
2441 {
2444 }
2445 }
2446 else
2447 skip("Could not create manifest file 9\n");
2448
2449 if(create_manifest_file("test10.manifest", manifest10, -1, NULL, NULL)) {
2450 handle = test_create("test10.manifest");
2451 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2452 DeleteFileA("test10.manifest");
2453 DeleteFileA("testdep.manifest");
2455 {
2458 }
2459 }
2460 else
2461 skip("Could not create manifest file 10\n");
2462
2463 if (create_manifest_file("test11.manifest", manifest11, -1, NULL, NULL))
2464 {
2465 handle = test_create("test11.manifest");
2466 ok(handle != INVALID_HANDLE_VALUE, "Failed to create activation context for %s, error %lu\n",
2467 "manifest11", GetLastError());
2468 DeleteFileA("test11.manifest");
2471 }
2472 else
2473 skip("Could not create manifest file 11\n");
2474
2475 trace("manifest4\n");
2476
2477 if(!create_manifest_file("test4.manifest", manifest4, -1, NULL, NULL)) {
2478 skip("Could not create manifest file\n");
2479 return;
2480 }
2481
2482 handle = test_create("test4.manifest");
2483 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2484 DeleteFileA("test4.manifest");
2485 DeleteFileA("testdep.manifest");
2487 test_basic_info(handle, __LINE__);
2492 }
2493
2494 trace("manifest1 in subdir\n");
2495
2498 {
2499 if(!create_manifest_file("..\\test1.manifest", manifest1, -1, NULL, NULL)) {
2500 skip("Could not create manifest file\n");
2501 return;
2502 }
2503 handle = test_create("..\\test1.manifest");
2504 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2505 DeleteFileA("..\\test1.manifest");
2507 test_basic_info(handle, __LINE__);
2511 }
2513 }
2514 else
2515 skip("Couldn't change directory\n");
2517
2518 trace("UTF-16 manifest1, with BOM\n");
2519 if(!create_wide_manifest("test1.manifest", manifest1, TRUE, FALSE)) {
2520 skip("Could not create manifest file\n");
2521 return;
2522 }
2523
2524 handle = test_create("test1.manifest");
2525 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2526 DeleteFileA("test1.manifest");
2528 test_basic_info(handle, __LINE__);
2532 }
2533
2534 trace("UTF-16 manifest1, reverse endian, with BOM\n");
2535 if(!create_wide_manifest("test1.manifest", manifest1, TRUE, TRUE)) {
2536 skip("Could not create manifest file\n");
2537 return;
2538 }
2539
2540 handle = test_create("test1.manifest");
2541 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2542 DeleteFileA("test1.manifest");
2544 test_basic_info(handle, __LINE__);
2548 }
2549
2550 /* Empty <assembly/> element. */
2551 create_manifest_file("empty_assembly.manifest", empty_assembly_manifest, -1, NULL, NULL);
2552 handle = test_create("empty_assembly.manifest");
2553 ok(handle != INVALID_HANDLE_VALUE, "Failed to create activation context.\n");
2554 DeleteFileA("empty_assembly.manifest");
2556 {
2557 test_basic_info(handle, __LINE__);
2559 }
2560
2565}
static const WCHAR nameW[]
Definition: main.c:49
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
BOOL WINAPI GetCurrentActCtx(OUT PHANDLE phActCtx)
Definition: actctx.c:298
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2249
BOOL WINAPI IsDebuggerPresent(void)
Definition: debug.c:167
static const WCHAR versionW[]
Definition: name.c:52
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
static void test_typelib_section(void)
Definition: actctx.c:2104
static const char empty_assembly_manifest[]
Definition: actctx.c:562
static const char manifest9[]
Definition: actctx.c:274
static void test_dllredirect_section(void)
Definition: actctx.c:2053
static void test_find_progid_redirection(HANDLE handle, const GUID *clsid, const char *progid, ULONG exid, int line)
Definition: actctx.c:1934
static const info_in_assembly manifest3_info
Definition: actctx.c:825
static void test_find_string_fail(void)
Definition: actctx.c:1503
static const char testdep_manifest3[]
Definition: actctx.c:323
static const runlevel_info_t runlevel_info9
Definition: actctx.c:1034
static const char manifest4[]
Definition: actctx.c:213
static const runlevel_info_t runlevel_info0
Definition: actctx.c:1018
static const char manifest6[]
Definition: actctx.c:237
static const char manifest3[]
Definition: actctx.c:86
static const char testdep_manifest2[]
Definition: actctx.c:316
static const char manifest1_1[]
Definition: actctx.c:55
static const WCHAR testlib_dll[]
Definition: actctx.c:573
static const info_in_assembly depmanifest3_info
Definition: actctx.c:851
static const char manifest2[]
Definition: actctx.c:60
static const char testdep_manifest1[]
Definition: actctx.c:311
static const char manifest7[]
Definition: actctx.c:249
static void test_find_dll_redirection(HANDLE handle, LPCWSTR libname, ULONG exid, int line)
Definition: actctx.c:1282
static BOOL create_wide_manifest(const char *filename, const char *manifest, BOOL fBOM, BOOL fReverse)
Definition: actctx.c:625
static const char manifest11[]
Definition: actctx.c:305
static const runlevel_info_t runlevel_info7
Definition: actctx.c:1026
static const info_in_assembly manifest1_info
Definition: actctx.c:807
static const info_in_assembly manifest_comctrl_info
Definition: actctx.c:857
static void test_basic_info(HANDLE handle, int line)
Definition: actctx.c:1536
static const WCHAR testlib2_dll[]
Definition: actctx.c:575
static const info_in_assembly manifest2_info
Definition: actctx.c:819
static const info_in_assembly depmanifest2_info
Definition: actctx.c:844
static void test_wndclass_section(void)
Definition: actctx.c:1992
static const char manifest10[]
Definition: actctx.c:292
static void test_find_activatable_class(HANDLE handle, const WCHAR *classid, enum winrt_threading_model threading_model, const WCHAR *file, ULONG exid, int line)
Definition: actctx.c:1456
static void test_find_surrogate(HANDLE handle, const GUID *clsid, const WCHAR *name, const WCHAR *version, ULONG exid, int line)
Definition: actctx.c:1867
static const WCHAR wndClass2W[]
Definition: actctx.c:581
static const detailed_info_t detailed_info2
Definition: actctx.c:716
static void test_find_ifaceps_redirection(HANDLE handle, const GUID *iid, const GUID *tlbid, const GUID *base, const GUID *ps32, ULONG exid, int line)
Definition: actctx.c:1796
static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembly *exinfo, int line)
Definition: actctx.c:861
static void test_allowDelayedBinding(void)
Definition: actctx.c:2171
static const info_in_assembly manifest4_info
Definition: actctx.c:831
static const info_in_assembly depmanifest1_info
Definition: actctx.c:837
static const runlevel_info_t runlevel_info6
Definition: actctx.c:1022
static void test_runlevel_info(HANDLE handle, const runlevel_info_t *exinfo, int line)
Definition: actctx.c:1038
static const WCHAR wndClassW[]
Definition: actctx.c:577
static void test_find_com_redirection(HANDLE handle, const GUID *clsid, const GUID *tlid, const WCHAR *progid, ULONG exid, int line)
Definition: actctx.c:1642
static const detailed_info_t detailed_info0
Definition: actctx.c:699
static const runlevel_info_t runlevel_info8
Definition: actctx.c:1030
static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid, int line)
Definition: actctx.c:1346
static const detailed_info_t detailed_info1
Definition: actctx.c:703
static void test_detailed_info(HANDLE handle, const detailed_info_t *exinfo, int line)
Definition: actctx.c:722
static const char manifest8[]
Definition: actctx.c:261
static const WCHAR progidW[]
Definition: compobj.c:112
static void test_file_info(void)
Definition: pipe.c:1262
Definition: cookie.c:34
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by START_TEST().

◆ test_allowDelayedBinding()

static void test_allowDelayedBinding ( void  )
static

Definition at line 2171 of file actctx.c.

2172{
2173 HANDLE handle;
2174
2175 if (!create_manifest_file("test5.manifest", manifest5, -1, NULL, NULL)) {
2176 skip("Could not create manifest file\n");
2177 return;
2178 }
2179
2180 handle = test_create("test5.manifest");
2182 win_skip("allowDelayedBinding attribute is not supported.\n");
2183 return;
2184 }
2185
2186 DeleteFileA("test5.manifest");
2187 DeleteFileA("testdep.manifest");
2189 test_basic_info(handle, __LINE__);
2191 }
2192}
static const char manifest5[]
Definition: actctx.c:226

Referenced by test_actctx().

◆ test_app_manifest()

static void test_app_manifest ( void  )
static

Definition at line 2567 of file actctx.c.

2568{
2569 HANDLE handle;
2570 BOOL b;
2571
2572 trace("child process manifest1\n");
2573
2575 ok(handle == NULL, "handle != NULL\n");
2576 ok(b, "GetCurrentActCtx failed: %lu\n", GetLastError());
2577 if(b) {
2578 test_basic_info(handle, __LINE__);
2582 }
2583}
static const info_in_assembly manifest1_child_info
Definition: actctx.c:813
static const detailed_info_t detailed_info1_child
Definition: actctx.c:709

Referenced by START_TEST().

◆ test_basic_info()

static void test_basic_info ( HANDLE  handle,
int  line 
)
static

Definition at line 1536 of file actctx.c.

1537{
1538 ACTIVATION_CONTEXT_BASIC_INFORMATION basic;
1539 SIZE_T size;
1540 BOOL b;
1541
1542 b = QueryActCtxW(QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL, ActivationContextBasicInformation, &basic,
1543 sizeof(basic), &size);
1544
1545 ok_(__FILE__, line) (b,"ActivationContextBasicInformation failed\n");
1546 ok_(__FILE__, line) (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n");
1547 ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %lx\n",basic.dwFlags);
1548 ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n");
1549
1550 b = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX | QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL,
1551 ActivationContextBasicInformation, &basic,
1552 sizeof(basic), &size);
1553 if (handle)
1554 {
1555 ok_(__FILE__, line) (!b,"ActivationContextBasicInformation succeeded\n");
1556 ok_(__FILE__, line) (size == 0,"size mismatch\n");
1557 ok_(__FILE__, line) (GetLastError() == ERROR_INVALID_PARAMETER, "Wrong last error\n");
1558 ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %lx\n",basic.dwFlags);
1559 ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n");
1560 }
1561 else
1562 {
1563 ok_(__FILE__, line) (b,"ActivationContextBasicInformation failed\n");
1564 ok_(__FILE__, line) (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n");
1565 ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %lx\n",basic.dwFlags);
1566 ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n");
1567 }
1568}
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
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by test_actctx(), test_allowDelayedBinding(), test_app_manifest(), test_compatibility(), and test_manifest_in_module().

◆ test_builtin_sxs()

static void test_builtin_sxs ( void  )
static

Definition at line 3834 of file actctx.c.

3835{
3836 char path_manifest[MAX_PATH + 12];
3837 char path_tmp[MAX_PATH];
3838 HMODULE module_msvcp = 0, module_msvcr = 0;
3839 char path_msvcp[MAX_PATH], path_msvcr[MAX_PATH];
3840 ACTCTXA context;
3842 HANDLE handle_context;
3843 BOOL success;
3844#ifdef __REACTOS__
3845 static char expected_path[MAX_PATH];
3846 GetWindowsDirectoryA(expected_path, sizeof(expected_path));
3847 strcat(expected_path, "\\WinSxS");
3848#else
3849 static const char *expected_path = "C:\\Windows\\WinSxS";
3850#endif
3851
3852 GetTempPathA(sizeof(path_tmp), path_tmp);
3853
3854 sprintf(path_manifest, "%s%s", path_tmp, "exe.manifest");
3855 create_manifest_file(path_manifest, builtin_dll_manifest, -1, NULL, NULL);
3856
3857 context.cbSize = sizeof(ACTCTXA);
3858 context.lpSource = path_manifest;
3859 context.lpAssemblyDirectory = path_tmp;
3860 context.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
3861
3862 handle_context = CreateActCtxA(&context);
3863 ok((handle_context != NULL && handle_context != INVALID_HANDLE_VALUE )
3864 || broken(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX), /* XP doesn't support manifests outside of PE files */
3865 "CreateActCtxA failed: %ld\n", GetLastError());
3867 {
3868 skip("Failed to create activation context.\n");
3869 goto cleanup;
3870 }
3871
3872
3873 success = ActivateActCtx(handle_context, &cookie);
3874 ok(success, "ActivateActCtx failed: %ld\n", GetLastError());
3875
3876 module_msvcp = LoadLibraryA("msvcp90.dll");
3877 ok (module_msvcp != 0 || broken(module_msvcp == 0), "LoadLibraryA failed, %ld\n", GetLastError());
3878 module_msvcr = LoadLibraryA("msvcr90.dll");
3879 ok (module_msvcr != 0 || broken(module_msvcr == 0), "LoadLibraryA failed, %ld\n", GetLastError());
3880 if (!module_msvcp || !module_msvcr)
3881 {
3882 skip("Failed to find msvcp90 or msvcr90.\n");
3883 goto cleanup;
3884 }
3885
3886 GetModuleFileNameA(module_msvcp, path_msvcp, sizeof(path_msvcp));
3887 GetModuleFileNameA(module_msvcr, path_msvcr, sizeof(path_msvcr));
3888 ok(strnicmp(expected_path, path_msvcp, strlen(expected_path)) == 0, "Expected path to start with %s, got %s\n", expected_path, path_msvcp);
3889 ok(strnicmp(expected_path, path_msvcr, strlen(expected_path)) == 0, "Expected path to start with %s, got %s\n", expected_path, path_msvcr);
3890
3892
3893cleanup:
3894 if (module_msvcp)
3895 FreeLibrary(module_msvcp);
3896 if (module_msvcr)
3897 FreeLibrary(module_msvcr);
3898 if (*path_manifest)
3899 {
3900 success = DeleteFileA(path_manifest);
3901 ok(success, "DeleteFileA failed for %s: %ld\n", path_manifest, GetLastError());
3902 }
3903}
#define FreeLibrary(x)
Definition: compat.h:748
static void cleanup(void)
Definition: main.c:1335
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2337
static const char builtin_dll_manifest[]
Definition: actctx.c:546
Definition: http.c:7252
#define strnicmp
Definition: xmlstorage.h:206

Referenced by run_sxs_test().

◆ test_compatibility()

static void test_compatibility ( void  )
static

Definition at line 3301 of file actctx.c.

3302{
3303 HANDLE handle;
3304
3305 /* No compat results returned */
3306 trace("manifest1\n");
3307 if(!create_manifest_file("test1.manifest", manifest1, -1, NULL, NULL))
3308 {
3309 skip("Could not create manifest file\n");
3310 return;
3311 }
3312 handle = test_create("test1.manifest");
3313 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
3314 DeleteFileA("test1.manifest");
3316 {
3317 char buffer[sizeof(COMPATIBILITY_CONTEXT_ELEMENT) * 2 + sizeof(DWORD)];
3318 SIZE_T size;
3319 BOOL b;
3320
3321 memset(buffer, 0, sizeof(buffer));
3322 b = QueryActCtxW(QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL, CompatibilityInformationInActivationContext,
3323 buffer, sizeof(buffer), &size);
3324
3326 {
3327 win_skip("CompatibilityInformationInActivationContext not supported.\n");
3329 return;
3330 }
3331
3332 test_basic_info(handle, __LINE__);
3333 test_no_compat(handle, __LINE__);
3335 }
3336
3337 /* Still no compat results returned */
3338 trace("no_supportedOs\n");
3339 if(!create_manifest_file("no_supportedOs.manifest", compat_manifest_no_supportedOs, -1, NULL, NULL))
3340 {
3341 skip("Could not create manifest file\n");
3342 return;
3343 }
3344 handle = test_create("no_supportedOs.manifest");
3345 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
3346 DeleteFileA("no_supportedOs.manifest");
3348 {
3349 test_basic_info(handle, __LINE__);
3350 test_no_compat(handle, __LINE__);
3352 }
3353
3354 /* Just one result returned */
3355 trace("manifest_vista\n");
3356 if(!create_manifest_file("manifest_vista.manifest", compat_manifest_vista, -1, NULL, NULL))
3357 {
3358 skip("Could not create manifest file\n");
3359 return;
3360 }
3361 handle = test_create("manifest_vista.manifest");
3362 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
3363 DeleteFileA("manifest_vista.manifest");
3365 {
3366 static const GUID* expect_manifest[] =
3367 {
3368 &VISTA_COMPAT_GUID
3369 };
3370 test_basic_info(handle, __LINE__);
3371 test_with_compat(handle, 1, 0, expect_manifest, NULL, __LINE__);
3373 }
3374
3375 /* Show that the order is retained */
3376 trace("manifest_vista_7_8_10_81\n");
3377 if(!create_manifest_file("manifest_vista_7_8_10_81.manifest", compat_manifest_vista_7_8_10_81, -1, NULL, NULL))
3378 {
3379 skip("Could not create manifest file\n");
3380 return;
3381 }
3382 handle = test_create("manifest_vista_7_8_10_81.manifest");
3383 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
3384 DeleteFileA("manifest_vista_7_8_10_81.manifest");
3386 {
3387 static const GUID* expect_manifest[] =
3388 {
3389 &VISTA_COMPAT_GUID,
3390 &WIN7_COMPAT_GUID,
3391 &WIN8_COMPAT_GUID,
3392 &WIN10_COMPAT_GUID,
3393 &WIN81_COMPAT_GUID,
3394 };
3395 static const ULONGLONG expect_version[] =
3396 {
3397 0x000a000047b60000ull, /* 10.0.18358.0 */
3398 0x0002000300040005ull, /* 2.3.4.5 */
3399 };
3400 test_basic_info(handle, __LINE__);
3401 test_with_compat(handle, 5, 2, expect_manifest, expect_version, __LINE__);
3403 }
3404
3405 /* Show that even unknown GUID's are stored */
3406 trace("manifest_other_guid\n");
3407 if(!create_manifest_file("manifest_other_guid.manifest", compat_manifest_other_guid, -1, NULL, NULL))
3408 {
3409 skip("Could not create manifest file\n");
3410 return;
3411 }
3412 handle = test_create("manifest_other_guid.manifest");
3413 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
3414 DeleteFileA("manifest_other_guid.manifest");
3416 {
3417 static const GUID* expect_manifest[] =
3418 {
3419 &OTHER_COMPAT_GUID,
3420 };
3421 test_basic_info(handle, __LINE__);
3422 test_with_compat(handle, 1, 0, expect_manifest, NULL, __LINE__);
3424 }
3425}
static void test_no_compat(HANDLE handle, int line)
Definition: actctx.c:3228
static const char compat_manifest_no_supportedOs[]
Definition: actctx.c:423
static void test_with_compat(HANDLE handle, DWORD num_compat, DWORD num_version, const GUID *expected_compat[], const ULONGLONG expected_version[], int line)
Definition: actctx.c:3245
static const char compat_manifest_vista[]
Definition: actctx.c:432
static const char compat_manifest_vista_7_8_10_81[]
Definition: actctx.c:442
static const char compat_manifest_other_guid[]
Definition: actctx.c:458
uint64_t ULONGLONG
Definition: typedefs.h:67

Referenced by START_TEST().

◆ test_create()

static HANDLE test_create ( const char file)
static

Definition at line 1063 of file actctx.c.

1064{
1065 ACTCTXW actctx;
1066 HANDLE handle;
1068
1070 memset(&actctx, 0, sizeof(ACTCTXW));
1071 actctx.cbSize = sizeof(ACTCTXW);
1072 actctx.lpSource = path;
1073
1075 /* to be tested outside of this helper, including last error */
1076 if (handle == INVALID_HANDLE_VALUE) return handle;
1077
1078 ok(actctx.cbSize == sizeof(actctx), "actctx.cbSize=%ld\n", actctx.cbSize);
1079 ok(actctx.dwFlags == 0, "actctx.dwFlags=%ld\n", actctx.dwFlags);
1080 ok(actctx.lpSource == path, "actctx.lpSource=%p\n", actctx.lpSource);
1081 ok(actctx.wProcessorArchitecture == 0,
1082 "actctx.wProcessorArchitecture=%d\n", actctx.wProcessorArchitecture);
1083 ok(actctx.wLangId == 0, "actctx.wLangId=%d\n", actctx.wLangId);
1084 ok(actctx.lpAssemblyDirectory == NULL,
1085 "actctx.lpAssemblyDirectory=%p\n", actctx.lpAssemblyDirectory);
1086 ok(actctx.lpResourceName == NULL, "actctx.lpResourceName=%p\n", actctx.lpResourceName);
1087 ok(actctx.lpApplicationName == NULL, "actctx.lpApplicationName=%p\n",
1088 actctx.lpApplicationName);
1089 ok(actctx.hModule == NULL, "actctx.hModule=%p\n", actctx.hModule);
1090
1091 return handle;
1092}
HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx)
Definition: actctx.c:102

◆ test_create_and_fail()

static void test_create_and_fail ( const char manifest,
const char depmanifest,
int  todo,
BOOL  is_broken 
)
static

Definition at line 1094 of file actctx.c.

1095{
1096 ACTCTXW actctx;
1097 HANDLE handle;
1099
1100 MultiByteToWideChar( CP_ACP, 0, "bad.manifest", -1, path, MAX_PATH );
1101 memset(&actctx, 0, sizeof(ACTCTXW));
1102 actctx.cbSize = sizeof(ACTCTXW);
1103 actctx.lpSource = path;
1104
1105 create_manifest_file("bad.manifest", manifest, -1, "testdep.manifest", depmanifest);
1108 {
1109 if (is_broken)
1111 "Unexpected context handle %p.\n", handle);
1112 else
1113 ok(handle == INVALID_HANDLE_VALUE, "Unexpected context handle %p.\n", handle);
1114
1116 ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "Unexpected error %ld.\n", GetLastError());
1117 }
1119 DeleteFileA("bad.manifest");
1120 DeleteFileA("testdep.manifest");
1121}

Referenced by test_create_fail().

◆ test_create_fail()

static void test_create_fail ( void  )
static

Definition at line 1143 of file actctx.c.

1144{
1145 ACTCTXW actctx;
1146 HANDLE handle;
1148
1149 MultiByteToWideChar( CP_ACP, 0, "nonexistent.manifest", -1, path, MAX_PATH );
1150 memset(&actctx, 0, sizeof(ACTCTXW));
1151 actctx.cbSize = sizeof(ACTCTXW);
1152 actctx.lpSource = path;
1153
1155 ok(handle == INVALID_HANDLE_VALUE, "handle != INVALID_HANDLE_VALUE\n");
1156 ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError == %lu\n", GetLastError());
1157
1158 trace("wrong_manifest1\n");
1160 trace("wrong_manifest2\n");
1162 trace("wrong_manifest3\n");
1164 trace("wrong_manifest4\n");
1166 trace("wrong_manifest5\n");
1168 trace("wrong_manifest6\n");
1170 trace("wrong_manifest7\n");
1172 trace("wrong_manifest8\n");
1174 trace("wrong_manifest9\n");
1176 trace("wrong_manifest10\n");
1178 trace("wrong_manifest11\n");
1179 test_create_and_fail(wrong_manifest11, NULL, 1, TRUE /* w1064v1909 */);
1180 trace("UTF-16 manifest1 without BOM\n");
1182 trace("manifest2\n");
1184 trace("manifest2+depmanifest1\n");
1186}
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static const char wrong_manifest2[]
Definition: actctx.c:338
static const char wrong_manifest7[]
Definition: actctx.c:365
static const char wrong_manifest11[]
Definition: actctx.c:410
static const char wrong_manifest9[]
Definition: actctx.c:377
static const char wrong_manifest10[]
Definition: actctx.c:390
static void test_create_and_fail(const char *manifest, const char *depmanifest, int todo, BOOL is_broken)
Definition: actctx.c:1094
static const char wrong_manifest4[]
Definition: actctx.c:348
static const char wrong_manifest6[]
Definition: actctx.c:360
static const char wrong_manifest5[]
Definition: actctx.c:354
static const char wrong_manifest8[]
Definition: actctx.c:371
static const char wrong_manifest3[]
Definition: actctx.c:343
static const char wrong_depmanifest1[]
Definition: actctx.c:418
static void test_create_wide_and_fail(const char *manifest, BOOL fBOM)
Definition: actctx.c:1123

Referenced by START_TEST().

◆ test_create_wide_and_fail()

static void test_create_wide_and_fail ( const char manifest,
BOOL  fBOM 
)
static

Definition at line 1123 of file actctx.c.

1124{
1125 ACTCTXW actctx;
1126 HANDLE handle;
1128
1129 MultiByteToWideChar( CP_ACP, 0, "bad.manifest", -1, path, MAX_PATH );
1130 memset(&actctx, 0, sizeof(ACTCTXW));
1131 actctx.cbSize = sizeof(ACTCTXW);
1132 actctx.lpSource = path;
1133
1134 create_wide_manifest("bad.manifest", manifest, fBOM, FALSE);
1136 ok(handle == INVALID_HANDLE_VALUE, "handle != INVALID_HANDLE_VALUE\n");
1137 ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "GetLastError == %lu\n", GetLastError());
1138
1140 DeleteFileA("bad.manifest");
1141}

Referenced by test_create_fail().

◆ test_CreateActCtx()

static void test_CreateActCtx ( void  )
static

Definition at line 2817 of file actctx.c.

2818{
2821 static const struct
2822 {
2824 } test[] =
2825 {
2826 { FIELD_OFFSET(ACTCTXW, lpSource), 0, ERROR_INVALID_PARAMETER },
2827 { FIELD_OFFSET(ACTCTXW, wProcessorArchitecture), 0, 0 },
2828 { FIELD_OFFSET(ACTCTXW, lpAssemblyDirectory), ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID, ERROR_INVALID_PARAMETER },
2829 { FIELD_OFFSET(ACTCTXW, lpResourceName), ACTCTX_FLAG_RESOURCE_NAME_VALID, ERROR_INVALID_PARAMETER },
2830 { FIELD_OFFSET(ACTCTXW, hModule), ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID, ERROR_INVALID_PARAMETER },
2831 };
2834 ACTCTXA actctx;
2835 ACTCTXW ctxW;
2836 HANDLE handle;
2837 int i;
2838
2840 strcpy(dir, path);
2841 strcat(path, "main_wndcls.manifest");
2842
2843 write_manifest("testdep1.manifest", manifest_wndcls1);
2844 write_manifest("testdep2.manifest", manifest_wndcls2);
2845 write_manifest("main_wndcls.manifest", manifest_wndcls_main);
2846
2849
2851 wcscpy(dirW, pathW);
2852 wcscat(pathW, L"main_wndcls.manifest");
2853
2854 memset(&ctxW, 0, sizeof(ctxW));
2855 ctxW.cbSize = sizeof(ctxW);
2856 ctxW.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
2857 ctxW.lpSource = pathW;
2858 ctxW.lpAssemblyDirectory = dirW;
2859 ctxW.lpResourceName = (LPWSTR)124;
2860 ctxW.hModule = GetModuleHandleW(NULL);
2862 ok(handle != INVALID_HANDLE_VALUE, "CreateActCtx error %lu\n", GetLastError());
2864
2865 for (i = 0; i < ARRAY_SIZE(test); i++)
2866 {
2867 winetest_push_context("%i", i);
2868 ctxW.cbSize = test[i].size;
2869 ctxW.dwFlags = test[i].flags;
2870 SetLastError(0xdeadbeef);
2872 if (!test[i].error)
2873 {
2874 ok(handle != INVALID_HANDLE_VALUE, "CreateActCtx error %lu\n", GetLastError());
2876 }
2877 else
2878 {
2879 ok(handle == INVALID_HANDLE_VALUE, "CreateActCtx should fail\n");
2880 ok(test[i].error == GetLastError(), "expected %lu, got %lu\n", test[i].error, GetLastError());
2881 }
2882
2883 ctxW.cbSize += sizeof(void *);
2884 if ((ctxW.dwFlags & (ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID)) == ACTCTX_FLAG_RESOURCE_NAME_VALID)
2885 ctxW.lpSource = sourceW; /* source without hModule must point to valid PE */
2886 SetLastError(0xdeadbeef);
2888 ok(handle != INVALID_HANDLE_VALUE, "CreateActCtx error %lu\n", GetLastError());
2890
2892 }
2893
2894 memset(&actctx, 0, sizeof(actctx));
2895 actctx.cbSize = sizeof(actctx);
2896 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
2897 actctx.lpSource = path;
2898 actctx.lpAssemblyDirectory = dir;
2899 actctx.lpResourceName = (LPSTR)124;
2900 actctx.hModule = GetModuleHandleW(NULL);
2902 ok(handle != INVALID_HANDLE_VALUE, "CreateActCtx error %lu\n", GetLastError());
2904
2905 for (i = 0; i < ARRAY_SIZE(test); i++)
2906 {
2907 winetest_push_context("%i", i);
2908 actctx.cbSize = test[i].size;
2909 actctx.dwFlags = test[i].flags;
2910 SetLastError(0xdeadbeef);
2912 if (!test[i].error)
2913 {
2914 ok(handle != INVALID_HANDLE_VALUE, "CreateActCtx error %lu\n", GetLastError());
2916 }
2917 else
2918 {
2919 ok(handle == INVALID_HANDLE_VALUE, "CreateActCtx should fail\n");
2920 ok(test[i].error == GetLastError(), "expected %lu, got %lu\n", test[i].error, GetLastError());
2921 }
2922
2923 actctx.cbSize += sizeof(void *);
2924 if ((actctx.dwFlags & (ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID)) == ACTCTX_FLAG_RESOURCE_NAME_VALID)
2925 actctx.lpSource = source; /* source without hModule must point to valid PE */
2926 SetLastError(0xdeadbeef);
2928 ok(handle != INVALID_HANDLE_VALUE, "CreateActCtx error %lu\n", GetLastError());
2930
2932 }
2933
2934 memset(&actctx, 0, sizeof(ACTCTXA));
2935 actctx.cbSize = sizeof(ACTCTXA);
2936 actctx.lpSource = path;
2937
2938 /* create using lpSource without specified directory */
2940 ok(handle != INVALID_HANDLE_VALUE, "failed to generate context, error %lu\n", GetLastError());
2942
2943 /* with specified directory, that doesn't contain dependent assembly */
2945
2946 memset(&actctx, 0, sizeof(ACTCTXA));
2947 actctx.cbSize = sizeof(ACTCTXA);
2948 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
2949 actctx.lpAssemblyDirectory = dir;
2950 actctx.lpSource = path;
2951
2952 SetLastError(0xdeadbeef);
2954todo_wine {
2955 ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle);
2956 ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "got error %ld\n", GetLastError());
2957}
2959
2960 /* with specified directory, that does contain dependent assembly */
2962 actctx.lpAssemblyDirectory = dir;
2964 ok(handle != INVALID_HANDLE_VALUE, "got handle %p\n", handle);
2966
2967 /* Should still work if we add a dll with the same name, but without manifest */
2968 strcpy(dll, dir);
2969 strcat(dll, "testdep1.dll");
2970 extract_resource("dummy.dll", "TESTDLL", dll);
2974 DeleteFileA(dll);
2975
2976 delete_manifest_file("main_wndcls.manifest");
2977 delete_manifest_file("testdep1.manifest");
2978 delete_manifest_file("testdep2.manifest");
2979
2980 /* create from HMODULE - resource doesn't exist, lpSource is set */
2981 memset(&actctx, 0, sizeof(ACTCTXA));
2982 actctx.cbSize = sizeof(ACTCTXA);
2983 actctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
2984 actctx.lpSource = "dummyfile.dll";
2985 actctx.lpResourceName = MAKEINTRESOURCEA(20);
2986 actctx.hModule = GetModuleHandleA(NULL);
2987
2988 SetLastError(0xdeadbeef);
2990 ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle);
2991 ok(GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "got error %ld\n", GetLastError());
2992
2993 /* load manifest from lpAssemblyDirectory directory */
2994 write_manifest("testdir.manifest", manifest1);
2997 strcat(path, "assembly_dir");
2998 strcpy(dir, path);
2999 strcat(path, "\\testdir.manifest");
3000
3001 memset(&actctx, 0, sizeof(actctx));
3002 actctx.cbSize = sizeof(actctx);
3003 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
3004 actctx.lpSource = "testdir.manifest";
3005 actctx.lpAssemblyDirectory = dir;
3006
3007 SetLastError(0xdeadbeef);
3009 ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle);
3012 "got error %ld\n", GetLastError());
3013
3015 memset(&actctx, 0, sizeof(actctx));
3016 actctx.cbSize = sizeof(actctx);
3017 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
3018 actctx.lpSource = "testdir.manifest";
3019 actctx.lpAssemblyDirectory = dir;
3020
3021 SetLastError(0xdeadbeef);
3023 ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle);
3024 ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %ld\n", GetLastError());
3026
3027 write_manifest("assembly_dir\\testdir.manifest", manifest1);
3028 memset(&actctx, 0, sizeof(actctx));
3029 actctx.cbSize = sizeof(actctx);
3030 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
3031 actctx.lpSource = "testdir.manifest";
3032 actctx.lpAssemblyDirectory = dir;
3033
3035 ok(handle != INVALID_HANDLE_VALUE, "got handle %p\n", handle);
3037
3038 memset(&actctx, 0, sizeof(actctx));
3039 actctx.cbSize = sizeof(actctx);
3040 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
3041 actctx.lpSource = path;
3042 actctx.lpAssemblyDirectory = dir;
3043
3045 ok(handle != INVALID_HANDLE_VALUE, "got handle %p\n", handle);
3047
3048 delete_manifest_file("testdir.manifest");
3049 delete_manifest_file("assembly_dir\\testdir.manifest");
3051
3052 /* create using lpSource with a DLL relative name */
3053 memset(&actctx, 0, sizeof(actctx));
3054 actctx.cbSize = sizeof(actctx);
3055 actctx.lpSource = "shell32.dll";
3056 actctx.lpResourceName = MAKEINTRESOURCEA(124);
3057 actctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID;
3059 ok(handle == INVALID_HANDLE_VALUE, "CreateActCtxA succeeded\n");
3060
3061 /* create from module loaded as data file */
3062 memset(&actctx, 0, sizeof(actctx));
3063 actctx.cbSize = sizeof(actctx);
3064 actctx.lpResourceName = MAKEINTRESOURCEA(1);
3065 actctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID;
3066#ifdef __REACTOS__
3067 char path_explorer[MAX_PATH];
3068 GetWindowsDirectoryA(path_explorer, sizeof(path_explorer));
3069 strcat(path_explorer, "\\explorer.exe");
3070#endif
3071 for (i = 0; i < ARRAY_SIZE(flags); ++i)
3072 {
3073 winetest_push_context("%lu", flags[i]);
3074
3075 /* use explorer.exe because using modules already loaded has a different behavior */
3076#ifdef __REACTOS__
3077 if (GetNTVersion() < _WIN32_WINNT_VISTA && i > 0)
3078 break; // Only the first test is valid for WS03.
3079 actctx.hModule = LoadLibraryExA(path_explorer, NULL, flags[i]);
3080#else
3081 actctx.hModule = LoadLibraryExA("C:\\windows\\explorer.exe", NULL, flags[i]);
3082#endif
3083 ok(actctx.hModule != NULL, "LoadLibraryExA failed, error %lu\n", GetLastError());
3085 ok(handle == INVALID_HANDLE_VALUE, "CreateActCtxA succeeded\n");
3086 FreeLibrary(actctx.hModule);
3087
3089 }
3090}
unsigned int dir
Definition: maze.c:112
static const WCHAR ctxW[]
Definition: axinstall.c:33
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:159
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
Definition: path.c:2206
GLbitfield flags
Definition: glext.h:7161
static const WCHAR sourceW[]
Definition: jsregexp.c:37
#define todo_wine
Definition: minitest.h:80
#define error(str)
Definition: mkdosfs.c:1605
static void write_manifest(const char *filename, const char *manifest)
Definition: actctx.c:2775
static const char manifest_wndcls1[]
Definition: actctx.c:173
static const char manifest_wndcls2[]
Definition: actctx.c:184
static LPWSTR
Definition: actctx.c:32
static void delete_manifest_file(const char *filename)
Definition: actctx.c:2790
static const char manifest_wndcls_main[]
Definition: actctx.c:198
static const WCHAR pathW[]
Definition: path.c:2368
HMODULE hModule
Definition: netsh.c:17
wcscat
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define LOAD_LIBRARY_AS_IMAGE_RESOURCE
Definition: winbase.h:343
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:338
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:228
#define ERROR_RESOURCE_NAME_NOT_FOUND
Definition: winerror.h:1478
char * LPSTR
Definition: xmlstorage.h:182

Referenced by START_TEST().

◆ test_CreateActCtx_share_mode()

static void test_CreateActCtx_share_mode ( void  )
static

Definition at line 3092 of file actctx.c.

3093{
3094 WCHAR tmp_manifest_pathname[MAX_PATH];
3095 HANDLE handle, manifest_file;
3096 ACTCTXW actctx;
3097
3098 manifest_file = create_temp_manifest_file(manifest1, tmp_manifest_pathname);
3099
3100 memset(&actctx, 0, sizeof(ACTCTXW));
3101 actctx.cbSize = sizeof(ACTCTXW);
3102 actctx.lpSource = tmp_manifest_pathname;
3103
3105#ifdef __REACTOS__
3106 ok(handle != INVALID_HANDLE_VALUE || GetLastError() == ERROR_SHARING_VIOLATION /* WS03 */, "CreateActCtxW returned error %lu\n", GetLastError());
3107#else
3108 ok(handle != INVALID_HANDLE_VALUE, "CreateActCtxW returned error %lu\n", GetLastError());
3109#endif
3110 ok(handle != NULL, "CreateActCtxW returned %p\n", handle);
3111
3113
3114 CloseHandle(manifest_file);
3115}
static HANDLE create_temp_manifest_file(const char *manifest, WCHAR *pathname)
Definition: actctx.c:644
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:257

Referenced by START_TEST().

◆ test_detailed_info()

static void test_detailed_info ( HANDLE  handle,
const detailed_info_t exinfo,
int  line 
)
static

Definition at line 722 of file actctx.c.

723{
724 ACTIVATION_CONTEXT_DETAILED_INFORMATION detailed_info_tmp, *detailed_info;
725 SIZE_T size, exsize, retsize;
726 BOOL b;
727
728 exsize = sizeof(ACTIVATION_CONTEXT_DETAILED_INFORMATION)
729 + (exinfo->root_manifest_path ? (lstrlenW(exinfo->root_manifest_path)+1)*sizeof(WCHAR):0)
730 + (exinfo->app_dir ? (lstrlenW(exinfo->app_dir)+1)*sizeof(WCHAR) : 0);
731
732 if(exsize != sizeof(ACTIVATION_CONTEXT_DETAILED_INFORMATION)) {
733 size = 0xdeadbeef;
734 b = QueryActCtxW(0, handle, NULL, ActivationContextDetailedInformation, &detailed_info_tmp,
735 sizeof(detailed_info_tmp), &size);
736 ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n");
737 ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %lu\n", GetLastError());
738 ok_(__FILE__, line)(size == exsize, "size=%Id, expected %Id\n", size, exsize);
739 }else {
740 size = sizeof(ACTIVATION_CONTEXT_DETAILED_INFORMATION);
741 }
742
743 detailed_info = HeapAlloc(GetProcessHeap(), 0, size);
744 memset(detailed_info, 0xfe, size);
745 b = QueryActCtxW(0, handle, NULL, ActivationContextDetailedInformation, detailed_info, size, &retsize);
746 ok_(__FILE__, line)(b, "QueryActCtx failed: %lu\n", GetLastError());
747 ok_(__FILE__, line)(retsize == exsize, "size=%Id, expected %Id\n", retsize, exsize);
748
749 ok_(__FILE__, line)(detailed_info->dwFlags == 0, "detailed_info->dwFlags=%lx\n", detailed_info->dwFlags);
750 ok_(__FILE__, line)(detailed_info->ulFormatVersion == exinfo->format_version,
751 "detailed_info->ulFormatVersion=%lu, expected %lu\n", detailed_info->ulFormatVersion,
752 exinfo->format_version);
753 ok_(__FILE__, line)(exinfo->assembly_cnt_min <= detailed_info->ulAssemblyCount &&
754 detailed_info->ulAssemblyCount <= exinfo->assembly_cnt_max,
755 "detailed_info->ulAssemblyCount=%lu, expected between %lu and %lu\n", detailed_info->ulAssemblyCount,
756 exinfo->assembly_cnt_min, exinfo->assembly_cnt_max);
757 ok_(__FILE__, line)(detailed_info->ulRootManifestPathType == exinfo->root_manifest_type,
758 "detailed_info->ulRootManifestPathType=%lu, expected %lu\n",
759 detailed_info->ulRootManifestPathType, exinfo->root_manifest_type);
760 ok_(__FILE__, line)(detailed_info->ulRootManifestPathChars ==
761 (exinfo->root_manifest_path ? lstrlenW(exinfo->root_manifest_path) : 0),
762 "detailed_info->ulRootManifestPathChars=%lu, expected %u\n",
763 detailed_info->ulRootManifestPathChars,
764 exinfo->root_manifest_path ?lstrlenW(exinfo->root_manifest_path) : 0);
765 ok_(__FILE__, line)(detailed_info->ulRootConfigurationPathType == exinfo->root_config_type,
766 "detailed_info->ulRootConfigurationPathType=%lu, expected %lu\n",
767 detailed_info->ulRootConfigurationPathType, exinfo->root_config_type);
768 ok_(__FILE__, line)(detailed_info->ulRootConfigurationPathChars == 0,
769 "detailed_info->ulRootConfigurationPathChars=%ld\n", detailed_info->ulRootConfigurationPathChars);
770 ok_(__FILE__, line)(detailed_info->ulAppDirPathType == exinfo->app_dir_type,
771 "detailed_info->ulAppDirPathType=%lu, expected %lu\n", detailed_info->ulAppDirPathType,
772 exinfo->app_dir_type);
773 ok_(__FILE__, line)(detailed_info->ulAppDirPathChars == (exinfo->app_dir ? lstrlenW(exinfo->app_dir) : 0),
774 "detailed_info->ulAppDirPathChars=%lu, expected %u\n",
775 detailed_info->ulAppDirPathChars, exinfo->app_dir ? lstrlenW(exinfo->app_dir) : 0);
776 if(exinfo->root_manifest_path) {
777 ok_(__FILE__, line)(detailed_info->lpRootManifestPath != NULL, "detailed_info->lpRootManifestPath == NULL\n");
778 if(detailed_info->lpRootManifestPath)
779 ok_(__FILE__, line)(!lstrcmpiW(detailed_info->lpRootManifestPath, exinfo->root_manifest_path),
780 "unexpected detailed_info->lpRootManifestPath %s\n", wine_dbgstr_w(detailed_info->lpRootManifestPath));
781 }else {
782 ok_(__FILE__, line)(detailed_info->lpRootManifestPath == NULL, "detailed_info->lpRootManifestPath != NULL\n");
783 }
784 ok_(__FILE__, line)(detailed_info->lpRootConfigurationPath == NULL,
785 "detailed_info->lpRootConfigurationPath=%p\n", detailed_info->lpRootConfigurationPath);
786 if(exinfo->app_dir) {
787 ok_(__FILE__, line)(detailed_info->lpAppDirPath != NULL, "detailed_info->lpAppDirPath == NULL\n");
788 if(detailed_info->lpAppDirPath)
789 ok_(__FILE__, line)(!lstrcmpiW(exinfo->app_dir, detailed_info->lpAppDirPath),
790 "unexpected detailed_info->lpAppDirPath %s / %s\n",
791 wine_dbgstr_w(detailed_info->lpAppDirPath), wine_dbgstr_w( exinfo->app_dir ));
792 }else {
793 ok_(__FILE__, line)(detailed_info->lpAppDirPath == NULL, "detailed_info->lpAppDirPath != NULL\n");
794 }
795
796 HeapFree(GetProcessHeap(), 0, detailed_info);
797}
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4265
#define wine_dbgstr_w
Definition: kernel32.h:34
ULONG assembly_cnt_max
Definition: actctx.c:691
LPWSTR root_manifest_path
Definition: actctx.c:693
ULONG assembly_cnt_min
Definition: actctx.c:690
ULONG root_manifest_type
Definition: actctx.c:692
ULONG app_dir_type
Definition: actctx.c:695
LPCWSTR app_dir
Definition: actctx.c:696
ULONG root_config_type
Definition: actctx.c:694
ULONG format_version
Definition: actctx.c:689

Referenced by test_actctx(), test_app_manifest(), and test_manifest_in_module().

◆ test_dllredirect_section()

static void test_dllredirect_section ( void  )
static

Definition at line 2053 of file actctx.c.

2054{
2055 static const WCHAR testlib1W[] = {'t','e','s','t','l','i','b','1','.','d','l','l',0};
2056 static const WCHAR testlib2W[] = {'t','e','s','t','l','i','b','2','.','d','l','l',0};
2057 ACTCTX_SECTION_KEYED_DATA data, data2;
2058 struct strsection_header *section;
2060 HANDLE handle;
2061 BOOL ret;
2062
2063 /* use two dependent manifests, 4 'files' total */
2064 create_manifest_file("testdep1.manifest", manifest_wndcls1, -1, NULL, NULL);
2065 create_manifest_file("testdep2.manifest", manifest_wndcls2, -1, NULL, NULL);
2066 create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL);
2067
2068 handle = test_create("main_wndcls.manifest");
2069 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2070
2071 DeleteFileA("testdep1.manifest");
2072 DeleteFileA("testdep2.manifest");
2073 DeleteFileA("main_wndcls.manifest");
2074
2076 ok(ret, "ActivateActCtx failed: %lu\n", GetLastError());
2077
2078 memset(&data, 0, sizeof(data));
2079 memset(&data2, 0, sizeof(data2));
2080 data.cbSize = sizeof(data);
2081 data2.cbSize = sizeof(data2);
2082
2083 /* get data for two files from different assemblies */
2084 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, testlib1W, &data);
2085 ok(ret, "got %d\n", ret);
2086 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, testlib2W, &data2);
2087 ok(ret, "got %d\n", ret);
2088
2089 section = (struct strsection_header*)data.lpSectionBase;
2090 ok(section->count == 4, "got %ld\n", section->count);
2091 ok(section->size == sizeof(*section), "got %ld\n", section->size);
2092
2093 /* For both string same section is returned, meaning it's one dll redirect section per context */
2094 ok(data.lpSectionBase == data2.lpSectionBase, "got %p, %p\n", data.lpSectionBase, data2.lpSectionBase);
2095 ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %lu, %lu\n", data.ulSectionTotalLength,
2096 data2.ulSectionTotalLength);
2097
2099 ok(ret, "DeactivateActCtx failed: %lu\n", GetLastError());
2100
2102}
Definition: tftpd.h:138

Referenced by test_actctx().

◆ test_file_info()

static void test_file_info ( HANDLE  handle,
ULONG  assid,
ULONG  fileid,
LPCWSTR  filename,
int  line 
)
static

Definition at line 971 of file actctx.c.

972{
973 ASSEMBLY_FILE_DETAILED_INFORMATION *info, info_tmp;
974 ACTIVATION_CONTEXT_QUERY_INDEX index = {assid, fileid};
975 SIZE_T size, exsize;
976 BOOL b;
977
978 exsize = sizeof(ASSEMBLY_FILE_DETAILED_INFORMATION)
979 +(lstrlenW(filename)+1)*sizeof(WCHAR);
980
981 size = 0xdeadbeef;
982 b = QueryActCtxW(0, handle, &index, FileInformationInAssemblyOfAssemblyInActivationContext, &info_tmp,
983 sizeof(info_tmp), &size);
984 ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n");
985 ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %lu\n", GetLastError());
986 ok_(__FILE__, line)(size == exsize, "size=%Iu, expected %Iu\n", size, exsize);
987
988 if(size == 0xdeadbeef)
989 {
990 skip("bad size\n");
991 return;
992 }
993
995 memset(info, 0xfe, size);
996
997 b = QueryActCtxW(0, handle, &index, FileInformationInAssemblyOfAssemblyInActivationContext, info, size, &size);
998 ok_(__FILE__, line)(b, "QueryActCtx failed: %lu\n", GetLastError());
999 ok_(__FILE__, line)(!size, "size=%Iu, expected 0\n", size);
1000
1001 ok_(__FILE__, line)(info->ulFlags == 2, "info->ulFlags=%lx, expected 2\n", info->ulFlags);
1002 ok_(__FILE__, line)(info->ulFilenameLength == lstrlenW(filename)*sizeof(WCHAR),
1003 "info->ulFilenameLength=%lu, expected %u*sizeof(WCHAR)\n",
1004 info->ulFilenameLength, lstrlenW(filename));
1005 ok_(__FILE__, line)(info->ulPathLength == 0, "info->ulPathLength=%lu\n", info->ulPathLength);
1006 ok_(__FILE__, line)(info->lpFileName != NULL, "info->lpFileName == NULL\n");
1007 if(info->lpFileName)
1008 ok_(__FILE__, line)(!lstrcmpiW(info->lpFileName, filename), "unexpected info->lpFileName\n");
1009 ok_(__FILE__, line)(info->lpFilePath == NULL, "info->lpFilePath != NULL\n");
1011}
GLuint index
Definition: glext.h:6031

◆ test_find_activatable_class()

static void test_find_activatable_class ( HANDLE  handle,
const WCHAR classid,
enum winrt_threading_model  threading_model,
const WCHAR file,
ULONG  exid,
int  line 
)
static

Definition at line 1456 of file actctx.c.

1458{
1459 struct activatable_class_data *activatable_class;
1460 struct strsection_header *header;
1461 ACTCTX_SECTION_KEYED_DATA data;
1462 void *ptr;
1463 BOOL ret;
1464
1465 memset(&data, 0xfe, sizeof(data));
1466 data.cbSize = sizeof(data);
1467
1468 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_WINRT_ACTIVATABLE_CLASSES, classid, &data);
1469 ok_(__FILE__, line)(ret || broken(!ret) /* <= Win10 v1809 */, "FindActCtxSectionStringW failed, error %lu\n", GetLastError());
1470 if (!ret)
1471 {
1472 ok_(__FILE__, line)(GetLastError() == ERROR_SXS_SECTION_NOT_FOUND, "got error %lu\n", GetLastError());
1473 return;
1474 }
1475
1476 ok_(__FILE__, line)(data.cbSize == sizeof(data), "got cbSize %lu\n", data.cbSize);
1477 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "got ulDataFormatVersion %lu\n", data.ulDataFormatVersion);
1478 ok_(__FILE__, line)(data.lpData != NULL, "got lpData %p\n", data.lpData);
1479
1480 header = (struct strsection_header *)data.lpSectionBase;
1481 ok_(__FILE__, line)(data.lpSectionBase != NULL, "got lpSectionBase %p\n", data.lpSectionBase);
1482 ok_(__FILE__, line)(header->magic == 0x64487353, "got wrong magic 0x%08lx\n", header->magic);
1483 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "got ulSectionTotalLength %lu\n", data.ulSectionTotalLength);
1484 ok_(__FILE__, line)(data.lpSectionGlobalData == (BYTE *)header + header->global_offset,
1485 "got lpSectionGlobalData %p\n", data.lpSectionGlobalData);
1486 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == header->global_len,
1487 "got ulSectionGlobalDataLength %lu\n", data.ulSectionGlobalDataLength);
1488 ok_(__FILE__, line)(data.hActCtx == NULL, "got hActCtx %p\n", data.hActCtx);
1489 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "got ulAssemblyRosterIndex %lu\n", data.ulAssemblyRosterIndex);
1490
1491 activatable_class = (struct activatable_class_data *)data.lpData;
1492 ok_(__FILE__, line)(activatable_class->size == sizeof(*activatable_class), "got size %lu\n",
1493 activatable_class->size);
1494 ok_(__FILE__, line)(activatable_class->threading_model == threading_model, "got threading_model %lu\n",
1495 activatable_class->threading_model);
1496
1497 ptr = (BYTE *)header + activatable_class->module_offset;
1498 ok_(__FILE__, line)(wcslen(ptr) * sizeof(WCHAR) == activatable_class->module_len,
1499 "got module_len %lu\n", activatable_class->module_len);
1500 ok_(__FILE__, line)(!wcscmp(ptr, file), "got data.lpSectionGlobalData %s\n", debugstr_w(ptr));
1501}
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1972
#define debugstr_w
Definition: kernel32.h:32
#define ERROR_SXS_SECTION_NOT_FOUND
Definition: winerror.h:3094
unsigned char BYTE
Definition: xxhash.c:193

Referenced by test_actctx().

◆ test_find_com_redirection()

static void test_find_com_redirection ( HANDLE  handle,
const GUID clsid,
const GUID tlid,
const WCHAR progid,
ULONG  exid,
int  line 
)
static

Definition at line 1642 of file actctx.c.

1643{
1644 struct comclassredirect_data *comclass, *comclass2;
1645 ACTCTX_SECTION_KEYED_DATA data, data2;
1646 struct guidsection_header *header;
1647 BOOL ret;
1648
1649 memset(&data, 0xfe, sizeof(data));
1650 data.cbSize = sizeof(data);
1651
1652 ret = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION, clsid, &data);
1653 if (!ret)
1654 {
1655 skip("failed for guid %s\n", wine_dbgstr_guid(clsid));
1656 return;
1657 }
1658 ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %lu\n", GetLastError());
1659
1660 comclass = (struct comclassredirect_data*)data.lpData;
1661
1662 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize);
1663 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion);
1664 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1665 ok_(__FILE__, line)(comclass->size == sizeof(*comclass), "got %ld for header size\n", comclass->size);
1666 if (data.lpData && comclass->size == sizeof(*comclass))
1667 {
1669 WCHAR *ptr;
1670
1671 ok_(__FILE__, line)(comclass->model == ThreadingModel_Neutral, "got model %ld\n", comclass->model);
1672 ok_(__FILE__, line)(IsEqualGUID(&comclass->clsid, clsid), "got wrong clsid %s\n", wine_dbgstr_guid(&comclass->clsid));
1673 ok_(__FILE__, line)(IsEqualGUID(&comclass->clsid2, clsid), "got wrong clsid2 %s\n", wine_dbgstr_guid(&comclass->clsid2));
1674 if (tlid)
1675 ok_(__FILE__, line)(IsEqualGUID(&comclass->tlid, tlid), "got wrong tlid %s\n", wine_dbgstr_guid(&comclass->tlid));
1676 ok_(__FILE__, line)(comclass->name_len > 0, "got modulename len %ld\n", comclass->name_len);
1677
1678 if (progid)
1679 {
1680 len = comclass->size + comclass->clrdata_len;
1681 ok_(__FILE__, line)(comclass->progid_offset == len, "got progid offset %ld, expected %ld\n", comclass->progid_offset, len);
1682 }
1683 else
1684 ok_(__FILE__, line)(comclass->progid_offset == 0, "got progid offset %ld, expected 0\n", comclass->progid_offset);
1685
1686 if (comclass->progid_offset)
1687 {
1688 ptr = (WCHAR*)((BYTE*)comclass + comclass->progid_offset);
1689 ok_(__FILE__, line)(!lstrcmpW(ptr, progid), "got wrong progid %s, expected %s\n", wine_dbgstr_w(ptr), wine_dbgstr_w(progid));
1690 ok_(__FILE__, line)(lstrlenW(progid)*sizeof(WCHAR) == comclass->progid_len,
1691 "got progid name length %ld\n", comclass->progid_len);
1692 }
1693
1694 /* data length is simply header length + string data length including nulls */
1695 len = comclass->size + comclass->clrdata_len;
1696 if (comclass->progid_len) len += comclass->progid_len + sizeof(WCHAR);
1697 ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %ld, expected %ld\n", data.ulLength, len);
1698
1699 /* keyed data structure doesn't include module name, it's available from section data */
1700 ok_(__FILE__, line)(data.ulSectionTotalLength > comclass->name_offset, "got wrong offset %ld\n", comclass->name_offset);
1701
1702 /* check misc fields are set */
1703 miscmask = (comclass->flags >> 8) & 0xff;
1704 if (miscmask)
1705 {
1706 if (miscmask & MiscStatus)
1707 ok_(__FILE__, line)(comclass->miscstatus != 0, "got miscstatus 0x%08lx\n", comclass->miscstatus);
1709 ok_(__FILE__, line)(comclass->miscstatusicon != 0, "got miscstatusicon 0x%08lx\n", comclass->miscstatusicon);
1711 ok_(__FILE__, line)(comclass->miscstatuscontent != 0, "got miscstatuscontent 0x%08lx\n", comclass->miscstatuscontent);
1713 ok_(__FILE__, line)(comclass->miscstatusthumbnail != 0, "got miscstatusthumbnail 0x%08lx\n", comclass->miscstatusthumbnail);
1715 ok_(__FILE__, line)(comclass->miscstatusdocprint != 0, "got miscstatusdocprint 0x%08lx\n", comclass->miscstatusdocprint);
1716 }
1717 ok_(__FILE__, line)(!(comclass->flags & 0xffff00ff), "Unexpected flags %#lx.\n", comclass->flags);
1718
1719 /* part used for clrClass only */
1720 if (comclass->clrdata_len)
1721 {
1722 static const WCHAR mscoreeW[] = {'M','S','C','O','R','E','E','.','D','L','L',0};
1723 static const WCHAR mscoree2W[] = {'m','s','c','o','r','e','e','.','d','l','l',0};
1724 struct clrclass_data *clrclass;
1725 WCHAR *ptrW;
1726
1727 clrclass = (struct clrclass_data*)((BYTE*)data.lpData + comclass->clrdata_offset);
1728 ok_(__FILE__, line)(clrclass->size == sizeof(*clrclass), "clrclass: got size %ld\n", clrclass->size);
1729 ok_(__FILE__, line)(clrclass->res[0] == 0, "clrclass: got res[0]=0x%08lx\n", clrclass->res[0]);
1730 ok_(__FILE__, line)(clrclass->res[1] == 2, "clrclass: got res[1]=0x%08lx\n", clrclass->res[1]);
1731 ok_(__FILE__, line)(clrclass->module_len == lstrlenW(mscoreeW)*sizeof(WCHAR), "clrclass: got module len %ld\n", clrclass->module_len);
1732 ok_(__FILE__, line)(clrclass->module_offset > 0, "clrclass: got module offset %ld\n", clrclass->module_offset);
1733
1734 ok_(__FILE__, line)(clrclass->name_len > 0, "clrclass: got name len %ld\n", clrclass->name_len);
1735 ok_(__FILE__, line)(clrclass->name_offset == clrclass->size, "clrclass: got name offset %ld\n", clrclass->name_offset);
1736 ok_(__FILE__, line)(clrclass->version_len > 0, "clrclass: got version len %ld\n", clrclass->version_len);
1737 ok_(__FILE__, line)(clrclass->version_offset > 0, "clrclass: got version offset %ld\n", clrclass->version_offset);
1738
1739 ok_(__FILE__, line)(clrclass->res2[0] == 0, "clrclass: got res2[0]=0x%08lx\n", clrclass->res2[0]);
1740 ok_(__FILE__, line)(clrclass->res2[1] == 0, "clrclass: got res2[1]=0x%08lx\n", clrclass->res2[1]);
1741
1742 /* clrClass uses mscoree.dll as module name, but in two variants - comclass data points to module name
1743 in lower case, clsclass subsection - in upper case */
1744 ok_(__FILE__, line)(comclass->name_len == lstrlenW(mscoree2W)*sizeof(WCHAR), "clrclass: got com name len %ld\n", comclass->name_len);
1745 ok_(__FILE__, line)(comclass->name_offset > 0, "clrclass: got name offset %ld\n", clrclass->name_offset);
1746
1747 ptrW = (WCHAR*)((BYTE*)data.lpSectionBase + comclass->name_offset);
1748 ok_(__FILE__, line)(!lstrcmpW(ptrW, mscoreeW), "clrclass: module name %s\n", wine_dbgstr_w(ptrW));
1749
1750 ptrW = (WCHAR*)((BYTE*)data.lpSectionBase + clrclass->module_offset);
1751 ok_(__FILE__, line)(!lstrcmpW(ptrW, mscoree2W), "clrclass: module name2 %s\n", wine_dbgstr_w(ptrW));
1752 }
1753 }
1754
1755 header = (struct guidsection_header*)data.lpSectionBase;
1756 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1757 ok_(__FILE__, line)(data.lpSectionGlobalData == ((BYTE*)header + header->names_offset), "data.lpSectionGlobalData == NULL\n");
1758 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == header->names_len, "data.ulSectionGlobalDataLength=%lu\n",
1759 data.ulSectionGlobalDataLength);
1760 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n",
1761 data.ulSectionTotalLength);
1762 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1763 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n",
1764 data.ulAssemblyRosterIndex, exid);
1766
1767 /* generated guid for this class works as key guid in search */
1768 memset(&data2, 0xfe, sizeof(data2));
1769 data2.cbSize = sizeof(data2);
1770 ret = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION, &comclass->alias, &data2);
1771 ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %lu\n", GetLastError());
1772
1773 comclass2 = (struct comclassredirect_data*)data2.lpData;
1774 ok_(__FILE__, line)(comclass->size == comclass2->size, "got wrong data length %ld, expected %ld\n", comclass2->size, comclass->size);
1775 ok_(__FILE__, line)(!memcmp(comclass, comclass2, comclass->size), "got wrong data\n");
1776}
BOOL WINAPI FindActCtxSectionGuid(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, const GUID *lpSearchGuid, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:265
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4246
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2802
#define progid(str)
Definition: exdisp.idl:31
GLenum GLsizei len
Definition: glext.h:6722
static void validate_guid_index(const ACTCTX_SECTION_KEYED_DATA *data, int line)
Definition: actctx.c:1619
const CLSID * clsid
Definition: msctf.cpp:50
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
static const WCHAR mscoree2W[]
Definition: actctx.c:680
static const WCHAR mscoreeW[]
Definition: actctx.c:679
ULONG module_len
Definition: sxs.c:94
DWORD res2[2]
Definition: sxs.c:100
DWORD res[2]
Definition: sxs.c:93
ULONG size
Definition: sxs.c:92
ULONG version_offset
Definition: sxs.c:99
ULONG name_offset
Definition: sxs.c:97
ULONG module_offset
Definition: sxs.c:95
ULONG name_len
Definition: sxs.c:96
ULONG version_len
Definition: sxs.c:98
DWORD miscstatusdocprint
Definition: compobj.c:128
DWORD miscstatusthumbnail
Definition: compobj.c:126
uint32_t ULONG
Definition: typedefs.h:59

Referenced by test_actctx().

◆ test_find_dll_redirection()

static void test_find_dll_redirection ( HANDLE  handle,
LPCWSTR  libname,
ULONG  exid,
int  line 
)
static

Definition at line 1282 of file actctx.c.

1283{
1284 ACTCTX_SECTION_KEYED_DATA data;
1285 BOOL ret;
1286
1287 memset(&data, 0xfe, sizeof(data));
1288 data.cbSize = sizeof(data);
1289
1290 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, libname, &data);
1291 ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %lu\n", GetLastError());
1292 if (!ret) return;
1293
1294 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize);
1295 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion);
1296 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1297 ok_(__FILE__, line)(data.ulLength == offsetof( struct dllredirect_data, paths[0]), "data.ulLength=%lu\n", data.ulLength);
1298
1299 if (data.lpData)
1300 {
1301 struct dllredirect_data *dlldata = (struct dllredirect_data*)data.lpData;
1302 ok_(__FILE__, line)(dlldata->size == offsetof( struct dllredirect_data, paths[dlldata->paths_count]),
1303 "got wrong size %ld\n", dlldata->size);
1304 ok_(__FILE__, line)(dlldata->flags == DLL_REDIRECT_PATH_OMITS_ASSEMBLY_ROOT,
1305 "got wrong flags value %lx\n", dlldata->flags);
1306 ok_(__FILE__, line)(dlldata->total_len == 0, "got wrong total len value %ld\n", dlldata->total_len);
1307 ok_(__FILE__, line)(dlldata->paths_count == 0, "got wrong paths count value %ld\n", dlldata->paths_count);
1308 ok_(__FILE__, line)(dlldata->paths_offset == 0, "got wrong paths offset value %ld\n", dlldata->paths_offset);
1309 }
1310
1311 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1312 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n",
1313 data.ulSectionGlobalDataLength);
1314 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1315 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n",
1316 data.ulSectionTotalLength);
1317 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1318 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n",
1319 data.ulAssemblyRosterIndex, exid);
1320
1321 memset(&data, 0xfe, sizeof(data));
1322 data.cbSize = sizeof(data);
1323
1324 ret = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
1325 ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, libname, &data);
1326 ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %lu\n", GetLastError());
1327 if (!ret) return;
1328
1329 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize);
1330 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion);
1331 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1332 ok_(__FILE__, line)(data.ulLength == 20, "data.ulLength=%lu\n", data.ulLength);
1333 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1334 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n",
1335 data.ulSectionGlobalDataLength);
1336 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1337 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n",
1338 data.ulSectionTotalLength);
1339 ok_(__FILE__, line)(data.hActCtx == handle, "data.hActCtx=%p\n", data.hActCtx);
1340 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n",
1341 data.ulAssemblyRosterIndex, exid);
1342
1344}
GLsizei const GLuint * paths
Definition: glext.h:11717
#define DLL_REDIRECT_PATH_OMITS_ASSEMBLY_ROOT
Definition: actctx.c:1257
#define offsetof(TYPE, MEMBER)
ULONG paths_offset
Definition: actctx.c:1252
ULONG total_len
Definition: actctx.c:1250
ULONG paths_count
Definition: actctx.c:1251

Referenced by test_actctx().

◆ test_find_ifaceps_redirection()

static void test_find_ifaceps_redirection ( HANDLE  handle,
const GUID iid,
const GUID tlbid,
const GUID base,
const GUID ps32,
ULONG  exid,
int  line 
)
static

Definition at line 1796 of file actctx.c.

1798{
1799 struct ifacepsredirect_data *ifaceps;
1800 ACTCTX_SECTION_KEYED_DATA data;
1801 BOOL ret;
1802
1803 memset(&data, 0xfe, sizeof(data));
1804 data.cbSize = sizeof(data);
1805
1806 ret = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION, iid, &data);
1807 ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %lu\n", GetLastError());
1808
1809 ifaceps = (struct ifacepsredirect_data*)data.lpData;
1810
1811 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize);
1812 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion);
1813 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1814 ok_(__FILE__, line)(ifaceps->size == sizeof(*ifaceps), "got %ld for header size\n", ifaceps->size);
1815 if (data.lpData && ifaceps->size == sizeof(*ifaceps))
1816 {
1817 ULONG len;
1818
1819 /* for external proxy stubs it contains a value from 'proxyStubClsid32' */
1820 if (ps32)
1821 {
1822 ok_(__FILE__, line)(IsEqualGUID(&ifaceps->iid, ps32), "got wrong iid %s\n", wine_dbgstr_guid(&ifaceps->iid));
1823 }
1824 else
1825 ok_(__FILE__, line)(IsEqualGUID(&ifaceps->iid, iid), "got wrong iid %s\n", wine_dbgstr_guid(&ifaceps->iid));
1826
1827 ok_(__FILE__, line)(IsEqualGUID(&ifaceps->tlbid, tlbid), "got wrong tlid %s\n", wine_dbgstr_guid(&ifaceps->tlbid));
1828 ok_(__FILE__, line)(ifaceps->name_len > 0, "got modulename len %ld\n", ifaceps->name_len);
1829 ok_(__FILE__, line)(ifaceps->name_offset == ifaceps->size, "got progid offset %ld\n", ifaceps->name_offset);
1830
1831 /* data length is simply header length + string data length including nulls */
1832 len = ifaceps->size + ifaceps->name_len + sizeof(WCHAR);
1833 ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %ld, expected %ld\n", data.ulLength, len);
1834
1835 /* mask purpose is to indicate if attribute was specified, for testing purposes assume that manifest
1836 always has non-zero value for it */
1837 if (ifaceps->mask & NumMethods)
1838 ok_(__FILE__, line)(ifaceps->nummethods != 0, "got nummethods %ld\n", ifaceps->nummethods);
1839 if (ifaceps->mask & BaseIface)
1840 ok_(__FILE__, line)(IsEqualGUID(&ifaceps->base, base), "got base %s\n", wine_dbgstr_guid(&ifaceps->base));
1841 }
1842
1843 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1844 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n",
1845 data.ulSectionGlobalDataLength);
1846 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1847 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n",
1848 data.ulSectionTotalLength);
1849 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1850 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n",
1851 data.ulAssemblyRosterIndex, exid);
1852
1854}

Referenced by test_actctx().

◆ test_find_progid_redirection()

static void test_find_progid_redirection ( HANDLE  handle,
const GUID clsid,
const char progid,
ULONG  exid,
int  line 
)
static

Definition at line 1934 of file actctx.c.

1935{
1936 struct progidredirect_data *progiddata;
1937 struct comclassredirect_data *comclass;
1938 ACTCTX_SECTION_KEYED_DATA data, data2;
1939 struct strsection_header *header;
1940 BOOL ret;
1941
1942#if defined(__REACTOS__) && defined(_MSC_VER)
1943 if (is_reactos()) {
1944 ok(FALSE, "FIXME: This crashes on MSVC ReactOS\n");
1945 return;
1946 }
1947#endif
1948 memset(&data, 0xfe, sizeof(data));
1949 data.cbSize = sizeof(data);
1950
1951 ret = FindActCtxSectionStringA(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION, progid, &data);
1952 ok_(__FILE__, line)(ret, "FindActCtxSectionStringA failed: %lu\n", GetLastError());
1953
1954 progiddata = (struct progidredirect_data*)data.lpData;
1955
1956 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize);
1957 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion);
1958 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1959 ok_(__FILE__, line)(progiddata->size == sizeof(*progiddata), "got %ld for header size\n", progiddata->size);
1960 if (data.lpData && progiddata->size == sizeof(*progiddata))
1961 {
1962 GUID *guid;
1963
1964 ok_(__FILE__, line)(progiddata->reserved == 0, "got reserved as %ld\n", progiddata->reserved);
1965 ok_(__FILE__, line)(progiddata->clsid_offset > 0, "got clsid_offset as %ld\n", progiddata->clsid_offset);
1966
1967 /* progid data points to generated alias guid */
1968 guid = (GUID*)((BYTE*)data.lpSectionBase + progiddata->clsid_offset);
1969
1970 memset(&data2, 0, sizeof(data2));
1971 data2.cbSize = sizeof(data2);
1972 ret = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION, guid, &data2);
1973 ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %lu\n", GetLastError());
1974
1975 comclass = (struct comclassredirect_data*)data2.lpData;
1976 ok_(__FILE__, line)(IsEqualGUID(guid, &comclass->alias), "got wrong alias referenced from progid %s, %s\n", progid, wine_dbgstr_guid(guid));
1977 ok_(__FILE__, line)(IsEqualGUID(clsid, &comclass->clsid), "got wrong class referenced from progid %s, %s\n", progid, wine_dbgstr_guid(clsid));
1978
1980 }
1981
1982 header = (struct strsection_header*)data.lpSectionBase;
1983 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1984 ok_(__FILE__, line)(data.lpSectionGlobalData == (BYTE*)header + header->global_offset, "data.lpSectionGlobalData == NULL\n");
1985 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == header->global_len, "data.ulSectionGlobalDataLength=%lu\n", data.ulSectionGlobalDataLength);
1986 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n", data.ulSectionTotalLength);
1987 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1988 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n",
1989 data.ulAssemblyRosterIndex, exid);
1990}
GUID guid
Definition: version.c:147
#define is_reactos()
Definition: test.h:1041

Referenced by test_actctx().

◆ test_find_string_fail()

static void test_find_string_fail ( void  )
static

Definition at line 1503 of file actctx.c.

1504{
1505 ACTCTX_SECTION_KEYED_DATA data = {sizeof(data)};
1506 BOOL ret;
1507
1509 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1510 ok(GetLastError() == ERROR_SXS_SECTION_NOT_FOUND, "GetLastError()=%lu\n", GetLastError());
1511
1512 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, testlib2_dll, &data);
1513 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1514 ok(GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "GetLastError()=%lu\n", GetLastError());
1515
1516 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, testlib_dll, NULL);
1517 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1518 ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%lu\n", GetLastError());
1519
1520 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, NULL, &data);
1521 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1522 ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%lu\n", GetLastError());
1523
1524 data.cbSize = 0;
1525 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, testlib_dll, &data);
1526 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1527 ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%lu\n", GetLastError());
1528
1529 data.cbSize = 35;
1530 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, testlib_dll, &data);
1531 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1532 ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%lu\n", GetLastError());
1533}

Referenced by test_actctx().

◆ test_find_surrogate()

static void test_find_surrogate ( HANDLE  handle,
const GUID clsid,
const WCHAR name,
const WCHAR version,
ULONG  exid,
int  line 
)
static

Definition at line 1867 of file actctx.c.

1869{
1870 struct clrsurrogate_data *surrogate;
1871 ACTCTX_SECTION_KEYED_DATA data;
1872 BOOL ret;
1873
1874#ifdef __REACTOS__
1875 if (is_reactos()) {
1876 ok(FALSE, "FIXME: This test crashes on ReactOS\n");
1877 return;
1878 }
1879#endif
1880 memset(&data, 0xfe, sizeof(data));
1881 data.cbSize = sizeof(data);
1882
1883 ret = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES, clsid, &data);
1884 if (!ret)
1885 {
1886 skip("surrogate sections are not supported\n");
1887 return;
1888 }
1889 ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %lu\n", GetLastError());
1890
1891 surrogate = (struct clrsurrogate_data*)data.lpData;
1892
1893 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize);
1894 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion);
1895 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1896 ok_(__FILE__, line)(surrogate->size == sizeof(*surrogate), "got %ld for header size\n", surrogate->size);
1897 if (data.lpData && surrogate->size == sizeof(*surrogate))
1898 {
1899 WCHAR *ptrW;
1900 ULONG len;
1901
1902 ok_(__FILE__, line)(surrogate->res == 0, "invalid res value %ld\n", surrogate->res);
1903 ok_(__FILE__, line)(IsEqualGUID(&surrogate->clsid, clsid), "got wrong clsid %s\n", wine_dbgstr_guid(&surrogate->clsid));
1904
1905 ok_(__FILE__, line)(surrogate->version_len == lstrlenW(version)*sizeof(WCHAR), "got version len %ld\n", surrogate->version_len);
1906 ok_(__FILE__, line)(surrogate->version_offset == surrogate->size, "got version offset %ld\n", surrogate->version_offset);
1907
1908 ok_(__FILE__, line)(surrogate->name_len == lstrlenW(name)*sizeof(WCHAR), "got name len %ld\n", surrogate->name_len);
1909 ok_(__FILE__, line)(surrogate->name_offset > surrogate->version_offset, "got name offset %ld\n", surrogate->name_offset);
1910
1911 len = surrogate->size + surrogate->name_len + surrogate->version_len + 2*sizeof(WCHAR);
1912 ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %ld, expected %ld\n", data.ulLength, len);
1913
1914 ptrW = (WCHAR*)((BYTE*)surrogate + surrogate->name_offset);
1915 ok(!lstrcmpW(ptrW, name), "got wrong name %s\n", wine_dbgstr_w(ptrW));
1916
1917 ptrW = (WCHAR*)((BYTE*)surrogate + surrogate->version_offset);
1918 ok(!lstrcmpW(ptrW, version), "got wrong name %s\n", wine_dbgstr_w(ptrW));
1919 }
1920
1921 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1922 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n",
1923 data.ulSectionGlobalDataLength);
1924 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1925 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n",
1926 data.ulSectionTotalLength);
1927 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1928 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n",
1929 data.ulAssemblyRosterIndex, exid);
1930
1932}
static const WCHAR version[]
Definition: asmname.c:66
ULONG version_len
Definition: actctx.c:1862
ULONG name_offset
Definition: actctx.c:1863
ULONG version_offset
Definition: actctx.c:1861

Referenced by test_actctx().

◆ test_find_window_class()

static void test_find_window_class ( HANDLE  handle,
LPCWSTR  clsname,
ULONG  exid,
int  line 
)
static

Definition at line 1346 of file actctx.c.

1347{
1348 struct wndclass_redirect_data *wnddata;
1349 struct strsection_header *header;
1350 ACTCTX_SECTION_KEYED_DATA data;
1351 BOOL ret;
1352
1353 memset(&data, 0xfe, sizeof(data));
1354 data.cbSize = sizeof(data);
1355
1356 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, clsname, &data);
1357 ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %lu, class %s\n", GetLastError(),
1358 wine_dbgstr_w(clsname));
1359 if (!ret) return;
1360
1361 header = (struct strsection_header*)data.lpSectionBase;
1362 wnddata = (struct wndclass_redirect_data*)data.lpData;
1363
1364 ok_(__FILE__, line)(header->magic == 0x64487353, "got wrong magic 0x%08lx\n", header->magic);
1365 ok_(__FILE__, line)(header->count > 0, "got count %ld\n", header->count);
1366 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize);
1367 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion);
1368 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1369 ok_(__FILE__, line)(wnddata->size == sizeof(*wnddata), "got %ld for header size\n", wnddata->size);
1370 if (data.lpData && wnddata->size == sizeof(*wnddata))
1371 {
1372 static const WCHAR verW[] = {'6','.','5','.','4','.','3','!',0};
1373 WCHAR buff[50];
1374 WCHAR *ptr;
1375 ULONG len;
1376
1377 ok_(__FILE__, line)(wnddata->res == 0, "got reserved as %ld\n", wnddata->res);
1378 /* redirect class name (versioned or not) is stored just after header data */
1379 ok_(__FILE__, line)(wnddata->name_offset == wnddata->size, "got name offset as %ld\n", wnddata->name_offset);
1380 ok_(__FILE__, line)(wnddata->module_len > 0, "got module name length as %ld\n", wnddata->module_len);
1381
1382 /* expected versioned name */
1383 lstrcpyW(buff, verW);
1384 lstrcatW(buff, clsname);
1385 ptr = (WCHAR*)((BYTE*)wnddata + wnddata->name_offset);
1386 ok_(__FILE__, line)(!lstrcmpW(ptr, buff), "got wrong class name %s, expected %s\n", wine_dbgstr_w(ptr), wine_dbgstr_w(buff));
1387 ok_(__FILE__, line)(lstrlenW(ptr)*sizeof(WCHAR) == wnddata->name_len,
1388 "got wrong class name length %ld, expected %d\n", wnddata->name_len, lstrlenW(ptr));
1389
1390 /* data length is simply header length + string data length including nulls */
1391 len = wnddata->size + wnddata->name_len + wnddata->module_len + 2*sizeof(WCHAR);
1392 ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %ld, expected %ld\n", data.ulLength, len);
1393
1394 if (data.ulSectionTotalLength > wnddata->module_offset)
1395 {
1396 WCHAR *modulename, *sectionptr;
1397
1398 /* just compare pointers */
1399 modulename = (WCHAR*)((BYTE*)wnddata + wnddata->size + wnddata->name_len + sizeof(WCHAR));
1400 sectionptr = (WCHAR*)((BYTE*)data.lpSectionBase + wnddata->module_offset);
1401 ok_(__FILE__, line)(modulename == sectionptr, "got wrong name offset %p, expected %p\n", sectionptr, modulename);
1402 }
1403 }
1404
1405 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1406 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n",
1407 data.ulSectionGlobalDataLength);
1408 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1409 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n",
1410 data.ulSectionTotalLength);
1411 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1412 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n",
1413 data.ulAssemblyRosterIndex, exid);
1414
1415 memset(&data, 0xfe, sizeof(data));
1416 data.cbSize = sizeof(data);
1417
1418 ret = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
1419 ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, clsname, &data);
1420 ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %lu, class %s\n", GetLastError(),
1421 wine_dbgstr_w(clsname));
1422 if (!ret) return;
1423
1424 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%lu\n", data.cbSize);
1425 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%lu\n", data.ulDataFormatVersion);
1426 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1427 ok_(__FILE__, line)(data.ulLength > 0, "data.ulLength=%lu\n", data.ulLength);
1428 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1429 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%lu\n",
1430 data.ulSectionGlobalDataLength);
1431 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1432 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%lu\n", data.ulSectionTotalLength);
1433 ok_(__FILE__, line)(data.hActCtx == handle, "data.hActCtx=%p\n", data.hActCtx);
1434 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%lu, expected %lu\n",
1435 data.ulAssemblyRosterIndex, exid);
1436
1438}
static unsigned char buff[32768]
Definition: fatten.c:17

Referenced by test_actctx().

◆ test_findsectionstring()

static void test_findsectionstring ( void  )
static

Definition at line 2674 of file actctx.c.

2675{
2676 HANDLE handle;
2677 BOOL ret;
2679
2680 handle = create_manifest("test.manifest", testdep_manifest3, __LINE__);
2682 ok(ret, "ActivateActCtx failed: %lu\n", GetLastError());
2683
2684 /* first we show the parameter validation from kernel32 */
2685 kernel32_find(ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION, "testdep", FALSE, TRUE, __LINE__);
2686 kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib.dll", TRUE, FALSE, __LINE__);
2687 kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib2.dll", TRUE, FALSE, __LINE__);
2688 kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib3.dll", FALSE, FALSE, __LINE__);
2689 kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass", TRUE, FALSE, __LINE__);
2690 kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass2", TRUE, FALSE, __LINE__);
2691 kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass3", FALSE, FALSE, __LINE__);
2692
2693 /* then we show that ntdll plays by different rules */
2694 ntdll_find(ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION, "testdep", FALSE, TRUE, __LINE__);
2695 ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib.dll", TRUE, FALSE, __LINE__);
2696 ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib2.dll", TRUE, FALSE, __LINE__);
2697 ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib3.dll", FALSE, FALSE, __LINE__);
2698 ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass", TRUE, FALSE, __LINE__);
2699 ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass2", TRUE, FALSE, __LINE__);
2700 ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass3", FALSE, FALSE, __LINE__);
2701
2702#ifdef __REACTOS__
2703 if (is_reactos()) {
2704 trace("HACK: ReactOS crashes on DeactivateActCtx() below.\n");
2705 ret = FALSE;
2706 } else
2707#endif
2709 ok(ret, "DeactivateActCtx failed: %lu\n", GetLastError());
2711}
static void kernel32_find(ULONG section, const char *string_to_find, BOOL should_find, BOOL todo, int line)
Definition: actctx.c:2598
static HANDLE create_manifest(const char *filename, const char *data, int line)
Definition: actctx.c:2585
static void ntdll_find(ULONG section, const char *string_to_find, BOOL should_find, BOOL todo, int line)
Definition: actctx.c:2650

Referenced by START_TEST().

◆ test_info_in_assembly()

static void test_info_in_assembly ( HANDLE  handle,
DWORD  id,
const info_in_assembly exinfo,
int  line 
)
static

Definition at line 861 of file actctx.c.

862{
863 ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *info, info_tmp;
864 SIZE_T size, exsize;
865 ULONG len;
866 BOOL b;
867
868 exsize = sizeof(ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION);
869 if (exinfo->manifest_path) exsize += (lstrlenW(exinfo->manifest_path)+1) * sizeof(WCHAR);
870 if (exinfo->encoded_assembly_id) exsize += (lstrlenW(exinfo->encoded_assembly_id) + 1) * sizeof(WCHAR);
871
872 size = 0xdeadbeef;
873 b = QueryActCtxW(0, handle, &id, AssemblyDetailedInformationInActivationContext, &info_tmp, sizeof(info_tmp), &size);
874 ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n");
875 ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %lu\n", GetLastError());
876
877 ok_(__FILE__, line)(size >= exsize, "size=%Iu, expected %Iu\n", size, exsize);
878
879 if (size == 0xdeadbeef)
880 {
881 skip("bad size\n");
882 return;
883 }
884
886 memset(info, 0xfe, size);
887
888 size = 0xdeadbeef;
889 b = QueryActCtxW(0, handle, &id, AssemblyDetailedInformationInActivationContext, info, size, &size);
890 ok_(__FILE__, line)(b, "QueryActCtx failed: %lu\n", GetLastError());
891 if (!exinfo->manifest_path)
892 exsize += info->ulManifestPathLength + sizeof(WCHAR);
893 if (!exinfo->encoded_assembly_id)
894 exsize += info->ulEncodedAssemblyIdentityLength + sizeof(WCHAR);
895 if (exinfo->has_assembly_dir)
896 exsize += info->ulAssemblyDirectoryNameLength + sizeof(WCHAR);
897 ok_(__FILE__, line)(size == exsize, "size=%Iu, expected %Iu\n", size, exsize);
898
899 if (0) /* FIXME: flags meaning unknown */
900 {
901 ok_(__FILE__, line)((info->ulFlags) == exinfo->flags, "info->ulFlags = %lx, expected %lx\n",
902 info->ulFlags, exinfo->flags);
903 }
904 if(exinfo->encoded_assembly_id) {
905 len = lstrlenW(exinfo->encoded_assembly_id)*sizeof(WCHAR);
906 ok_(__FILE__, line)(info->ulEncodedAssemblyIdentityLength == len,
907 "info->ulEncodedAssemblyIdentityLength = %lu, expected %lu\n",
908 info->ulEncodedAssemblyIdentityLength, len);
909 } else {
910 ok_(__FILE__, line)(info->ulEncodedAssemblyIdentityLength != 0,
911 "info->ulEncodedAssemblyIdentityLength == 0\n");
912 }
913 ok_(__FILE__, line)(info->ulManifestPathType == ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE,
914 "info->ulManifestPathType = %lx\n", info->ulManifestPathType);
915 if(exinfo->manifest_path) {
916 len = lstrlenW(exinfo->manifest_path)*sizeof(WCHAR);
917 ok_(__FILE__, line)(info->ulManifestPathLength == len, "info->ulManifestPathLength = %lu, expected %lu\n",
918 info->ulManifestPathLength, len);
919 } else {
920 ok_(__FILE__, line)(info->ulManifestPathLength != 0, "info->ulManifestPathLength == 0\n");
921 }
922
923 ok_(__FILE__, line)(info->ulPolicyPathType == ACTIVATION_CONTEXT_PATH_TYPE_NONE,
924 "info->ulPolicyPathType = %lx\n", info->ulPolicyPathType);
925 ok_(__FILE__, line)(info->ulPolicyPathLength == 0,
926 "info->ulPolicyPathLength = %lu, expected 0\n", info->ulPolicyPathLength);
927 ok_(__FILE__, line)(info->ulMetadataSatelliteRosterIndex == 0, "info->ulMetadataSatelliteRosterIndex = %lx\n",
928 info->ulMetadataSatelliteRosterIndex);
929 ok_(__FILE__, line)(info->ulManifestVersionMajor == 1,"info->ulManifestVersionMajor = %lx\n",
930 info->ulManifestVersionMajor);
931 ok_(__FILE__, line)(info->ulManifestVersionMinor == 0, "info->ulManifestVersionMinor = %lx\n",
932 info->ulManifestVersionMinor);
933 ok_(__FILE__, line)(info->ulPolicyVersionMajor == 0, "info->ulPolicyVersionMajor = %lx\n",
934 info->ulPolicyVersionMajor);
935 ok_(__FILE__, line)(info->ulPolicyVersionMinor == 0, "info->ulPolicyVersionMinor = %lx\n",
936 info->ulPolicyVersionMinor);
937 if(exinfo->has_assembly_dir)
938 ok_(__FILE__, line)(info->ulAssemblyDirectoryNameLength != 0,
939 "info->ulAssemblyDirectoryNameLength == 0\n");
940 else
941 ok_(__FILE__, line)(info->ulAssemblyDirectoryNameLength == 0,
942 "info->ulAssemblyDirectoryNameLength != 0\n");
943
944 ok_(__FILE__, line)(info->lpAssemblyEncodedAssemblyIdentity != NULL,
945 "info->lpAssemblyEncodedAssemblyIdentity == NULL\n");
946 if(info->lpAssemblyEncodedAssemblyIdentity && exinfo->encoded_assembly_id) {
947 ok_(__FILE__, line)(!lstrcmpW(info->lpAssemblyEncodedAssemblyIdentity, exinfo->encoded_assembly_id),
948 "unexpected info->lpAssemblyEncodedAssemblyIdentity %s / %s\n",
949 wine_dbgstr_w(info->lpAssemblyEncodedAssemblyIdentity), wine_dbgstr_w(exinfo->encoded_assembly_id));
950 }
951 if(exinfo->manifest_path) {
952 ok_(__FILE__, line)(info->lpAssemblyManifestPath != NULL, "info->lpAssemblyManifestPath == NULL\n");
953 if(info->lpAssemblyManifestPath)
954 ok_(__FILE__, line)(!lstrcmpiW(info->lpAssemblyManifestPath, exinfo->manifest_path),
955 "unexpected info->lpAssemblyManifestPath\n");
956 }else {
957 ok_(__FILE__, line)(info->lpAssemblyManifestPath != NULL, "info->lpAssemblyManifestPath == NULL\n");
958 }
959
960 ok_(__FILE__, line)(info->lpAssemblyPolicyPath == NULL, "info->lpAssemblyPolicyPath != NULL\n");
961 if(info->lpAssemblyPolicyPath)
962 ok_(__FILE__, line)(*(WORD*)info->lpAssemblyPolicyPath == 0, "info->lpAssemblyPolicyPath is not empty\n");
963 if(exinfo->has_assembly_dir)
964 ok_(__FILE__, line)(info->lpAssemblyDirectoryName != NULL, "info->lpAssemblyDirectoryName == NULL\n");
965 else
966 ok_(__FILE__, line)(info->lpAssemblyDirectoryName == NULL, "info->lpAssemblyDirectoryName = %s\n",
967 wine_dbgstr_w(info->lpAssemblyDirectoryName));
969}
unsigned short WORD
Definition: ntddk_ex.h:93
LPCWSTR manifest_path
Definition: actctx.c:802
BOOL has_assembly_dir
Definition: actctx.c:804
LPCWSTR encoded_assembly_id
Definition: actctx.c:803

Referenced by test_actctx(), and test_app_manifest().

◆ test_manifest_in_module()

static void test_manifest_in_module ( void  )
static

Definition at line 4390 of file actctx.c.

4391{
4392 ACTCTXW ctx;
4393 HANDLE handle;
4394
4395#ifdef __REACTOS__
4397 skip("test_manifest_in_module() crashes on WS03.\n");
4398 return;
4399 }
4400#endif
4401 memset(&ctx, 0, sizeof(ctx));
4402 ctx.cbSize = sizeof(ctx);
4403 ctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID;
4404 ctx.lpResourceName = (LPWSTR)124;
4405 ctx.hModule = GetModuleHandleW(NULL);
4407 ok(handle != INVALID_HANDLE_VALUE, "CreateActCtx error %lu\n", GetLastError());
4408
4409 test_basic_info(handle, __LINE__);
4411
4413}
static const detailed_info_t detailed_info3
Definition: actctx.c:4383

Referenced by START_TEST().

◆ test_manifest_resource_name_omitted()

static void test_manifest_resource_name_omitted ( void  )
static

Definition at line 4415 of file actctx.c.

4416{
4417 WCHAR pathbuf[MAX_PATH];
4418 HANDLE handle;
4419 ACTCTXW ctx;
4420 DWORD err, len;
4421
4422 memset(&ctx, 0, sizeof(ctx));
4423 ctx.cbSize = sizeof(ctx);
4424 ctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID;
4425 ctx.hModule = GetModuleHandleW(NULL);
4427 err = GetLastError();
4428 ok(handle == INVALID_HANDLE_VALUE, "CreateActCtxW shall fail\n");
4429 todo_wine
4430#ifdef __REACTOS__
4431 ok(err == ERROR_RESOURCE_TYPE_NOT_FOUND || broken(err == ERROR_NOT_ENOUGH_MEMORY) /* WS03 */, "got %lu\n", err);
4432#else
4433 ok(err == ERROR_RESOURCE_TYPE_NOT_FOUND, "got %lu\n", err);
4434#endif
4435
4436 memset(&ctx, 0, sizeof(ctx));
4437 ctx.cbSize = sizeof(ctx);
4438 ctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID;
4439 ctx.hModule = GetModuleHandleW(NULL);
4440 ctx.lpResourceName = NULL;
4442 err = GetLastError();
4443 ok(handle == INVALID_HANDLE_VALUE, "CreateActCtxW shall fail\n");
4444#ifdef __REACTOS__
4445 ok(err == ERROR_INVALID_PARAMETER || broken(err == ERROR_NOT_ENOUGH_MEMORY) /* WS03 */, "got %lu\n", err);
4446#else
4447 ok(err == ERROR_INVALID_PARAMETER, "got %lu\n", err);
4448#endif
4449
4450 len = GetModuleFileNameW(NULL, pathbuf, ARRAY_SIZE(pathbuf));
4451 ok(len > 0 && len < ARRAY_SIZE(pathbuf), "GetModuleFileNameW returned error %lu\n", GetLastError());
4452
4453 memset(&ctx, 0, sizeof(ctx));
4454 ctx.cbSize = sizeof(ctx);
4455 ctx.lpSource = pathbuf;
4456 ctx.dwFlags = 0;
4458 err = GetLastError();
4459 ok(handle == INVALID_HANDLE_VALUE, "CreateActCtxW shall fail\n");
4460 todo_wine
4461 ok(err == ERROR_RESOURCE_TYPE_NOT_FOUND, "got %lu\n", err);
4462
4463 memset(&ctx, 0, sizeof(ctx));
4464 ctx.cbSize = sizeof(ctx);
4465 ctx.lpSource = pathbuf;
4466 ctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID;
4467 ctx.lpResourceName = NULL;
4469 err = GetLastError();
4470 ok(handle == INVALID_HANDLE_VALUE, "CreateActCtxW shall fail\n");
4471 ok(err == ERROR_INVALID_PARAMETER, "got %lu\n", err);
4472}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_RESOURCE_TYPE_NOT_FOUND
Definition: winerror.h:1477

Referenced by START_TEST().

◆ test_manifest_resources()

static void test_manifest_resources ( void  )
static

Definition at line 4080 of file actctx.c.

4081{
4082#ifdef __REACTOS__
4083 skip("test_manifest_resources() is invalid for WS03 - Win10 1607.\n");
4084#else
4085 static const struct manifest_res_spec wrong_manifest_resources_numbered[] = {
4088 { (char *)3, 0, wrong_manifest1 },
4089 { (char *)0x1234, 0, wrong_manifest1 },
4090 { NULL },
4091 };
4092 static const struct manifest_res_spec correct_manifest_resources_numbered[] = {
4093 { (char *)2, MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT) },
4094 { (char *)2, MAKELANGID(LANG_FRENCH,SUBLANG_DEFAULT) },
4095 { (char *)3, 0 },
4096 { (char *)0x1234, 0 },
4097 { NULL },
4098 };
4099 static const struct manifest_res_spec wrong_manifest_resources_gte_3[] = {
4100 { (char *)3, 0, wrong_manifest1 },
4102 { NULL },
4103 };
4104 static const struct manifest_res_spec correct_manifest_resources_gte_3[] = {
4105 { (char *)3, 0 },
4106 { (char *)3, MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT) },
4107 { NULL },
4108 };
4109 static const struct manifest_res_spec wrong_manifest_resources_named[] = {
4110 { "foo", 0, wrong_manifest1 },
4112 { NULL },
4113 };
4114 static const struct manifest_res_spec correct_manifest_resources_named[] = {
4115 { "foo", 0 },
4117 { NULL },
4118 };
4119 struct multiple_manifest_test tests[] = {
4120 /* Test well-known manifest resource IDs */
4124
4125 /* Test remaining reserved manifest resource IDs */
4126 { { (char *)4 }, NULL, ERROR_SUCCESS },
4127 { { (char *)5 }, NULL, ERROR_SUCCESS },
4128 { { (char *)6 }, NULL, ERROR_SUCCESS },
4129 { { (char *)7 }, NULL, ERROR_SUCCESS },
4130 { { (char *)8 }, NULL, ERROR_SUCCESS },
4131 { { (char *)9 }, NULL, ERROR_SUCCESS },
4132 { { (char *)10 }, NULL, ERROR_SUCCESS },
4133 { { (char *)11 }, NULL, ERROR_SUCCESS },
4134 { { (char *)12 }, NULL, ERROR_SUCCESS },
4135 { { (char *)13 }, NULL, ERROR_SUCCESS },
4136 { { (char *)14 }, NULL, ERROR_SUCCESS },
4137 { { (char *)15 }, NULL, ERROR_SUCCESS },
4139
4140 /* Test arbitrary resource IDs */
4141 { { (char *)0x1234 }, NULL, ERROR_SUCCESS },
4142 { { (char *)0x89ab }, NULL, ERROR_SUCCESS },
4143 { { (char *)0xffff }, NULL, ERROR_SUCCESS },
4144
4145 /* Test arbitrary LANGID */
4148 { { (char *)2, 0x1234 }, NULL, ERROR_SUCCESS },
4149 { { (char *)2, 0xffff }, NULL, ERROR_SUCCESS },
4150
4151 /* Test multiple manifest resources coexisting inside a module */
4152 { { (char *)2, 0 }, wrong_manifest_resources_numbered, ERROR_SUCCESS },
4153 { { (char *)2, 0, wrong_manifest1 }, correct_manifest_resources_numbered,
4155
4156 /* Test that smaller resource ID takes precedence regardless of language ID */
4157 { { (char *)2, MAKELANGID(LANG_INVARIANT,SUBLANG_NEUTRAL) },
4158 wrong_manifest_resources_gte_3, ERROR_SUCCESS },
4160 correct_manifest_resources_gte_3, ERROR_SXS_CANT_GEN_ACTCTX },
4161
4162 /* Test multiple manifest resources (ID / name) coexisting inside a module */
4163 { { (char *)2, 0 }, wrong_manifest_resources_named, ERROR_SUCCESS },
4164 { { (char *)2, 0, wrong_manifest1 },
4165 correct_manifest_resources_named, ERROR_SXS_CANT_GEN_ACTCTX },
4166
4167 /* Test name-only RT_MANIFEST resources */
4168 { { NULL }, correct_manifest_resources_named, ERROR_SXS_CANT_GEN_ACTCTX },
4169 };
4170 size_t i;
4171
4172 for (i = 0; i < ARRAY_SIZE(tests); i++)
4173 {
4174 winetest_push_context("tests[%Iu] (%p 0x%04x)", i,
4175 tests[i].manifest_inline.name, tests[i].manifest_inline.lang);
4178 }
4179#endif
4180}
static struct test_info tests[]
static const char two_dll_manifest_exe[]
Definition: actctx.c:537
static const char two_dll_manifest_dll[]
Definition: actctx.c:531
#define LANG_INVARIANT
Definition: nls.h:23
#define LANG_FRENCH
Definition: nls.h:58
struct manifest_res_spec manifest_inline
Definition: actctx.c:3952
#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID
Definition: winuser.h:628
#define CREATEPROCESS_MANIFEST_RESOURCE_ID
Definition: winuser.h:626
#define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID
Definition: winuser.h:630
#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID
Definition: winuser.h:627

Referenced by START_TEST().

◆ test_no_compat()

static void test_no_compat ( HANDLE  handle,
int  line 
)
static

Definition at line 3228 of file actctx.c.

3229{
3230 test_act_ctx_compat_info compat_info;
3231 SIZE_T size;
3232 BOOL b;
3233
3234 memset(&compat_info, 0, sizeof(compat_info));
3235 b = QueryActCtxW(QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL, CompatibilityInformationInActivationContext,
3236 &compat_info, sizeof(compat_info), &size);
3237
3238 ok_(__FILE__, line)(b, "CompatibilityInformationInActivationContext failed\n");
3239 ok_(__FILE__, line)(size == offsetof(test_act_ctx_compat_info,Elements[0]) ||
3241 "size mismatch got %Iu\n", size);
3242 ok_(__FILE__, line)(compat_info.ElementCount == 0, "unexpected ElementCount %lu\n", compat_info.ElementCount);
3243}

Referenced by test_compatibility().

◆ test_one_sxs_and_one_local_1()

static void test_one_sxs_and_one_local_1 ( void  )
static

Definition at line 3714 of file actctx.c.

3715{
3716 sxs_info dll;
3717 char path_dll_local[MAX_PATH + 11];
3718 char path_application[MAX_PATH];
3720 char path1[MAX_PATH], path2[MAX_PATH];
3721 void (WINAPI *get_path)(char *buffer, int buffer_size);
3722
3723 get_application_directory(path_application, sizeof(path_application));
3724
3725 sprintf(path_dll_local, "%s%s", path_application, "sxs_dll.dll");
3726 extract_resource("dummy.dll", "TESTDLL", path_dll_local);
3727
3728 module = LoadLibraryA(path_dll_local);
3729 get_path = (void *)GetProcAddress(module, "get_path");
3730
3731 if (!fill_sxs_info(&dll, "1", "dummy.dll", two_dll_manifest_exe, two_dll_manifest_dll, TRUE))
3732 goto cleanup;
3733
3734 ok(dll.module != module, "Libraries are the same\n");
3735 dll.get_path(path1, sizeof(path1));
3736 ok(strcmp(path1, dll.path_dll) == 0, "Got '%s', expected '%s'\n", path1, dll.path_dll);
3737 get_path(path2, sizeof(path2));
3738 ok(strcmp(path2, path_dll_local) == 0, "Got '%s', expected '%s'\n", path2, path_dll_local);
3739
3740cleanup:
3741 if (module)
3743 if (dll.module)
3744 FreeLibrary(dll.module);
3745 if (*path_dll_local)
3746 {
3747 BOOL success = DeleteFileA(path_dll_local);
3748 ok(success, "DeleteFileA failed for %s: %ld\n", path_dll_local, GetLastError());
3749 }
3750 clean_sxs_info(&dll);
3751}
static void clean_sxs_info(sxs_info *info)
Definition: actctx.c:3651
static void get_application_directory(char *buffer, int buffer_size)
Definition: actctx.c:3677
static BOOL fill_sxs_info(sxs_info *info, const char *temp, const char *path_dll, const char *exe_manifest, const char *dll_manifest, BOOL do_load)
Definition: actctx.c:3602
static const WCHAR path1[]
Definition: path.c:28
static const WCHAR path2[]
Definition: path.c:29
static Character const *__cdecl get_path()
Definition: popen.cpp:172
char path_dll[MAX_PATH+11]
Definition: actctx.c:3592
HMODULE module
Definition: actctx.c:3598
#define WINAPI
Definition: msvc.h:6

Referenced by run_sxs_test().

◆ test_one_sxs_and_one_local_2()

static void test_one_sxs_and_one_local_2 ( void  )
static

Definition at line 3754 of file actctx.c.

3755{
3756 sxs_info dll;
3757 char path_dll_local[MAX_PATH + 11];
3758 char path_application[MAX_PATH];
3760 char path1[MAX_PATH], path2[MAX_PATH];
3761 void (WINAPI *get_path)(char *buffer, int buffer_size);
3762
3763 get_application_directory(path_application, sizeof(path_application));
3764
3765 sprintf(path_dll_local, "%s%s", path_application, "sxs_dll.dll");
3766 extract_resource("dummy.dll", "TESTDLL", path_dll_local);
3767
3768 if (!fill_sxs_info(&dll, "1", "dummy.dll", two_dll_manifest_exe, two_dll_manifest_dll, TRUE))
3769 goto cleanup;
3770
3771 module = LoadLibraryA(path_dll_local);
3772 get_path = (void *)GetProcAddress(module, "get_path");
3773
3774 ok(dll.module != module, "Libraries are the same\n");
3775 dll.get_path(path1, sizeof(path1));
3776 ok(strcmp(path1, dll.path_dll) == 0, "Got '%s', expected '%s'\n", path1, dll.path_dll);
3777 get_path(path2, sizeof(path2));
3778 ok(strcmp(path2, path_dll_local) == 0, "Got '%s', expected '%s'\n", path2, path_dll_local);
3779
3780cleanup:
3781 if (module)
3783 if (dll.module)
3784 FreeLibrary(dll.module);
3785 if (*path_dll_local)
3786 {
3787 BOOL success = DeleteFileA(path_dll_local);
3788 ok(success, "DeleteFileA failed for %s: %ld\n", path_dll_local, GetLastError());
3789 }
3790 clean_sxs_info(&dll);
3791}

Referenced by run_sxs_test().

◆ test_one_with_sxs_and_GetModuleHandleA()

static void test_one_with_sxs_and_GetModuleHandleA ( void  )
static

Definition at line 3795 of file actctx.c.

3796{
3797 sxs_info dll;
3798 char path_dll_local[MAX_PATH + 11];
3799 char path_tmp[MAX_PATH];
3800 HMODULE module = NULL, module_temp;
3801 BOOL success;
3802
3803 GetTempPathA(sizeof(path_tmp), path_tmp);
3804
3805 sprintf(path_dll_local, "%s%s", path_tmp, "sxs_dll.dll");
3806 extract_resource("dummy.dll", "TESTDLL", path_dll_local);
3807
3808 module = LoadLibraryA(path_dll_local);
3809
3810 if (!fill_sxs_info(&dll, "1", "dummy.dll", two_dll_manifest_exe, two_dll_manifest_dll, FALSE))
3811 goto cleanup;
3812
3814 ok(success, "ActivateActCtx failed: %ld\n", GetLastError());
3815
3816 module_temp = GetModuleHandleA("sxs_dll.dll");
3817 ok (module_temp == 0, "Expected 0, got %p\n", module_temp);
3818
3819 DeactivateActCtx(0, dll.cookie);
3820
3821cleanup:
3822 if (module)
3824 if (dll.module)
3825 FreeLibrary(dll.module);
3826 if (*path_dll_local)
3827 {
3828 success = DeleteFileA(path_dll_local);
3829 ok(success, "DeleteFileA failed for %s: %ld\n", path_dll_local, GetLastError());
3830 }
3831 clean_sxs_info(&dll);
3832}
ULONG_PTR cookie
Definition: actctx.c:3596
HANDLE handle_context
Definition: actctx.c:3597

Referenced by run_sxs_test().

◆ test_runlevel_info()

static void test_runlevel_info ( HANDLE  handle,
const runlevel_info_t exinfo,
int  line 
)
static

Definition at line 1038 of file actctx.c.

1039{
1040 ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION runlevel_info;
1041 SIZE_T size, retsize;
1042 BOOL b;
1043
1044 size = sizeof(runlevel_info);
1045 b = QueryActCtxW(0, handle, NULL, RunlevelInformationInActivationContext, &runlevel_info,
1046 sizeof(runlevel_info), &retsize);
1048 {
1049 win_skip("RunlevelInformationInActivationContext not supported.\n");
1050 return;
1051 }
1052
1053 ok_(__FILE__, line)(b, "QueryActCtx failed: %lu\n", GetLastError());
1054 ok_(__FILE__, line)(retsize == size, "size=%Id, expected %Id\n", retsize, size);
1055
1056 ok_(__FILE__, line)(runlevel_info.ulFlags == 0, "runlevel_info.ulFlags=%lx\n", runlevel_info.ulFlags);
1057 ok_(__FILE__, line)(runlevel_info.RunLevel == exinfo->run_level,
1058 "runlevel_info.RunLevel=%u, expected %u\n", runlevel_info.RunLevel, exinfo->run_level);
1059 ok_(__FILE__, line)(runlevel_info.UiAccess == exinfo->ui_access,
1060 "runlevel_info.UiAccess=%lu, expected %lu\n", runlevel_info.UiAccess, exinfo->ui_access);
1061}
ACTCTX_REQUESTED_RUN_LEVEL run_level
Definition: actctx.c:1014
DWORD ui_access
Definition: actctx.c:1015

Referenced by test_actctx().

◆ test_settings()

static void test_settings ( void  )
static

Definition at line 3427 of file actctx.c.

3428{
3429 static const WCHAR dpiAwareW[] = {'d','p','i','A','w','a','r','e',0};
3430 static const WCHAR dpiAwarenessW[] = {'d','p','i','A','w','a','r','e','n','e','s','s',0};
3431 static const WCHAR dummyW[] = {'d','u','m','m','y',0};
3432 static const WCHAR trueW[] = {'t','r','u','e',0};
3433 static const WCHAR namespace2005W[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','0','5','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0};
3434 static const WCHAR namespace2016W[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','6','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0};
3435 WCHAR buffer[80];
3436 SIZE_T size;
3437 HANDLE handle;
3438 BOOL ret;
3439
3440#if defined(__REACTOS__) && DLL_EXPORT_VERSION >= 0x600
3441 /* FIXME: QueryActCtxSettingsW() is a STUB on ReactOS. */
3442 if (is_reactos() || !pQueryActCtxSettingsW)
3443#else
3444 if (!pQueryActCtxSettingsW)
3445#endif
3446 {
3447 win_skip( "QueryActCtxSettingsW is missing\n" );
3448 return;
3449 }
3450 create_manifest_file( "manifest_settings.manifest", settings_manifest, -1, NULL, NULL );
3451 handle = test_create("manifest_settings.manifest");
3452 ok( handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError() );
3453 DeleteFileA( "manifest_settings.manifest" );
3454
3455 SetLastError( 0xdeadbeef );
3456 ret = pQueryActCtxSettingsW( 1, handle, NULL, dpiAwareW, buffer, 80, &size );
3457 ok( !ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() );
3458 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
3459 SetLastError( 0xdeadbeef );
3460 ret = pQueryActCtxSettingsW( 0, handle, dummyW, dpiAwareW, buffer, 80, &size );
3461 ok( !ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() );
3462 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
3463 SetLastError( 0xdeadbeef );
3464 size = 0xdead;
3465 memset( buffer, 0xcc, sizeof(buffer) );
3466 ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, 80, &size );
3467 ok( ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() );
3468 ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) );
3469 ok( size == lstrlenW( buffer ) + 1, "wrong len %Iu\n", size );
3470 SetLastError( 0xdeadbeef );
3471 size = 0xdead;
3472 memset( buffer, 0xcc, sizeof(buffer) );
3473 ret = pQueryActCtxSettingsW( 0, handle, NULL, dummyW, buffer, 80, &size );
3474 ok( !ret, "QueryActCtxSettingsW succeeded\n" );
3475 ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %lu\n", GetLastError() );
3476 ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) );
3477 SetLastError( 0xdeadbeef );
3478 size = 0xdead;
3479 memset( buffer, 0xcc, sizeof(buffer) );
3480 ret = pQueryActCtxSettingsW( 0, handle, namespace2005W, dpiAwareW, buffer, 80, &size );
3481 ok( ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() );
3482 ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) );
3483 ok( size == ARRAY_SIZE(trueW), "wrong len %Iu\n", size );
3484 SetLastError( 0xdeadbeef );
3485 size = 0xdead;
3486 memset( buffer, 0xcc, sizeof(buffer) );
3487 ret = pQueryActCtxSettingsW( 0, handle, namespace2005W, dpiAwareW, buffer, lstrlenW(trueW) + 1, &size );
3488 ok( ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() );
3489 ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) );
3490 ok( size == ARRAY_SIZE(trueW), "wrong len %Iu\n", size );
3491 SetLastError( 0xdeadbeef );
3492 size = 0xdead;
3493 memset( buffer, 0xcc, sizeof(buffer) );
3494 ret = pQueryActCtxSettingsW( 0, handle, namespace2016W, dpiAwareW, buffer, lstrlenW(trueW) + 1, &size );
3495 ok( !ret, "QueryActCtxSettingsW succeeded\n" );
3497 "wrong error %lu\n", GetLastError() );
3498 ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) );
3499 SetLastError( 0xdeadbeef );
3500 size = 0xdead;
3501 memset( buffer, 0xcc, sizeof(buffer) );
3502 ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwarenessW, buffer, lstrlenW(trueW) + 1, &size );
3503 ok( !ret, "QueryActCtxSettingsW succeeded\n" );
3504 ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %lu\n", GetLastError() );
3505 ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) );
3506 SetLastError( 0xdeadbeef );
3507 size = 0xdead;
3508 memset( buffer, 0xcc, sizeof(buffer) );
3509 ret = pQueryActCtxSettingsW( 0, handle, namespace2005W, dpiAwarenessW, buffer, lstrlenW(trueW) + 1, &size );
3510 ok( !ret, "QueryActCtxSettingsW succeeded\n" );
3511 ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %lu\n", GetLastError() );
3512 ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) );
3513 SetLastError( 0xdeadbeef );
3514 size = 0xdead;
3515 memset( buffer, 0xcc, sizeof(buffer) );
3516 ret = pQueryActCtxSettingsW( 0, handle, namespace2016W, dpiAwarenessW, buffer, lstrlenW(trueW) + 1, &size );
3518 "QueryActCtxSettingsW failed err %lu\n", GetLastError() );
3519 if (ret)
3520 {
3521 ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) );
3522 ok( size == ARRAY_SIZE(trueW), "wrong len %Iu\n", size );
3523 }
3524 else ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) );
3525 SetLastError( 0xdeadbeef );
3526 size = 0xdead;
3527 memset( buffer, 0xcc, sizeof(buffer) );
3528 ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, lstrlenW(trueW), &size );
3529 ok( ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() );
3530 ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) );
3531 ok( size == ARRAY_SIZE(trueW), "wrong len %Iu\n", size );
3532 SetLastError( 0xdeadbeef );
3533 size = 0xdead;
3534 memset( buffer, 0xcc, sizeof(buffer) );
3535 ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, lstrlenW(trueW) - 1, &size );
3536 ok( !ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() );
3537 ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error %lu\n", GetLastError() );
3538 ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) );
3539 ok( size == ARRAY_SIZE(trueW), "wrong len %Iu\n", size );
3541
3542 create_manifest_file( "manifest_settings2.manifest", settings_manifest2, -1, NULL, NULL );
3543 handle = test_create("manifest_settings2.manifest");
3544 ok( handle != INVALID_HANDLE_VALUE || broken( handle == INVALID_HANDLE_VALUE ), /* <= vista */
3545 "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError() );
3546 DeleteFileA( "manifest_settings2.manifest" );
3548 {
3549 SetLastError( 0xdeadbeef );
3550 size = 0xdead;
3551 memset( buffer, 0xcc, sizeof(buffer) );
3552 ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, 80, &size );
3553 ok( ret, "QueryActCtxSettingsW failed err %lu\n", GetLastError() );
3554 ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) );
3555 ok( size == lstrlenW( buffer ) + 1, "wrong len %Iu\n", size );
3557 }
3558
3559 create_manifest_file( "manifest_settings3.manifest", settings_manifest3, -1, NULL, NULL );
3560 handle = test_create("manifest_settings3.manifest");
3561 ok( handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError() );
3562 DeleteFileA( "manifest_settings3.manifest" );
3563 SetLastError( 0xdeadbeef );
3564 size = 0xdead;
3565 memset( buffer, 0xcc, sizeof(buffer) );
3566 ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, 80, &size );
3567 ok( !ret, "QueryActCtxSettingsW succeeded\n" );
3568 ok( GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "wrong error %lu\n", GetLastError() );
3570
3571 /* lookup occurs in first non empty node */
3572 create_manifest_file( "manifest_settings4.manifest", settings_manifest4, -1, NULL, NULL );
3573 handle = test_create("manifest_settings4.manifest");
3574 ok( handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError() );
3575 DeleteFileA( "manifest_settings4.manifest" );
3576 SetLastError( 0xdeadbeef );
3577 size = 0xdead;
3578 memset( buffer, 0xcc, sizeof(buffer) );
3579 ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, 80, &size );
3580 ok( ret, "QueryActCtxSettingsW failed\n" );
3581 SetLastError( 0xdeadbeef );
3582 size = 0xdead;
3583 memset( buffer, 0xcc, sizeof(buffer) );
3584 ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwarenessW, buffer, 80, &size );
3585 ok( !ret, "QueryActCtxSettingsW succeeded\n" );
3587}
static const WCHAR trueW[]
Definition: json.c:33
static const char settings_manifest3[]
Definition: actctx.c:504
static const char settings_manifest[]
Definition: actctx.c:468
static const char settings_manifest2[]
Definition: actctx.c:479
static const char settings_manifest4[]
Definition: actctx.c:514
static const WCHAR dummyW[]
Definition: directory.c:79
static const WCHAR dpiAwarenessW[]
Definition: actctx.c:723
static const WCHAR dpiAwareW[]
Definition: actctx.c:722

Referenced by START_TEST().

◆ test_two_dlls_at_same_time()

static void test_two_dlls_at_same_time ( void  )
static

Definition at line 3686 of file actctx.c.

3687{
3688 sxs_info dll_1;
3689 sxs_info dll_2;
3690 char path1[MAX_PATH], path2[MAX_PATH];
3691
3692 if (!fill_sxs_info(&dll_1, "1", "dummy.dll", two_dll_manifest_exe, two_dll_manifest_dll, TRUE))
3693 goto cleanup1;
3694 if (!fill_sxs_info(&dll_2, "2", "dummy.dll", two_dll_manifest_exe, two_dll_manifest_dll, TRUE))
3695 goto cleanup2;
3696
3697 ok(dll_1.module != dll_2.module, "Libraries are the same\n");
3698 dll_1.get_path(path1, sizeof(path1));
3699 ok(strcmp(path1, dll_1.path_dll) == 0, "Got '%s', expected '%s'\n", path1, dll_1.path_dll);
3700 dll_2.get_path(path2, sizeof(path2));
3701 ok(strcmp(path2, dll_2.path_dll) == 0, "Got '%s', expected '%s'\n", path2, dll_2.path_dll);
3702
3703cleanup2:
3704 if (dll_2.module)
3705 FreeLibrary(dll_2.module);
3706 clean_sxs_info(&dll_2);
3707cleanup1:
3708 if (dll_1.module)
3709 FreeLibrary(dll_1.module);
3710 clean_sxs_info(&dll_1);
3711}

Referenced by run_sxs_test().

◆ test_typelib_section()

static void test_typelib_section ( void  )
static

Definition at line 2104 of file actctx.c.

2105{
2106 static const WCHAR helpW[] = {'h','e','l','p'};
2107 ACTCTX_SECTION_KEYED_DATA data, data2;
2109 struct tlibredirect_data *tlib;
2111 HANDLE handle;
2112 BOOL ret;
2113
2114 /* use two dependent manifests, 4 'files' total */
2115 create_manifest_file("testdep1.manifest", manifest_wndcls1, -1, NULL, NULL);
2116 create_manifest_file("testdep2.manifest", manifest_wndcls2, -1, NULL, NULL);
2117 create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL);
2118
2119 handle = test_create("main_wndcls.manifest");
2120 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2121
2122 DeleteFileA("testdep1.manifest");
2123 DeleteFileA("testdep2.manifest");
2124 DeleteFileA("main_wndcls.manifest");
2125
2127 ok(ret, "ActivateActCtx failed: %lu\n", GetLastError());
2128
2129 memset(&data, 0, sizeof(data));
2130 memset(&data2, 0, sizeof(data2));
2131 data.cbSize = sizeof(data);
2132 data2.cbSize = sizeof(data2);
2133
2134 /* get data for two typelibs from different assemblies */
2135 ret = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION, &IID_TlibTest, &data);
2136 ok(ret, "got %d\n", ret);
2137
2138 ret = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION,
2139 &IID_TlibTest4, &data2);
2140 ok(ret, "got %d\n", ret);
2141
2142 section = (struct guidsection_header*)data.lpSectionBase;
2143 ok(section->count == 4, "got %ld\n", section->count);
2144 ok(section->size == sizeof(*section), "got %ld\n", section->size);
2145 validate_guid_index(&data, __LINE__);
2146
2147 /* For both GUIDs same section is returned */
2148 ok(data.lpSectionBase == data2.lpSectionBase, "got %p, %p\n", data.lpSectionBase, data2.lpSectionBase);
2149 ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %lu, %lu\n", data.ulSectionTotalLength,
2150 data2.ulSectionTotalLength);
2151
2152 ok(data.lpSectionGlobalData == ((BYTE*)section + section->names_offset), "data.lpSectionGlobalData == NULL\n");
2153 ok(data.ulSectionGlobalDataLength == section->names_len, "data.ulSectionGlobalDataLength=%lu\n",
2154 data.ulSectionGlobalDataLength);
2155
2156 /* test some actual data */
2157 tlib = (struct tlibredirect_data*)data.lpData;
2158 ok(tlib->size == sizeof(*tlib), "got %ld\n", tlib->size);
2159 ok(tlib->major_version == 1, "got %d\n", tlib->major_version);
2160 ok(tlib->minor_version == 0, "got %d\n", tlib->minor_version);
2161 ok(tlib->help_offset > 0, "got %ld\n", tlib->help_offset);
2162 ok(tlib->help_len == sizeof(helpW), "got %ld\n", tlib->help_len);
2163 ok(tlib->flags == (LIBFLAG_FHIDDEN|LIBFLAG_FCONTROL|LIBFLAG_FRESTRICTED), "got %x\n", tlib->flags);
2164
2166 ok(ret, "DeactivateActCtx failed: %lu\n", GetLastError());
2167
2169}
static const WCHAR helpW[]
Definition: htmlevent.c:70
@ LIBFLAG_FRESTRICTED
Definition: actctx.c:72
@ LIBFLAG_FCONTROL
Definition: actctx.c:73
@ LIBFLAG_FHIDDEN
Definition: actctx.c:74
ULONG help_len
Definition: oleaut.c:795
ULONG help_offset
Definition: oleaut.c:796
WORD minor_version
Definition: oleaut.c:798
WORD major_version
Definition: oleaut.c:797

Referenced by test_actctx().

◆ test_valid_manifest_resources_locale()

static void test_valid_manifest_resources_locale ( void  )
static

Definition at line 4314 of file actctx.c.

4315{
4316#ifdef __REACTOS__
4317 skip("test_valid_manifest_resources_locale() is invalid for WS03 - Win10 1607.\n");
4318#else
4319 static const LANGID langs[] = {
4322 };
4323 size_t i;
4324
4325 for (i = 0; i < ARRAY_SIZE(langs); i++)
4326 {
4327 winetest_push_context("[%Iu]lang=0x%04x", i, langs[i]);
4330 }
4331#endif
4332}
std::set< LANGID > langs
Definition: LocaleTests.cpp:65
static void subtest_valid_manifest_resources_locale(LANGID actctx_lang)
Definition: actctx.c:4221

Referenced by START_TEST().

◆ test_with_compat()

static void test_with_compat ( HANDLE  handle,
DWORD  num_compat,
DWORD  num_version,
const GUID expected_compat[],
const ULONGLONG  expected_version[],
int  line 
)
static

Definition at line 3245 of file actctx.c.

3247{
3248 test_act_ctx_compat_info compat_info;
3249 SIZE_T size;
3250 DWORD n;
3251 BOOL b;
3252
3253 memset(&compat_info, 0, sizeof(compat_info));
3254 b = QueryActCtxW(QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL, CompatibilityInformationInActivationContext,
3255 &compat_info, sizeof(compat_info), &size);
3256
3257 ok_(__FILE__, line)(b, "CompatibilityInformationInActivationContext failed\n");
3258 ok_(__FILE__, line)(size == offsetof(test_act_ctx_compat_info,Elements[num_compat + num_version]) ||
3259 broken(size == offsetof(old_win10_test_act_ctx_compat_info,Elements[num_compat])),
3260 "size mismatch got %Iu\n", size);
3261 ok_(__FILE__, line)(compat_info.ElementCount == num_compat + num_version ||
3262 broken(compat_info.ElementCount == num_compat),
3263 "unexpected ElementCount %lu\n", compat_info.ElementCount);
3264
3265 if (size == offsetof(old_win10_test_act_ctx_compat_info,Elements[num_compat]))
3266 {
3267 for (n = 0; n < num_compat; ++n)
3268 {
3270 ok_(__FILE__, line)(IsEqualGUID(&info->Elements[n].Id, expected_compat[n]),
3271 "got wrong clsid %s, expected %s for %lu\n",
3272 wine_dbgstr_guid(&info->Elements[n].Id),
3273 wine_dbgstr_guid(expected_compat[n]),
3274 n);
3275 ok_(__FILE__, line)(info->Elements[n].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS,
3276 "Wrong type, got %lu for %lu\n", (DWORD)info->Elements[n].Type, n);
3277 }
3278 }
3279 else
3280 {
3281 for (n = 0; n < num_compat; ++n)
3282 {
3283 ok_(__FILE__, line)(IsEqualGUID(&compat_info.Elements[n].Id, expected_compat[n]),
3284 "got wrong clsid %s, expected %s for %lu\n",
3285 wine_dbgstr_guid(&compat_info.Elements[n].Id),
3286 wine_dbgstr_guid(expected_compat[n]),
3287 n);
3288 ok_(__FILE__, line)(compat_info.Elements[n].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS,
3289 "Wrong type, got %lu for %lu\n", (DWORD)compat_info.Elements[n].Type, n);
3290 }
3291 for (; n < num_compat + num_version; ++n)
3292 {
3293 ok_(__FILE__, line)(compat_info.Elements[n].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_MAXVERSIONTESTED,
3294 "Wrong type, got %lu for %lu\n", (DWORD)compat_info.Elements[n].Type, n);
3295 ok_(__FILE__, line)(compat_info.Elements[n].MaxVersionTested == expected_version[n - num_compat],
3296 "Wrong version, got %s for %lu\n", wine_dbgstr_longlong(compat_info.Elements[n].MaxVersionTested), n);
3297 }
3298 }
3299}
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
#define DWORD
Definition: nt_native.h:44
COMPATIBILITY_CONTEXT_ELEMENT Elements[10]
Definition: actctx.c:3211

Referenced by test_compatibility().

◆ test_wndclass_section()

static void test_wndclass_section ( void  )
static

Definition at line 1992 of file actctx.c.

1993{
1994 static const WCHAR cls1W[] = {'1','.','2','.','3','.','4','!','w','n','d','C','l','a','s','s','1',0};
1995 ACTCTX_SECTION_KEYED_DATA data, data2;
1996 struct wndclass_redirect_data *classdata;
1997 struct strsection_header *section;
1999 HANDLE handle;
2000 WCHAR *ptrW;
2001 BOOL ret;
2002
2003 /* use two dependent manifests, each defines 2 window class redirects */
2004 create_manifest_file("testdep1.manifest", manifest_wndcls1, -1, NULL, NULL);
2005 create_manifest_file("testdep2.manifest", manifest_wndcls2, -1, NULL, NULL);
2006 create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL);
2007
2008 handle = test_create("main_wndcls.manifest");
2009 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %lu\n", GetLastError());
2010
2011 DeleteFileA("testdep1.manifest");
2012 DeleteFileA("testdep2.manifest");
2013 DeleteFileA("main_wndcls.manifest");
2014
2016 ok(ret, "ActivateActCtx failed: %lu\n", GetLastError());
2017
2018 memset(&data, 0, sizeof(data));
2019 memset(&data2, 0, sizeof(data2));
2020 data.cbSize = sizeof(data);
2021 data2.cbSize = sizeof(data2);
2022
2023 /* get data for two classes from different assemblies */
2024 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, wndClass1W, &data);
2025 ok(ret, "got %d\n", ret);
2026 ret = FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, wndClass3W, &data2);
2027 ok(ret, "got %d\n", ret);
2028
2029 section = (struct strsection_header*)data.lpSectionBase;
2030 ok(section->count == 4, "got %ld\n", section->count);
2031 ok(section->size == sizeof(*section), "got %ld\n", section->size);
2032
2033 /* For both string same section is returned, meaning it's one wndclass section per context */
2034 ok(data.lpSectionBase == data2.lpSectionBase, "got %p, %p\n", data.lpSectionBase, data2.lpSectionBase);
2035 ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %lu, %lu\n", data.ulSectionTotalLength,
2036 data2.ulSectionTotalLength);
2037
2038 /* wndClass1 is versioned, wndClass3 is not */
2039 classdata = (struct wndclass_redirect_data*)data.lpData;
2040 ptrW = (WCHAR*)((BYTE*)data.lpData + classdata->name_offset);
2041 ok(!lstrcmpW(ptrW, cls1W), "got %s\n", wine_dbgstr_w(ptrW));
2042
2043 classdata = (struct wndclass_redirect_data*)data2.lpData;
2044 ptrW = (WCHAR*)((BYTE*)data2.lpData + classdata->name_offset);
2045 ok(!lstrcmpW(ptrW, wndClass3W), "got %s\n", wine_dbgstr_w(ptrW));
2046
2048 ok(ret, "DeactivateActCtx failed: %lu\n", GetLastError());
2049
2051}
static const WCHAR wndClass3W[]
Definition: actctx.c:583
static const WCHAR wndClass1W[]
Definition: actctx.c:579

Referenced by test_actctx().

◆ test_ZombifyActCtx()

static void test_ZombifyActCtx ( void  )
static

Definition at line 3133 of file actctx.c.

3134{
3135 ACTIVATION_CONTEXT_BASIC_INFORMATION basicinfo;
3138 BOOL ret;
3139
3140 SetLastError(0xdeadbeef);
3142 todo_wine
3143 ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %ld\n", ret, GetLastError());
3144
3145 handle = create_manifest("test.manifest", testdep_manifest3, __LINE__);
3146
3148 ok(ret, "got %d, error %ld\n", ret, GetLastError());
3149 ok(current == NULL, "got %p\n", current);
3150
3152 ok(ret, "ActivateActCtx failed: %lu\n", GetLastError());
3153
3155 ok(ret, "got %d, error %ld\n", ret, GetLastError());
3156 ok(handle == current, "got %p, %p\n", current, handle);
3157
3158 memset(&basicinfo, 0xff, sizeof(basicinfo));
3159 ret = QueryActCtxW(0, handle, 0, ActivationContextBasicInformation, &basicinfo, sizeof(basicinfo), NULL);
3160 ok(ret, "got %d, error %ld\n", ret, GetLastError());
3161 ok(basicinfo.hActCtx == handle, "got %p\n", basicinfo.hActCtx);
3162 ok(basicinfo.dwFlags == 0, "got %lx\n", basicinfo.dwFlags);
3163
3164 memset(&basicinfo, 0xff, sizeof(basicinfo));
3165 ret = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX, NULL, 0, ActivationContextBasicInformation,
3166 &basicinfo, sizeof(basicinfo), NULL);
3167 ok(ret, "got %d, error %ld\n", ret, GetLastError());
3168 ok(basicinfo.hActCtx == handle, "got %p\n", basicinfo.hActCtx);
3169 ok(basicinfo.dwFlags == 0, "got %lx\n", basicinfo.dwFlags);
3170
3172 todo_wine
3173 ok(ret, "got %d\n", ret);
3174
3175 memset(&basicinfo, 0xff, sizeof(basicinfo));
3176 ret = QueryActCtxW(0, handle, 0, ActivationContextBasicInformation, &basicinfo, sizeof(basicinfo), NULL);
3177 ok(ret, "got %d, error %ld\n", ret, GetLastError());
3178 ok(basicinfo.hActCtx == handle, "got %p\n", basicinfo.hActCtx);
3179 ok(basicinfo.dwFlags == 0, "got %lx\n", basicinfo.dwFlags);
3180
3181 memset(&basicinfo, 0xff, sizeof(basicinfo));
3182 ret = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX, NULL, 0, ActivationContextBasicInformation,
3183 &basicinfo, sizeof(basicinfo), NULL);
3184 ok(ret, "got %d, error %ld\n", ret, GetLastError());
3185 ok(basicinfo.hActCtx == handle, "got %p\n", basicinfo.hActCtx);
3186 ok(basicinfo.dwFlags == 0, "got %lx\n", basicinfo.dwFlags);
3187
3189 ok(ret, "got %d, error %ld\n", ret, GetLastError());
3190 ok(current == handle, "got %p\n", current);
3191
3192 /* one more time */
3194 todo_wine
3195 ok(ret, "got %d\n", ret);
3196
3197#ifdef __REACTOS__
3198 if (is_reactos()) {
3199 trace("HACK: ReactOS crashes on DeactivateActCtx() below.\n");
3200 ret = FALSE;
3201 } else
3202#endif
3204 ok(ret, "DeactivateActCtx failed: %lu\n", GetLastError());
3206}
BOOL WINAPI ZombifyActCtx(HANDLE hActCtx)
Definition: actctx.c:219
struct task_struct * current
Definition: linux.c:32

Referenced by START_TEST().

◆ validate_guid_index()

static void validate_guid_index ( const ACTCTX_SECTION_KEYED_DATA *  data,
int  line 
)
static

Definition at line 1619 of file actctx.c.

1620{
1621#define GUIDSECTION_MAGIC 0x64487347 /* dHsG */
1622 struct guidsection_header *header;
1623 struct guid_index *index;
1624 unsigned int i;
1625
1626 header = (struct guidsection_header *)data->lpSectionBase;
1627
1628 ok_(__FILE__, line)(header->magic == GUIDSECTION_MAGIC, "Unexpected magic %#lx.\n", header->magic);
1629 ok_(__FILE__, line)(header->size == sizeof(*header), "Unexpected size %ld.\n", header->size);
1630 ok_(__FILE__, line)(header->index_offset >= sizeof(*header), "Unexpected index offset %lu.\n", header->index_offset);
1631
1632 index = (struct guid_index *)((BYTE *)data->lpSectionBase + header->index_offset);
1633 for (i = 0; i < header->count; ++i)
1634 {
1635 ok_(__FILE__, line)(index[i].data_len <= data->ulSectionTotalLength, "Unexpected data length.\n");
1636 ok_(__FILE__, line)(index[i].data_offset <= data->ulSectionTotalLength - index[i].data_len,
1637 "Unexpected data offset %ld, section total length %lu, data length %lu.\n",
1638 index[i].data_offset, data->ulSectionTotalLength, index[i].data_len);
1639 }
1640}
#define index(s, c)
Definition: various.h:29
#define GUIDSECTION_MAGIC

Referenced by test_find_com_redirection(), test_find_ifaceps_redirection(), test_find_progid_redirection(), test_find_surrogate(), and test_typelib_section().

◆ VOID()

static VOID ( NTAPI pRtlFreeUnicodeString)
static

◆ write_manifest()

static void write_manifest ( const char filename,
const char manifest 
)
static

Definition at line 2775 of file actctx.c.

2776{
2777 HANDLE file;
2778 DWORD size;
2780
2783
2785 ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError());
2788}

Referenced by test_CreateActCtx().

Variable Documentation

◆ app_dir

WCHAR app_dir[MAX_PATH]
static

Definition at line 586 of file actctx.c.

Referenced by init_paths(), VerFindFileA(), and VerFindFileW().

◆ app_manifest_path

WCHAR app_manifest_path[MAX_PATH]
static

Definition at line 587 of file actctx.c.

Referenced by init_paths().

◆ builtin_dll_manifest

const char builtin_dll_manifest[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
" <dependency>"
" <dependentAssembly>"
" <assemblyIdentity"
" type=\"win32\""
" name=\"microsoft.vc90.crt\""
" version=\"9.0.20718.0\""
" processorArchitecture=\"*\""
" publicKeyToken=\"1fc8b3b9a1e18e3b\""
" language=\"*\""
" />"
" </dependentAssembly>"
" </dependency>"
"</assembly>"

Definition at line 546 of file actctx.c.

Referenced by test_builtin_sxs().

◆ compat_manifest_no_supportedOs

const char compat_manifest_no_supportedOs[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
" <assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
" <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">"
" <application>"
" </application>"
" </compatibility>"
"</assembly>"

Definition at line 423 of file actctx.c.

Referenced by test_compatibility().

◆ compat_manifest_other_guid

const char compat_manifest_other_guid[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
" <assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
" <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">"
" <application>"
" <supportedOS Id=\"{12345566-1111-2222-3333-444444444444}\" />"
" </application>"
" </compatibility>"
"</assembly>"

Definition at line 458 of file actctx.c.

Referenced by test_compatibility().

◆ compat_manifest_vista

const char compat_manifest_vista[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
" <assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
" <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">"
" <application>"
" <supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\" />"
" </application>"
" </compatibility>"
"</assembly>"

Definition at line 432 of file actctx.c.

Referenced by test_compatibility().

◆ compat_manifest_vista_7_8_10_81

const char compat_manifest_vista_7_8_10_81[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
" <assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
" <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">"
" <application>"
" <supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\" ></supportedOS>"
" <supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\" />"
" <supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\" ></supportedOS>"
" <supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\" />"
" <supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\" />"
" <maxversiontested Id=\"10.0.18358\" />"
" <maxversiontested Id=\"2.3.4.5\" />"
" </application>"
" </compatibility>"
"</assembly>"

Definition at line 442 of file actctx.c.

Referenced by test_compatibility().

◆ depmanifest1_info

const info_in_assembly depmanifest1_info
static
Initial value:
= {
L"testdep,processorArchitecture=\"" ARCH "\","
"type=\"win32\",version=\"6.5.4.3\"",
}

Definition at line 837 of file actctx.c.

Referenced by test_actctx().

◆ depmanifest2_info

const info_in_assembly depmanifest2_info
static
Initial value:
= {
L"testdep,processorArchitecture=\"" ARCH "\","
"type=\"win32\",version=\"6.5.4.3\"",
}

Definition at line 844 of file actctx.c.

Referenced by test_actctx().

◆ depmanifest3_info

const info_in_assembly depmanifest3_info
static
Initial value:
= {
L"testdep,processorArchitecture=\"" ARCH "\",type=\"win32\",version=\"6.5.4.3\"",
}

Definition at line 851 of file actctx.c.

Referenced by test_actctx().

◆ depmanifest_path

WCHAR depmanifest_path[MAX_PATH]
static

Definition at line 587 of file actctx.c.

Referenced by create_manifest_file().

◆ detailed_info0

const detailed_info_t detailed_info0
static
Initial value:
= {
0, 0, 0, 0, NULL, 0, 0, NULL
}

Definition at line 699 of file actctx.c.

Referenced by test_actctx().

◆ detailed_info1

const detailed_info_t detailed_info1
static
Initial value:
= {
1, 1, 1, ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE, manifest_path,
ACTIVATION_CONTEXT_PATH_TYPE_NONE, ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE,
}

Definition at line 703 of file actctx.c.

Referenced by test_actctx().

◆ detailed_info1_child

const detailed_info_t detailed_info1_child
static
Initial value:
= {
1, 1, 1, ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE, app_manifest_path,
ACTIVATION_CONTEXT_PATH_TYPE_NONE, ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE,
}

Definition at line 709 of file actctx.c.

Referenced by test_app_manifest().

◆ detailed_info2

const detailed_info_t detailed_info2
static
Initial value:
= {
1, 2, 3, ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE, manifest_path,
ACTIVATION_CONTEXT_PATH_TYPE_NONE, ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE,
}

Definition at line 716 of file actctx.c.

Referenced by test_actctx().

◆ detailed_info3

const detailed_info_t detailed_info3
static
Initial value:
=
{
1, 1, 1, ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE, exe_path,
ACTIVATION_CONTEXT_PATH_TYPE_NONE, ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE,
}

Definition at line 4383 of file actctx.c.

Referenced by test_manifest_in_module().

◆ empty_assembly_manifest

const char empty_assembly_manifest[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\" />"

Definition at line 562 of file actctx.c.

Referenced by test_actctx().

◆ exe_path

WCHAR exe_path[MAX_PATH]
static

Definition at line 586 of file actctx.c.

Referenced by init_paths().

◆ HANDLE

Definition at line 32 of file actctx.c.

◆ LPCWSTR

Definition at line 32 of file actctx.c.

◆ LPWSTR

◆ manifest1

const char manifest1[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"</assembly>"

Definition at line 50 of file actctx.c.

Referenced by run_child_process(), test_actctx(), test_compatibility(), test_create_fail(), test_CreateActCtx(), and test_CreateActCtx_share_mode().

◆ manifest10

const char manifest10[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv2=\"urn:schemas-microsoft-com:asm.v2\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"<asmv2:trustInfo>"
" <asmv2:security>"
" <asmv2:requestedPrivileges>"
" <asmv2:requestedExecutionLevel level=\"requireAdministrator\" uiAccess=\"true\"></asmv2:requestedExecutionLevel>"
" </asmv2:requestedPrivileges>"
" </asmv2:security>"
"</asmv2:trustInfo>"
"</assembly>"

Definition at line 292 of file actctx.c.

Referenced by test_actctx().

◆ manifest11

const char manifest11[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv2=\"urn:schemas-microsoft-com:asm.v2\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"<dependency />"
"</assembly>"

Definition at line 305 of file actctx.c.

Referenced by test_actctx().

◆ manifest1_1

const char manifest1_1[]
static
Initial value:
=
"<assembly xmlns = \"urn:schemas-microsoft-com:asm.v1\" manifestVersion = \"1.0\">"
"<assemblyIdentity version = \"1.0.0.0\" name = \"Wine.Test\" type = \"win32\"></assemblyIdentity>"
"</assembly>"

Definition at line 55 of file actctx.c.

Referenced by test_actctx().

◆ manifest1_child_info

const info_in_assembly manifest1_child_info
static
Initial value:
= {
L"Wine.Test,type=\"win32\",version=\"1.0.0.0\"",
}

Definition at line 813 of file actctx.c.

Referenced by test_app_manifest().

◆ manifest1_info

const info_in_assembly manifest1_info
static
Initial value:
= {
L"Wine.Test,type=\"win32\",version=\"1.0.0.0\"",
}

Definition at line 807 of file actctx.c.

Referenced by test_actctx().

◆ manifest2

const char manifest2[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\">"
"</assemblyIdentity>"
"<dependency>"
"<dependentAssembly>"
"<assemblyIdentity type=\"win32\" name=\"testdep\" version=\"6.5.4.3\" processorArchitecture=\"" ARCH "\">"
"</assemblyIdentity>"
"</dependentAssembly>"
"</dependency>"
"</assembly>"

Definition at line 60 of file actctx.c.

Referenced by test_actctx(), and test_create_fail().

◆ manifest2_info

const info_in_assembly manifest2_info
static
Initial value:
= {
L"Wine.Test,type=\"win32\",version=\"1.2.3.4\"",
}

Definition at line 819 of file actctx.c.

Referenced by test_actctx().

◆ manifest3

const char manifest3[]
static

Definition at line 86 of file actctx.c.

Referenced by test_actctx().

◆ manifest3_info

const info_in_assembly manifest3_info
static
Initial value:
= {
L"Wine.Test,publicKeyToken=\"6595b6414666f1df\",type=\"win32\",version=\"1.2.3.4\"",
}

Definition at line 825 of file actctx.c.

Referenced by test_actctx().

◆ manifest4

const char manifest4[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\">"
"</assemblyIdentity>"
"<dependency>"
"<dependentAssembly>"
"<assemblyIdentity type=\"win32\" name=\"Microsoft.Windows.Common-Controls\" "
"version=\"6.0.1.0\" processorArchitecture=\"" ARCH "\" publicKeyToken=\"6595b64144ccf1df\">"
"</assemblyIdentity>"
"</dependentAssembly>"
"</dependency>"
"</assembly>"

Definition at line 213 of file actctx.c.

Referenced by test_actctx().

◆ manifest4_info

const info_in_assembly manifest4_info
static
Initial value:
= {
L"Wine.Test,type=\"win32\",version=\"1.2.3.4\"",
}

Definition at line 831 of file actctx.c.

Referenced by test_actctx().

◆ manifest5

const char manifest5[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\">"
"</assemblyIdentity>"
"<dependency>"
" <dependentAssembly dependencyType=\"preRequisite\" allowDelayedBinding=\"true\">"
" <assemblyIdentity name=\"Missing.Assembly\" version=\"1.0.0.0\" />"
" </dependentAssembly>"
"</dependency>"
"</assembly>"

Definition at line 226 of file actctx.c.

Referenced by test_allowDelayedBinding().

◆ manifest6

const char manifest6[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v1\">"
" <security>"
" <requestedPrivileges>"
" <requestedExecutionLevel level=\"ASINVOKER\" uiAccess=\"false\"/>"
" </requestedPrivileges>"
" </security>"
"</trustInfo>"
"</assembly>"

Definition at line 237 of file actctx.c.

Referenced by test_actctx().

◆ manifest7

const char manifest7[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">"
" <security>"
" <requestedPrivileges>"
" <requestedExecutionLevel level=\"requireAdministrator\" uiAccess=\"TRUE\"/>"
" </requestedPrivileges>"
" </security>"
"</trustInfo>"
"</assembly>"

Definition at line 249 of file actctx.c.

Referenced by test_actctx().

◆ manifest8

const char manifest8[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">"
" <security>"
" <requestedPrivileges>"
" <requestedExecutionLevel level=\"requireAdministrator\" uiAccess=\"true\">"
" </requestedExecutionLevel>"
" </requestedPrivileges>"
" </security>"
"</trustInfo>"
"</assembly>"

Definition at line 261 of file actctx.c.

Referenced by test_actctx().

◆ manifest9

const char manifest9[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">"
" <security>"
" <requestedPrivileges>"
" <requestedExecutionLevel level=\"requireAdministrator\"/>"
" </requestedPrivileges>"
" </security>"
"</trustInfo>"
"<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">"
" <security>"
" <requestedPrivileges>"
" </requestedPrivileges>"
" </security>"
"</trustInfo>"
"</assembly>"

Definition at line 274 of file actctx.c.

Referenced by test_actctx().

◆ manifest_comctrl_info

const info_in_assembly manifest_comctrl_info
static
Initial value:
= {
0, NULL, NULL, TRUE
}

Definition at line 857 of file actctx.c.

Referenced by test_actctx().

◆ manifest_path

WCHAR manifest_path[MAX_PATH]
static

Definition at line 587 of file actctx.c.

Referenced by create_manifest_file(), and test_create().

◆ manifest_wndcls1

const char manifest_wndcls1[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.2.3.4\" name=\"testdep1\" type=\"win32\" processorArchitecture=\"" ARCH "\"/>"
"<file name=\"testlib1.dll\">"
"<windowClass versioned=\"yes\">wndClass1</windowClass>"
"<windowClass>wndClass2</windowClass>"
" <typelib tlbid=\"{99999999-8888-7777-6666-555555555558}\" version=\"1.0\" helpdir=\"\" />"
"</file>"
"<file name=\"testlib1_2.dll\" />"
"</assembly>"

Definition at line 173 of file actctx.c.

Referenced by test_CreateActCtx(), test_dllredirect_section(), test_typelib_section(), and test_wndclass_section().

◆ manifest_wndcls2

const char manifest_wndcls2[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"4.3.2.1\" name=\"testdep2\" type=\"win32\" processorArchitecture=\"" ARCH "\" />"
"<file name=\"testlib2.dll\">"
" <windowClass versioned=\"no\">wndClass3</windowClass>"
" <windowClass>wndClass4</windowClass>"
" <typelib tlbid=\"{99999999-8888-7777-6666-555555555555}\" version=\"1.0\" helpdir=\"help\" resourceid=\"409\""
" flags=\"HiddeN,CoNTROL,rESTRICTED\" />"
" <typelib tlbid=\"{99999999-8888-7777-6666-555555555556}\" version=\"1.0\" helpdir=\"help1\" resourceid=\"409\" />"
" <typelib tlbid=\"{99999999-8888-7777-6666-555555555557}\" version=\"1.0\" helpdir=\"\" />"
"</file>"
"<file name=\"testlib2_2.dll\" />"
"</assembly>"

Definition at line 184 of file actctx.c.

Referenced by test_CreateActCtx(), test_dllredirect_section(), test_typelib_section(), and test_wndclass_section().

◆ manifest_wndcls_main

const char manifest_wndcls_main[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\" />"
"<dependency>"
" <dependentAssembly>"
" <assemblyIdentity type=\"win32\" name=\"testdep1\" version=\"1.2.3.4\" processorArchitecture=\"" ARCH "\" />"
" </dependentAssembly>"
"</dependency>"
"<dependency>"
" <dependentAssembly>"
" <assemblyIdentity type=\"win32\" name=\"testdep2\" version=\"4.3.2.1\" processorArchitecture=\"" ARCH "\" />"
" </dependentAssembly>"
"</dependency>"
"</assembly>"

Definition at line 198 of file actctx.c.

Referenced by test_CreateActCtx(), test_dllredirect_section(), test_typelib_section(), and test_wndclass_section().

◆ PACTCTX_SECTION_KEYED_DATA

SIZE_T *static const GUID PACTCTX_SECTION_KEYED_DATA

◆ PCSZ

Definition at line 35 of file actctx.c.

◆ PUNICODE_STRING

Definition at line 34 of file actctx.c.

◆ runlevel_info0

const runlevel_info_t runlevel_info0
static
Initial value:
= {
ACTCTX_RUN_LEVEL_UNSPECIFIED, FALSE,
}

Definition at line 1018 of file actctx.c.

Referenced by test_actctx().

◆ runlevel_info6

const runlevel_info_t runlevel_info6
static
Initial value:
= {
ACTCTX_RUN_LEVEL_AS_INVOKER, FALSE,
}

Definition at line 1022 of file actctx.c.

Referenced by test_actctx().

◆ runlevel_info7

const runlevel_info_t runlevel_info7
static
Initial value:
= {
ACTCTX_RUN_LEVEL_REQUIRE_ADMIN, TRUE,
}

Definition at line 1026 of file actctx.c.

Referenced by test_actctx().

◆ runlevel_info8

const runlevel_info_t runlevel_info8
static
Initial value:
= {
ACTCTX_RUN_LEVEL_REQUIRE_ADMIN, TRUE,
}

Definition at line 1030 of file actctx.c.

Referenced by test_actctx().

◆ runlevel_info9

const runlevel_info_t runlevel_info9
static
Initial value:
= {
ACTCTX_RUN_LEVEL_REQUIRE_ADMIN, FALSE,
}

Definition at line 1034 of file actctx.c.

Referenced by test_actctx().

◆ settings_manifest

const char settings_manifest[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
" <assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
" <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">"
" <windowsSettings>"
" <dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true</dpiAware>"
" <dpiAwareness xmlns=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\">true</dpiAwareness>"
" </windowsSettings>"
" </application>"
"</assembly>"

Definition at line 468 of file actctx.c.

Referenced by test_settings().

◆ settings_manifest2

const char settings_manifest2[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
" <assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
" <application xmlns=\"urn:schemas-microsoft-com:asm.v3\""
" xmlns:ws05=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\""
" xmlns:ws11=\"http://schemas.microsoft.com/SMI/2011/WindowsSettings\""
" xmlns:ws16=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\""
" xmlns:ws17=\"http://schemas.microsoft.com/SMI/2017/WindowsSettings\">"
" <windowsSettings>"
" <ws05:autoElevate>true</ws05:autoElevate>"
" <ws05:disableTheming>true</ws05:disableTheming>"
" <ws11:disableWindowFiltering>true</ws11:disableWindowFiltering>"
" <ws05:dpiAware>true</ws05:dpiAware>"
" <ws16:dpiAwareness>true</ws16:dpiAwareness>"
" <ws17:gdiScaling>true</ws17:gdiScaling>"
" <ws17:highResolutionScrollingAware>true</ws17:highResolutionScrollingAware>"
" <ws16:longPathAware>true</ws16:longPathAware>"
" <ws17:magicFutureSetting>true</ws17:magicFutureSetting>"
" <ws11:printerDriverIsolation>true</ws11:printerDriverIsolation>"
" <ws17:ultraHighResolutionScrollingAware>true</ws17:ultraHighResolutionScrollingAware>"
" </windowsSettings>"
" </application>"
"</assembly>"

Definition at line 479 of file actctx.c.

Referenced by test_settings().

◆ settings_manifest3

const char settings_manifest3[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
" <assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
" <asmv3:application>"
" <asmv3:windowsSettings xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">"
" <dpiAware>true</dpiAware>"
" </asmv3:windowsSettings>"
" </asmv3:application>"
"</assembly>"

Definition at line 504 of file actctx.c.

Referenced by test_settings().

◆ settings_manifest4

const char settings_manifest4[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
" <assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
" <application/>"
" <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">"
" <windowsSettings>"
" <dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true</dpiAware>"
" </windowsSettings>"
" </application>"
" <application/>"
" <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">"
" <windowsSettings>"
" <dpiAwareness xmlns=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\">true</dpiAwareness>"
" </windowsSettings>"
" </application>"
"</assembly>"

Definition at line 514 of file actctx.c.

Referenced by test_settings().

◆ SIZE_T

Definition at line 32 of file actctx.c.

◆ testdep_manifest1

const char testdep_manifest1[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity type=\"win32\" name=\"testdep\" version=\"6.5.4.3\" processorArchitecture=\"" ARCH "\"/>"
"</assembly>"

Definition at line 311 of file actctx.c.

Referenced by test_actctx().

◆ testdep_manifest2

const char testdep_manifest2[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity type=\"win32\" name=\"testdep\" version=\"6.5.4.3\" processorArchitecture=\"" ARCH "\" />"
"<file name=\"testlib.dll\"></file>"
"<file name=\"testlib2.dll\" hash=\"63c978c2b53d6cf72b42fb7308f9af12ab19ec53\" hashalg=\"SHA1\" />"
"</assembly>"

Definition at line 316 of file actctx.c.

Referenced by test_actctx().

◆ testdep_manifest3

const char testdep_manifest3[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\"> "
"<assemblyIdentity type=\"win32\" name=\"testdep\" version=\"6.5.4.3\" processorArchitecture=\"" ARCH "\"/>"
"<file name=\"testlib.dll\"/>"
"<file name=\"testlib2.dll\" hash=\"63c978c2b53d6cf72b42fb7308f9af12ab19ec53\" hashalg=\"SHA1\">"
"<windowClass>wndClass</windowClass>"
"<windowClass>wndClass2</windowClass>"
"</file>"
"</assembly>"

Definition at line 323 of file actctx.c.

Referenced by test_actctx(), test_findsectionstring(), and test_ZombifyActCtx().

◆ testlib2_dll

const WCHAR testlib2_dll[]
static
Initial value:
=
{'t','e','s','t','l','i','b','2','.','d','l','l',0}

Definition at line 575 of file actctx.c.

Referenced by test_actctx(), and test_find_string_fail().

◆ testlib_dll

const WCHAR testlib_dll[]
static
Initial value:
=
{'t','e','s','t','l','i','b','.','d','l','l',0}

Definition at line 573 of file actctx.c.

Referenced by test_actctx(), and test_find_string_fail().

◆ two_dll_manifest_dll

const char two_dll_manifest_dll[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v3\" manifestVersion=\"1.0\">"
" <assemblyIdentity type=\"win32\" name=\"sxs_dll\" version=\"1.0.0.0\" processorArchitecture=\"x86\" publicKeyToken=\"0000000000000000\"/>"
" <file name=\"sxs_dll.dll\"></file>"
"</assembly>"

Definition at line 531 of file actctx.c.

Referenced by test_manifest_resources(), test_one_sxs_and_one_local_1(), test_one_sxs_and_one_local_2(), test_one_with_sxs_and_GetModuleHandleA(), and test_two_dlls_at_same_time().

◆ two_dll_manifest_exe

const char two_dll_manifest_exe[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
" <dependency>"
" <dependentAssembly>"
" <assemblyIdentity type=\"win32\" name=\"sxs_dll\" version=\"1.0.0.0\" processorArchitecture=\"x86\" publicKeyToken=\"0000000000000000\" language=\"*\"/>"
" </dependentAssembly>"
" </dependency>"
"</assembly>"

Definition at line 537 of file actctx.c.

Referenced by test_manifest_resources(), test_one_sxs_and_one_local_1(), test_one_sxs_and_one_local_2(), test_one_with_sxs_and_GetModuleHandleA(), and test_two_dlls_at_same_time().

◆ ULONG

◆ wndClass1W

const WCHAR wndClass1W[]
static
Initial value:
=
{'w','n','d','C','l','a','s','s','1',0}

Definition at line 579 of file actctx.c.

Referenced by test_wndclass_section().

◆ wndClass2W

const WCHAR wndClass2W[]
static
Initial value:
=
{'w','n','d','C','l','a','s','s','2',0}

Definition at line 581 of file actctx.c.

Referenced by test_actctx().

◆ wndClass3W

const WCHAR wndClass3W[]
static
Initial value:
=
{'w','n','d','C','l','a','s','s','3',0}

Definition at line 583 of file actctx.c.

Referenced by test_wndclass_section().

◆ wndClassW

const WCHAR wndClassW[]
static
Initial value:
=
{'w','n','d','C','l','a','s','s',0}

Definition at line 577 of file actctx.c.

Referenced by test_actctx().

◆ work_dir

WCHAR work_dir[MAX_PATH]
static

Definition at line 586 of file actctx.c.

Referenced by init_paths(), test_actctx(), and test_CreateActCtx().

◆ work_dir_subdir

WCHAR work_dir_subdir[MAX_PATH]
static

Definition at line 586 of file actctx.c.

Referenced by init_paths(), and test_actctx().

◆ wrong_depmanifest1

const char wrong_depmanifest1[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity type=\"win32\" name=\"testdep\" version=\"6.5.4.4\" processorArchitecture=\"" ARCH "\" />"
"</assembly>"

Definition at line 418 of file actctx.c.

Referenced by test_create_fail().

◆ wrong_manifest1

const char wrong_manifest1[]
static
Initial value:
=
"<assembly manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"</assembly>"

Definition at line 333 of file actctx.c.

Referenced by subtest_valid_manifest_resources_locale(), test_create_fail(), and test_manifest_resources().

◆ wrong_manifest10

const char wrong_manifest10[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">"
" <security>"
" <requestedPrivileges>"
" <requestedExecutionLevel level=\"requireAdministrator\"/>"
" </requestedPrivileges>"
" </security>"
"</trustInfo>"
"<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">"
" <security>"
" <requestedPrivileges>"
" <requestedExecutionLevel uiAccess=\"true\"/>"
" </requestedPrivileges>"
" </security>"
"</trustInfo>"
"</assembly>"

Definition at line 390 of file actctx.c.

Referenced by test_create_fail().

◆ wrong_manifest11

const char wrong_manifest11[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\" />"
"<file name=\"testlib.dll\">"
" <activatableClass name=\"Wine.Test.Class1\" threadingModel=\"both\" />"
"</file>"
"</assembly>"

Definition at line 410 of file actctx.c.

Referenced by test_create_fail().

◆ wrong_manifest2

const char wrong_manifest2[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"</assembly>"

Definition at line 338 of file actctx.c.

Referenced by test_create_fail().

◆ wrong_manifest3

const char wrong_manifest3[]
static
Initial value:
=
"<assembly test=\"test\" xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"</assembly>"

Definition at line 343 of file actctx.c.

Referenced by test_create_fail().

◆ wrong_manifest4

const char wrong_manifest4[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"<test></test>"
"</assembly>"

Definition at line 348 of file actctx.c.

Referenced by test_create_fail().

◆ wrong_manifest5

const char wrong_manifest5[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"</assembly>"
"<test></test>"

Definition at line 354 of file actctx.c.

Referenced by test_create_fail().

◆ wrong_manifest6

const char wrong_manifest6[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v5\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"</assembly>"

Definition at line 360 of file actctx.c.

Referenced by test_create_fail().

◆ wrong_manifest7

const char wrong_manifest7[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity type=\"win32\" name=\"testdep\" version=\"6.5.4.3\" processorArchitecture=\"" ARCH "\" />"
"<file name=\"testlib.dll\" hash=\"63c978c2b53d6cf72b42fb7308f9af12ab19ec5\" hashalg=\"SHA1\" />"
"</assembly>"

Definition at line 365 of file actctx.c.

Referenced by test_create_fail().

◆ wrong_manifest8

const char wrong_manifest8[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"<file></file>"
"</assembly>"

Definition at line 371 of file actctx.c.

Referenced by test_create_fail().

◆ wrong_manifest9

const char wrong_manifest9[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.0.0.0\" name=\"Wine.Test\" type=\"win32\"></assemblyIdentity>"
"<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">"
" <security>"
" <requestedPrivileges>"
" <requestedExecutionLevel level=\"requireAdministrator\"/>"
" <requestedExecutionLevel uiAccess=\"true\"/>"
" </requestedPrivileges>"
" </security>"
"</trustInfo>"
"</assembly>"

Definition at line 377 of file actctx.c.

Referenced by test_create_fail().