ReactOS  0.4.14-dev-98-gb0d4763
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,
1374  MiscStatusContent = 4,
1375  MiscStatusThumbnail = 8,
1376  MiscStatusDocPrint = 16
1377 };

◆ 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.

◆ ifaceps_mask

Enumerator
NumMethods 
BaseIface 
NumMethods 
BaseIface 

Definition at line 1554 of file actctx.c.

1555 {
1556  NumMethods = 1,
1557  BaseIface = 2
1558 };

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 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
const char * filename
Definition: ioapi.h:135
static BOOL create_manifest_file(const char *filename, const char *manifest, int manifest_len, const char *depfile, const char *depmanifest)
Definition: actctx.c:486
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
Definition: parser.c:48
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static HANDLE test_create(const char *file)
Definition: actctx.c:924
#define ok_(x1, x2)
Definition: atltest.h:61

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);
505  CloseHandle(file);
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);
517  CloseHandle(file);
518  }
519  return TRUE;
520 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CP_ACP
Definition: compat.h:99
static WCHAR manifest_path[MAX_PATH]
Definition: actctx.c:470
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
const char * filename
Definition: ioapi.h:135
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
static WCHAR depmanifest_path[MAX_PATH]
Definition: actctx.c:470
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define CREATE_ALWAYS
Definition: disk.h:72
#define ok(value,...)
Definition: atltest.h:57
Definition: services.c:325
#define MultiByteToWideChar
Definition: compat.h:100
#define CreateFileW
Definition: compat.h:400
static const CHAR manifest[]
Definition: v6util.h:39
Definition: fci.c:126

Referenced by create_manifest(), create_wide_manifest(), run_child_process(), test_actctx(), test_allowDelayedBinding(), test_compatibility(), test_create_and_fail(), test_dllredirect_section(), 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 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CP_ACP
Definition: compat.h:99
GLintptr offset
Definition: glext.h:5920
const char * filename
Definition: ioapi.h:135
static BOOL create_manifest_file(const char *filename, const char *manifest, int manifest_len, const char *depfile, const char *depmanifest)
Definition: actctx.c:486
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
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
#define MultiByteToWideChar
Definition: compat.h:100
static const CHAR manifest[]
Definition: v6util.h:39
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by test_actctx(), and test_create_wide_and_fail().

◆ DEFINE_GUID() [1/19]

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

◆ DEFINE_GUID() [2/19]

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

◆ DEFINE_GUID() [3/19]

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

◆ DEFINE_GUID() [4/19]

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

◆ DEFINE_GUID() [5/19]

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

◆ DEFINE_GUID() [6/19]

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

◆ DEFINE_GUID() [7/19]

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

◆ DEFINE_GUID() [8/19]

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

◆ DEFINE_GUID() [9/19]

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

◆ DEFINE_GUID() [10/19]

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

◆ DEFINE_GUID() [11/19]

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

◆ DEFINE_GUID() [12/19]

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

◆ DEFINE_GUID() [13/19]

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

◆ DEFINE_GUID() [14/19]

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

◆ DEFINE_GUID() [15/19]

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

◆ DEFINE_GUID() [16/19]

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

◆ DEFINE_GUID() [17/19]

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

◆ DEFINE_GUID() [18/19]

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

◆ DEFINE_GUID() [19/19]

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

◆ delete_manifest_file()

static void delete_manifest_file ( const char filename)
static

Definition at line 2515 of file actctx.c.

2516 {
2517  CHAR path[MAX_PATH];
2518 
2519  GetTempPathA(sizeof(path)/sizeof(CHAR), path);
2520  strcat(path, filename);
2521  DeleteFileA(path);
2522 }
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
char CHAR
Definition: xmlstorage.h:175
const char * filename
Definition: ioapi.h:135
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
#define MAX_PATH
Definition: compat.h:26
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2053
Definition: services.c:325

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;
2656  X(ActivateActCtx);
2657  X(CreateActCtxA);
2658  X(CreateActCtxW);
2664  X(QueryActCtxW);
2665  X(ReleaseActCtx);
2667  X(ZombifyActCtx);
2668 
2669  hLibrary = GetModuleHandleA("ntdll.dll");
2673 #undef X
2674 
2675  return TRUE;
2676 }
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
Definition: actctx.c:237
BOOL WINAPI IsDebuggerPresent(VOID)
Definition: debugger.c:615
#define TRUE
Definition: types.h:120
BOOL WINAPI GetCurrentActCtx(OUT PHANDLE phActCtx)
Definition: actctx.c:298
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 FindActCtxSectionStringW(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, LPCWSTR lpSearchStr, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:156
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
Definition: actctx.c:268
BOOL WINAPI ZombifyActCtx(HANDLE hActCtx)
Definition: actctx.c:219
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
BOOL WINAPI FindActCtxSectionStringA(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, LPCSTR lpSearchStr, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:124
VOID WINAPI ReleaseActCtx(IN HANDLE hActCtx)
Definition: actctx.c:208
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
HMODULE hLibrary
Definition: odbccp32.c:12
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define X(f)
HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx)
Definition: actctx.c:104
HANDLE WINAPI CreateActCtxA(PCACTCTXA pActCtx)
Definition: actctx.c:28
BOOL WINAPI FindActCtxSectionGuid(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, const GUID *lpSearchGuid, PACTCTX_SECTION_KEYED_DATA pInfo)
Definition: actctx.c:183
NTSTATUS NTAPI RtlFindActivationContextSectionString(ULONG flags, const GUID *guid, ULONG section_kind, const UNICODE_STRING *section_name, PVOID ptr)
Definition: actctx.c:5743

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 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:609
static WCHAR exe_path[MAX_PATH]
Definition: actctx.c:469
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:413
static WCHAR app_dir[MAX_PATH]
Definition: actctx.c:469
static WCHAR work_dir_subdir[MAX_PATH]
Definition: actctx.c:469
#define lstrlenW
Definition: compat.h:407
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define lstrcpyW
Definition: compat.h:406
static WCHAR work_dir[MAX_PATH]
Definition: actctx.c:469
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR app_manifest_path[MAX_PATH]
Definition: actctx.c:470

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_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SXS_KEY_NOT_FOUND
Definition: winerror.h:2148
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
Definition: parser.c:55
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
#define err(...)
#define memset(x, y, z)
Definition: compat.h:39
#define ok_(x1, x2)
Definition: atltest.h:61

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:1170
Definition: parser.c:55
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define memset(x, y, z)
Definition: compat.h:39
#define ok_(x1, x2)
Definition: atltest.h:61

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) {
2464  SetFileTime(file, NULL, NULL, &now);
2465  CloseHandle(file);
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);
2473  DeleteFileA(path);
2474 }
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
#define CloseHandle
Definition: compat.h:398
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define argv
Definition: mplay32.c:18
static BOOL create_manifest_file(const char *filename, const char *manifest, int manifest_len, const char *depfile, const char *depmanifest)
Definition: actctx.c:486
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:548
#define FILE_WRITE_ATTRIBUTES
Definition: nt_native.h:649
#define FILE_SHARE_READ
Definition: compat.h:125
static const char manifest1[]
Definition: actctx.c:71
BOOL WINAPI SetFileTime(IN HANDLE hFile, CONST FILETIME *lpCreationTime OPTIONAL, CONST FILETIME *lpLastAccessTime OPTIONAL, CONST FILETIME *lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:1098
#define sprintf(buf, format,...)
Definition: sprintf.c:55
unsigned int BOOL
Definition: ntddk_ex.h:94
time_t now
Definition: finger.c:65
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
#define OPEN_EXISTING
Definition: compat.h:426
DWORD cb
Definition: winbase.h:803
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:4742
#define MAX_PATH
Definition: compat.h:26
const char file[]
Definition: icontest.c:11
int winetest_get_mainargs(char ***pargv)
static DWORD pi
Definition: protocol.c:150
int ret
void winetest_wait_child_process(HANDLE process)
#define ok(value,...)
Definition: atltest.h:57
Definition: services.c:325
#define skip(...)
Definition: atltest.h:64
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:399
Definition: fci.c:126

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();
2942  test_create_fail();
2948 }
static int argc
Definition: ServiceArgs.c:12
static void test_actctx(void)
Definition: actctx.c:1970
static BOOL init_funcs(void)
Definition: actctx.c:2651
static void test_compatibility(void)
Definition: actctx.c:2800
static void test_create_fail(void)
Definition: actctx.c:1004
#define argv
Definition: mplay32.c:18
static void test_CreateActCtx(void)
Definition: actctx.c:2524
static void test_ZombifyActCtx(void)
Definition: actctx.c:2678
static void init_paths(void)
Definition: actctx.c:2476
int winetest_get_mainargs(char ***pargv)
static void test_app_manifest(void)
Definition: actctx.c:2302
static void test_findsectionstring(void)
Definition: actctx.c:2405
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static void run_child_process(void)
Definition: actctx.c:2438
#define win_skip
Definition: test.h:141

◆ 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 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CP_ACP
Definition: compat.h:99
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MultiByteToWideChar
Definition: compat.h:100
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 }
#define CP_ACP
Definition: compat.h:99
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define MultiByteToWideChar
Definition: compat.h:100

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 }
GLuint buffer
Definition: glext.h:5915
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
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(), 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 {
1972  ULONG_PTR cookie;
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");
2005  if(handle != INVALID_HANDLE_VALUE) {
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");
2032  if(handle != INVALID_HANDLE_VALUE) {
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");
2051  if(handle != INVALID_HANDLE_VALUE) {
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");
2080  if(handle != INVALID_HANDLE_VALUE) {
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());
2092  test_find_window_class(handle, wndClassW, 2, __LINE__);
2093  test_find_window_class(handle, wndClass2W, 2, __LINE__);
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");
2113  if(handle != INVALID_HANDLE_VALUE) {
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");
2232  if(handle != INVALID_HANDLE_VALUE) {
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");
2252  if(handle != INVALID_HANDLE_VALUE) {
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");
2273  if (handle != INVALID_HANDLE_VALUE) {
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");
2289  if (handle != INVALID_HANDLE_VALUE) {
2290  test_basic_info(handle, __LINE__);
2293  pReleaseActCtx(handle);
2294  }
2295 
2300 }
static const WCHAR versionW[]
Definition: actctx.c:615
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
static const runlevel_info_t runlevel_info9
Definition: actctx.c:894
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
static const char manifest3[]
Definition: actctx.c:107
static const runlevel_info_t runlevel_info7
Definition: actctx.c:886
static const WCHAR testlib2_dll[]
Definition: actctx.c:458
static const char testdep_manifest2[]
Definition: actctx.c:307
static void test_allowDelayedBinding(void)
Definition: actctx.c:1947
static void test_runlevel_info(HANDLE handle, const runlevel_info_t *exinfo, int line)
Definition: actctx.c:898
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
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static WCHAR work_dir_subdir[MAX_PATH]
Definition: actctx.c:469
static const char testdep_manifest1[]
Definition: actctx.c:302
static const detailed_info_t detailed_info1
Definition: actctx.c:556
static void test_find_progid_redirection(HANDLE handle, const GUID *clsid, const char *progid, ULONG exid, int line)
Definition: actctx.c:1704
static void test_detailed_info(HANDLE handle, const detailed_info_t *exinfo, int line)
Definition: actctx.c:575
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 BOOL create_manifest_file(const char *filename, const char *manifest, int manifest_len, const char *depfile, const char *depmanifest)
Definition: actctx.c:486
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 char manifest1[]
Definition: actctx.c:71
static const runlevel_info_t runlevel_info8
Definition: actctx.c:890
static const WCHAR wndClassW[]
Definition: actctx.c:460
uint32_t ULONG_PTR
Definition: typedefs.h:63
static const char manifest1_1[]
Definition: actctx.c:76
static const info_in_assembly depmanifest2_info
Definition: actctx.c:699
static const WCHAR wndClass2W[]
Definition: actctx.c:464
unsigned int BOOL
Definition: ntddk_ex.h:94
static void test_basic_info(HANDLE handle, int line)
Definition: actctx.c:1327
static const char manifest4[]
Definition: actctx.c:223
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static const char manifest9[]
Definition: actctx.c:284
static const detailed_info_t detailed_info0
Definition: actctx.c:552
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732
#define b
Definition: ke_i.h:79
static const WCHAR nameW[]
Definition: main.c:46
static const detailed_info_t detailed_info2
Definition: actctx.c:569
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
static const runlevel_info_t runlevel_info6
Definition: actctx.c:882
#define trace
Definition: atltest.h:70
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR progidW[]
Definition: actctx.c:610
static void test_wndclass_section(void)
Definition: actctx.c:1758
static void test_find_string_fail(void)
Definition: actctx.c:1289
static const runlevel_info_t runlevel_info0
Definition: actctx.c:878
static const WCHAR testlib_dll[]
Definition: actctx.c:456
static const info_in_assembly manifest3_info
Definition: actctx.c:680
static const char manifest2[]
Definition: actctx.c:81
static const info_in_assembly manifest1_info
Definition: actctx.c:662
static BOOL create_wide_manifest(const char *filename, const char *manifest, BOOL fBOM, BOOL fReverse)
Definition: actctx.c:522
static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembly *exinfo, int line)
Definition: actctx.c:716
static void test_typelib_section(void)
Definition: actctx.c:1878
static HANDLE test_create(const char *file)
Definition: actctx.c:924
#define broken(x)
Definition: _sntprintf.h:21
static void test_find_dll_redirection(HANDLE handle, LPCWSTR libname, ULONG exid, int line)
Definition: actctx.c:1127
static void test_dllredirect_section(void)
Definition: actctx.c:1823
static const info_in_assembly manifest_comctrl_info
Definition: actctx.c:712
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2248
#define ok(value,...)
Definition: atltest.h:57
static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid, int line)
Definition: actctx.c:1192
static const char manifest6[]
Definition: actctx.c:247
static WCHAR work_dir[MAX_PATH]
Definition: actctx.c:469
#define skip(...)
Definition: atltest.h:64
static const info_in_assembly manifest2_info
Definition: actctx.c:674
static const char manifest8[]
Definition: actctx.c:271
#define win_skip
Definition: test.h:141
static const info_in_assembly manifest4_info
Definition: actctx.c:686
static const char testdep_manifest3[]
Definition: actctx.c:314
static const char manifest7[]
Definition: actctx.c:259
static const info_in_assembly depmanifest3_info
Definition: actctx.c:706
static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR filename, int line)
Definition: actctx.c:829
static const info_in_assembly depmanifest1_info
Definition: actctx.c:692

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");
1957  if (handle == INVALID_HANDLE_VALUE) {
1958  win_skip("allowDelayedBinding attribute is not supported.\n");
1959  return;
1960  }
1961 
1962  DeleteFileA("test5.manifest");
1963  DeleteFileA("testdep.manifest");
1964  if (handle != INVALID_HANDLE_VALUE) {
1965  test_basic_info(handle, __LINE__);
1966  pReleaseActCtx(handle);
1967  }
1968 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
static BOOL create_manifest_file(const char *filename, const char *manifest, int manifest_len, const char *depfile, const char *depmanifest)
Definition: actctx.c:486
static void test_basic_info(HANDLE handle, int line)
Definition: actctx.c:1327
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static HANDLE test_create(const char *file)
Definition: actctx.c:924
static const char manifest5[]
Definition: actctx.c:236
#define skip(...)
Definition: atltest.h:64
#define win_skip
Definition: test.h:141

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 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
static const detailed_info_t detailed_info1_child
Definition: actctx.c:562
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static void test_detailed_info(HANDLE handle, const detailed_info_t *exinfo, int line)
Definition: actctx.c:575
unsigned int BOOL
Definition: ntddk_ex.h:94
static void test_basic_info(HANDLE handle, int line)
Definition: actctx.c:1327
smooth NULL
Definition: ftsmooth.c:416
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define trace
Definition: atltest.h:70
static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembly *exinfo, int line)
Definition: actctx.c:716
#define ok(value,...)
Definition: atltest.h:57
static const info_in_assembly manifest1_child_info
Definition: actctx.c:668

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 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLsizeiptr size
Definition: glext.h:5919
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define ok_(x1, x2)
Definition: atltest.h:61

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 
2825  if (!b && GetLastError() == ERROR_INVALID_PARAMETER)
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 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
static const char compat_manifest_vista[]
Definition: actctx.c:414
static void test_with_compat(HANDLE handle, DWORD num_compat, const GUID *expected_compat[], int line)
Definition: actctx.c:2771
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
GLuint buffer
Definition: glext.h:5915
static BOOL create_manifest_file(const char *filename, const char *manifest, int manifest_len, const char *depfile, const char *depmanifest)
Definition: actctx.c:486
static const char manifest1[]
Definition: actctx.c:71
unsigned int BOOL
Definition: ntddk_ex.h:94
static void test_basic_info(HANDLE handle, int line)
Definition: actctx.c:1327
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
#define b
Definition: ke_i.h:79
static void test_no_compat(HANDLE handle, int line)
Definition: actctx.c:2755
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLsizeiptr size
Definition: glext.h:5919
static const char compat_manifest_vista_7_8_10_81[]
Definition: actctx.c:424
#define trace
Definition: atltest.h:70
unsigned long DWORD
Definition: ntddk_ex.h:95
static const char compat_manifest_no_supportedOs[]
Definition: actctx.c:405
static const char compat_manifest_other_guid[]
Definition: actctx.c:438
static HANDLE test_create(const char *file)
Definition: actctx.c:924
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141

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;
927  HANDLE handle;
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 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
GLsizei const GLchar ** path
Definition: glext.h:7234
#define CP_ACP
Definition: compat.h:99
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
smooth NULL
Definition: ftsmooth.c:416
#define actctx
Definition: kernel32.h:8
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define ok(value,...)
Definition: atltest.h:57
Definition: services.c:325
#define MultiByteToWideChar
Definition: compat.h:100
#define memset(x, y, z)
Definition: compat.h:39
Definition: fci.c:126

Referenced by create_manifest(), test_actctx(), test_allowDelayedBinding(), test_compatibility(), test_dllredirect_section(), test_typelib_section(), and test_wndclass_section().

◆ 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;
958  HANDLE handle;
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 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
GLsizei const GLchar ** path
Definition: glext.h:7234
#define CP_ACP
Definition: compat.h:99
BOOL todo
Definition: filedlg.c:313
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static BOOL create_manifest_file(const char *filename, const char *manifest, int manifest_len, const char *depfile, const char *depmanifest)
Definition: actctx.c:486
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
#define actctx
Definition: kernel32.h:8
#define todo_wine_if(is_todo)
Definition: test.h:155
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define broken(x)
Definition: _sntprintf.h:21
#define ok(value,...)
Definition: atltest.h:57
Definition: services.c:325
#define MultiByteToWideChar
Definition: compat.h:100
#define ERROR_SXS_CANT_GEN_ACTCTX
Definition: winerror.h:2142
static const CHAR manifest[]
Definition: v6util.h:39
#define memset(x, y, z)
Definition: compat.h:39

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;
1008  WCHAR path[MAX_PATH];
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");
1036  test_create_and_fail(wrong_manifest9, NULL, 0, TRUE /* WinXP */);
1037  trace("wrong_manifest10\n");
1038  test_create_and_fail(wrong_manifest10, NULL, 0, TRUE /* WinXP */);
1039  trace("UTF-16 manifest1 without BOM\n");
1041  trace("manifest2\n");
1043  trace("manifest2+depmanifest1\n");
1045 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define TRUE
Definition: types.h:120
static const char wrong_manifest10[]
Definition: actctx.c:381
static const char wrong_manifest3[]
Definition: actctx.c:334
GLsizei const GLchar ** path
Definition: glext.h:7234
#define CP_ACP
Definition: compat.h:99
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static const char wrong_manifest5[]
Definition: actctx.c:345
static const char wrong_manifest8[]
Definition: actctx.c:362
static const char manifest1[]
Definition: actctx.c:71
smooth NULL
Definition: ftsmooth.c:416
#define actctx
Definition: kernel32.h:8
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static const char wrong_depmanifest1[]
Definition: actctx.c:400
#define trace
Definition: atltest.h:70
static void test_create_and_fail(const char *manifest, const char *depmanifest, int todo, BOOL is_broken)
Definition: actctx.c:955
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
static const char manifest2[]
Definition: actctx.c:81
static const char wrong_manifest7[]
Definition: actctx.c:356
static const char wrong_manifest2[]
Definition: actctx.c:329
static void test_create_wide_and_fail(const char *manifest, BOOL fBOM)
Definition: actctx.c:984
static const char wrong_manifest1[]
Definition: actctx.c:324
#define ok(value,...)
Definition: atltest.h:57
Definition: services.c:325
static const char wrong_manifest6[]
Definition: actctx.c:351
#define MultiByteToWideChar
Definition: compat.h:100
static const char wrong_manifest4[]
Definition: actctx.c:339
static const char wrong_manifest9[]
Definition: actctx.c:368
#define memset(x, y, z)
Definition: compat.h:39

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;
987  HANDLE handle;
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 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
GLsizei const GLchar ** path
Definition: glext.h:7234
#define CP_ACP
Definition: compat.h:99
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
#define actctx
Definition: kernel32.h:8
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
static BOOL create_wide_manifest(const char *filename, const char *manifest, BOOL fBOM, BOOL fReverse)
Definition: actctx.c:522
#define ok(value,...)
Definition: atltest.h:57
Definition: services.c:325
#define MultiByteToWideChar
Definition: compat.h:100
#define ERROR_SXS_CANT_GEN_ACTCTX
Definition: winerror.h:2142
static const CHAR manifest[]
Definition: v6util.h:39
#define memset(x, y, z)
Definition: compat.h:39

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);
2557 todo_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);
2574 todo_wine
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);
2609  broken(GetLastError()==ERROR_FILE_NOT_FOUND) /* WinXP */,
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 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
static const char manifest_wndcls1[]
Definition: actctx.c:183
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
GLsizei const GLchar ** path
Definition: glext.h:7234
char CHAR
Definition: xmlstorage.h:175
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
static const char manifest1[]
Definition: actctx.c:71
static const char manifest_wndcls_main[]
Definition: actctx.c:208
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
smooth NULL
Definition: ftsmooth.c:416
#define actctx
Definition: kernel32.h:8
unsigned int dir
Definition: maze.c:112
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static const char manifest_wndcls2[]
Definition: actctx.c:194
#define MAX_PATH
Definition: compat.h:26
#define SetLastError(x)
Definition: compat.h:409
#define todo_wine
Definition: test.h:154
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
Definition: path.c:2205
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define broken(x)
Definition: _sntprintf.h:21
static void delete_manifest_file(const char *filename)
Definition: actctx.c:2515
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2053
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2248
#define ok(value,...)
Definition: atltest.h:57
Definition: services.c:325
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2336
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714
#define ERROR_SXS_CANT_GEN_ACTCTX
Definition: winerror.h:2142
static WCHAR work_dir[MAX_PATH]
Definition: actctx.c:469
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define memset(x, y, z)
Definition: compat.h:39
static void write_manifest(const char *filename, const char *manifest)
Definition: actctx.c:2500
#define ERROR_RESOURCE_TYPE_NOT_FOUND
Definition: winerror.h:1120

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 }
LPWSTR root_manifest_path
Definition: actctx.c:546
ULONG assembly_cnt_min
Definition: actctx.c:543
ULONG root_manifest_type
Definition: actctx.c:545
static WCHAR app_dir[MAX_PATH]
Definition: actctx.c:469
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define lstrlenW
Definition: compat.h:407
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
ULONG app_dir_type
Definition: actctx.c:548
Definition: parser.c:48
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LPCWSTR app_dir
Definition: actctx.c:549
ULONG root_config_type
Definition: actctx.c:547
ULONG assembly_cnt_max
Definition: actctx.c:544
ULONG_PTR SIZE_T
Definition: typedefs.h:78
ULONG format_version
Definition: actctx.c:542
#define memset(x, y, z)
Definition: compat.h:39
static const char * strw(LPCWSTR x)
Definition: actctx.c:49
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ok_(x1, x2)
Definition: atltest.h:61
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

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;
1829  ULONG_PTR cookie;
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 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
static const char manifest_wndcls1[]
Definition: actctx.c:183
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
Definition: parser.c:55
static BOOL create_manifest_file(const char *filename, const char *manifest, int manifest_len, const char *depfile, const char *depmanifest)
Definition: actctx.c:486
static IMAGE_SECTION_HEADER section
Definition: loader.c:152
uint32_t ULONG_PTR
Definition: typedefs.h:63
static const char manifest_wndcls_main[]
Definition: actctx.c:208
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const char manifest_wndcls2[]
Definition: actctx.c:194
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
static HANDLE test_create(const char *file)
Definition: actctx.c:924
static const WCHAR data2[]
Definition: db.c:2971
#define ok(value,...)
Definition: atltest.h:57
#define memset(x, y, z)
Definition: compat.h:39
Definition: tftpd.h:137

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 }
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
const char * filename
Definition: ioapi.h:135
#define lstrlenW
Definition: compat.h:407
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
struct _test_info info[]
Definition: SetCursorPos.c:19
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
GLuint index
Definition: glext.h:6031
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define skip(...)
Definition: atltest.h:64
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ok_(x1, x2)
Definition: atltest.h:61
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

Referenced by test_actctx().

◆ test_find_com_redirection()

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

Definition at line 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
DWORD res2[2]
Definition: actctx.c:1411
DWORD miscstatusdocprint
Definition: compobj.c:131
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
const char * wine_dbgstr_guid(const GUID *guid)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define lstrlenW
Definition: compat.h:407
static const WCHAR mscoree2W[]
Definition: actctx.c:635
unsigned int BOOL
Definition: ntddk_ex.h:94
ULONG version_len
Definition: actctx.c:1409
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
ULONG version_offset
Definition: actctx.c:1410
ULONG name_offset
Definition: actctx.c:1408
ULONG name_len
Definition: actctx.c:1407
ULONG size
Definition: actctx.c:1403
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD miscstatusthumbnail
Definition: compobj.c:129
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
REFCLSID clsid
Definition: msctf.c:84
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
ULONG module_offset
Definition: actctx.c:1406
static const WCHAR data2[]
Definition: db.c:2971
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static const WCHAR mscoreeW[]
Definition: actctx.c:634
ULONG module_len
Definition: actctx.c:1405
#define skip(...)
Definition: atltest.h:64
unsigned int ULONG
Definition: retypes.h:1
#define progid(str)
Definition: exdisp.idl:31
#define memset(x, y, z)
Definition: compat.h:39
DWORD res[2]
Definition: actctx.c:1404
struct CFHEADER header
Definition: fdi.c:109
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: tftpd.h:137

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 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
#define memset(x, y, z)
Definition: compat.h:39
#define ok_(x1, x2)
Definition: atltest.h:61

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 }
const char * wine_dbgstr_guid(const GUID *guid)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
GLenum GLsizei len
Definition: glext.h:6722
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39
#define ok_(x1, x2)
Definition: atltest.h:61

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 char * wine_dbgstr_guid(const GUID *guid)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
const GUID * guid
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
REFCLSID clsid
Definition: msctf.c:84
unsigned char BYTE
Definition: mem.h:68
static const WCHAR data2[]
Definition: db.c:2971
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define progid(str)
Definition: exdisp.idl:31
#define memset(x, y, z)
Definition: compat.h:39
struct CFHEADER header
Definition: fdi.c:109
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: tftpd.h:137

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_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SXS_KEY_NOT_FOUND
Definition: winerror.h:2148
static const WCHAR testlib2_dll[]
Definition: actctx.c:458
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_SXS_SECTION_NOT_FOUND
Definition: winerror.h:2141
static const WCHAR testlib_dll[]
Definition: actctx.c:456
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
#define ok(value,...)
Definition: atltest.h:57

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 }
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
const char * wine_dbgstr_guid(const GUID *guid)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
ULONG name_offset
Definition: actctx.c:1639
#define lstrlenW
Definition: compat.h:407
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
Definition: parser.c:48
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
REFCLSID clsid
Definition: msctf.c:84
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
ULONG version_offset
Definition: actctx.c:1637
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define skip(...)
Definition: atl