ReactOS 0.4.16-dev-106-g10b08aa
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
 
struct  tlibredirect_data
 
struct  progidredirect_data
 
struct  comclassredirect_data
 
struct  clrclass_data
 
struct  ifacepsredirect_data
 
struct  clrsurrogate_data
 
struct  _test_act_ctx_compat_info
 

Macros

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

Typedefs

typedef struct _test_act_ctx_compat_info test_act_ctx_compat_info
 

Enumerations

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 *pActivateActCtx)(HANDLE
 
static ULONG_PTR *static HANDLE (WINAPI *pCreateActCtxA)(PCACTCTXA)
 
static SIZE_T *static VOID (WINAPI *pReleaseActCtx)(HANDLE)
 
static NTSTATUS (NTAPI *pRtlFindActivationContextSectionString)(DWORD
 
static BOOLEAN (NTAPI *pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING
 
static VOID (NTAPI *pRtlFreeUnicodeString)(PUNICODE_STRING)
 
static const charstrw (LPCWSTR x)
 
 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 int strcmp_aw (LPCWSTR strw, const char *stra)
 
static DWORD strlen_aw (const char *str)
 
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 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_string_fail (void)
 
static void test_basic_info (HANDLE handle, 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, int line)
 
static void ntdll_find (ULONG section, const char *string_to_find, BOOL should_find, 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 test_CreateActCtx (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, const GUID *expected_compat[], int line)
 
static void test_compatibility (void)
 
 START_TEST (actctx)
 

Variables

static ULONG_PTR
 
static const GUID ULONG
 
static const GUID LPCSTR
 
static const GUID PACTCTX_SECTION_KEYED_DATA
 
static const GUID LPCWSTR
 
static HANDLE
 
static PVOID
 
static SIZE_T
 
static const GUID PUNICODE_STRING
 
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 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_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 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
 

Macro Definition Documentation

◆ ARCH

#define ARCH   "none"

Definition at line 68 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 1371 of file actctx.c.

1371 {
1372 MiscStatus = 1,
1373 MiscStatusIcon = 2,
1377};
@ MiscStatusContent
Definition: actctx.c:1374
@ MiscStatusThumbnail
Definition: actctx.c:1375
@ MiscStatus
Definition: actctx.c:1372
@ MiscStatusDocPrint
Definition: actctx.c:1376
@ MiscStatusIcon
Definition: actctx.c:1373

◆ 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 1363 of file actctx.c.

1363 {
1369};
@ ThreadingModel_No
Definition: actctx.c:1366
@ ThreadingModel_Both
Definition: actctx.c:1367
@ ThreadingModel_Neutral
Definition: actctx.c:1368
@ ThreadingModel_Free
Definition: actctx.c:1365
@ ThreadingModel_Apartment
Definition: actctx.c:1364

◆ ifaceps_mask

Enumerator
NumMethods 
BaseIface 
NumMethods 
BaseIface 

Definition at line 1554 of file actctx.c.

1555{
1556 NumMethods = 1,
1557 BaseIface = 2
1558};
@ BaseIface
Definition: actctx.c:1557
@ NumMethods
Definition: actctx.c:1556

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pActivateActCtx)
static

◆ BOOLEAN()

static BOOLEAN ( NTAPI pRtlCreateUnicodeStringFromAsciiz)
static

◆ create_manifest()

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

Definition at line 2320 of file actctx.c.

2321{
2322 HANDLE handle;
2324
2326 ok_(__FILE__, line)(handle != INVALID_HANDLE_VALUE,
2327 "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2328
2330 return handle;
2331}
#define ok_(x1, x2)
Definition: atltest.h:61
#define NULL
Definition: types.h:112
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
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:486
Definition: parser.c:49
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

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 486 of file actctx.c.

488{
489 DWORD size;
490 HANDLE file;
492
495
496 if (manifest_len == -1)
497 manifest_len = strlen(manifest);
498
501 ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError());
503 return FALSE;
504 WriteFile(file, manifest, manifest_len, &size, NULL);
506
507 if (depmanifest)
508 {
509 MultiByteToWideChar( CP_ACP, 0, depfile, -1, path, MAX_PATH );
513 ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError());
515 return FALSE;
516 WriteFile(file, depmanifest, strlen(depmanifest), &size, NULL);
518 }
519 return TRUE;
520}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ok(value,...)
Definition: atltest.h:57
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#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:470
static WCHAR manifest_path[MAX_PATH]
Definition: actctx.c:470
#define GENERIC_WRITE
Definition: nt_native.h:90
Definition: fci.c:127
static const CHAR manifest[]
Definition: v6util.h:41
__wchar_t WCHAR
Definition: xmlstorage.h:180

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

◆ create_wide_manifest()

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

Definition at line 522 of file actctx.c.

523{
524 WCHAR *wmanifest = HeapAlloc(GetProcessHeap(), 0, (strlen(manifest)+2) * sizeof(WCHAR));
525 BOOL ret;
526 int offset = (fBOM ? 0 : 1);
527
528 MultiByteToWideChar(CP_ACP, 0, manifest, -1, &wmanifest[1], (strlen(manifest)+1));
529 wmanifest[0] = 0xfeff;
530 if (fReverse)
531 {
532 size_t i;
533 for (i = 0; i < strlen(manifest)+1; i++)
534 wmanifest[i] = (wmanifest[i] << 8) | ((wmanifest[i] >> 8) & 0xff);
535 }
536 ret = create_manifest_file(filename, (char *)&wmanifest[offset], (strlen(manifest)+1-offset) * sizeof(WCHAR), NULL, NULL);
537 HeapFree(GetProcessHeap(), 0, wmanifest);
538 return ret;
539}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
unsigned int BOOL
Definition: ntddk_ex.h:94
GLintptr offset
Definition: glext.h:5920
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int ret

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 2515 of file actctx.c.

2516{
2518
2519 GetTempPathA(sizeof(path)/sizeof(CHAR), path);
2522}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2054
char CHAR
Definition: xmlstorage.h:175

Referenced by test_CreateActCtx().

◆ HANDLE()

static ULONG_PTR *static HANDLE ( WINAPI pCreateActCtxA)
static

◆ init_funcs()

static BOOL init_funcs ( void  )
static

Definition at line 2651 of file actctx.c.

2652{
2653 HMODULE hLibrary = GetModuleHandleA("kernel32.dll");
2654
2655#define X(f) if (!(p##f = (void*)GetProcAddress(hLibrary, #f))) return FALSE;
2664 X(QueryActCtxW);
2668
2669 hLibrary = GetModuleHandleA("ntdll.dll");
2673#undef X
2674
2675 return TRUE;
2676}
HMODULE hLibrary
Definition: odbccp32.c:12
BOOL WINAPI ZombifyActCtx(HANDLE hActCtx)
Definition: actctx.c:219
VOID WINAPI ReleaseActCtx(IN HANDLE hActCtx)
Definition: actctx.c:208
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
Definition: actctx.c:268
BOOL WINAPI QueryActCtxW(IN DWORD dwFlags, IN HANDLE hActCtx, IN PVOID pvSubInstance, IN ULONG ulInfoClass, IN PVOID pvBuffer, IN SIZE_T cbBuffer, IN OUT SIZE_T *pcbWrittenOrRequired OPTIONAL)
Definition: actctx.c:328
BOOL WINAPI GetCurrentActCtx(OUT PHANDLE phActCtx)
Definition: actctx.c:298
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
Definition: actctx.c:237
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
BOOL WINAPI FindActCtxSectionStringW(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, LPCWSTR lpSearchStr, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:238
HANDLE WINAPI CreateActCtxA(PCACTCTXA pActCtx)
Definition: actctx.c:26
BOOL WINAPI FindActCtxSectionStringA(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, LPCSTR lpSearchStr, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:206
HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx)
Definition: actctx.c:102
BOOL WINAPI FindActCtxSectionGuid(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, const GUID *lpSearchGuid, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:265
NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG, const GUID *, ULONG, const UNICODE_STRING *, PVOID)
Definition: actctx.c:5907
#define X(f)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
BOOL WINAPI IsDebuggerPresent(void)
Definition: debugger.c:580

Referenced by START_TEST().

◆ init_paths()

static void init_paths ( void  )
static

Definition at line 2476 of file actctx.c.

2477{
2478 LPWSTR ptr;
2479
2480 static const WCHAR dot_manifest[] = {'.','M','a','n','i','f','e','s','t',0};
2481 static const WCHAR backslash[] = {'\\',0};
2482 static const WCHAR subdir[] = {'T','e','s','t','S','u','b','d','i','r','\\',0};
2483
2484 GetModuleFileNameW(NULL, exe_path, sizeof(exe_path)/sizeof(WCHAR));
2486 for(ptr=app_dir+lstrlenW(app_dir); *ptr != '\\' && *ptr != '/'; ptr--);
2487 ptr[1] = 0;
2488
2490 ptr = work_dir + lstrlenW( work_dir ) - 1;
2491 if (*ptr != '\\' && *ptr != '/')
2492 lstrcatW(work_dir, backslash);
2494 lstrcatW(work_dir_subdir, subdir);
2495
2498}
#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 PVOID ptr
Definition: dispmode.c:27
static WCHAR work_dir_subdir[MAX_PATH]
Definition: actctx.c:469
static WCHAR exe_path[MAX_PATH]
Definition: actctx.c:469
static WCHAR app_manifest_path[MAX_PATH]
Definition: actctx.c:470
static WCHAR work_dir[MAX_PATH]
Definition: actctx.c:469
static WCHAR app_dir[MAX_PATH]
Definition: actctx.c:469
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,
int  line 
)
static

Definition at line 2333 of file actctx.c.

2334{
2335 UNICODE_STRING string_to_findW;
2336 ACTCTX_SECTION_KEYED_DATA data;
2337 BOOL ret;
2338 DWORD err;
2339
2340 pRtlCreateUnicodeStringFromAsciiz(&string_to_findW, string_to_find);
2341
2342 memset(&data, 0xfe, sizeof(data));
2343 data.cbSize = sizeof(data);
2344
2345 SetLastError(0);
2346 ret = pFindActCtxSectionStringA(0, NULL, section, string_to_find, &data);
2347 err = GetLastError();
2348 ok_(__FILE__, line)(ret == should_find,
2349 "FindActCtxSectionStringA: expected ret = %u, got %u\n", should_find, ret);
2350 ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
2351 "FindActCtxSectionStringA: unexpected error %u\n", err);
2352
2353 memset(&data, 0xfe, sizeof(data));
2354 data.cbSize = sizeof(data);
2355
2356 SetLastError(0);
2357 ret = pFindActCtxSectionStringW(0, NULL, section, string_to_findW.Buffer, &data);
2358 err = GetLastError();
2359 ok_(__FILE__, line)(ret == should_find,
2360 "FindActCtxSectionStringW: expected ret = %u, got %u\n", should_find, ret);
2361 ok_(__FILE__, line)(err == (should_find ? ERROR_SUCCESS : ERROR_SXS_KEY_NOT_FOUND),
2362 "FindActCtxSectionStringW: unexpected error %u\n", err);
2363
2364 SetLastError(0);
2365 ret = pFindActCtxSectionStringA(0, NULL, section, string_to_find, NULL);
2366 err = GetLastError();
2367 ok_(__FILE__, line)(!ret,
2368 "FindActCtxSectionStringA: expected failure, got %u\n", ret);
2369 ok_(__FILE__, line)(err == ERROR_INVALID_PARAMETER,
2370 "FindActCtxSectionStringA: unexpected error %u\n", err);
2371
2372 SetLastError(0);
2373 ret = pFindActCtxSectionStringW(0, NULL, section, string_to_findW.Buffer, NULL);
2374 err = GetLastError();
2375 ok_(__FILE__, line)(!ret,
2376 "FindActCtxSectionStringW: expected failure, got %u\n", ret);
2377 ok_(__FILE__, line)(err == ERROR_INVALID_PARAMETER,
2378 "FindActCtxSectionStringW: unexpected error %u\n", err);
2379
2380 pRtlFreeUnicodeString(&string_to_findW);
2381}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define err(...)
#define memset(x, y, z)
Definition: compat.h:39
Definition: parser.c:56
#define ERROR_SXS_KEY_NOT_FOUND
Definition: winerror.h:2148

Referenced by test_findsectionstring().

◆ ntdll_find()

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

Definition at line 2383 of file actctx.c.

2384{
2385 UNICODE_STRING string_to_findW;
2386 ACTCTX_SECTION_KEYED_DATA data;
2387 NTSTATUS ret;
2388
2389 pRtlCreateUnicodeStringFromAsciiz(&string_to_findW, string_to_find);
2390
2391 memset(&data, 0xfe, sizeof(data));
2392 data.cbSize = sizeof(data);
2393
2394 ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, &data);
2395 ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
2396 "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
2397
2398 ret = pRtlFindActivationContextSectionString(0, NULL, section, &string_to_findW, NULL);
2399 ok_(__FILE__, line)(ret == (should_find ? STATUS_SUCCESS : STATUS_SXS_KEY_NOT_FOUND),
2400 "RtlFindActivationContextSectionString: unexpected status 0x%x\n", ret);
2401
2402 pRtlFreeUnicodeString(&string_to_findW);
2403}
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_SXS_KEY_NOT_FOUND
Definition: ntstatus.h:1389
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by test_findsectionstring().

◆ NTSTATUS()

static NTSTATUS ( NTAPI pRtlFindActivationContextSectionString)
static

◆ run_child_process()

static void run_child_process ( void  )
static

Definition at line 2438 of file actctx.c.

2439{
2440 char cmdline[MAX_PATH];
2441 char path[MAX_PATH];
2442 char **argv;
2444 STARTUPINFOA si = { 0 };
2445 HANDLE file;
2446 FILETIME now;
2447 BOOL ret;
2448
2450 strcat(path, ".manifest");
2452 skip("Could not create manifest file\n");
2453 return;
2454 }
2455
2456 si.cb = sizeof(si);
2458 /* Vista+ seems to cache presence of .manifest files. Change last modified
2459 date to defeat the cache */
2461 NULL, OPEN_EXISTING, 0, NULL);
2462 if (file != INVALID_HANDLE_VALUE) {
2466 }
2467 sprintf(cmdline, "\"%s\" %s manifest1", argv[0], argv[1]);
2468 ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
2469 ok(ret, "Could not create process: %u\n", GetLastError());
2470 winetest_wait_child_process( pi.hProcess );
2471 CloseHandle(pi.hThread);
2472 CloseHandle(pi.hProcess);
2474}
#define skip(...)
Definition: atltest.h:64
#define OPEN_EXISTING
Definition: compat.h:775
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define FILE_SHARE_READ
Definition: compat.h:136
BOOL WINAPI SetFileTime(IN HANDLE hFile, CONST FILETIME *lpCreationTime OPTIONAL, CONST FILETIME *lpLastAccessTime OPTIONAL, CONST FILETIME *lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:948
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
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:4747
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
time_t now
Definition: finger.c:65
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static const char manifest1[]
Definition: actctx.c:71
static refpint_t pi[]
Definition: server.c:96
#define argv
Definition: mplay32.c:18
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_WRITE_ATTRIBUTES
Definition: nt_native.h:649
int winetest_get_mainargs(char ***pargv)
void winetest_wait_child_process(HANDLE process)
TCHAR * cmdline
Definition: stretchblt.cpp:32
DWORD cb
Definition: winbase.h:831

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( actctx  )

Definition at line 2922 of file actctx.c.

2923{
2924 int argc;
2925 char **argv;
2926
2928
2929 if (!init_funcs())
2930 {
2931 win_skip("Needed functions are not available\n");
2932 return;
2933 }
2934 init_paths();
2935
2936 if(argc > 2 && !strcmp(argv[2], "manifest1")) {
2938 return;
2939 }
2940
2941 test_actctx();
2948}
static int argc
Definition: ServiceArgs.c:12
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static void test_CreateActCtx(void)
Definition: actctx.c:2524
static BOOL init_funcs(void)
Definition: actctx.c:2651
static void test_actctx(void)
Definition: actctx.c:1970
static void test_compatibility(void)
Definition: actctx.c:2800
static void init_paths(void)
Definition: actctx.c:2476
static void test_ZombifyActCtx(void)
Definition: actctx.c:2678
static void test_create_fail(void)
Definition: actctx.c:1004
static void test_findsectionstring(void)
Definition: actctx.c:2405
static void run_child_process(void)
Definition: actctx.c:2438
static void test_app_manifest(void)
Definition: actctx.c:2302
#define win_skip
Definition: test.h:163

◆ strcmp_aw()

static int strcmp_aw ( LPCWSTR  strw,
const char stra 
)
static

Definition at line 472 of file actctx.c.

473{
474 WCHAR buf[1024];
475
476 if (!stra) return 1;
477 MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, sizeof(buf)/sizeof(WCHAR));
478 return lstrcmpW(strw, buf);
479}
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4242
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static const char * strw(LPCWSTR x)
Definition: actctx.c:49

Referenced by test_info_in_assembly().

◆ strlen_aw()

static DWORD strlen_aw ( const char str)
static

Definition at line 481 of file actctx.c.

482{
483 return MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0) - 1;
484}
const WCHAR * str

Referenced by test_info_in_assembly().

◆ strw()

static const char * strw ( LPCWSTR  x)
static

Definition at line 49 of file actctx.c.

50{
51 static char buffer[1024];
52 char* p = buffer;
53
54 if (!x) return "(nil)";
55 else while ((*p++ = *x++));
56 return buffer;
57}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint buffer
Definition: glext.h:5915
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by exec_fontname(), get_doc_string(), html_src_compare(), is_prefix_wa(), str_eq_wa(), strcmp_aw(), strcmp_wa(), stricmp_wa(), test_detailed_info(), test_HexFromBin(), test_info_in_assembly(), and wstr_contains().

◆ test_actctx()

static void test_actctx ( void  )
static

Definition at line 1970 of file actctx.c.

1971{
1973 HANDLE handle;
1974 BOOL b;
1975
1976 trace("default actctx\n");
1977
1978 b = pGetCurrentActCtx(&handle);
1979 ok(handle == NULL, "handle = %p, expected NULL\n", handle);
1980 ok(b, "GetCurrentActCtx failed: %u\n", GetLastError());
1981 if(b) {
1982 test_basic_info(handle, __LINE__);
1985 pReleaseActCtx(handle);
1986 }
1987
1988 /* test for whitespace handling in Eq ::= S? '=' S? */
1989 create_manifest_file("test1_1.manifest", manifest1_1, -1, NULL, NULL);
1990 handle = test_create("test1_1.manifest");
1991 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
1992 DeleteFileA("test1_1.manifest");
1993 pReleaseActCtx(handle);
1994
1995 if(!create_manifest_file("test1.manifest", manifest1, -1, NULL, NULL)) {
1996 skip("Could not create manifest file\n");
1997 return;
1998 }
1999
2000 trace("manifest1\n");
2001
2002 handle = test_create("test1.manifest");
2003 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2004 DeleteFileA("test1.manifest");
2006 test_basic_info(handle, __LINE__);
2009
2010 if (pIsDebuggerPresent && !pIsDebuggerPresent())
2011 {
2012 /* CloseHandle will generate an exception if a debugger is present */
2013 b = CloseHandle(handle);
2014 ok(!b, "CloseHandle succeeded\n");
2015 ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() == %u\n", GetLastError());
2016 }
2017
2018 pReleaseActCtx(handle);
2019 }
2020
2021 if(!create_manifest_file("test2.manifest", manifest2, -1, "testdep.manifest", testdep_manifest1)) {
2022 skip("Could not create manifest file\n");
2023 return;
2024 }
2025
2026 trace("manifest2 depmanifest1\n");
2027
2028 handle = test_create("test2.manifest");
2029 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2030 DeleteFileA("test2.manifest");
2031 DeleteFileA("testdep.manifest");
2033 test_basic_info(handle, __LINE__);
2037 pReleaseActCtx(handle);
2038 }
2039
2040 if(!create_manifest_file("test2-2.manifest", manifest2, -1, "testdep.manifest", testdep_manifest2)) {
2041 skip("Could not create manifest file\n");
2042 return;
2043 }
2044
2045 trace("manifest2 depmanifest2\n");
2046
2047 handle = test_create("test2-2.manifest");
2048 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2049 DeleteFileA("test2-2.manifest");
2050 DeleteFileA("testdep.manifest");
2052 test_basic_info(handle, __LINE__);
2056 test_file_info(handle, 1, 0, testlib_dll, __LINE__);
2057 test_file_info(handle, 1, 1, testlib2_dll, __LINE__);
2058
2059 b = pActivateActCtx(handle, &cookie);
2060 ok(b, "ActivateActCtx failed: %u\n", GetLastError());
2063 b = pDeactivateActCtx(0, cookie);
2064 ok(b, "DeactivateActCtx failed: %u\n", GetLastError());
2065
2066 pReleaseActCtx(handle);
2067 }
2068
2069 trace("manifest2 depmanifest3\n");
2070
2071 if(!create_manifest_file("test2-3.manifest", manifest2, -1, "testdep.manifest", testdep_manifest3)) {
2072 skip("Could not create manifest file\n");
2073 return;
2074 }
2075
2076 handle = test_create("test2-3.manifest");
2077 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2078 DeleteFileA("test2-3.manifest");
2079 DeleteFileA("testdep.manifest");
2081 test_basic_info(handle, __LINE__);
2085 test_file_info(handle, 1, 0, testlib_dll, __LINE__);
2086 test_file_info(handle, 1, 1, testlib2_dll, __LINE__);
2087
2088 b = pActivateActCtx(handle, &cookie);
2089 ok(b, "ActivateActCtx failed: %u\n", GetLastError());
2094 b = pDeactivateActCtx(0, cookie);
2095 ok(b, "DeactivateActCtx failed: %u\n", GetLastError());
2096
2097 pReleaseActCtx(handle);
2098 }
2099
2100 trace("manifest3\n");
2101
2102 if(!create_manifest_file("test3.manifest", manifest3, -1, NULL, NULL)) {
2103 skip("Could not create manifest file\n");
2104 return;
2105 }
2106
2107 handle = test_create("test3.manifest");
2108 ok(handle != INVALID_HANDLE_VALUE || broken(handle == INVALID_HANDLE_VALUE) /* XP pre-SP2, win2k3 w/o SP */,
2109 "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2111 win_skip("Some activation context features not supported, skipping a test (possibly old XP/Win2k3 system\n");
2112 DeleteFileA("test3.manifest");
2114 static const WCHAR nameW[] = {'t','e','s','t','s','u','r','r','o','g','a','t','e',0};
2115 static const WCHAR versionW[] = {'v','2','.','0','.','5','0','7','2','7',0};
2116 static const WCHAR progidW[] = {'P','r','o','g','I','d','.','P','r','o','g','I','d',0};
2117 static const WCHAR clrprogidW[] = {'c','l','r','p','r','o','g','i','d',0};
2118
2119 test_basic_info(handle, __LINE__);
2122 test_file_info(handle, 0, 0, testlib_dll, __LINE__);
2123
2124 b = pActivateActCtx(handle, &cookie);
2125 ok(b, "ActivateActCtx failed: %u\n", GetLastError());
2128 test_find_com_redirection(handle, &IID_CoTest, &IID_TlibTest, progidW, 1, __LINE__);
2129 test_find_com_redirection(handle, &IID_CoTest2, NULL, NULL, 1, __LINE__);
2130 test_find_com_redirection(handle, &CLSID_clrclass, &IID_TlibTest, clrprogidW, 1, __LINE__);
2131 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId", 1, __LINE__);
2132 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.1", 1, __LINE__);
2133 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.2", 1, __LINE__);
2134 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.3", 1, __LINE__);
2135 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.4", 1, __LINE__);
2136 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.5", 1, __LINE__);
2137 test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.6", 1, __LINE__);
2138 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid", 1, __LINE__);
2139 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.1", 1, __LINE__);
2140 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.2", 1, __LINE__);
2141 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.3", 1, __LINE__);
2142 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.4", 1, __LINE__);
2143 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.5", 1, __LINE__);
2144 test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.6", 1, __LINE__);
2145 test_find_surrogate(handle, &IID_Iiface, nameW, versionW, 1, __LINE__);
2146 test_find_ifaceps_redirection(handle, &IID_Iifaceps, &IID_TlibTest4, &IID_Ibifaceps, NULL, 1, __LINE__);
2147 test_find_ifaceps_redirection(handle, &IID_Iifaceps2, &IID_TlibTest4, &IID_Ibifaceps, &IID_PS32, 1, __LINE__);
2148 test_find_ifaceps_redirection(handle, &IID_Iifaceps3, &IID_TlibTest4, &IID_Ibifaceps, NULL, 1, __LINE__);
2150
2151 b = pDeactivateActCtx(0, cookie);
2152 ok(b, "DeactivateActCtx failed: %u\n", GetLastError());
2153 pReleaseActCtx(handle);
2154 }
2155
2156 trace("manifest6\n");
2157
2158 if(create_manifest_file("test6.manifest", manifest6, -1, NULL, NULL)) {
2159 handle = test_create("test6.manifest");
2161 "Unexpected context handle %p.\n", handle);
2162 DeleteFileA("test6.manifest");
2163 DeleteFileA("testdep.manifest");
2165 {
2167 pReleaseActCtx(handle);
2168 }
2169 }
2170 else
2171 skip("Could not create manifest file 6\n");
2172
2173 trace("manifest7\n");
2174
2175 if(create_manifest_file("test7.manifest", manifest7, -1, NULL, NULL)) {
2176 handle = test_create("test7.manifest");
2177 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2178 DeleteFileA("test7.manifest");
2179 DeleteFileA("testdep.manifest");
2181 {
2183 pReleaseActCtx(handle);
2184 }
2185 }
2186 else
2187 skip("Could not create manifest file 7\n");
2188
2189 trace("manifest8\n");
2190
2191 if(create_manifest_file("test8.manifest", manifest8, -1, NULL, NULL)) {
2192 handle = test_create("test8.manifest");
2193 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2194 DeleteFileA("test8.manifest");
2195 DeleteFileA("testdep.manifest");
2197 {
2199 pReleaseActCtx(handle);
2200 }
2201 }
2202 else
2203 skip("Could not create manifest file 8\n");
2204
2205 trace("manifest9\n");
2206
2207 if(create_manifest_file("test9.manifest", manifest9, -1, NULL, NULL)) {
2208 handle = test_create("test9.manifest");
2209 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2210 DeleteFileA("test9.manifest");
2211 DeleteFileA("testdep.manifest");
2213 {
2215 pReleaseActCtx(handle);
2216 }
2217 }
2218 else
2219 skip("Could not create manifest file 9\n");
2220
2221 trace("manifest4\n");
2222
2223 if(!create_manifest_file("test4.manifest", manifest4, -1, NULL, NULL)) {
2224 skip("Could not create manifest file\n");
2225 return;
2226 }
2227
2228 handle = test_create("test4.manifest");
2229 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2230 DeleteFileA("test4.manifest");
2231 DeleteFileA("testdep.manifest");
2233 test_basic_info(handle, __LINE__);
2237 pReleaseActCtx(handle);
2238 }
2239
2240 trace("manifest1 in subdir\n");
2241
2244 {
2245 if(!create_manifest_file("..\\test1.manifest", manifest1, -1, NULL, NULL)) {
2246 skip("Could not create manifest file\n");
2247 return;
2248 }
2249 handle = test_create("..\\test1.manifest");
2250 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2251 DeleteFileA("..\\test1.manifest");
2253 test_basic_info(handle, __LINE__);
2256 pReleaseActCtx(handle);
2257 }
2259 }
2260 else
2261 skip("Couldn't change directory\n");
2263
2264 trace("UTF-16 manifest1, with BOM\n");
2265 if(!create_wide_manifest("test1.manifest", manifest1, TRUE, FALSE)) {
2266 skip("Could not create manifest file\n");
2267 return;
2268 }
2269
2270 handle = test_create("test1.manifest");
2271 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2272 DeleteFileA("test1.manifest");
2274 test_basic_info(handle, __LINE__);
2277 pReleaseActCtx(handle);
2278 }
2279
2280 trace("UTF-16 manifest1, reverse endian, with BOM\n");
2281 if(!create_wide_manifest("test1.manifest", manifest1, TRUE, TRUE)) {
2282 skip("Could not create manifest file\n");
2283 return;
2284 }
2285
2286 handle = test_create("test1.manifest");
2287 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2288 DeleteFileA("test1.manifest");
2290 test_basic_info(handle, __LINE__);
2293 pReleaseActCtx(handle);
2294 }
2295
2300}
#define trace
Definition: atltest.h:70
#define broken(x)
Definition: atltest.h:178
static const WCHAR nameW[]
Definition: main.c:49
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
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
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:1878
static const char manifest9[]
Definition: actctx.c:284
static void test_dllredirect_section(void)
Definition: actctx.c:1823
static void test_find_progid_redirection(HANDLE handle, const GUID *clsid, const char *progid, ULONG exid, int line)
Definition: actctx.c:1704
static const info_in_assembly manifest3_info
Definition: actctx.c:680
static void test_find_string_fail(void)
Definition: actctx.c:1289
static const char testdep_manifest3[]
Definition: actctx.c:314
static const runlevel_info_t runlevel_info9
Definition: actctx.c:894
static const char manifest4[]
Definition: actctx.c:223
static const runlevel_info_t runlevel_info0
Definition: actctx.c:878
static const char manifest6[]
Definition: actctx.c:247
static const char manifest3[]
Definition: actctx.c:107
static const char testdep_manifest2[]
Definition: actctx.c:307
static const char manifest1_1[]
Definition: actctx.c:76
static const WCHAR testlib_dll[]
Definition: actctx.c:456
static const info_in_assembly depmanifest3_info
Definition: actctx.c:706
static const char manifest2[]
Definition: actctx.c:81
static const char testdep_manifest1[]
Definition: actctx.c:302
static const char manifest7[]
Definition: actctx.c:259
static void test_find_dll_redirection(HANDLE handle, LPCWSTR libname, ULONG exid, int line)
Definition: actctx.c:1127
static BOOL create_wide_manifest(const char *filename, const char *manifest, BOOL fBOM, BOOL fReverse)
Definition: actctx.c:522
static const runlevel_info_t runlevel_info7
Definition: actctx.c:886
static const info_in_assembly manifest1_info
Definition: actctx.c:662
static const info_in_assembly manifest_comctrl_info
Definition: actctx.c:712
static void test_basic_info(HANDLE handle, int line)
Definition: actctx.c:1327
static const WCHAR testlib2_dll[]
Definition: actctx.c:458
static const info_in_assembly manifest2_info
Definition: actctx.c:674
static const info_in_assembly depmanifest2_info
Definition: actctx.c:699
static void test_wndclass_section(void)
Definition: actctx.c:1758
static void test_find_surrogate(HANDLE handle, const GUID *clsid, const WCHAR *name, const WCHAR *version, ULONG exid, int line)
Definition: actctx.c:1643
static const WCHAR wndClass2W[]
Definition: actctx.c:464
static const detailed_info_t detailed_info2
Definition: actctx.c:569
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:1572
static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembly *exinfo, int line)
Definition: actctx.c:716
static void test_allowDelayedBinding(void)
Definition: actctx.c:1947
static const info_in_assembly manifest4_info
Definition: actctx.c:686
static const info_in_assembly depmanifest1_info
Definition: actctx.c:692
static const runlevel_info_t runlevel_info6
Definition: actctx.c:882
static void test_runlevel_info(HANDLE handle, const runlevel_info_t *exinfo, int line)
Definition: actctx.c:898
static const WCHAR wndClassW[]
Definition: actctx.c:460
static void test_find_com_redirection(HANDLE handle, const GUID *clsid, const GUID *tlid, const WCHAR *progid, ULONG exid, int line)
Definition: actctx.c:1414
static const detailed_info_t detailed_info0
Definition: actctx.c:552
static const runlevel_info_t runlevel_info8
Definition: actctx.c:890
static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid, int line)
Definition: actctx.c:1192
static const detailed_info_t detailed_info1
Definition: actctx.c:556
static void test_detailed_info(HANDLE handle, const detailed_info_t *exinfo, int line)
Definition: actctx.c:575
static const char manifest8[]
Definition: actctx.c:271
static void test_file_info(void)
Definition: pipe.c:1262
static const WCHAR progidW[]
Definition: compobj.c:112
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 1947 of file actctx.c.

1948{
1949 HANDLE handle;
1950
1951 if (!create_manifest_file("test5.manifest", manifest5, -1, NULL, NULL)) {
1952 skip("Could not create manifest file\n");
1953 return;
1954 }
1955
1956 handle = test_create("test5.manifest");
1958 win_skip("allowDelayedBinding attribute is not supported.\n");
1959 return;
1960 }
1961
1962 DeleteFileA("test5.manifest");
1963 DeleteFileA("testdep.manifest");
1965 test_basic_info(handle, __LINE__);
1966 pReleaseActCtx(handle);
1967 }
1968}
static const char manifest5[]
Definition: actctx.c:236

Referenced by test_actctx().

◆ test_app_manifest()

static void test_app_manifest ( void  )
static

Definition at line 2302 of file actctx.c.

2303{
2304 HANDLE handle;
2305 BOOL b;
2306
2307 trace("child process manifest1\n");
2308
2309 b = pGetCurrentActCtx(&handle);
2310 ok(handle == NULL, "handle != NULL\n");
2311 ok(b, "GetCurrentActCtx failed: %u\n", GetLastError());
2312 if(b) {
2313 test_basic_info(handle, __LINE__);
2316 pReleaseActCtx(handle);
2317 }
2318}
static const info_in_assembly manifest1_child_info
Definition: actctx.c:668
static const detailed_info_t detailed_info1_child
Definition: actctx.c:562

Referenced by START_TEST().

◆ test_basic_info()

static void test_basic_info ( HANDLE  handle,
int  line 
)
static

Definition at line 1327 of file actctx.c.

1328{
1329 ACTIVATION_CONTEXT_BASIC_INFORMATION basic;
1330 SIZE_T size;
1331 BOOL b;
1332
1333 b = pQueryActCtxW(QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL,
1334 ActivationContextBasicInformation, &basic,
1335 sizeof(basic), &size);
1336
1337 ok_(__FILE__, line) (b,"ActivationContextBasicInformation failed\n");
1338 ok_(__FILE__, line) (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n");
1339 ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags);
1340 ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n");
1341
1342 b = pQueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX |
1343 QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL,
1344 ActivationContextBasicInformation, &basic,
1345 sizeof(basic), &size);
1346 if (handle)
1347 {
1348 ok_(__FILE__, line) (!b,"ActivationContextBasicInformation succeeded\n");
1349 ok_(__FILE__, line) (size == 0,"size mismatch\n");
1350 ok_(__FILE__, line) (GetLastError() == ERROR_INVALID_PARAMETER, "Wrong last error\n");
1351 ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags);
1352 ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n");
1353 }
1354 else
1355 {
1356 ok_(__FILE__, line) (b,"ActivationContextBasicInformation failed\n");
1357 ok_(__FILE__, line) (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n");
1358 ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags);
1359 ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n");
1360 }
1361}
ULONG_PTR SIZE_T
Definition: typedefs.h:80

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

◆ test_compatibility()

static void test_compatibility ( void  )
static

Definition at line 2800 of file actctx.c.

2801{
2802 HANDLE handle;
2803
2804 /* No compat results returned */
2805 trace("manifest1\n");
2806 if(!create_manifest_file("test1.manifest", manifest1, -1, NULL, NULL))
2807 {
2808 skip("Could not create manifest file\n");
2809 return;
2810 }
2811 handle = test_create("test1.manifest");
2812 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2813 DeleteFileA("test1.manifest");
2815 {
2816 char buffer[sizeof(COMPATIBILITY_CONTEXT_ELEMENT) * 2 + sizeof(DWORD)];
2817 SIZE_T size;
2818 BOOL b;
2819
2820 memset(buffer, 0, sizeof(buffer));
2821 b = pQueryActCtxW(QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL,
2822 CompatibilityInformationInActivationContext, buffer,
2823 sizeof(buffer), &size);
2824
2826 {
2827 win_skip("CompatibilityInformationInActivationContext not supported.\n");
2828 pReleaseActCtx(handle);
2829 return;
2830 }
2831
2832 test_basic_info(handle, __LINE__);
2833 test_no_compat(handle, __LINE__);
2834 pReleaseActCtx(handle);
2835 }
2836
2837 /* Still no compat results returned */
2838 trace("no_supportedOs\n");
2839 if(!create_manifest_file("no_supportedOs.manifest", compat_manifest_no_supportedOs, -1, NULL, NULL))
2840 {
2841 skip("Could not create manifest file\n");
2842 return;
2843 }
2844 handle = test_create("no_supportedOs.manifest");
2845 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2846 DeleteFileA("no_supportedOs.manifest");
2848 {
2849 test_basic_info(handle, __LINE__);
2850 test_no_compat(handle, __LINE__);
2851 pReleaseActCtx(handle);
2852 }
2853
2854 /* Just one result returned */
2855 trace("manifest_vista\n");
2856 if(!create_manifest_file("manifest_vista.manifest", compat_manifest_vista, -1, NULL, NULL))
2857 {
2858 skip("Could not create manifest file\n");
2859 return;
2860 }
2861 handle = test_create("manifest_vista.manifest");
2862 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2863 DeleteFileA("manifest_vista.manifest");
2865 {
2866 static const GUID* expect_manifest[] =
2867 {
2868 &VISTA_COMPAT_GUID
2869 };
2870 test_basic_info(handle, __LINE__);
2871 test_with_compat(handle, 1, expect_manifest, __LINE__);
2872 pReleaseActCtx(handle);
2873 }
2874
2875 /* Show that the order is retained */
2876 trace("manifest_vista_7_8_10_81\n");
2877 if(!create_manifest_file("manifest_vista_7_8_10_81.manifest", compat_manifest_vista_7_8_10_81, -1, NULL, NULL))
2878 {
2879 skip("Could not create manifest file\n");
2880 return;
2881 }
2882 handle = test_create("manifest_vista_7_8_10_81.manifest");
2883 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2884 DeleteFileA("manifest_vista_7_8_10_81.manifest");
2886 {
2887 static const GUID* expect_manifest[] =
2888 {
2889 &VISTA_COMPAT_GUID,
2890 &WIN7_COMPAT_GUID,
2891 &WIN8_COMPAT_GUID,
2892 &WIN10_COMPAT_GUID,
2893 &WIN81_COMPAT_GUID,
2894 };
2895 test_basic_info(handle, __LINE__);
2896 test_with_compat(handle, 5, expect_manifest, __LINE__);
2897 pReleaseActCtx(handle);
2898 }
2899
2900 /* Show that even unknown GUID's are stored */
2901 trace("manifest_other_guid\n");
2902 if(!create_manifest_file("manifest_other_guid.manifest", compat_manifest_other_guid, -1, NULL, NULL))
2903 {
2904 skip("Could not create manifest file\n");
2905 return;
2906 }
2907 handle = test_create("manifest_other_guid.manifest");
2908 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
2909 DeleteFileA("manifest_other_guid.manifest");
2911 {
2912 static const GUID* expect_manifest[] =
2913 {
2914 &OTHER_COMPAT_GUID,
2915 };
2916 test_basic_info(handle, __LINE__);
2917 test_with_compat(handle, 1, expect_manifest, __LINE__);
2918 pReleaseActCtx(handle);
2919 }
2920}
static void test_no_compat(HANDLE handle, int line)
Definition: actctx.c:2755
static const char compat_manifest_no_supportedOs[]
Definition: actctx.c:405
static void test_with_compat(HANDLE handle, DWORD num_compat, const GUID *expected_compat[], int line)
Definition: actctx.c:2771
static const char compat_manifest_vista[]
Definition: actctx.c:414
static const char compat_manifest_vista_7_8_10_81[]
Definition: actctx.c:424
static const char compat_manifest_other_guid[]
Definition: actctx.c:438

Referenced by START_TEST().

◆ test_create()

static HANDLE test_create ( const char file)
static

Definition at line 924 of file actctx.c.

925{
926 ACTCTXW actctx;
929
931 memset(&actctx, 0, sizeof(ACTCTXW));
932 actctx.cbSize = sizeof(ACTCTXW);
933 actctx.lpSource = path;
934
935 handle = pCreateActCtxW(&actctx);
936 /* to be tested outside of this helper, including last error */
937 if (handle == INVALID_HANDLE_VALUE) return handle;
938
939 ok(actctx.cbSize == sizeof(actctx), "actctx.cbSize=%d\n", actctx.cbSize);
940 ok(actctx.dwFlags == 0, "actctx.dwFlags=%d\n", actctx.dwFlags);
941 ok(actctx.lpSource == path, "actctx.lpSource=%p\n", actctx.lpSource);
942 ok(actctx.wProcessorArchitecture == 0,
943 "actctx.wProcessorArchitecture=%d\n", actctx.wProcessorArchitecture);
944 ok(actctx.wLangId == 0, "actctx.wLangId=%d\n", actctx.wLangId);
945 ok(actctx.lpAssemblyDirectory == NULL,
946 "actctx.lpAssemblyDirectory=%p\n", actctx.lpAssemblyDirectory);
947 ok(actctx.lpResourceName == NULL, "actctx.lpResourceName=%p\n", actctx.lpResourceName);
948 ok(actctx.lpApplicationName == NULL, "actctx.lpApplicationName=%p\n",
949 actctx.lpApplicationName);
950 ok(actctx.hModule == NULL, "actctx.hModule=%p\n", actctx.hModule);
951
952 return handle;
953}
#define actctx
Definition: kernel32.h:8

◆ 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 955 of file actctx.c.

956{
957 ACTCTXW actctx;
960
961 MultiByteToWideChar( CP_ACP, 0, "bad.manifest", -1, path, MAX_PATH );
962 memset(&actctx, 0, sizeof(ACTCTXW));
963 actctx.cbSize = sizeof(ACTCTXW);
964 actctx.lpSource = path;
965
966 create_manifest_file("bad.manifest", manifest, -1, "testdep.manifest", depmanifest);
967 handle = pCreateActCtxW(&actctx);
969 {
970 if (is_broken)
972 "Unexpected context handle %p.\n", handle);
973 else
974 ok(handle == INVALID_HANDLE_VALUE, "Unexpected context handle %p.\n", handle);
975
977 ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "Unexpected error %d.\n", GetLastError());
978 }
979 if (handle != INVALID_HANDLE_VALUE) pReleaseActCtx( handle );
980 DeleteFileA("bad.manifest");
981 DeleteFileA("testdep.manifest");
982}
BOOL todo
Definition: filedlg.c:313
#define todo_wine_if(is_todo)
Definition: custom.c:86
#define ERROR_SXS_CANT_GEN_ACTCTX
Definition: winerror.h:2142

Referenced by test_create_fail().

◆ test_create_fail()

static void test_create_fail ( void  )
static

Definition at line 1004 of file actctx.c.

1005{
1006 ACTCTXW actctx;
1007 HANDLE handle;
1009
1010 MultiByteToWideChar( CP_ACP, 0, "nonexistent.manifest", -1, path, MAX_PATH );
1011 memset(&actctx, 0, sizeof(ACTCTXW));
1012 actctx.cbSize = sizeof(ACTCTXW);
1013 actctx.lpSource = path;
1014
1015 handle = pCreateActCtxW(&actctx);
1016 ok(handle == INVALID_HANDLE_VALUE, "handle != INVALID_HANDLE_VALUE\n");
1017 ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError == %u\n", GetLastError());
1018
1019 trace("wrong_manifest1\n");
1021 trace("wrong_manifest2\n");
1023 trace("wrong_manifest3\n");
1025 trace("wrong_manifest4\n");
1027 trace("wrong_manifest5\n");
1029 trace("wrong_manifest6\n");
1031 trace("wrong_manifest7\n");
1033 trace("wrong_manifest8\n");
1035 trace("wrong_manifest9\n");
1037 trace("wrong_manifest10\n");
1039 trace("UTF-16 manifest1 without BOM\n");
1041 trace("manifest2\n");
1043 trace("manifest2+depmanifest1\n");
1045}
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static const char wrong_manifest2[]
Definition: actctx.c:329
static const char wrong_manifest1[]
Definition: actctx.c:324
static const char wrong_manifest7[]
Definition: actctx.c:356
static const char wrong_manifest9[]
Definition: actctx.c:368
static const char wrong_manifest10[]
Definition: actctx.c:381
static void test_create_and_fail(const char *manifest, const char *depmanifest, int todo, BOOL is_broken)
Definition: actctx.c:955
static const char wrong_manifest4[]
Definition: actctx.c:339
static const char wrong_manifest6[]
Definition: actctx.c:351
static const char wrong_manifest5[]
Definition: actctx.c:345
static const char wrong_manifest8[]
Definition: actctx.c:362
static const char wrong_manifest3[]
Definition: actctx.c:334
static const char wrong_depmanifest1[]
Definition: actctx.c:400
static void test_create_wide_and_fail(const char *manifest, BOOL fBOM)
Definition: actctx.c:984

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 984 of file actctx.c.

985{
986 ACTCTXW actctx;
989
990 MultiByteToWideChar( CP_ACP, 0, "bad.manifest", -1, path, MAX_PATH );
991 memset(&actctx, 0, sizeof(ACTCTXW));
992 actctx.cbSize = sizeof(ACTCTXW);
993 actctx.lpSource = path;
994
995 create_wide_manifest("bad.manifest", manifest, fBOM, FALSE);
996 handle = pCreateActCtxW(&actctx);
997 ok(handle == INVALID_HANDLE_VALUE, "handle != INVALID_HANDLE_VALUE\n");
998 ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "GetLastError == %u\n", GetLastError());
999
1000 if (handle != INVALID_HANDLE_VALUE) pReleaseActCtx( handle );
1001 DeleteFileA("bad.manifest");
1002}

Referenced by test_create_fail().

◆ test_CreateActCtx()

static void test_CreateActCtx ( void  )
static

Definition at line 2524 of file actctx.c.

2525{
2527 ACTCTXA actctx;
2528 HANDLE handle;
2529
2530 GetTempPathA(sizeof(path)/sizeof(CHAR), path);
2531 strcat(path, "main_wndcls.manifest");
2532
2533 write_manifest("testdep1.manifest", manifest_wndcls1);
2534 write_manifest("testdep2.manifest", manifest_wndcls2);
2535 write_manifest("main_wndcls.manifest", manifest_wndcls_main);
2536
2537 memset(&actctx, 0, sizeof(ACTCTXA));
2538 actctx.cbSize = sizeof(ACTCTXA);
2539 actctx.lpSource = path;
2540
2541 /* create using lpSource without specified directory */
2542 handle = pCreateActCtxA(&actctx);
2543 ok(handle != INVALID_HANDLE_VALUE, "failed to generate context, error %u\n", GetLastError());
2544 pReleaseActCtx(handle);
2545
2546 /* with specified directory, that doesn't contain dependent assembly */
2547 GetWindowsDirectoryA(dir, sizeof(dir)/sizeof(CHAR));
2548
2549 memset(&actctx, 0, sizeof(ACTCTXA));
2550 actctx.cbSize = sizeof(ACTCTXA);
2551 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
2552 actctx.lpAssemblyDirectory = dir;
2553 actctx.lpSource = path;
2554
2555 SetLastError(0xdeadbeef);
2556 handle = pCreateActCtxA(&actctx);
2557todo_wine {
2558 ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle);
2559 ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "got error %d\n", GetLastError());
2560}
2561 if (handle != INVALID_HANDLE_VALUE) pReleaseActCtx(handle);
2562
2563 delete_manifest_file("main_wndcls.manifest");
2564 delete_manifest_file("testdep1.manifest");
2565 delete_manifest_file("testdep2.manifest");
2566
2567 /* ACTCTX_FLAG_HMODULE_VALID but hModule is not set */
2568 memset(&actctx, 0, sizeof(ACTCTXA));
2569 actctx.cbSize = sizeof(ACTCTXA);
2570 actctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID;
2571 SetLastError(0xdeadbeef);
2572 handle = pCreateActCtxA(&actctx);
2573 ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle);
2576 "got error %d\n", GetLastError());
2577
2578 /* create from HMODULE - resource doesn't exist, lpSource is set */
2579 memset(&actctx, 0, sizeof(ACTCTXA));
2580 actctx.cbSize = sizeof(ACTCTXA);
2581 actctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
2582 actctx.lpSource = "dummyfile.dll";
2583 actctx.lpResourceName = MAKEINTRESOURCEA(20);
2584 actctx.hModule = GetModuleHandleA(NULL);
2585
2586 SetLastError(0xdeadbeef);
2587 handle = pCreateActCtxA(&actctx);
2588 ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle);
2589 ok(GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "got error %d\n", GetLastError());
2590
2591 /* load manifest from lpAssemblyDirectory directory */
2592 write_manifest("testdir.manifest", manifest1);
2593 GetTempPathA(sizeof(path)/sizeof(path[0]), path);
2595 strcat(path, "assembly_dir");
2596 strcpy(dir, path);
2597 strcat(path, "\\testdir.manifest");
2598
2599 memset(&actctx, 0, sizeof(actctx));
2600 actctx.cbSize = sizeof(actctx);
2601 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
2602 actctx.lpSource = "testdir.manifest";
2603 actctx.lpAssemblyDirectory = dir;
2604
2605 SetLastError(0xdeadbeef);
2606 handle = pCreateActCtxA(&actctx);
2607 ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle);
2610 "got error %d\n", GetLastError());
2611
2613 memset(&actctx, 0, sizeof(actctx));
2614 actctx.cbSize = sizeof(actctx);
2615 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
2616 actctx.lpSource = "testdir.manifest";
2617 actctx.lpAssemblyDirectory = dir;
2618
2619 SetLastError(0xdeadbeef);
2620 handle = pCreateActCtxA(&actctx);
2621 ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle);
2622 ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %d\n", GetLastError());
2624
2625 write_manifest("assembly_dir\\testdir.manifest", manifest1);
2626 memset(&actctx, 0, sizeof(actctx));
2627 actctx.cbSize = sizeof(actctx);
2628 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
2629 actctx.lpSource = "testdir.manifest";
2630 actctx.lpAssemblyDirectory = dir;
2631
2632 handle = pCreateActCtxA(&actctx);
2633 ok(handle != INVALID_HANDLE_VALUE, "got handle %p\n", handle);
2634 pReleaseActCtx(handle);
2635
2636 memset(&actctx, 0, sizeof(actctx));
2637 actctx.cbSize = sizeof(actctx);
2638 actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
2639 actctx.lpSource = path;
2640 actctx.lpAssemblyDirectory = dir;
2641
2642 handle = pCreateActCtxA(&actctx);
2643 ok(handle != INVALID_HANDLE_VALUE, "got handle %p\n", handle);
2644 pReleaseActCtx(handle);
2645
2646 delete_manifest_file("testdir.manifest");
2647 delete_manifest_file("assembly_dir\\testdir.manifest");
2649}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int dir
Definition: maze.c:112
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2337
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
Definition: path.c:2206
static void write_manifest(const char *filename, const char *manifest)
Definition: actctx.c:2500
static const char manifest_wndcls1[]
Definition: actctx.c:183
static const char manifest_wndcls2[]
Definition: actctx.c:194
static void delete_manifest_file(const char *filename)
Definition: actctx.c:2515
static const char manifest_wndcls_main[]
Definition: actctx.c:208
#define todo_wine
Definition: custom.c:89
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define ERROR_RESOURCE_TYPE_NOT_FOUND
Definition: winerror.h:1120
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581

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 575 of file actctx.c.

576{
577 ACTIVATION_CONTEXT_DETAILED_INFORMATION detailed_info_tmp, *detailed_info;
578 SIZE_T size, exsize, retsize;
579 BOOL b;
580
581 exsize = sizeof(ACTIVATION_CONTEXT_DETAILED_INFORMATION)
582 + (exinfo->root_manifest_path ? (lstrlenW(exinfo->root_manifest_path)+1)*sizeof(WCHAR):0)
583 + (exinfo->app_dir ? (lstrlenW(exinfo->app_dir)+1)*sizeof(WCHAR) : 0);
584
585 if(exsize != sizeof(ACTIVATION_CONTEXT_DETAILED_INFORMATION)) {
586 size = 0xdeadbeef;
587 b = pQueryActCtxW(0, handle, NULL,
588 ActivationContextDetailedInformation, &detailed_info_tmp,
589 sizeof(detailed_info_tmp), &size);
590 ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n");
591 ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError());
592 ok_(__FILE__, line)(size == exsize, "size=%ld, expected %ld\n", size, exsize);
593 }else {
594 size = sizeof(ACTIVATION_CONTEXT_DETAILED_INFORMATION);
595 }
596
597 detailed_info = HeapAlloc(GetProcessHeap(), 0, size);
598 memset(detailed_info, 0xfe, size);
599 b = pQueryActCtxW(0, handle, NULL,
600 ActivationContextDetailedInformation, detailed_info,
601 size, &retsize);
602 ok_(__FILE__, line)(b, "QueryActCtx failed: %u\n", GetLastError());
603 ok_(__FILE__, line)(retsize == exsize, "size=%ld, expected %ld\n", retsize, exsize);
604
605 ok_(__FILE__, line)(detailed_info->dwFlags == 0, "detailed_info->dwFlags=%x\n", detailed_info->dwFlags);
606 ok_(__FILE__, line)(detailed_info->ulFormatVersion == exinfo->format_version,
607 "detailed_info->ulFormatVersion=%u, expected %u\n", detailed_info->ulFormatVersion,
608 exinfo->format_version);
609 ok_(__FILE__, line)(exinfo->assembly_cnt_min <= detailed_info->ulAssemblyCount &&
610 detailed_info->ulAssemblyCount <= exinfo->assembly_cnt_max,
611 "detailed_info->ulAssemblyCount=%u, expected between %u and %u\n", detailed_info->ulAssemblyCount,
612 exinfo->assembly_cnt_min, exinfo->assembly_cnt_max);
613 ok_(__FILE__, line)(detailed_info->ulRootManifestPathType == exinfo->root_manifest_type,
614 "detailed_info->ulRootManifestPathType=%u, expected %u\n",
615 detailed_info->ulRootManifestPathType, exinfo->root_manifest_type);
616 ok_(__FILE__, line)(detailed_info->ulRootManifestPathChars ==
617 (exinfo->root_manifest_path ? lstrlenW(exinfo->root_manifest_path) : 0),
618 "detailed_info->ulRootManifestPathChars=%u, expected %u\n",
619 detailed_info->ulRootManifestPathChars,
620 exinfo->root_manifest_path ?lstrlenW(exinfo->root_manifest_path) : 0);
621 ok_(__FILE__, line)(detailed_info->ulRootConfigurationPathType == exinfo->root_config_type,
622 "detailed_info->ulRootConfigurationPathType=%u, expected %u\n",
623 detailed_info->ulRootConfigurationPathType, exinfo->root_config_type);
624 ok_(__FILE__, line)(detailed_info->ulRootConfigurationPathChars == 0,
625 "detailed_info->ulRootConfigurationPathChars=%d\n", detailed_info->ulRootConfigurationPathChars);
626 ok_(__FILE__, line)(detailed_info->ulAppDirPathType == exinfo->app_dir_type,
627 "detailed_info->ulAppDirPathType=%u, expected %u\n", detailed_info->ulAppDirPathType,
628 exinfo->app_dir_type);
629 ok_(__FILE__, line)(detailed_info->ulAppDirPathChars == (exinfo->app_dir ? lstrlenW(exinfo->app_dir) : 0),
630 "detailed_info->ulAppDirPathChars=%u, expected %u\n",
631 detailed_info->ulAppDirPathChars, exinfo->app_dir ? lstrlenW(exinfo->app_dir) : 0);
632 if(exinfo->root_manifest_path) {
633 ok_(__FILE__, line)(detailed_info->lpRootManifestPath != NULL, "detailed_info->lpRootManifestPath == NULL\n");
634 if(detailed_info->lpRootManifestPath)
635 ok_(__FILE__, line)(!lstrcmpiW(detailed_info->lpRootManifestPath, exinfo->root_manifest_path),
636 "unexpected detailed_info->lpRootManifestPath\n");
637 }else {
638 ok_(__FILE__, line)(detailed_info->lpRootManifestPath == NULL, "detailed_info->lpRootManifestPath != NULL\n");
639 }
640 ok_(__FILE__, line)(detailed_info->lpRootConfigurationPath == NULL,
641 "detailed_info->lpRootConfigurationPath=%p\n", detailed_info->lpRootConfigurationPath);
642 if(exinfo->app_dir) {
643 ok_(__FILE__, line)(detailed_info->lpAppDirPath != NULL, "detailed_info->lpAppDirPath == NULL\n");
644 if(detailed_info->lpAppDirPath)
645 ok_(__FILE__, line)(!lstrcmpiW(exinfo->app_dir, detailed_info->lpAppDirPath),
646 "unexpected detailed_info->lpAppDirPath\n%s\n",strw(detailed_info->lpAppDirPath));
647 }else {
648 ok_(__FILE__, line)(detailed_info->lpAppDirPath == NULL, "detailed_info->lpAppDirPath != NULL\n");
649 }
650
651 HeapFree(GetProcessHeap(), 0, detailed_info);
652}
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
ULONG assembly_cnt_max
Definition: actctx.c:544
LPWSTR root_manifest_path
Definition: actctx.c:546
ULONG assembly_cnt_min
Definition: actctx.c:543
ULONG root_manifest_type
Definition: actctx.c:545
ULONG app_dir_type
Definition: actctx.c:548
LPCWSTR app_dir
Definition: actctx.c:549
ULONG root_config_type
Definition: actctx.c:547
ULONG format_version
Definition: actctx.c:542

Referenced by test_actctx(), and test_app_manifest().

◆ test_dllredirect_section()

static void test_dllredirect_section ( void  )
static

Definition at line 1823 of file actctx.c.

1824{
1825 static const WCHAR testlib1W[] = {'t','e','s','t','l','i','b','1','.','d','l','l',0};
1826 static const WCHAR testlib2W[] = {'t','e','s','t','l','i','b','2','.','d','l','l',0};
1827 ACTCTX_SECTION_KEYED_DATA data, data2;
1828 struct strsection_header *section;
1830 HANDLE handle;
1831 BOOL ret;
1832
1833 /* use two dependent manifests, 4 'files' total */
1834 create_manifest_file("testdep1.manifest", manifest_wndcls1, -1, NULL, NULL);
1835 create_manifest_file("testdep2.manifest", manifest_wndcls2, -1, NULL, NULL);
1836 create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL);
1837
1838 handle = test_create("main_wndcls.manifest");
1839 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
1840
1841 DeleteFileA("testdep1.manifest");
1842 DeleteFileA("testdep2.manifest");
1843 DeleteFileA("main_wndcls.manifest");
1844
1845 ret = pActivateActCtx(handle, &cookie);
1846 ok(ret, "ActivateActCtx failed: %u\n", GetLastError());
1847
1848 memset(&data, 0, sizeof(data));
1849 memset(&data2, 0, sizeof(data2));
1850 data.cbSize = sizeof(data);
1851 data2.cbSize = sizeof(data2);
1852
1853 /* get data for two files from different assemblies */
1854 ret = pFindActCtxSectionStringW(0, NULL,
1855 ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
1856 testlib1W, &data);
1857 ok(ret, "got %d\n", ret);
1858 ret = pFindActCtxSectionStringW(0, NULL,
1859 ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
1860 testlib2W, &data2);
1861 ok(ret, "got %d\n", ret);
1862
1863 section = (struct strsection_header*)data.lpSectionBase;
1864 ok(section->count == 4, "got %d\n", section->count);
1865 ok(section->size == sizeof(*section), "got %d\n", section->size);
1866
1867 /* For both string same section is returned, meaning it's one dll redirect section per context */
1868 ok(data.lpSectionBase == data2.lpSectionBase, "got %p, %p\n", data.lpSectionBase, data2.lpSectionBase);
1869 ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %u, %u\n", data.ulSectionTotalLength,
1870 data2.ulSectionTotalLength);
1871
1872 ret = pDeactivateActCtx(0, cookie);
1873 ok(ret, "DeactivateActCtx failed: %u\n", GetLastError());
1874
1875 pReleaseActCtx(handle);
1876}
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 829 of file actctx.c.

830{
831 ASSEMBLY_FILE_DETAILED_INFORMATION *info, info_tmp;
832 ACTIVATION_CONTEXT_QUERY_INDEX index = {assid, fileid};
833 SIZE_T size, exsize;
834 BOOL b;
835
836 exsize = sizeof(ASSEMBLY_FILE_DETAILED_INFORMATION)
837 +(lstrlenW(filename)+1)*sizeof(WCHAR);
838
839 size = 0xdeadbeef;
840 b = pQueryActCtxW(0, handle, &index,
841 FileInformationInAssemblyOfAssemblyInActivationContext, &info_tmp,
842 sizeof(info_tmp), &size);
843 ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n");
844 ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError());
845 ok_(__FILE__, line)(size == exsize, "size=%lu, expected %lu\n", size, exsize);
846
847 if(size == 0xdeadbeef)
848 {
849 skip("bad size\n");
850 return;
851 }
852
854 memset(info, 0xfe, size);
855
856 b = pQueryActCtxW(0, handle, &index,
857 FileInformationInAssemblyOfAssemblyInActivationContext, info, size, &size);
858 ok_(__FILE__, line)(b, "QueryActCtx failed: %u\n", GetLastError());
859 ok_(__FILE__, line)(!size, "size=%lu, expected 0\n", size);
860
861 ok_(__FILE__, line)(info->ulFlags == 2, "info->ulFlags=%x, expected 2\n", info->ulFlags);
862 ok_(__FILE__, line)(info->ulFilenameLength == lstrlenW(filename)*sizeof(WCHAR),
863 "info->ulFilenameLength=%u, expected %u*sizeof(WCHAR)\n",
864 info->ulFilenameLength, lstrlenW(filename));
865 ok_(__FILE__, line)(info->ulPathLength == 0, "info->ulPathLength=%u\n", info->ulPathLength);
866 ok_(__FILE__, line)(info->lpFileName != NULL, "info->lpFileName == NULL\n");
867 if(info->lpFileName)
868 ok_(__FILE__, line)(!lstrcmpiW(info->lpFileName, filename), "unexpected info->lpFileName\n");
869 ok_(__FILE__, line)(info->lpFilePath == NULL, "info->lpFilePath != NULL\n");
871}
GLuint index
Definition: glext.h:6031

◆ 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 1414 of file actctx.c.

1415{
1416 struct comclassredirect_data *comclass, *comclass2;
1417 ACTCTX_SECTION_KEYED_DATA data, data2;
1418 struct guidsection_header *header;
1419 BOOL ret;
1420
1421 memset(&data, 0xfe, sizeof(data));
1422 data.cbSize = sizeof(data);
1423
1424 ret = pFindActCtxSectionGuid(0, NULL,
1425 ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION,
1426 clsid, &data);
1427 if (!ret)
1428 {
1429 skip("failed for guid %s\n", wine_dbgstr_guid(clsid));
1430 return;
1431 }
1432 ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError());
1433
1434 comclass = (struct comclassredirect_data*)data.lpData;
1435
1436 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
1437 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
1438 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1439 ok_(__FILE__, line)(comclass->size == sizeof(*comclass), "got %d for header size\n", comclass->size);
1440 if (data.lpData && comclass->size == sizeof(*comclass))
1441 {
1442 WCHAR *ptr;
1443 ULONG len;
1444
1445 ok_(__FILE__, line)(comclass->res == 0, "got res as %d\n", comclass->res);
1446 ok_(__FILE__, line)(comclass->res1[0] == 0, "got res1[0] as %02x\n", comclass->res1[0]);
1447 ok_(__FILE__, line)(comclass->res1[1] == 0, "got res1[1] as %02x\n", comclass->res1[1]);
1448 ok_(__FILE__, line)(comclass->model == ThreadingModel_Neutral, "got model %d\n", comclass->model);
1449 ok_(__FILE__, line)(IsEqualGUID(&comclass->clsid, clsid), "got wrong clsid %s\n", wine_dbgstr_guid(&comclass->clsid));
1450 ok_(__FILE__, line)(IsEqualGUID(&comclass->clsid2, clsid), "got wrong clsid2 %s\n", wine_dbgstr_guid(&comclass->clsid2));
1451 if (tlid)
1452 ok_(__FILE__, line)(IsEqualGUID(&comclass->tlid, tlid), "got wrong tlid %s\n", wine_dbgstr_guid(&comclass->tlid));
1453 ok_(__FILE__, line)(comclass->name_len > 0, "got modulename len %d\n", comclass->name_len);
1454
1455 if (progid)
1456 {
1457 len = comclass->size + comclass->clrdata_len;
1458 ok_(__FILE__, line)(comclass->progid_offset == len, "got progid offset %d, expected %d\n", comclass->progid_offset, len);
1459 }
1460 else
1461 ok_(__FILE__, line)(comclass->progid_offset == 0, "got progid offset %d, expected 0\n", comclass->progid_offset);
1462
1463 if (comclass->progid_offset)
1464 {
1465 ptr = (WCHAR*)((BYTE*)comclass + comclass->progid_offset);
1466 ok_(__FILE__, line)(!lstrcmpW(ptr, progid), "got wrong progid %s, expected %s\n", wine_dbgstr_w(ptr), wine_dbgstr_w(progid));
1467 ok_(__FILE__, line)(lstrlenW(progid)*sizeof(WCHAR) == comclass->progid_len,
1468 "got progid name length %d\n", comclass->progid_len);
1469 }
1470
1471 /* data length is simply header length + string data length including nulls */
1472 len = comclass->size + comclass->clrdata_len;
1473 if (comclass->progid_len) len += comclass->progid_len + sizeof(WCHAR);
1474 ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %d, expected %d\n", data.ulLength, len);
1475
1476 /* keyed data structure doesn't include module name, it's available from section data */
1477 ok_(__FILE__, line)(data.ulSectionTotalLength > comclass->name_offset, "got wrong offset %d\n", comclass->name_offset);
1478
1479 /* check misc fields are set */
1480 if (comclass->miscmask)
1481 {
1482 if (comclass->miscmask & MiscStatus)
1483 ok_(__FILE__, line)(comclass->miscstatus != 0, "got miscstatus 0x%08x\n", comclass->miscstatus);
1484 if (comclass->miscmask & MiscStatusIcon)
1485 ok_(__FILE__, line)(comclass->miscstatusicon != 0, "got miscstatusicon 0x%08x\n", comclass->miscstatusicon);
1486 if (comclass->miscmask & MiscStatusContent)
1487 ok_(__FILE__, line)(comclass->miscstatuscontent != 0, "got miscstatuscontent 0x%08x\n", comclass->miscstatuscontent);
1488 if (comclass->miscmask & MiscStatusThumbnail)
1489 ok_(__FILE__, line)(comclass->miscstatusthumbnail != 0, "got miscstatusthumbnail 0x%08x\n", comclass->miscstatusthumbnail);
1490 if (comclass->miscmask & MiscStatusDocPrint)
1491 ok_(__FILE__, line)(comclass->miscstatusdocprint != 0, "got miscstatusdocprint 0x%08x\n", comclass->miscstatusdocprint);
1492 }
1493
1494 /* part used for clrClass only */
1495 if (comclass->clrdata_len)
1496 {
1497 static const WCHAR mscoreeW[] = {'M','S','C','O','R','E','E','.','D','L','L',0};
1498 static const WCHAR mscoree2W[] = {'m','s','c','o','r','e','e','.','d','l','l',0};
1499 struct clrclass_data *clrclass;
1500 WCHAR *ptrW;
1501
1502 clrclass = (struct clrclass_data*)((BYTE*)data.lpData + comclass->clrdata_offset);
1503 ok_(__FILE__, line)(clrclass->size == sizeof(*clrclass), "clrclass: got size %d\n", clrclass->size);
1504 ok_(__FILE__, line)(clrclass->res[0] == 0, "clrclass: got res[0]=0x%08x\n", clrclass->res[0]);
1505 ok_(__FILE__, line)(clrclass->res[1] == 2, "clrclass: got res[1]=0x%08x\n", clrclass->res[1]);
1506 ok_(__FILE__, line)(clrclass->module_len == lstrlenW(mscoreeW)*sizeof(WCHAR), "clrclass: got module len %d\n", clrclass->module_len);
1507 ok_(__FILE__, line)(clrclass->module_offset > 0, "clrclass: got module offset %d\n", clrclass->module_offset);
1508
1509 ok_(__FILE__, line)(clrclass->name_len > 0, "clrclass: got name len %d\n", clrclass->name_len);
1510 ok_(__FILE__, line)(clrclass->name_offset == clrclass->size, "clrclass: got name offset %d\n", clrclass->name_offset);
1511 ok_(__FILE__, line)(clrclass->version_len > 0, "clrclass: got version len %d\n", clrclass->version_len);
1512 ok_(__FILE__, line)(clrclass->version_offset > 0, "clrclass: got version offset %d\n", clrclass->version_offset);
1513
1514 ok_(__FILE__, line)(clrclass->res2[0] == 0, "clrclass: got res2[0]=0x%08x\n", clrclass->res2[0]);
1515 ok_(__FILE__, line)(clrclass->res2[1] == 0, "clrclass: got res2[1]=0x%08x\n", clrclass->res2[1]);
1516
1517 /* clrClass uses mscoree.dll as module name, but in two variants - comclass data points to module name
1518 in lower case, clsclass subsection - in upper case */
1519 ok_(__FILE__, line)(comclass->name_len == lstrlenW(mscoree2W)*sizeof(WCHAR), "clrclass: got com name len %d\n", comclass->name_len);
1520 ok_(__FILE__, line)(comclass->name_offset > 0, "clrclass: got name offset %d\n", clrclass->name_offset);
1521
1522 ptrW = (WCHAR*)((BYTE*)data.lpSectionBase + comclass->name_offset);
1523 ok_(__FILE__, line)(!lstrcmpW(ptrW, mscoreeW), "clrclass: module name %s\n", wine_dbgstr_w(ptrW));
1524
1525 ptrW = (WCHAR*)((BYTE*)data.lpSectionBase + clrclass->module_offset);
1526 ok_(__FILE__, line)(!lstrcmpW(ptrW, mscoree2W), "clrclass: module name2 %s\n", wine_dbgstr_w(ptrW));
1527 }
1528 }
1529
1530 header = (struct guidsection_header*)data.lpSectionBase;
1531 ok_(__FILE__, line)(data.lpSectionGlobalData == ((BYTE*)header + header->names_offset), "data.lpSectionGlobalData == NULL\n");
1532 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == header->names_len, "data.ulSectionGlobalDataLength=%u\n",
1533 data.ulSectionGlobalDataLength);
1534 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1535 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n",
1536 data.ulSectionTotalLength);
1537 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1538 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
1539 data.ulAssemblyRosterIndex, exid);
1540
1541 /* generated guid for this class works as key guid in search */
1542 memset(&data2, 0xfe, sizeof(data2));
1543 data2.cbSize = sizeof(data2);
1544 ret = pFindActCtxSectionGuid(0, NULL,
1545 ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION,
1546 &comclass->alias, &data2);
1547 ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError());
1548
1549 comclass2 = (struct comclassredirect_data*)data2.lpData;
1550 ok_(__FILE__, line)(comclass->size == comclass2->size, "got wrong data length %d, expected %d\n", comclass2->size, comclass->size);
1551 ok_(__FILE__, line)(!memcmp(comclass, comclass2, comclass->size), "got wrong data\n");
1552}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define progid(str)
Definition: exdisp.idl:31
GLenum GLsizei len
Definition: glext.h:6722
#define wine_dbgstr_w
Definition: kernel32.h:34
REFCLSID clsid
Definition: msctf.c:82
#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:741
static const WCHAR mscoreeW[]
Definition: actctx.c:740
ULONG module_len
Definition: sxs.c:92
DWORD res2[2]
Definition: sxs.c:98
DWORD res[2]
Definition: sxs.c:91
ULONG size
Definition: sxs.c:90
ULONG version_offset
Definition: sxs.c:97
ULONG name_offset
Definition: sxs.c:95
ULONG module_offset
Definition: sxs.c:93
ULONG name_len
Definition: sxs.c:94
ULONG version_len
Definition: sxs.c:96
DWORD miscstatusdocprint
Definition: compobj.c:128
DWORD miscstatusthumbnail
Definition: compobj.c:126
uint32_t ULONG
Definition: typedefs.h:59
unsigned char BYTE
Definition: xxhash.c:193

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 1127 of file actctx.c.

1128{
1129 ACTCTX_SECTION_KEYED_DATA data;
1130 BOOL ret;
1131
1132 memset(&data, 0xfe, sizeof(data));
1133 data.cbSize = sizeof(data);
1134
1135 ret = pFindActCtxSectionStringW(0, NULL,
1136 ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
1137 libname, &data);
1138 ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError());
1139 if (!ret) return;
1140
1141 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
1142 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
1143 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1144 ok_(__FILE__, line)(data.ulLength == 20, "data.ulLength=%u\n", data.ulLength);
1145
1146 if (data.lpData)
1147 {
1148 struct dllredirect_data *dlldata = (struct dllredirect_data*)data.lpData;
1149 ok_(__FILE__, line)(dlldata->size == data.ulLength, "got wrong size %d\n", dlldata->size);
1150 ok_(__FILE__, line)(dlldata->unk == 2, "got wrong field value %d\n", dlldata->unk);
1151 ok_(__FILE__, line)(dlldata->res[0] == 0, "got wrong res[0] value %d\n", dlldata->res[0]);
1152 ok_(__FILE__, line)(dlldata->res[1] == 0, "got wrong res[1] value %d\n", dlldata->res[1]);
1153 ok_(__FILE__, line)(dlldata->res[2] == 0, "got wrong res[2] value %d\n", dlldata->res[2]);
1154 }
1155
1156 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1157 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
1158 data.ulSectionGlobalDataLength);
1159 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1160 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n",
1161 data.ulSectionTotalLength);
1162 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1163 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
1164 data.ulAssemblyRosterIndex, exid);
1165
1166 memset(&data, 0xfe, sizeof(data));
1167 data.cbSize = sizeof(data);
1168
1169 ret = pFindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
1170 ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
1171 libname, &data);
1172 ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError());
1173 if (!ret) return;
1174
1175 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
1176 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
1177 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1178 ok_(__FILE__, line)(data.ulLength == 20, "data.ulLength=%u\n", data.ulLength);
1179 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1180 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
1181 data.ulSectionGlobalDataLength);
1182 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1183 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n",
1184 data.ulSectionTotalLength);
1185 ok_(__FILE__, line)(data.hActCtx == handle, "data.hActCtx=%p\n", data.hActCtx);
1186 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
1187 data.ulAssemblyRosterIndex, exid);
1188
1189 pReleaseActCtx(handle);
1190}

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 1572 of file actctx.c.

1574{
1575 struct ifacepsredirect_data *ifaceps;
1576 ACTCTX_SECTION_KEYED_DATA data;
1577 BOOL ret;
1578
1579 memset(&data, 0xfe, sizeof(data));
1580 data.cbSize = sizeof(data);
1581
1582 ret = pFindActCtxSectionGuid(0, NULL,
1583 ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION,
1584 iid, &data);
1585 ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError());
1586
1587 ifaceps = (struct ifacepsredirect_data*)data.lpData;
1588
1589 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
1590 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
1591 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1592 ok_(__FILE__, line)(ifaceps->size == sizeof(*ifaceps), "got %d for header size\n", ifaceps->size);
1593 if (data.lpData && ifaceps->size == sizeof(*ifaceps))
1594 {
1595 ULONG len;
1596
1597 /* for external proxy stubs it contains a value from 'proxyStubClsid32' */
1598 if (ps32)
1599 {
1600 ok_(__FILE__, line)(IsEqualGUID(&ifaceps->iid, ps32), "got wrong iid %s\n", wine_dbgstr_guid(&ifaceps->iid));
1601 }
1602 else
1603 ok_(__FILE__, line)(IsEqualGUID(&ifaceps->iid, iid), "got wrong iid %s\n", wine_dbgstr_guid(&ifaceps->iid));
1604
1605 ok_(__FILE__, line)(IsEqualGUID(&ifaceps->tlbid, tlbid), "got wrong tlid %s\n", wine_dbgstr_guid(&ifaceps->tlbid));
1606 ok_(__FILE__, line)(ifaceps->name_len > 0, "got modulename len %d\n", ifaceps->name_len);
1607 ok_(__FILE__, line)(ifaceps->name_offset == ifaceps->size, "got progid offset %d\n", ifaceps->name_offset);
1608
1609 /* data length is simply header length + string data length including nulls */
1610 len = ifaceps->size + ifaceps->name_len + sizeof(WCHAR);
1611 ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %d, expected %d\n", data.ulLength, len);
1612
1613 /* mask purpose is to indicate if attribute was specified, for testing purposes assume that manifest
1614 always has non-zero value for it */
1615 if (ifaceps->mask & NumMethods)
1616 ok_(__FILE__, line)(ifaceps->nummethods != 0, "got nummethods %d\n", ifaceps->nummethods);
1617 if (ifaceps->mask & BaseIface)
1618 ok_(__FILE__, line)(IsEqualGUID(&ifaceps->base, base), "got base %s\n", wine_dbgstr_guid(&ifaceps->base));
1619 }
1620
1621 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1622 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
1623 data.ulSectionGlobalDataLength);
1624 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1625 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n",
1626 data.ulSectionTotalLength);
1627 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1628 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
1629 data.ulAssemblyRosterIndex, exid);
1630}

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 1704 of file actctx.c.

1705{
1706 struct progidredirect_data *progiddata;
1707 struct comclassredirect_data *comclass;
1708 ACTCTX_SECTION_KEYED_DATA data, data2;
1709 struct strsection_header *header;
1710 BOOL ret;
1711
1712 memset(&data, 0xfe, sizeof(data));
1713 data.cbSize = sizeof(data);
1714
1715 ret = pFindActCtxSectionStringA(0, NULL,
1716 ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION,
1717 progid, &data);
1718 ok_(__FILE__, line)(ret, "FindActCtxSectionStringA failed: %u\n", GetLastError());
1719
1720 progiddata = (struct progidredirect_data*)data.lpData;
1721
1722 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
1723 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
1724 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1725 ok_(__FILE__, line)(progiddata->size == sizeof(*progiddata), "got %d for header size\n", progiddata->size);
1726 if (data.lpData && progiddata->size == sizeof(*progiddata))
1727 {
1728 GUID *guid;
1729
1730 ok_(__FILE__, line)(progiddata->reserved == 0, "got reserved as %d\n", progiddata->reserved);
1731 ok_(__FILE__, line)(progiddata->clsid_offset > 0, "got clsid_offset as %d\n", progiddata->clsid_offset);
1732
1733 /* progid data points to generated alias guid */
1734 guid = (GUID*)((BYTE*)data.lpSectionBase + progiddata->clsid_offset);
1735
1736 memset(&data2, 0, sizeof(data2));
1737 data2.cbSize = sizeof(data2);
1738 ret = pFindActCtxSectionGuid(0, NULL,
1739 ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION,
1740 guid, &data2);
1741 ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError());
1742
1743 comclass = (struct comclassredirect_data*)data2.lpData;
1744 ok_(__FILE__, line)(IsEqualGUID(guid, &comclass->alias), "got wrong alias referenced from progid %s, %s\n", progid, wine_dbgstr_guid(guid));
1745 ok_(__FILE__, line)(IsEqualGUID(clsid, &comclass->clsid), "got wrong class referenced from progid %s, %s\n", progid, wine_dbgstr_guid(clsid));
1746 }
1747
1748 header = (struct strsection_header*)data.lpSectionBase;
1749 ok_(__FILE__, line)(data.lpSectionGlobalData == (BYTE*)header + header->global_offset, "data.lpSectionGlobalData == NULL\n");
1750 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == header->global_len, "data.ulSectionGlobalDataLength=%u\n", data.ulSectionGlobalDataLength);
1751 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1752 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", data.ulSectionTotalLength);
1753 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1754 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
1755 data.ulAssemblyRosterIndex, exid);
1756}
const GUID * guid

Referenced by test_actctx().

◆ test_find_string_fail()

static void test_find_string_fail ( void  )
static

Definition at line 1289 of file actctx.c.

1290{
1291 ACTCTX_SECTION_KEYED_DATA data = {sizeof(data)};
1292 BOOL ret;
1293
1294 ret = pFindActCtxSectionStringW(0, NULL, 100, testlib_dll, &data);
1295 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1296 ok(GetLastError() == ERROR_SXS_SECTION_NOT_FOUND, "GetLastError()=%u\n", GetLastError());
1297
1298 ret = pFindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
1299 testlib2_dll, &data);
1300 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1301 ok(GetLastError() == ERROR_SXS_KEY_NOT_FOUND, "GetLastError()=%u\n", GetLastError());
1302
1303 ret = pFindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
1304 testlib_dll, NULL);
1305 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1306 ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%u\n", GetLastError());
1307
1308 ret = pFindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
1309 NULL, &data);
1310 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1311 ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%u\n", GetLastError());
1312
1313 data.cbSize = 0;
1314 ret = pFindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
1315 testlib_dll, &data);
1316 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1317 ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%u\n", GetLastError());
1318
1319 data.cbSize = 35;
1320 ret = pFindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
1321 testlib_dll, &data);
1322 ok(!ret, "FindActCtxSectionStringW succeeded\n");
1323 ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%u\n", GetLastError());
1324}
#define ERROR_SXS_SECTION_NOT_FOUND
Definition: winerror.h:2141

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 1643 of file actctx.c.

1645{
1646 struct clrsurrogate_data *surrogate;
1647 ACTCTX_SECTION_KEYED_DATA data;
1648 BOOL ret;
1649
1650 memset(&data, 0xfe, sizeof(data));
1651 data.cbSize = sizeof(data);
1652
1653 ret = pFindActCtxSectionGuid(0, NULL,
1654 ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES,
1655 clsid, &data);
1656 if (!ret)
1657 {
1658 skip("surrogate sections are not supported\n");
1659 return;
1660 }
1661 ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError());
1662
1663 surrogate = (struct clrsurrogate_data*)data.lpData;
1664
1665 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
1666 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
1667 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1668 ok_(__FILE__, line)(surrogate->size == sizeof(*surrogate), "got %d for header size\n", surrogate->size);
1669 if (data.lpData && surrogate->size == sizeof(*surrogate))
1670 {
1671 WCHAR *ptrW;
1672 ULONG len;
1673
1674 ok_(__FILE__, line)(surrogate->res == 0, "invalid res value %d\n", surrogate->res);
1675 ok_(__FILE__, line)(IsEqualGUID(&surrogate->clsid, clsid), "got wrong clsid %s\n", wine_dbgstr_guid(&surrogate->clsid));
1676
1677 ok_(__FILE__, line)(surrogate->version_len == lstrlenW(version)*sizeof(WCHAR), "got version len %d\n", surrogate->version_len);
1678 ok_(__FILE__, line)(surrogate->version_offset == surrogate->size, "got version offset %d\n", surrogate->version_offset);
1679
1680 ok_(__FILE__, line)(surrogate->name_len == lstrlenW(name)*sizeof(WCHAR), "got name len %d\n", surrogate->name_len);
1681 ok_(__FILE__, line)(surrogate->name_offset > surrogate->version_offset, "got name offset %d\n", surrogate->name_offset);
1682
1683 len = surrogate->size + surrogate->name_len + surrogate->version_len + 2*sizeof(WCHAR);
1684 ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %d, expected %d\n", data.ulLength, len);
1685
1686 ptrW = (WCHAR*)((BYTE*)surrogate + surrogate->name_offset);
1687 ok(!lstrcmpW(ptrW, name), "got wrong name %s\n", wine_dbgstr_w(ptrW));
1688
1689 ptrW = (WCHAR*)((BYTE*)surrogate + surrogate->version_offset);
1690 ok(!lstrcmpW(ptrW, version), "got wrong name %s\n", wine_dbgstr_w(ptrW));
1691 }
1692
1693 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1694 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
1695 data.ulSectionGlobalDataLength);
1696 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1697 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n",
1698 data.ulSectionTotalLength);
1699 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1700 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
1701 data.ulAssemblyRosterIndex, exid);
1702}
static const WCHAR version[]
Definition: asmname.c:66
ULONG version_len
Definition: actctx.c:1638
ULONG name_offset
Definition: actctx.c:1639
ULONG version_offset
Definition: actctx.c:1637
Definition: name.c:39

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 1192 of file actctx.c.

1193{
1194 struct wndclass_redirect_data *wnddata;
1195 struct strsection_header *header;
1196 ACTCTX_SECTION_KEYED_DATA data;
1197 BOOL ret;
1198
1199 memset(&data, 0xfe, sizeof(data));
1200 data.cbSize = sizeof(data);
1201
1202 ret = pFindActCtxSectionStringW(0, NULL,
1203 ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION,
1204 clsname, &data);
1205 ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u, class %s\n", GetLastError(),
1206 wine_dbgstr_w(clsname));
1207 if (!ret) return;
1208
1209 header = (struct strsection_header*)data.lpSectionBase;
1210 wnddata = (struct wndclass_redirect_data*)data.lpData;
1211
1212 ok_(__FILE__, line)(header->magic == 0x64487353, "got wrong magic 0x%08x\n", header->magic);
1213 ok_(__FILE__, line)(header->count > 0, "got count %d\n", header->count);
1214 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
1215 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
1216 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1217 ok_(__FILE__, line)(wnddata->size == sizeof(*wnddata), "got %d for header size\n", wnddata->size);
1218 if (data.lpData && wnddata->size == sizeof(*wnddata))
1219 {
1220 static const WCHAR verW[] = {'6','.','5','.','4','.','3','!',0};
1221 WCHAR buff[50];
1222 WCHAR *ptr;
1223 ULONG len;
1224
1225 ok_(__FILE__, line)(wnddata->res == 0, "got reserved as %d\n", wnddata->res);
1226 /* redirect class name (versioned or not) is stored just after header data */
1227 ok_(__FILE__, line)(wnddata->name_offset == wnddata->size, "got name offset as %d\n", wnddata->name_offset);
1228 ok_(__FILE__, line)(wnddata->module_len > 0, "got module name length as %d\n", wnddata->module_len);
1229
1230 /* expected versioned name */
1231 lstrcpyW(buff, verW);
1232 lstrcatW(buff, clsname);
1233 ptr = (WCHAR*)((BYTE*)wnddata + wnddata->name_offset);
1234 ok_(__FILE__, line)(!lstrcmpW(ptr, buff), "got wrong class name %s, expected %s\n", wine_dbgstr_w(ptr), wine_dbgstr_w(buff));
1235 ok_(__FILE__, line)(lstrlenW(ptr)*sizeof(WCHAR) == wnddata->name_len,
1236 "got wrong class name length %d, expected %d\n", wnddata->name_len, lstrlenW(ptr));
1237
1238 /* data length is simply header length + string data length including nulls */
1239 len = wnddata->size + wnddata->name_len + wnddata->module_len + 2*sizeof(WCHAR);
1240 ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %d, expected %d\n", data.ulLength, len);
1241
1242 if (data.ulSectionTotalLength > wnddata->module_offset)
1243 {
1244 WCHAR *modulename, *sectionptr;
1245
1246 /* just compare pointers */
1247 modulename = (WCHAR*)((BYTE*)wnddata + wnddata->size + wnddata->name_len + sizeof(WCHAR));
1248 sectionptr = (WCHAR*)((BYTE*)data.lpSectionBase + wnddata->module_offset);
1249 ok_(__FILE__, line)(modulename == sectionptr, "got wrong name offset %p, expected %p\n", sectionptr, modulename);
1250 }
1251 }
1252
1253 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1254 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
1255 data.ulSectionGlobalDataLength);
1256 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1257 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n",
1258 data.ulSectionTotalLength);
1259 ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
1260 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
1261 data.ulAssemblyRosterIndex, exid);
1262
1263 memset(&data, 0xfe, sizeof(data));
1264 data.cbSize = sizeof(data);
1265
1266 ret = pFindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
1267 ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION,
1268 clsname, &data);
1269 ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u, class %s\n", GetLastError(),
1270 wine_dbgstr_w(clsname));
1271 if (!ret) return;
1272
1273 ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
1274 ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
1275 ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
1276 ok_(__FILE__, line)(data.ulLength > 0, "data.ulLength=%u\n", data.ulLength);
1277 ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
1278 ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
1279 data.ulSectionGlobalDataLength);
1280 ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
1281 ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", data.ulSectionTotalLength);
1282 ok_(__FILE__, line)(data.hActCtx == handle, "data.hActCtx=%p\n", data.hActCtx);
1283 ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
1284 data.ulAssemblyRosterIndex, exid);
1285
1286 pReleaseActCtx(handle);
1287}
static unsigned char buff[32768]
Definition: fatten.c:17

Referenced by test_actctx().

◆ test_findsectionstring()

static void test_findsectionstring ( void  )
static

Definition at line 2405 of file actctx.c.

2406{
2407 HANDLE handle;
2408 BOOL ret;
2410
2411 handle = create_manifest("test.manifest", testdep_manifest3, __LINE__);
2412 ret = pActivateActCtx(handle, &cookie);
2413 ok(ret, "ActivateActCtx failed: %u\n", GetLastError());
2414
2415 /* first we show the parameter validation from kernel32 */
2416 kernel32_find(ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION, "testdep", FALSE, __LINE__);
2417 kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib.dll", TRUE, __LINE__);
2418 kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib2.dll", TRUE, __LINE__);
2419 kernel32_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib3.dll", FALSE, __LINE__);
2420 kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass", TRUE, __LINE__);
2421 kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass2", TRUE, __LINE__);
2422 kernel32_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass3", FALSE, __LINE__);
2423
2424 /* then we show that ntdll plays by different rules */
2425 ntdll_find(ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION, "testdep", FALSE, __LINE__);
2426 ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib.dll", TRUE, __LINE__);
2427 ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib2.dll", TRUE, __LINE__);
2428 ntdll_find(ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, "testlib3.dll", FALSE, __LINE__);
2429 ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass", TRUE, __LINE__);
2430 ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass2", TRUE, __LINE__);
2431 ntdll_find(ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, "wndClass3", FALSE, __LINE__);
2432
2433 ret = pDeactivateActCtx(0, cookie);
2434 ok(ret, "DeactivateActCtx failed: %u\n", GetLastError());
2435 pReleaseActCtx(handle);
2436}
static HANDLE create_manifest(const char *filename, const char *data, int line)
Definition: actctx.c:2320
static void kernel32_find(ULONG section, const char *string_to_find, BOOL should_find, int line)
Definition: actctx.c:2333
static void ntdll_find(ULONG section, const char *string_to_find, BOOL should_find, int line)
Definition: actctx.c:2383

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 716 of file actctx.c.

717{
718 ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *info, info_tmp;
719 SIZE_T size, exsize;
720 ULONG len;
721 BOOL b;
722
723 exsize = sizeof(ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION);
724 if (exinfo->manifest_path) exsize += (lstrlenW(exinfo->manifest_path)+1) * sizeof(WCHAR);
725 if (exinfo->encoded_assembly_id) exsize += (strlen_aw(exinfo->encoded_assembly_id) + 1) * sizeof(WCHAR);
726
727 size = 0xdeadbeef;
728 b = pQueryActCtxW(0, handle, &id,
729 AssemblyDetailedInformationInActivationContext, &info_tmp,
730 sizeof(info_tmp), &size);
731 ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n");
732 ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError());
733
734 ok_(__FILE__, line)(size >= exsize, "size=%lu, expected %lu\n", size, exsize);
735
736 if (size == 0xdeadbeef)
737 {
738 skip("bad size\n");
739 return;
740 }
741
743 memset(info, 0xfe, size);
744
745 size = 0xdeadbeef;
746 b = pQueryActCtxW(0, handle, &id,
747 AssemblyDetailedInformationInActivationContext, info, size, &size);
748 ok_(__FILE__, line)(b, "QueryActCtx failed: %u\n", GetLastError());
749 if (!exinfo->manifest_path)
750 exsize += info->ulManifestPathLength + sizeof(WCHAR);
751 if (!exinfo->encoded_assembly_id)
752 exsize += info->ulEncodedAssemblyIdentityLength + sizeof(WCHAR);
753 if (exinfo->has_assembly_dir)
754 exsize += info->ulAssemblyDirectoryNameLength + sizeof(WCHAR);
755 ok_(__FILE__, line)(size == exsize, "size=%lu, expected %lu\n", size, exsize);
756
757 if (0) /* FIXME: flags meaning unknown */
758 {
759 ok_(__FILE__, line)((info->ulFlags) == exinfo->flags, "info->ulFlags = %x, expected %x\n",
760 info->ulFlags, exinfo->flags);
761 }
762 if(exinfo->encoded_assembly_id) {
763 len = strlen_aw(exinfo->encoded_assembly_id)*sizeof(WCHAR);
764 ok_(__FILE__, line)(info->ulEncodedAssemblyIdentityLength == len,
765 "info->ulEncodedAssemblyIdentityLength = %u, expected %u\n",
766 info->ulEncodedAssemblyIdentityLength, len);
767 } else {
768 ok_(__FILE__, line)(info->ulEncodedAssemblyIdentityLength != 0,
769 "info->ulEncodedAssemblyIdentityLength == 0\n");
770 }
771 ok_(__FILE__, line)(info->ulManifestPathType == ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE,
772 "info->ulManifestPathType = %x\n", info->ulManifestPathType);
773 if(exinfo->manifest_path) {
774 len = lstrlenW(exinfo->manifest_path)*sizeof(WCHAR);
775 ok_(__FILE__, line)(info->ulManifestPathLength == len, "info->ulManifestPathLength = %u, expected %u\n",
776 info->ulManifestPathLength, len);
777 } else {
778 ok_(__FILE__, line)(info->ulManifestPathLength != 0, "info->ulManifestPathLength == 0\n");
779 }
780
781 ok_(__FILE__, line)(info->ulPolicyPathType == ACTIVATION_CONTEXT_PATH_TYPE_NONE,
782 "info->ulPolicyPathType = %x\n", info->ulPolicyPathType);
783 ok_(__FILE__, line)(info->ulPolicyPathLength == 0,
784 "info->ulPolicyPathLength = %u, expected 0\n", info->ulPolicyPathLength);
785 ok_(__FILE__, line)(info->ulMetadataSatelliteRosterIndex == 0, "info->ulMetadataSatelliteRosterIndex = %x\n",
786 info->ulMetadataSatelliteRosterIndex);
787 ok_(__FILE__, line)(info->ulManifestVersionMajor == 1,"info->ulManifestVersionMajor = %x\n",
788 info->ulManifestVersionMajor);
789 ok_(__FILE__, line)(info->ulManifestVersionMinor == 0, "info->ulManifestVersionMinor = %x\n",
790 info->ulManifestVersionMinor);
791 ok_(__FILE__, line)(info->ulPolicyVersionMajor == 0, "info->ulPolicyVersionMajor = %x\n",
792 info->ulPolicyVersionMajor);
793 ok_(__FILE__, line)(info->ulPolicyVersionMinor == 0, "info->ulPolicyVersionMinor = %x\n",
794 info->ulPolicyVersionMinor);
795 if(exinfo->has_assembly_dir)
796 ok_(__FILE__, line)(info->ulAssemblyDirectoryNameLength != 0,
797 "info->ulAssemblyDirectoryNameLength == 0\n");
798 else
799 ok_(__FILE__, line)(info->ulAssemblyDirectoryNameLength == 0,
800 "info->ulAssemblyDirectoryNameLength != 0\n");
801
802 ok_(__FILE__, line)(info->lpAssemblyEncodedAssemblyIdentity != NULL,
803 "info->lpAssemblyEncodedAssemblyIdentity == NULL\n");
804 if(info->lpAssemblyEncodedAssemblyIdentity && exinfo->encoded_assembly_id) {
805 ok_(__FILE__, line)(!strcmp_aw(info->lpAssemblyEncodedAssemblyIdentity, exinfo->encoded_assembly_id),
806 "unexpected info->lpAssemblyEncodedAssemblyIdentity %s / %s\n",
807 strw(info->lpAssemblyEncodedAssemblyIdentity), exinfo->encoded_assembly_id);
808 }
809 if(exinfo->manifest_path) {
810 ok_(__FILE__, line)(info->lpAssemblyManifestPath != NULL, "info->lpAssemblyManifestPath == NULL\n");
811 if(info->lpAssemblyManifestPath)
812 ok_(__FILE__, line)(!lstrcmpiW(info->lpAssemblyManifestPath, exinfo->manifest_path),
813 "unexpected info->lpAssemblyManifestPath\n");
814 }else {
815 ok_(__FILE__, line)(info->lpAssemblyManifestPath != NULL, "info->lpAssemblyManifestPath == NULL\n");
816 }
817
818 ok_(__FILE__, line)(info->lpAssemblyPolicyPath == NULL, "info->lpAssemblyPolicyPath != NULL\n");
819 if(info->lpAssemblyPolicyPath)
820 ok_(__FILE__, line)(*(WORD*)info->lpAssemblyPolicyPath == 0, "info->lpAssemblyPolicyPath is not empty\n");
821 if(exinfo->has_assembly_dir)
822 ok_(__FILE__, line)(info->lpAssemblyDirectoryName != NULL, "info->lpAssemblyDirectoryName == NULL\n");
823 else
824 ok_(__FILE__, line)(info->lpAssemblyDirectoryName == NULL, "info->lpAssemblyDirectoryName = %s\n",
825 strw(info->lpAssemblyDirectoryName));
827}
unsigned short WORD
Definition: ntddk_ex.h:93
static DWORD strlen_aw(const char *str)
Definition: actctx.c:481
static int strcmp_aw(LPCWSTR strw, const char *stra)
Definition: actctx.c:472
LPCWSTR manifest_path
Definition: actctx.c:657
BOOL has_assembly_dir
Definition: actctx.c:659
LPCSTR encoded_assembly_id
Definition: actctx.c:658

Referenced by test_actctx(), and test_app_manifest().

◆ test_no_compat()

static void test_no_compat ( HANDLE  handle,
int  line 
)
static

Definition at line 2755 of file actctx.c.

2756{
2757 test_act_ctx_compat_info compat_info;
2758 SIZE_T size;
2759 BOOL b;
2760
2761 memset(&compat_info, 0, sizeof(compat_info));
2762 b = pQueryActCtxW(QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL,
2763 CompatibilityInformationInActivationContext, &compat_info,
2764 sizeof(compat_info), &size);
2765
2766 ok_(__FILE__, line)(b, "CompatibilityInformationInActivationContext failed\n");
2767 ok_(__FILE__, line)(size == sizeof(DWORD), "size mismatch (got %lu, expected 4)\n", size);
2768 ok_(__FILE__, line)(compat_info.ElementCount == 0, "unexpected ElementCount %u\n", compat_info.ElementCount);
2769}
#define DWORD
Definition: nt_native.h:44

Referenced by test_compatibility().

◆ test_runlevel_info()

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

Definition at line 898 of file actctx.c.

899{
900 ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION runlevel_info;
901 SIZE_T size, retsize;
902 BOOL b;
903
904 size = sizeof(runlevel_info);
905 b = pQueryActCtxW(0, handle, NULL,
906 RunlevelInformationInActivationContext, &runlevel_info,
907 sizeof(runlevel_info), &retsize);
909 {
910 win_skip("RunlevelInformationInActivationContext not supported.\n");
911 return;
912 }
913
914 ok_(__FILE__, line)(b, "QueryActCtx failed: %u\n", GetLastError());
915 ok_(__FILE__, line)(retsize == size, "size=%ld, expected %ld\n", retsize, size);
916
917 ok_(__FILE__, line)(runlevel_info.ulFlags == 0, "runlevel_info.ulFlags=%x\n", runlevel_info.ulFlags);
918 ok_(__FILE__, line)(runlevel_info.RunLevel == exinfo->run_level,
919 "runlevel_info.RunLevel=%u, expected %u\n", runlevel_info.RunLevel, exinfo->run_level);
920 ok_(__FILE__, line)(runlevel_info.UiAccess == exinfo->ui_access,
921 "runlevel_info.UiAccess=%u, expected %u\n", runlevel_info.UiAccess, exinfo->ui_access);
922}
ACTCTX_REQUESTED_RUN_LEVEL run_level
Definition: actctx.c:874
DWORD ui_access
Definition: actctx.c:875

Referenced by test_actctx().

◆ test_typelib_section()

static void test_typelib_section ( void  )
static

Definition at line 1878 of file actctx.c.

1879{
1880 static const WCHAR helpW[] = {'h','e','l','p'};
1881 ACTCTX_SECTION_KEYED_DATA data, data2;
1883 struct tlibredirect_data *tlib;
1885 HANDLE handle;
1886 BOOL ret;
1887
1888 /* use two dependent manifests, 4 'files' total */
1889 create_manifest_file("testdep1.manifest", manifest_wndcls1, -1, NULL, NULL);
1890 create_manifest_file("testdep2.manifest", manifest_wndcls2, -1, NULL, NULL);
1891 create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL);
1892
1893 handle = test_create("main_wndcls.manifest");
1894 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
1895
1896 DeleteFileA("testdep1.manifest");
1897 DeleteFileA("testdep2.manifest");
1898 DeleteFileA("main_wndcls.manifest");
1899
1900 ret = pActivateActCtx(handle, &cookie);
1901 ok(ret, "ActivateActCtx failed: %u\n", GetLastError());
1902
1903 memset(&data, 0, sizeof(data));
1904 memset(&data2, 0, sizeof(data2));
1905 data.cbSize = sizeof(data);
1906 data2.cbSize = sizeof(data2);
1907
1908 /* get data for two typelibs from different assemblies */
1909 ret = pFindActCtxSectionGuid(0, NULL,
1910 ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION,
1911 &IID_TlibTest, &data);
1912 ok(ret, "got %d\n", ret);
1913
1914 ret = pFindActCtxSectionGuid(0, NULL,
1915 ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION,
1916 &IID_TlibTest4, &data2);
1917 ok(ret, "got %d\n", ret);
1918
1919 section = (struct guidsection_header*)data.lpSectionBase;
1920 ok(section->count == 4, "got %d\n", section->count);
1921 ok(section->size == sizeof(*section), "got %d\n", section->size);
1922
1923 /* For both GUIDs same section is returned */
1924 ok(data.lpSectionBase == data2.lpSectionBase, "got %p, %p\n", data.lpSectionBase, data2.lpSectionBase);
1925 ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %u, %u\n", data.ulSectionTotalLength,
1926 data2.ulSectionTotalLength);
1927
1928 ok(data.lpSectionGlobalData == ((BYTE*)section + section->names_offset), "data.lpSectionGlobalData == NULL\n");
1929 ok(data.ulSectionGlobalDataLength == section->names_len, "data.ulSectionGlobalDataLength=%u\n",
1930 data.ulSectionGlobalDataLength);
1931
1932 /* test some actual data */
1933 tlib = (struct tlibredirect_data*)data.lpData;
1934 ok(tlib->size == sizeof(*tlib), "got %d\n", tlib->size);
1935 ok(tlib->major_version == 1, "got %d\n", tlib->major_version);
1936 ok(tlib->minor_version == 0, "got %d\n", tlib->minor_version);
1937 ok(tlib->help_offset > 0, "got %d\n", tlib->help_offset);
1938 ok(tlib->help_len == sizeof(helpW), "got %d\n", tlib->help_len);
1939 ok(tlib->flags == (LIBFLAG_FHIDDEN|LIBFLAG_FCONTROL|LIBFLAG_FRESTRICTED), "got %x\n", tlib->flags);
1940
1941 ret = pDeactivateActCtx(0, cookie);
1942 ok(ret, "DeactivateActCtx failed: %u\n", GetLastError());
1943
1944 pReleaseActCtx(handle);
1945}
static const WCHAR helpW[]
Definition: htmlevent.c:70
@ LIBFLAG_FRESTRICTED
Definition: actctx.c:74
@ LIBFLAG_FCONTROL
Definition: actctx.c:75
@ LIBFLAG_FHIDDEN
Definition: actctx.c:76
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_with_compat()

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

Definition at line 2771 of file actctx.c.

2772{
2773 test_act_ctx_compat_info compat_info;
2774 SIZE_T size;
2775 SIZE_T expected = sizeof(COMPATIBILITY_CONTEXT_ELEMENT) * num_compat + sizeof(DWORD);
2776 DWORD n;
2777 BOOL b;
2778
2779 memset(&compat_info, 0, sizeof(compat_info));
2780 b = pQueryActCtxW(QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL,
2781 CompatibilityInformationInActivationContext, &compat_info,
2782 sizeof(compat_info), &size);
2783
2784 ok_(__FILE__, line)(b, "CompatibilityInformationInActivationContext failed\n");
2785 ok_(__FILE__, line)(size == expected, "size mismatch (got %lu, expected %lu)\n", size, expected);
2786 ok_(__FILE__, line)(compat_info.ElementCount == num_compat, "unexpected ElementCount %u\n", compat_info.ElementCount);
2787
2788 for (n = 0; n < num_compat; ++n)
2789 {
2790 ok_(__FILE__, line)(IsEqualGUID(&compat_info.Elements[n].Id, expected_compat[n]),
2791 "got wrong clsid %s, expected %s for %u\n",
2792 wine_dbgstr_guid(&compat_info.Elements[n].Id),
2793 wine_dbgstr_guid(expected_compat[n]),
2794 n);
2795 ok_(__FILE__, line)(compat_info.Elements[n].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS,
2796 "Wrong type, got %u for %u\n", (DWORD)compat_info.Elements[n].Type, n);
2797 }
2798}
GLdouble n
Definition: glext.h:7729
BOOL expected
Definition: store.c:2063
COMPATIBILITY_CONTEXT_ELEMENT Elements[10]
Definition: actctx.c:2752

Referenced by test_compatibility().

◆ test_wndclass_section()

static void test_wndclass_section ( void  )
static

Definition at line 1758 of file actctx.c.

1759{
1760 static const WCHAR cls1W[] = {'1','.','2','.','3','.','4','!','w','n','d','C','l','a','s','s','1',0};
1761 ACTCTX_SECTION_KEYED_DATA data, data2;
1762 struct wndclass_redirect_data *classdata;
1763 struct strsection_header *section;
1765 HANDLE handle;
1766 WCHAR *ptrW;
1767 BOOL ret;
1768
1769 /* use two dependent manifests, each defines 2 window class redirects */
1770 create_manifest_file("testdep1.manifest", manifest_wndcls1, -1, NULL, NULL);
1771 create_manifest_file("testdep2.manifest", manifest_wndcls2, -1, NULL, NULL);
1772 create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL);
1773
1774 handle = test_create("main_wndcls.manifest");
1775 ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError());
1776
1777 DeleteFileA("testdep1.manifest");
1778 DeleteFileA("testdep2.manifest");
1779 DeleteFileA("main_wndcls.manifest");
1780
1781