ReactOS 0.4.15-dev-7942-gd23573b
actctx.c File Reference
#include <rtl.h>
#include <ntstrsafe.h>
#include <compat_undoc.h>
#include <debug.h>
#include <wine/unicode.h>
Include dependency graph for actctx.c:

Go to the source code of this file.

Classes

struct  xmlstr_t
 
struct  xml_elem
 
struct  xml_attr
 
struct  xmlbuf_t
 
struct  file_info
 
struct  assembly_version
 
struct  assembly_identity
 
struct  strsection_header
 
struct  string_index
 
struct  guidsection_header
 
struct  guid_index
 
struct  wndclass_redirect_data
 
struct  dllredirect_data
 
struct  tlibredirect_data
 
struct  comclassredirect_data
 
struct  ifacepsredirect_data
 
struct  clrsurrogate_data
 
struct  clrclass_data
 
struct  progidredirect_data
 
struct  progids
 
struct  entity
 
struct  entity_array
 
struct  dll_redirect
 
struct  assembly
 
struct  _ASSEMBLY_STORAGE_MAP_ENTRY
 
struct  _ASSEMBLY_STORAGE_MAP
 
struct  _ACTIVATION_CONTEXT
 
struct  actctx_loader
 
struct  _ACTIVATION_CONTEXT_WRAPPED
 
struct  olemisc_entry
 

Macros

#define NDEBUG
 
#define ACTCTX_FLAGS_ALL
 
#define STRSECTION_MAGIC   0x64487353 /* dHsS */
 
#define GUIDSECTION_MAGIC   0x64487347 /* dHsG */
 
#define ACTCTX_MAGIC_MARKER   (PVOID)'gMcA'
 
#define ACTCTX_FAKE_HANDLE   ((HANDLE) 0xf00baa)
 
#define ACTCTX_FAKE_COOKIE   ((ULONG_PTR) 0xf00bad)
 
#define MAX_NAMESPACES   64
 
#define FIND_ACTCTX_RETURN_FLAGS   0x00000002
 
#define FIND_ACTCTX_RETURN_ASSEMBLY_METADATA   0x00000004
 
#define FIND_ACTCTX_VALID_MASK   (FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX | FIND_ACTCTX_RETURN_FLAGS | FIND_ACTCTX_RETURN_ASSEMBLY_METADATA)
 

Typedefs

typedef struct _ASSEMBLY_STORAGE_MAP_ENTRY ASSEMBLY_STORAGE_MAP_ENTRY
 
typedef struct _ASSEMBLY_STORAGE_MAP_ENTRYPASSEMBLY_STORAGE_MAP_ENTRY
 
typedef struct _ASSEMBLY_STORAGE_MAP ASSEMBLY_STORAGE_MAP
 
typedef struct _ASSEMBLY_STORAGE_MAPPASSEMBLY_STORAGE_MAP
 
typedef struct _ACTIVATION_CONTEXT ACTIVATION_CONTEXT
 
typedef struct _ACTIVATION_CONTEXTPIACTIVATION_CONTEXT
 
typedef struct _ACTIVATION_CONTEXT_WRAPPED ACTIVATION_CONTEXT_WRAPPED
 
typedef struct _ACTIVATION_CONTEXT_WRAPPEDPACTIVATION_CONTEXT_WRAPPED
 

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 }
 
enum  assembly_type { APPLICATION_MANIFEST , ASSEMBLY_MANIFEST , ASSEMBLY_SHARED_MANIFEST }
 
enum  context_sections {
  WINDOWCLASS_SECTION = 1 , DLLREDIRECT_SECTION = 2 , TLIBREDIRECT_SECTION = 4 , SERVERREDIRECT_SECTION = 8 ,
  IFACEREDIRECT_SECTION = 16 , CLRSURROGATES_SECTION = 32 , PROGIDREDIRECT_SECTION = 64
}
 

Functions

VOID NTAPI RtlpSxsBreakOnInvalidMarker (IN PACTIVATION_CONTEXT ActCtx, IN ULONG FailureCode)
 
FORCEINLINE VOID RtlpValidateActCtx (IN PACTIVATION_CONTEXT ActCtx)
 
static WCHARstrdupW (const WCHAR *str)
 
static WCHARxmlstrdupW (const xmlstr_t *str)
 
static BOOL xmlstr_cmp (const xmlstr_t *xmlstr, const WCHAR *str)
 
static BOOL xmlstr_cmpi (const xmlstr_t *xmlstr, const WCHAR *str)
 
static BOOL xmlstr_cmp_end (const xmlstr_t *xmlstr, const WCHAR *str)
 
static BOOL xml_attr_cmp (const struct xml_attr *attr, const WCHAR *str)
 
static BOOL xml_name_cmp (const struct xml_elem *elem1, const struct xml_elem *elem2)
 
static BOOL xml_elem_cmp (const struct xml_elem *elem, const WCHAR *str, const WCHAR *namespace)
 
static BOOL isxmlspace (WCHAR ch)
 
static struct assemblyadd_assembly (ACTIVATION_CONTEXT *actctx, enum assembly_type at)
 
static struct dll_redirectadd_dll_redirect (struct assembly *assembly)
 
static PCOMPATIBILITY_CONTEXT_ELEMENT add_compat_context (struct assembly *assembly)
 
static void free_assembly_identity (struct assembly_identity *ai)
 
static struct entityadd_entity (struct entity_array *array, DWORD kind)
 
static void free_entity_array (struct entity_array *array)
 
static BOOL is_matching_string (const WCHAR *str1, const WCHAR *str2)
 
static BOOL is_matching_identity (const struct assembly_identity *id1, const struct assembly_identity *id2)
 
static BOOL add_dependent_assembly_id (struct actctx_loader *acl, struct assembly_identity *ai)
 
static void free_depend_manifests (struct actctx_loader *acl)
 
static WCHARbuild_assembly_dir (struct assembly_identity *ai)
 
static void append_string (WCHAR *buffer, const WCHAR *prefix, const WCHAR *str)
 
static WCHARbuild_assembly_id (const struct assembly_identity *ai)
 
static ACTIVATION_CONTEXTcheck_actctx (HANDLE h)
 
static void actctx_addref (ACTIVATION_CONTEXT *actctx)
 
static void actctx_release (ACTIVATION_CONTEXT *actctx)
 
static BOOL set_error (xmlbuf_t *xmlbuf)
 
static BOOL is_xmlns_attr (const struct xml_attr *attr)
 
static void push_xmlns (xmlbuf_t *xmlbuf, const struct xml_attr *attr)
 
static xmlstr_t find_xmlns (xmlbuf_t *xmlbuf, const xmlstr_t *name)
 
static BOOL next_xml_attr (xmlbuf_t *xmlbuf, struct xml_attr *attr, BOOL *end)
 
static void read_xml_elem (xmlbuf_t *xmlbuf, struct xml_elem *elem)
 
static BOOL next_xml_elem (xmlbuf_t *xmlbuf, struct xml_elem *elem, const struct xml_elem *parent)
 
static BOOL parse_xml_header (xmlbuf_t *xmlbuf)
 
static BOOL parse_text_content (xmlbuf_t *xmlbuf, xmlstr_t *content)
 
static BOOL parse_version (const xmlstr_t *str, struct assembly_version *version)
 
static void parse_expect_no_attr (xmlbuf_t *xmlbuf, BOOL *end)
 
static void parse_expect_end_elem (xmlbuf_t *xmlbuf, const struct xml_elem *parent)
 
static void parse_unknown_elem (xmlbuf_t *xmlbuf, const struct xml_elem *parent)
 
static void parse_assembly_identity_elem (xmlbuf_t *xmlbuf, ACTIVATION_CONTEXT *actctx, struct assembly_identity *ai, const struct xml_elem *parent)
 
static enum comclass_threadingmodel parse_com_class_threadingmodel (xmlstr_t *value)
 
static OLEMISC get_olemisc_value (const WCHAR *str, int len)
 
static DWORD parse_com_class_misc (const xmlstr_t *value)
 
static BOOL com_class_add_progid (const xmlstr_t *progid, struct entity *entity)
 
static void parse_com_class_progid (xmlbuf_t *xmlbuf, struct entity *entity, const struct xml_elem *parent)
 
static void parse_com_class_elem (xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl, const struct xml_elem *parent)
 
static BOOL parse_nummethods (const xmlstr_t *str, struct entity *entity)
 
static void parse_add_interface_class (xmlbuf_t *xmlbuf, struct entity_array *entities, struct actctx_loader *acl, WCHAR *clsid)
 
static void parse_cominterface_proxy_stub_elem (xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl, const struct xml_elem *parent)
 
static BOOL parse_typelib_flags (const xmlstr_t *value, struct entity *entity)
 
static BOOL parse_typelib_version (const xmlstr_t *str, struct entity *entity)
 
static void parse_typelib_elem (xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl, const struct xml_elem *parent)
 
static int aligned_string_len (int len)
 
static int get_assembly_version (struct assembly *assembly, WCHAR *ret)
 
static void parse_window_class_elem (xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_binding_redirect_elem (xmlbuf_t *xmlbuf, const struct xml_elem *parent)
 
static void parse_description_elem (xmlbuf_t *xmlbuf, const struct xml_elem *parent)
 
static void parse_com_interface_external_proxy_stub_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_clr_class_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_clr_surrogate_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_dependent_assembly_elem (xmlbuf_t *xmlbuf, struct actctx_loader *acl, const struct xml_elem *parent, BOOL optional)
 
static void parse_dependency_elem (xmlbuf_t *xmlbuf, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_noinherit_elem (xmlbuf_t *xmlbuf, const struct xml_elem *parent)
 
static void parse_noinheritable_elem (xmlbuf_t *xmlbuf, const struct xml_elem *parent)
 
static void parse_file_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_supportedos_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_compatibility_application_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_compatibility_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_settings_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, struct xml_elem *parent)
 
static void parse_windows_settings_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_application_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_requested_execution_level_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_requested_privileges_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_security_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_trust_info_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
 
static void parse_assembly_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent, struct assembly_identity *expected_ai)
 
static NTSTATUS parse_manifest_buffer (struct actctx_loader *acl, struct assembly *assembly, struct assembly_identity *ai, xmlbuf_t *xmlbuf)
 
static NTSTATUS parse_manifest (struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, const void *buffer, SIZE_T size)
 
static NTSTATUS open_nt_file (HANDLE *handle, UNICODE_STRING *name)
 
static NTSTATUS get_module_filename (HMODULE module, UNICODE_STRING *str, USHORT extra_len)
 
static NTSTATUS get_manifest_in_module (struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, HANDLE hModule, LPCWSTR resname, ULONG lang)
 
IMAGE_RESOURCE_DIRECTORYfind_entry_by_name (IMAGE_RESOURCE_DIRECTORY *dir, LPCWSTR name, void *root, int want_dir)
 
IMAGE_RESOURCE_DIRECTORYfind_first_entry (IMAGE_RESOURCE_DIRECTORY *dir, void *root, int want_dir)
 
static IMAGE_RESOURCE_DIRECTORYfind_first_id_entry (IMAGE_RESOURCE_DIRECTORY *dir, void *root, int want_dir)
 
static NTSTATUS search_manifest_in_module (struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, HANDLE hModule, ULONG lang)
 
static NTSTATUS get_manifest_in_pe_file (struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, HANDLE file, LPCWSTR resname, ULONG lang)
 
static NTSTATUS get_manifest_in_manifest_file (struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, HANDLE file)
 
static NTSTATUS get_manifest_in_associated_manifest (struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, HMODULE module, LPCWSTR resname)
 
static WCHARlookup_manifest_file (HANDLE dir, struct assembly_identity *ai)
 
static NTSTATUS lookup_winsxs (struct actctx_loader *acl, struct assembly_identity *ai)
 
static NTSTATUS lookup_assembly (struct actctx_loader *acl, struct assembly_identity *ai)
 
static NTSTATUS parse_depend_manifests (struct actctx_loader *acl)
 
static NTSTATUS find_query_actctx (HANDLE *handle, DWORD flags, ULONG class)
 
static NTSTATUS build_dllredirect_section (ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
 
static struct string_indexfind_string_index (const struct strsection_header *section, const UNICODE_STRING *name)
 
static struct guid_indexfind_guid_index (const struct guidsection_header *section, const GUID *guid)
 
static struct dllredirect_dataget_dllredirect_data (ACTIVATION_CONTEXT *ctxt, struct string_index *index)
 
static NTSTATUS find_dll_redirection (ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
 
static struct string_indexget_wndclass_first_index (ACTIVATION_CONTEXT *actctx)
 
static struct wndclass_redirect_dataget_wndclass_data (ACTIVATION_CONTEXT *ctxt, struct string_index *index)
 
static NTSTATUS build_wndclass_section (ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
 
static NTSTATUS find_window_class (ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
 
static _Must_inspect_result_ NTSTATUS build_tlib_section (ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
 
static struct tlibredirect_dataget_tlib_data (ACTIVATION_CONTEXT *actctx, struct guid_index *index)
 
static NTSTATUS find_tlib_redirection (ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
 
static void generate_uuid (ULONG *seed, GUID *guid)
 
static void get_comserver_datalen (const struct entity_array *entities, const struct dll_redirect *dll, unsigned int *count, unsigned int *len, unsigned int *module_len)
 
static _Must_inspect_result_ NTSTATUS add_comserver_record (const struct guidsection_header *section, const struct entity_array *entities, const struct dll_redirect *dll, struct guid_index **index, ULONG *data_offset, ULONG *module_offset, ULONG *seed, ULONG rosterindex)
 
static _Must_inspect_result_ NTSTATUS build_comserver_section (ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
 
static struct comclassredirect_dataget_comclass_data (ACTIVATION_CONTEXT *actctx, struct guid_index *index)
 
static _Must_inspect_result_ NTSTATUS find_comserver_redirection (ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
 
static void get_ifaceps_datalen (const struct entity_array *entities, unsigned int *count, unsigned int *len)
 
static _Must_inspect_result_ NTSTATUS add_ifaceps_record (struct guidsection_header *section, struct entity_array *entities, struct guid_index **index, ULONG *data_offset, ULONG rosterindex)
 
static _Must_inspect_result_ NTSTATUS build_ifaceps_section (ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
 
static struct ifacepsredirect_dataget_ifaceps_data (ACTIVATION_CONTEXT *actctx, struct guid_index *index)
 
static _Must_inspect_result_ NTSTATUS find_cominterface_redirection (ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
 
static _Must_inspect_result_ NTSTATUS build_clr_surrogate_section (ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
 
static struct clrsurrogate_dataget_surrogate_data (ACTIVATION_CONTEXT *actctx, const struct guid_index *index)
 
static _Must_inspect_result_ NTSTATUS find_clr_surrogate (ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
 
static void get_progid_datalen (struct entity_array *entities, unsigned int *count, unsigned int *total_len)
 
static void write_progid_record (struct strsection_header *section, const WCHAR *progid, const GUID *alias, struct string_index **index, ULONG *data_offset, ULONG *global_offset, ULONG rosterindex)
 
static _Must_inspect_result_ NTSTATUS add_progid_record (ACTIVATION_CONTEXT *actctx, struct strsection_header *section, const struct entity_array *entities, struct string_index **index, ULONG *data_offset, ULONG *global_offset, ULONG rosterindex)
 
static _Must_inspect_result_ NTSTATUS build_progid_section (ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
 
static struct progidredirect_dataget_progid_data (ACTIVATION_CONTEXT *actctx, const struct string_index *index)
 
static NTSTATUS find_progid_redirection (ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
 
static NTSTATUS find_string (ACTIVATION_CONTEXT *actctx, ULONG section_kind, const UNICODE_STRING *section_name, DWORD flags, PACTCTX_SECTION_KEYED_DATA data)
 
static NTSTATUS find_guid (ACTIVATION_CONTEXT *actctx, ULONG section_kind, const GUID *guid, DWORD flags, PACTCTX_SECTION_KEYED_DATA data)
 
void actctx_init (PVOID *pOldShimData)
 
NTSTATUS NTAPI RtlCreateActivationContext (IN ULONG Flags, IN PACTIVATION_CONTEXT_DATA ActivationContextData, IN ULONG ExtraBytes, IN PVOID NotificationRoutine, IN PVOID NotificationContext, OUT PACTIVATION_CONTEXT *ActCtx)
 
VOID NTAPI RtlAddRefActivationContext (HANDLE handle)
 
VOID NTAPI RtlReleaseActivationContext (HANDLE handle)
 
NTSTATUS NTAPI RtlZombifyActivationContext (PVOID Context)
 
NTSTATUS NTAPI RtlActivateActivationContextEx (ULONG flags, PTEB tebAddress, HANDLE handle, PULONG_PTR cookie)
 
NTSTATUS NTAPI RtlActivateActivationContext (ULONG flags, HANDLE handle, PULONG_PTR cookie)
 
NTSTATUS NTAPI RtlDeactivateActivationContext (ULONG flags, ULONG_PTR cookie)
 
VOID NTAPI RtlFreeActivationContextStack (IN PACTIVATION_CONTEXT_STACK Stack)
 
VOID NTAPI RtlFreeThreadActivationContextStack (VOID)
 
NTSTATUS NTAPI RtlGetActiveActivationContext (HANDLE *handle)
 
BOOLEAN NTAPI RtlIsActivationContextActive (HANDLE handle)
 
NTSTATUS NTAPI RtlQueryInformationActivationContext (ULONG flags, HANDLE handle, PVOID subinst, ULONG class, PVOID buffer, SIZE_T bufsize, SIZE_T *retlen)
 
NTSTATUS NTAPI RtlQueryInformationActiveActivationContext (ULONG ulInfoClass, PVOID pvBuffer, SIZE_T cbBuffer OPTIONAL, SIZE_T *pcbWrittenOrRequired OPTIONAL)
 
NTSTATUS NTAPI RtlpFindActivationContextSection_CheckParameters (ULONG flags, const GUID *guid, ULONG section_kind, const UNICODE_STRING *section_name, PACTCTX_SECTION_KEYED_DATA data)
 
NTSTATUS NTAPI RtlFindActivationContextSectionString (ULONG flags, const GUID *guid, ULONG section_kind, const UNICODE_STRING *section_name, PVOID ptr)
 
NTSTATUS WINAPI RtlFindActivationContextSectionGuid (ULONG flags, const GUID *extguid, ULONG section_kind, const GUID *guid, void *ptr)
 
NTSTATUS NTAPI RtlAllocateActivationContextStack (IN PACTIVATION_CONTEXT_STACK *Stack)
 
PRTL_ACTIVATION_CONTEXT_STACK_FRAME FASTCALL RtlActivateActivationContextUnsafeFast (IN PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame, IN PVOID Context)
 
PRTL_ACTIVATION_CONTEXT_STACK_FRAME FASTCALL RtlDeactivateActivationContextUnsafeFast (IN PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame)
 

Variables

BOOLEAN RtlpNotAllowingMultipleActivation
 
static const xmlstr_t empty_xmlstr
 
static const WCHAR current_archW [] = {'n','o','n','e',0}
 
static const WCHAR asmv1W [] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','1',0}
 
static const WCHAR asmv2W [] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','2',0}
 
static const WCHAR asmv3W [] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','3',0}
 
static const WCHAR assemblyW [] = {'a','s','s','e','m','b','l','y',0}
 
static const WCHAR assemblyIdentityW [] = {'a','s','s','e','m','b','l','y','I','d','e','n','t','i','t','y',0}
 
static const WCHAR bindingRedirectW [] = {'b','i','n','d','i','n','g','R','e','d','i','r','e','c','t',0}
 
static const WCHAR clrClassW [] = {'c','l','r','C','l','a','s','s',0}
 
static const WCHAR clrSurrogateW [] = {'c','l','r','S','u','r','r','o','g','a','t','e',0}
 
static const WCHAR comClassW [] = {'c','o','m','C','l','a','s','s',0}
 
static const WCHAR comInterfaceExternalProxyStubW [] = {'c','o','m','I','n','t','e','r','f','a','c','e','E','x','t','e','r','n','a','l','P','r','o','x','y','S','t','u','b',0}
 
static const WCHAR comInterfaceProxyStubW [] = {'c','o','m','I','n','t','e','r','f','a','c','e','P','r','o','x','y','S','t','u','b',0}
 
static const WCHAR dependencyW [] = {'d','e','p','e','n','d','e','n','c','y',0}
 
static const WCHAR dependentAssemblyW [] = {'d','e','p','e','n','d','e','n','t','A','s','s','e','m','b','l','y',0}
 
static const WCHAR descriptionW [] = {'d','e','s','c','r','i','p','t','i','o','n',0}
 
static const WCHAR fileW [] = {'f','i','l','e',0}
 
static const WCHAR hashW [] = {'h','a','s','h',0}
 
static const WCHAR noInheritW [] = {'n','o','I','n','h','e','r','i','t',0}
 
static const WCHAR noInheritableW [] = {'n','o','I','n','h','e','r','i','t','a','b','l','e',0}
 
static const WCHAR typelibW [] = {'t','y','p','e','l','i','b',0}
 
static const WCHAR windowClassW [] = {'w','i','n','d','o','w','C','l','a','s','s',0}
 
static const WCHAR clsidW [] = {'c','l','s','i','d',0}
 
static const WCHAR hashalgW [] = {'h','a','s','h','a','l','g',0}
 
static const WCHAR helpdirW [] = {'h','e','l','p','d','i','r',0}
 
static const WCHAR iidW [] = {'i','i','d',0}
 
static const WCHAR languageW [] = {'l','a','n','g','u','a','g','e',0}
 
static const WCHAR manifestVersionW [] = {'m','a','n','i','f','e','s','t','V','e','r','s','i','o','n',0}
 
static const WCHAR g_nameW [] = {'n','a','m','e',0}
 
static const WCHAR neutralW [] = {'n','e','u','t','r','a','l',0}
 
static const WCHAR newVersionW [] = {'n','e','w','V','e','r','s','i','o','n',0}
 
static const WCHAR oldVersionW [] = {'o','l','d','V','e','r','s','i','o','n',0}
 
static const WCHAR optionalW [] = {'o','p','t','i','o','n','a','l',0}
 
static const WCHAR processorArchitectureW [] = {'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e',0}
 
static const WCHAR progidW [] = {'p','r','o','g','i','d',0}
 
static const WCHAR publicKeyTokenW [] = {'p','u','b','l','i','c','K','e','y','T','o','k','e','n',0}
 
static const WCHAR threadingmodelW [] = {'t','h','r','e','a','d','i','n','g','M','o','d','e','l',0}
 
static const WCHAR tlbidW [] = {'t','l','b','i','d',0}
 
static const WCHAR typeW [] = {'t','y','p','e',0}
 
static const WCHAR versionW [] = {'v','e','r','s','i','o','n',0}
 
static const WCHAR xmlnsW [] = {'x','m','l','n','s',0}
 
static const WCHAR versionedW [] = {'v','e','r','s','i','o','n','e','d',0}
 
static const WCHAR yesW [] = {'y','e','s',0}
 
static const WCHAR noW [] = {'n','o',0}
 
static const WCHAR restrictedW [] = {'R','E','S','T','R','I','C','T','E','D',0}
 
static const WCHAR controlW [] = {'C','O','N','T','R','O','L',0}
 
static const WCHAR hiddenW [] = {'H','I','D','D','E','N',0}
 
static const WCHAR hasdiskimageW [] = {'H','A','S','D','I','S','K','I','M','A','G','E',0}
 
static const WCHAR flagsW [] = {'f','l','a','g','s',0}
 
static const WCHAR miscstatusW [] = {'m','i','s','c','S','t','a','t','u','s',0}
 
static const WCHAR miscstatusiconW [] = {'m','i','s','c','S','t','a','t','u','s','I','c','o','n',0}
 
static const WCHAR miscstatuscontentW [] = {'m','i','s','c','S','t','a','t','u','s','C','o','n','t','e','n','t',0}
 
static const WCHAR miscstatusthumbnailW [] = {'m','i','s','c','S','t','a','t','u','s','T','h','u','m','b','n','a','i','l',0}
 
static const WCHAR miscstatusdocprintW [] = {'m','i','s','c','S','t','a','t','u','s','D','o','c','P','r','i','n','t',0}
 
static const WCHAR baseInterfaceW [] = {'b','a','s','e','I','n','t','e','r','f','a','c','e',0}
 
static const WCHAR nummethodsW [] = {'n','u','m','M','e','t','h','o','d','s',0}
 
static const WCHAR proxyStubClsid32W [] = {'p','r','o','x','y','S','t','u','b','C','l','s','i','d','3','2',0}
 
static const WCHAR runtimeVersionW [] = {'r','u','n','t','i','m','e','V','e','r','s','i','o','n',0}
 
static const WCHAR mscoreeW [] = {'M','S','C','O','R','E','E','.','D','L','L',0}
 
static const WCHAR mscoree2W [] = {'m','s','c','o','r','e','e','.','d','l','l',0}
 
static const WCHAR activatewhenvisibleW [] = {'a','c','t','i','v','a','t','e','w','h','e','n','v','i','s','i','b','l','e',0}
 
static const WCHAR actslikebuttonW [] = {'a','c','t','s','l','i','k','e','b','u','t','t','o','n',0}
 
static const WCHAR actslikelabelW [] = {'a','c','t','s','l','i','k','e','l','a','b','e','l',0}
 
static const WCHAR alignableW [] = {'a','l','i','g','n','a','b','l','e',0}
 
static const WCHAR alwaysrunW [] = {'a','l','w','a','y','s','r','u','n',0}
 
static const WCHAR canlinkbyole1W [] = {'c','a','n','l','i','n','k','b','y','o','l','e','1',0}
 
static const WCHAR cantlinkinsideW [] = {'c','a','n','t','l','i','n','k','i','n','s','i','d','e',0}
 
static const WCHAR ignoreactivatewhenvisibleW [] = {'i','g','n','o','r','e','a','c','t','i','v','a','t','e','w','h','e','n','v','i','s','i','b','l','e',0}
 
static const WCHAR imemodeW [] = {'i','m','e','m','o','d','e',0}
 
static const WCHAR insertnotreplaceW [] = {'i','n','s','e','r','t','n','o','t','r','e','p','l','a','c','e',0}
 
static const WCHAR insideoutW [] = {'i','n','s','i','d','e','o','u','t',0}
 
static const WCHAR invisibleatruntimeW [] = {'i','n','v','i','s','i','b','l','e','a','t','r','u','n','t','i','m','e',0}
 
static const WCHAR islinkobjectW [] = {'i','s','l','i','n','k','o','b','j','e','c','t',0}
 
static const WCHAR nouiactivateW [] = {'n','o','u','i','a','c','t','i','v','a','t','e',0}
 
static const WCHAR onlyiconicW [] = {'o','n','l','y','i','c','o','n','i','c',0}
 
static const WCHAR recomposeonresizeW [] = {'r','e','c','o','m','p','o','s','e','o','n','r','e','s','i','z','e',0}
 
static const WCHAR renderingisdeviceindependentW [] = {'r','e','n','d','e','r','i','n','g','i','s','d','e','v','i','c','e','i','n','d','e','p','e','n','d','e','n','t',0}
 
static const WCHAR setclientsitefirstW [] = {'s','e','t','c','l','i','e','n','t','s','i','t','e','f','i','r','s','t',0}
 
static const WCHAR simpleframeW [] = {'s','i','m','p','l','e','f','r','a','m','e',0}
 
static const WCHAR staticW [] = {'s','t','a','t','i','c',0}
 
static const WCHAR supportsmultilevelundoW [] = {'s','u','p','p','o','r','t','s','m','u','l','t','i','l','e','v','e','l','u','n','d','o',0}
 
static const WCHAR wantstomenumergeW [] = {'w','a','n','t','s','t','o','m','e','n','u','m','e','r','g','e',0}
 
static const WCHAR compatibilityW [] = {'c','o','m','p','a','t','i','b','i','l','i','t','y',0}
 
static const WCHAR compatibilityNSW [] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','c','o','m','p','a','t','i','b','i','l','i','t','y','.','v','1',0}
 
static const WCHAR applicationW [] = {'a','p','p','l','i','c','a','t','i','o','n',0}
 
static const WCHAR supportedOSW [] = {'s','u','p','p','o','r','t','e','d','O','S',0}
 
static const WCHAR IdW [] = {'I','d',0}
 
static const WCHAR requestedExecutionLevelW [] = {'r','e','q','u','e','s','t','e','d','E','x','e','c','u','t','i','o','n','L','e','v','e','l',0}
 
static const WCHAR requestedPrivilegesW [] = {'r','e','q','u','e','s','t','e','d','P','r','i','v','i','l','e','g','e','s',0}
 
static const WCHAR securityW [] = {'s','e','c','u','r','i','t','y',0}
 
static const WCHAR trustInfoW [] = {'t','r','u','s','t','I','n','f','o',0}
 
static const WCHAR windowsSettingsW [] = {'w','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}
 
static const WCHAR autoElevateW [] = {'a','u','t','o','E','l','e','v','a','t','e',0}
 
static const WCHAR disableThemingW [] = {'d','i','s','a','b','l','e','T','h','e','m','i','n','g',0}
 
static const WCHAR disableWindowFilteringW [] = {'d','i','s','a','b','l','e','W','i','n','d','o','w','F','i','l','t','e','r','i','n','g',0}
 
static const WCHAR windowsSettings2005NSW [] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','0','5','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}
 
static const WCHAR windowsSettings2011NSW [] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','1','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}
 
static const WCHAR windowsSettings2016NSW [] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','6','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}
 
static const WCHAR windowsSettings2017NSW [] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','7','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}
 
static const WCHAR dpiAwareW [] = {'d','p','i','A','w','a','r','e',0}
 
static const WCHAR dpiAwarenessW [] = {'d','p','i','A','w','a','r','e','n','e','s','s',0}
 
static const WCHAR gdiScalingW [] = {'g','d','i','S','c','a','l','i','n','g',0}
 
static const WCHAR highResolutionScrollingAwareW [] = {'h','i','g','h','R','e','s','o','l','u','t','i','o','n','S','c','r','o','l','l','i','n','g','A','w','a','r','e',0}
 
static const WCHAR longPathAwareW [] = {'l','o','n','g','P','a','t','h','A','w','a','r','e',0}
 
static const WCHAR magicFutureSettingW [] = {'m','a','g','i','c','F','u','t','u','r','e','S','e','t','t','i','n','g',0}
 
static const WCHAR printerDriverIsolationW [] = {'p','r','i','n','t','e','r','D','r','i','v','e','r','I','s','o','l','a','t','i','o','n',0}
 
static const WCHAR ultraHighResolutionScrollingAwareW [] = {'u','l','t','r','a','H','i','g','h','R','e','s','o','l','u','t','i','o','n','S','c','r','o','l','l','i','n','g','A','w','a','r','e',0}
 
static const struct olemisc_entry olemisc_values []
 
static const WCHAR g_xmlW [] = {'?','x','m','l',0}
 
static const WCHAR manifestv1W [] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','1',0}
 
static const WCHAR manifestv2W [] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','2',0}
 
static const WCHAR manifestv3W [] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','3',0}
 
static const WCHAR dotManifestW [] = {'.','m','a','n','i','f','e','s','t',0}
 
static const WCHAR version_formatW [] = {'%','u','.','%','u','.','%','u','.','%','u',0}
 
static const WCHAR wildcardW [] = {'*',0}
 
static ACTIVATION_CONTEXT_WRAPPED system_actctx = { ACTCTX_MAGIC_MARKER, { 1 } }
 
static ACTIVATION_CONTEXTprocess_actctx = &system_actctx.ActivationContext
 
static ACTIVATION_CONTEXTimplicit_actctx = &system_actctx.ActivationContext
 

Macro Definition Documentation

◆ ACTCTX_FAKE_COOKIE

#define ACTCTX_FAKE_COOKIE   ((ULONG_PTR) 0xf00bad)

Definition at line 44 of file actctx.c.

◆ ACTCTX_FAKE_HANDLE

#define ACTCTX_FAKE_HANDLE   ((HANDLE) 0xf00baa)

Definition at line 43 of file actctx.c.

◆ ACTCTX_FLAGS_ALL

#define ACTCTX_FLAGS_ALL
Value:
(\
ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID |\
ACTCTX_FLAG_LANGID_VALID |\
ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID |\
ACTCTX_FLAG_RESOURCE_NAME_VALID |\
ACTCTX_FLAG_SET_PROCESS_DEFAULT |\
ACTCTX_FLAG_APPLICATION_NAME_VALID |\
ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF |\
ACTCTX_FLAG_HMODULE_VALID )

Definition at line 28 of file actctx.c.

◆ ACTCTX_MAGIC_MARKER

#define ACTCTX_MAGIC_MARKER   (PVOID)'gMcA'

Definition at line 41 of file actctx.c.

◆ FIND_ACTCTX_RETURN_ASSEMBLY_METADATA

#define FIND_ACTCTX_RETURN_ASSEMBLY_METADATA   0x00000004

Definition at line 5780 of file actctx.c.

◆ FIND_ACTCTX_RETURN_FLAGS

#define FIND_ACTCTX_RETURN_FLAGS   0x00000002

Definition at line 5779 of file actctx.c.

◆ FIND_ACTCTX_VALID_MASK

#define FIND_ACTCTX_VALID_MASK   (FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX | FIND_ACTCTX_RETURN_FLAGS | FIND_ACTCTX_RETURN_ASSEMBLY_METADATA)

Definition at line 5781 of file actctx.c.

◆ GUIDSECTION_MAGIC

#define GUIDSECTION_MAGIC   0x64487347 /* dHsG */

Definition at line 39 of file actctx.c.

◆ MAX_NAMESPACES

#define MAX_NAMESPACES   64

Definition at line 46 of file actctx.c.

◆ NDEBUG

#define NDEBUG

Definition at line 21 of file actctx.c.

◆ STRSECTION_MAGIC

#define STRSECTION_MAGIC   0x64487353 /* dHsS */

Definition at line 38 of file actctx.c.

Typedef Documentation

◆ ACTIVATION_CONTEXT

◆ ACTIVATION_CONTEXT_WRAPPED

◆ ASSEMBLY_STORAGE_MAP

◆ ASSEMBLY_STORAGE_MAP_ENTRY

◆ PACTIVATION_CONTEXT_WRAPPED

◆ PASSEMBLY_STORAGE_MAP

◆ PASSEMBLY_STORAGE_MAP_ENTRY

◆ PIACTIVATION_CONTEXT

Enumeration Type Documentation

◆ assembly_type

Enumerator
APPLICATION_MANIFEST 
ASSEMBLY_MANIFEST 
ASSEMBLY_SHARED_MANIFEST 

Definition at line 458 of file actctx.c.

459{
463};
@ APPLICATION_MANIFEST
Definition: actctx.c:460
@ ASSEMBLY_SHARED_MANIFEST
Definition: actctx.c:462
@ ASSEMBLY_MANIFEST
Definition: actctx.c:461

◆ comclass_miscfields

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

Definition at line 184 of file actctx.c.

185{
186 MiscStatus = 1,
187 MiscStatusIcon = 2,
191};
@ MiscStatusContent
Definition: actctx.c:1374
@ MiscStatusThumbnail
Definition: actctx.c:1375
@ MiscStatus
Definition: actctx.c:1372
@ MiscStatusDocPrint
Definition: actctx.c:1376
@ MiscStatusIcon
Definition: actctx.c:1373

◆ comclass_threadingmodel

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

Definition at line 175 of file actctx.c.

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

◆ context_sections

Enumerator
WINDOWCLASS_SECTION 
DLLREDIRECT_SECTION 
TLIBREDIRECT_SECTION 
SERVERREDIRECT_SECTION 
IFACEREDIRECT_SECTION 
CLRSURROGATES_SECTION 
PROGIDREDIRECT_SECTION 

Definition at line 482 of file actctx.c.

483{
491};
@ SERVERREDIRECT_SECTION
Definition: actctx.c:487
@ IFACEREDIRECT_SECTION
Definition: actctx.c:488
@ CLRSURROGATES_SECTION
Definition: actctx.c:489
@ PROGIDREDIRECT_SECTION
Definition: actctx.c:490
@ TLIBREDIRECT_SECTION
Definition: actctx.c:486
@ WINDOWCLASS_SECTION
Definition: actctx.c:484
@ DLLREDIRECT_SECTION
Definition: actctx.c:485

◆ ifaceps_mask

Enumerator
NumMethods 
BaseIface 
NumMethods 
BaseIface 

Definition at line 217 of file actctx.c.

218{
219 NumMethods = 1,
220 BaseIface = 2
221};
@ BaseIface
Definition: actctx.c:1557
@ NumMethods
Definition: actctx.c:1556

Function Documentation

◆ actctx_addref()

static void actctx_addref ( ACTIVATION_CONTEXT actctx)
inlinestatic

Definition at line 1180 of file actctx.c.

1181{
1182 InterlockedExchangeAdd( &actctx->RefCount, 1 );
1183}
#define InterlockedExchangeAdd
Definition: interlocked.h:181
#define actctx
Definition: kernel32.h:8

Referenced by find_guid(), find_string(), and RtlAddRefActivationContext().

◆ actctx_init()

void actctx_init ( PVOID pOldShimData)

Definition at line 5075 of file actctx.c.

5076{
5077 ACTCTXW ctx;
5078 HANDLE handle;
5079 WCHAR buffer[1024];
5081
5082 ctx.cbSize = sizeof(ctx);
5083 ctx.lpSource = NULL;
5084 ctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
5085 ctx.hModule = NtCurrentTeb()->ProcessEnvironmentBlock->ImageBaseAddress;
5087
5089 {
5091 }
5092
5093 /* ReactOS specific:
5094 Now that we have found the process_actctx we can initialize the process compat subsystem */
5096
5097
5098 ctx.dwFlags = 0;
5099 ctx.hModule = NULL;
5100 ctx.lpResourceName = NULL;
5101 ctx.lpSource = buffer;
5103
5105 {
5106 RtlStringCchCatW(buffer, RTL_NUMBER_OF(buffer), L"\\winsxs\\manifests\\forwardcompatible.manifest");
5107 }
5108 else
5109 {
5110 RtlStringCchCatW(buffer, RTL_NUMBER_OF(buffer), L"\\winsxs\\manifests\\systemcompatible.manifest");
5111 }
5112
5114 if (NT_SUCCESS(Status))
5115 {
5117 }
5118 else
5119 {
5120 DPRINT1("Failed to create the implicit act ctx. Status: 0x%x!!!\n", Status);
5121 }
5122}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
static DWORD RosGetProcessCompatVersion(VOID)
Definition: compat_undoc.h:22
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:25
GLuint buffer
Definition: glext.h:5915
NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE *, const void *)
#define NtCurrentTeb
VOID NTAPI LdrpInitializeProcessCompat(PVOID pProcessActctx, PVOID *pOldShimData)
Definition: ldrinit.c:1580
NTSTRSAFEAPI RtlStringCchCopyW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
Definition: ntstrsafe.h:127
NTSTRSAFEAPI RtlStringCchCatW(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
Definition: ntstrsafe.h:601
#define L(x)
Definition: ntvdm.h:50
#define SharedUserData
static ACTIVATION_CONTEXT * implicit_actctx
Definition: actctx.c:766
static ACTIVATION_CONTEXT * process_actctx
Definition: actctx.c:765
static ACTIVATION_CONTEXT * check_actctx(HANDLE h)
Definition: actctx.c:1158
#define CREATEPROCESS_MANIFEST_RESOURCE_ID
Definition: winuser.h:622
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by LdrpInitializeProcess().

◆ actctx_release()

static void actctx_release ( ACTIVATION_CONTEXT actctx)
static

Definition at line 1185 of file actctx.c.

1186{
1188
1189 if (InterlockedExchangeAdd(&actctx->RefCount, -1) == 1)
1190 {
1191 unsigned int i, j;
1192
1193 for (i = 0; i < actctx->num_assemblies; i++)
1194 {
1195 struct assembly *assembly = &actctx->assemblies[i];
1196 for (j = 0; j < assembly->num_dlls; j++)
1197 {
1198 struct dll_redirect *dll = &assembly->dlls[j];
1199 free_entity_array( &dll->entities );
1200 RtlFreeHeap( RtlGetProcessHeap(), 0, dll->name );
1201 RtlFreeHeap( RtlGetProcessHeap(), 0, dll->hash );
1202 }
1203 RtlFreeHeap( RtlGetProcessHeap(), 0, assembly->dlls );
1204 RtlFreeHeap( RtlGetProcessHeap(), 0, assembly->manifest.info );
1205 RtlFreeHeap( RtlGetProcessHeap(), 0, assembly->directory );
1206 RtlFreeHeap( RtlGetProcessHeap(), 0, assembly->compat_contexts );
1209 }
1210 RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->config.info );
1211 RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->appdir.info );
1212 RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->assemblies );
1213 RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->dllredirect_section );
1214 RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->wndclass_section );
1215 RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->tlib_section );
1216 RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->comserver_section );
1217 RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->ifaceps_section );
1218 RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->clrsurrogate_section );
1219 RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->progid_section );
1220
1221 pActual = CONTAINING_RECORD(actctx, ACTIVATION_CONTEXT_WRAPPED, ActivationContext);
1222 pActual->MagicMarker = 0;
1223 RtlFreeHeap(RtlGetProcessHeap(), 0, pActual);
1224 }
1225}
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static HMODULE dll
Definition: str.c:188
static void free_entity_array(struct entity_array *array)
Definition: actctx.c:952
static void free_assembly_identity(struct assembly_identity *ai)
Definition: actctx.c:915
WCHAR * directory
Definition: actctx.c:470
struct dll_redirect * dlls
Definition: actctx.c:472
struct assembly_identity id
Definition: actctx.c:468
unsigned int num_dlls
Definition: actctx.c:473
struct file_info manifest
Definition: actctx.c:469
struct entity_array entities
Definition: actctx.c:475
COMPATIBILITY_CONTEXT_ELEMENT * compat_contexts
Definition: actctx.c:476
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by RtlCreateActivationContext(), and RtlReleaseActivationContext().

◆ add_assembly()

static struct assembly * add_assembly ( ACTIVATION_CONTEXT actctx,
enum assembly_type  at 
)
static

Definition at line 839 of file actctx.c.

840{
841 struct assembly *assembly;
842
843 DPRINT("add_assembly() actctx %p, activeframe ??\n", actctx);
844
845 if (actctx->num_assemblies == actctx->allocated_assemblies)
846 {
847 void *ptr;
848 unsigned int new_count;
849 if (actctx->assemblies)
850 {
851 new_count = actctx->allocated_assemblies * 2;
852 ptr = RtlReAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY,
853 actctx->assemblies, new_count * sizeof(*assembly) );
854 }
855 else
856 {
857 new_count = 4;
858 ptr = RtlAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*assembly) );
859 }
860 if (!ptr) return NULL;
861 actctx->assemblies = ptr;
862 actctx->allocated_assemblies = new_count;
863 }
864
865 assembly = &actctx->assemblies[actctx->num_assemblies++];
866 assembly->type = at;
867 return assembly;
868}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE, ULONG, PVOID, SIZE_T)
Definition: heap.c:2667
static PVOID ptr
Definition: dispmode.c:27
#define DPRINT
Definition: sndvol32.h:71
BSTR type
Definition: cache.c:326

Referenced by parse_manifest().

◆ add_compat_context()

static PCOMPATIBILITY_CONTEXT_ELEMENT add_compat_context ( struct assembly assembly)
static

Definition at line 896 of file actctx.c.

897{
898 void *ptr;
900 {
901 unsigned int new_count = assembly->num_compat_contexts + 1;
902 ptr = RtlReAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY,
904 new_count * sizeof(COMPATIBILITY_CONTEXT_ELEMENT) );
905 }
906 else
907 {
908 ptr = RtlAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(COMPATIBILITY_CONTEXT_ELEMENT) );
909 }
910 if (!ptr) return NULL;
913}
ULONG num_compat_contexts
Definition: actctx.c:477

Referenced by parse_supportedos_elem().

◆ add_comserver_record()

static _Must_inspect_result_ NTSTATUS add_comserver_record ( const struct guidsection_header section,
const struct entity_array entities,
const struct dll_redirect dll,
struct guid_index **  index,
ULONG data_offset,
ULONG module_offset,
ULONG seed,
ULONG  rosterindex 
)
static

Definition at line 4086 of file actctx.c.

4089{
4090 unsigned int i;
4092
4093 for (i = 0; i < entities->num; i++)
4094 {
4095 struct entity *entity = &entities->base[i];
4096 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4097 {
4098 ULONG module_len, progid_len, str_len = 0;
4100 struct guid_index *alias_index;
4101 struct clrclass_data *clrdata;
4103 WCHAR *ptrW;
4104
4105 if (entity->u.comclass.progid)
4106 progid_len = strlenW(entity->u.comclass.progid)*sizeof(WCHAR);
4107 else
4108 progid_len = 0;
4109
4110 module_len = dll ? strlenW(dll->name)*sizeof(WCHAR) : strlenW(mscoreeW)*sizeof(WCHAR);
4111
4112 /* setup new index entry */
4114 Status = RtlGUIDFromString(&str, &(*index)->guid);
4115 if (!NT_SUCCESS(Status))
4116 return Status;
4117
4118 (*index)->data_offset = *data_offset;
4119 (*index)->data_len = sizeof(*data); /* additional length added later */
4120 (*index)->rosterindex = rosterindex;
4121
4122 /* Setup new index entry for alias guid. Alias index records are placed after
4123 normal records, so normal guids are hit first on search. Note that class count
4124 is doubled. */
4125 alias_index = (*index) + section->count/2;
4126 generate_uuid(seed, &alias_index->guid);
4127 alias_index->data_offset = (*index)->data_offset;
4128 alias_index->data_len = 0;
4129 alias_index->rosterindex = (*index)->rosterindex;
4130
4131 /* setup data */
4132 data = (struct comclassredirect_data*)((BYTE*)section + (*index)->data_offset);
4133 data->size = sizeof(*data);
4134 data->res = 0;
4135 data->res1[0] = 0;
4136 data->res1[1] = 0;
4137 data->model = entity->u.comclass.model;
4138 data->clsid = (*index)->guid;
4139 data->alias = alias_index->guid;
4140 data->clsid2 = data->clsid;
4141 if (entity->u.comclass.tlbid)
4142 {
4144 Status = RtlGUIDFromString(&str, &data->tlbid);
4145 if (!NT_SUCCESS(Status))
4146 return Status;
4147 }
4148 else
4149 memset(&data->tlbid, 0, sizeof(data->tlbid));
4150 data->name_len = module_len;
4151 data->name_offset = *module_offset;
4152 data->progid_len = progid_len;
4153 data->progid_offset = data->progid_len ? data->size : 0; /* in case of clrClass additional offset is added later */
4154 data->clrdata_len = 0; /* will be set later */
4155 data->clrdata_offset = entity->u.comclass.name ? sizeof(*data) : 0;
4156 data->miscstatus = entity->u.comclass.miscstatus;
4157 data->miscstatuscontent = entity->u.comclass.miscstatuscontent;
4158 data->miscstatusthumbnail = entity->u.comclass.miscstatusthumbnail;
4159 data->miscstatusicon = entity->u.comclass.miscstatusicon;
4160 data->miscstatusdocprint = entity->u.comclass.miscstatusdocprint;
4161
4162 /* mask describes which misc* data is available */
4163 data->miscmask = 0;
4164 if (data->miscstatus)
4165 data->miscmask |= MiscStatus;
4166 if (data->miscstatuscontent)
4167 data->miscmask |= MiscStatusContent;
4168 if (data->miscstatusthumbnail)
4169 data->miscmask |= MiscStatusThumbnail;
4170 if (data->miscstatusicon)
4171 data->miscmask |= MiscStatusIcon;
4172 if (data->miscstatusdocprint)
4173 data->miscmask |= MiscStatusDocPrint;
4174
4175 if (data->clrdata_offset)
4176 {
4177 clrdata = (struct clrclass_data*)((BYTE*)data + data->clrdata_offset);
4178
4179 clrdata->size = sizeof(*clrdata);
4180 clrdata->res[0] = 0;
4181 clrdata->res[1] = 2; /* FIXME: unknown field */
4182 clrdata->module_len = strlenW(mscoreeW)*sizeof(WCHAR);
4183 clrdata->module_offset = *module_offset + data->name_len + sizeof(WCHAR);
4184 clrdata->name_len = strlenW(entity->u.comclass.name)*sizeof(WCHAR);
4185 clrdata->name_offset = clrdata->size;
4186 clrdata->version_len = entity->u.comclass.version ? strlenW(entity->u.comclass.version)*sizeof(WCHAR) : 0;
4187 clrdata->version_offset = clrdata->version_len ? clrdata->name_offset + clrdata->name_len + sizeof(WCHAR) : 0;
4188 clrdata->res2[0] = 0;
4189 clrdata->res2[1] = 0;
4190
4191 data->clrdata_len = clrdata->size + clrdata->name_len + sizeof(WCHAR);
4192
4193 /* module name */
4194 ptrW = (WCHAR*)((BYTE*)section + clrdata->module_offset);
4195 memcpy(ptrW, mscoree2W, clrdata->module_len);
4196 ptrW[clrdata->module_len/sizeof(WCHAR)] = 0;
4197
4198 ptrW = (WCHAR*)((BYTE*)section + data->name_offset);
4199 memcpy(ptrW, mscoreeW, data->name_len);
4200 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4201
4202 /* class name */
4203 ptrW = (WCHAR*)((BYTE*)clrdata + clrdata->name_offset);
4204 memcpy(ptrW, entity->u.comclass.name, clrdata->name_len);
4205 ptrW[clrdata->name_len/sizeof(WCHAR)] = 0;
4206
4207 /* runtime version, optional */
4208 if (clrdata->version_len)
4209 {
4210 data->clrdata_len += clrdata->version_len + sizeof(WCHAR);
4211
4212 ptrW = (WCHAR*)((BYTE*)clrdata + clrdata->version_offset);
4213 memcpy(ptrW, entity->u.comclass.version, clrdata->version_len);
4214 ptrW[clrdata->version_len/sizeof(WCHAR)] = 0;
4215 }
4216
4217 if (data->progid_len)
4218 data->progid_offset += data->clrdata_len;
4219 (*index)->data_len += sizeof(*clrdata);
4220 }
4221 else
4222 {
4223 clrdata = NULL;
4224
4225 /* module name */
4226 ptrW = (WCHAR*)((BYTE*)section + data->name_offset);
4227 memcpy(ptrW, dll->name, data->name_len);
4228 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4229 }
4230
4231 /* progid string */
4232 if (data->progid_len)
4233 {
4234 ptrW = (WCHAR*)((BYTE*)data + data->progid_offset);
4235 memcpy(ptrW, entity->u.comclass.progid, data->progid_len);
4236 ptrW[data->progid_len/sizeof(WCHAR)] = 0;
4237 }
4238
4239 /* string block length */
4240 str_len = 0;
4241 if (clrdata)
4242 {
4243 str_len += clrdata->name_len + sizeof(WCHAR);
4244 if (clrdata->version_len)
4245 str_len += clrdata->version_len + sizeof(WCHAR);
4246 }
4247 if (progid_len)
4248 str_len += progid_len + sizeof(WCHAR);
4249
4250 (*index)->data_len += aligned_string_len(str_len);
4251 alias_index->data_len = (*index)->data_len;
4252
4253 /* move to next data record */
4254 (*data_offset) += sizeof(*data) + aligned_string_len(str_len);
4255 (*module_offset) += module_len + sizeof(WCHAR);
4256
4257 if (clrdata)
4258 {
4259 (*data_offset) += sizeof(*clrdata);
4260 (*module_offset) += clrdata->module_len + sizeof(WCHAR);
4261 }
4262 (*index) += 1;
4263 }
4264 }
4265
4266 return STATUS_SUCCESS;
4267}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define strlenW(s)
Definition: unicode.h:28
const WCHAR * str
#define memset(x, y, z)
Definition: compat.h:39
static int aligned_string_len(int len)
Definition: actctx.c:1958
static const WCHAR mscoree2W[]
Definition: actctx.c:672
static void generate_uuid(ULONG *seed, GUID *guid)
Definition: actctx.c:4020
static const WCHAR mscoreeW[]
Definition: actctx.c:671
#define STATUS_SUCCESS
Definition: shellext.h:65
ULONG module_len
Definition: sxs.c:92
DWORD res2[2]
Definition: sxs.c:98
DWORD res[2]
Definition: sxs.c:91
ULONG size
Definition: sxs.c:90
ULONG version_offset
Definition: sxs.c:97
ULONG name_offset
Definition: sxs.c:95
ULONG module_offset
Definition: sxs.c:93
ULONG name_len
Definition: sxs.c:94
ULONG version_len
Definition: sxs.c:96
unsigned int num
Definition: actctx.c:447
struct entity * base
Definition: actctx.c:446
Definition: actctx.c:388
union entity::@4975 u
struct entity::@4975::@4977 comclass
DWORD kind
Definition: actctx.c:389
GUID guid
Definition: actctx.c:1083
ULONG rosterindex
Definition: actctx.c:1086
ULONG data_offset
Definition: actctx.c:1084
ULONG data_len
Definition: actctx.c:1085
Definition: parser.c:56
#define str_len
Definition: treelist.c:89
uint32_t ULONG
Definition: typedefs.h:59
unsigned char BYTE
Definition: xxhash.c:193

Referenced by build_comserver_section().

◆ add_dependent_assembly_id()

static BOOL add_dependent_assembly_id ( struct actctx_loader acl,
struct assembly_identity ai 
)
static

Definition at line 1022 of file actctx.c.

1024{
1025 unsigned int i;
1026
1027 /* check if we already have that assembly */
1028
1029 for (i = 0; i < acl->actctx->num_assemblies; i++)
1030 if (is_matching_identity( ai, &acl->actctx->assemblies[i].id ))
1031 {
1032 DPRINT( "reusing existing assembly for %S arch %S version %u.%u.%u.%u\n",
1033 ai->name, ai->arch, ai->version.major, ai->version.minor,
1034 ai->version.build, ai->version.revision );
1035 return TRUE;
1036 }
1037
1038 for (i = 0; i < acl->num_dependencies; i++)
1039 if (is_matching_identity( ai, &acl->dependencies[i] ))
1040 {
1041 DPRINT( "reusing existing dependency for %S arch %S version %u.%u.%u.%u\n",
1042 ai->name, ai->arch, ai->version.major, ai->version.minor,
1043 ai->version.build, ai->version.revision );
1044 return TRUE;
1045 }
1046
1048 {
1049 void *ptr;
1050 unsigned int new_count;
1051 if (acl->dependencies)
1052 {
1053 new_count = acl->allocated_dependencies * 2;
1054 ptr = RtlReAllocateHeap(RtlGetProcessHeap(), 0, acl->dependencies,
1055 new_count * sizeof(acl->dependencies[0]));
1056 }
1057 else
1058 {
1059 new_count = 4;
1060 ptr = RtlAllocateHeap(RtlGetProcessHeap(), 0, new_count * sizeof(acl->dependencies[0]));
1061 }
1062 if (!ptr) return FALSE;
1063 acl->dependencies = ptr;
1064 acl->allocated_dependencies = new_count;
1065 }
1066 acl->dependencies[acl->num_dependencies++] = *ai;
1067
1068 return TRUE;
1069}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static BOOL is_matching_identity(const struct assembly_identity *id1, const struct assembly_identity *id2)
Definition: actctx.c:1002
struct assembly * assemblies
Definition: actctx.c:523
unsigned int num_assemblies
Definition: actctx.c:524
unsigned int allocated_dependencies
Definition: actctx.c:542
struct assembly_identity * dependencies
Definition: actctx.c:540
unsigned int num_dependencies
Definition: actctx.c:541
ACTIVATION_CONTEXT * actctx
Definition: actctx.c:539
WCHAR * name
Definition: actctx.c:92
WCHAR * arch
Definition: actctx.c:93
struct assembly_version version
Definition: actctx.c:97

Referenced by parse_dependent_assembly_elem().

◆ add_dll_redirect()

static struct dll_redirect * add_dll_redirect ( struct assembly assembly)
static

Definition at line 870 of file actctx.c.

871{
872 DPRINT("add_dll_redirect() to assembly %p, num_dlls %d\n", assembly, assembly->allocated_dlls);
873
875 {
876 void *ptr;
877 unsigned int new_count;
878 if (assembly->dlls)
879 {
880 new_count = assembly->allocated_dlls * 2;
881 ptr = RtlReAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY,
882 assembly->dlls, new_count * sizeof(*assembly->dlls) );
883 }
884 else
885 {
886 new_count = 4;
887 ptr = RtlAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*assembly->dlls) );
888 }
889 if (!ptr) return NULL;
890 assembly->dlls = ptr;
891 assembly->allocated_dlls = new_count;
892 }
893 return &assembly->dlls[assembly->num_dlls++];
894}
unsigned int allocated_dlls
Definition: actctx.c:474

Referenced by parse_file_elem().

◆ add_entity()

static struct entity * add_entity ( struct entity_array array,
DWORD  kind 
)
static

Definition at line 924 of file actctx.c.

925{
926 struct entity* entity;
927
928 if (array->num == array->allocated)
929 {
930 void *ptr;
931 unsigned int new_count;
932 if (array->base)
933 {
934 new_count = array->allocated * 2;
935 ptr = RtlReAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY,
936 array->base, new_count * sizeof(*array->base) );
937 }
938 else
939 {
940 new_count = 4;
941 ptr = RtlAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*array->base) );
942 }
943 if (!ptr) return NULL;
944 array->base = ptr;
945 array->allocated = new_count;
946 }
947 entity = &array->base[array->num++];
948 entity->kind = kind;
949 return entity;
950}
unsigned num
Definition: undname.c:60

Referenced by parse_add_interface_class(), parse_clr_class_elem(), parse_clr_surrogate_elem(), parse_com_class_elem(), parse_com_interface_external_proxy_stub_elem(), parse_cominterface_proxy_stub_elem(), parse_settings_elem(), parse_typelib_elem(), and parse_window_class_elem().

◆ add_ifaceps_record()

static _Must_inspect_result_ NTSTATUS add_ifaceps_record ( struct guidsection_header section,
struct entity_array entities,
struct guid_index **  index,
ULONG data_offset,
ULONG  rosterindex 
)
static

Definition at line 4403 of file actctx.c.

4405{
4406 unsigned int i;
4407
4408 for (i = 0; i < entities->num; i++)
4409 {
4410 struct entity *entity = &entities->base[i];
4411 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)
4412 {
4413 struct ifacepsredirect_data *data = (struct ifacepsredirect_data*)((BYTE*)section + *data_offset);
4417
4418 if (entity->u.ifaceps.name)
4419 name_len = strlenW(entity->u.ifaceps.name)*sizeof(WCHAR);
4420 else
4421 name_len = 0;
4422
4423 /* setup index */
4425 Status = RtlGUIDFromString(&str, &(*index)->guid);
4426 if (!NT_SUCCESS(Status))
4427 return Status;
4428 (*index)->data_offset = *data_offset;
4429 (*index)->data_len = sizeof(*data) + name_len ? aligned_string_len(name_len + sizeof(WCHAR)) : 0;
4430 (*index)->rosterindex = rosterindex;
4431
4432 /* setup data record */
4433 data->size = sizeof(*data);
4434 data->mask = entity->u.ifaceps.mask;
4435
4436 /* proxyStubClsid32 value is only stored for external PS,
4437 if set it's used as iid, otherwise 'iid' attribute value is used */
4438 if (entity->u.ifaceps.ps32)
4439 {
4441 Status = RtlGUIDFromString(&str, &data->iid);
4442 if (!NT_SUCCESS(Status))
4443 return Status;
4444 }
4445 else
4446 data->iid = (*index)->guid;
4447
4448 data->nummethods = entity->u.ifaceps.nummethods;
4449
4450 if (entity->u.ifaceps.tlib)
4451 {
4453 Status = RtlGUIDFromString(&str, &data->tlbid);
4454 if (!NT_SUCCESS(Status))
4455 return Status;
4456 }
4457 else
4458 memset(&data->tlbid, 0, sizeof(data->tlbid));
4459
4460 if (entity->u.ifaceps.base)
4461 {
4463 Status = RtlGUIDFromString(&str, &data->base);
4464 if (!NT_SUCCESS(Status))
4465 return Status;
4466 }
4467 else
4468 memset(&data->base, 0, sizeof(data->base));
4469
4470 data->name_len = name_len;
4471 data->name_offset = data->name_len ? sizeof(*data) : 0;
4472
4473 /* name string */
4474 if (data->name_len)
4475 {
4476 WCHAR *ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
4477 memcpy(ptrW, entity->u.ifaceps.name, data->name_len);
4478 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4479 }
4480
4481 /* move to next record */
4482 (*index) += 1;
4483 *data_offset += sizeof(*data);
4484 if (data->name_len)
4485 *data_offset += aligned_string_len(data->name_len + sizeof(WCHAR));
4486 }
4487 }
4488
4489 return STATUS_SUCCESS;
4490}
struct entity::@4975::@4978 ifaceps

Referenced by build_ifaceps_section().

◆ add_progid_record()

static _Must_inspect_result_ NTSTATUS add_progid_record ( ACTIVATION_CONTEXT actctx,
struct strsection_header section,
const struct entity_array entities,
struct string_index **  index,
ULONG data_offset,
ULONG global_offset,
ULONG  rosterindex 
)
static

Definition at line 4838 of file actctx.c.

4840{
4841 unsigned int i, j;
4843
4844 for (i = 0; i < entities->num; i++)
4845 {
4846 struct entity *entity = &entities->base[i];
4847 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4848 {
4849 const struct progids *progids = &entity->u.comclass.progids;
4850 struct comclassredirect_data *comclass;
4851 struct guid_index *guid_index;
4853 GUID clsid;
4854
4857 if (!NT_SUCCESS(Status))
4858 return Status;
4859
4860 guid_index = find_guid_index(actctx->comserver_section, &clsid);
4861 comclass = get_comclass_data(actctx, guid_index);
4862
4863 if (entity->u.comclass.progid)
4864 write_progid_record(section, entity->u.comclass.progid, &comclass->alias,
4865 index, data_offset, global_offset, rosterindex);
4866
4867 for (j = 0; j < progids->num; j++)
4869 index, data_offset, global_offset, rosterindex);
4870 }
4871 }
4872 return Status;
4873}
GLuint index
Definition: glext.h:6031
REFCLSID clsid
Definition: msctf.c:82
static void write_progid_record(struct strsection_header *section, const WCHAR *progid, const GUID *alias, struct string_index **index, ULONG *data_offset, ULONG *global_offset, ULONG rosterindex)
Definition: actctx.c:4792
static struct comclassredirect_data * get_comclass_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:4335
static struct guid_index * find_guid_index(const struct guidsection_header *section, const GUID *guid)
Definition: actctx.c:3560
WCHAR ** progids
Definition: actctx.c:382
unsigned int num
Definition: actctx.c:383

Referenced by build_progid_section().

◆ aligned_string_len()

◆ append_string()

static void append_string ( WCHAR buffer,
const WCHAR prefix,
const WCHAR str 
)
inlinestatic

Definition at line 1110 of file actctx.c.

1111{
1112 WCHAR *p = buffer;
1113
1114 if (!str) return;
1115 strcatW( buffer, prefix );
1116 p += strlenW(p);
1117 *p++ = '"';
1118 strcpyW( p, str );
1119 p += strlenW(p);
1120 *p++ = '"';
1121 *p = 0;
1122}
GLfloat GLfloat p
Definition: glext.h:8902
#define strcatW(d, s)
Definition: unicode.h:30
#define strcpyW(d, s)
Definition: unicode.h:29

Referenced by build_assembly_id().

◆ build_assembly_dir()

static WCHAR * build_assembly_dir ( struct assembly_identity ai)
static

Definition at line 1079 of file actctx.c.

1080{
1081 static const WCHAR undW[] = {'_',0};
1082 static const WCHAR noneW[] = {'n','o','n','e',0};
1083 static const WCHAR mskeyW[] = {'d','e','a','d','b','e','e','f',0};
1084
1085 const WCHAR *arch = ai->arch ? ai->arch : noneW;
1086 const WCHAR *key = ai->public_key ? ai->public_key : noneW;
1087 const WCHAR *lang = ai->language ? ai->language : noneW;
1088 const WCHAR *name = ai->name ? ai->name : noneW;
1089 SIZE_T size = (strlenW(arch) + 1 + strlenW(name) + 1 + strlenW(key) + 24 + 1 +
1090 strlenW(lang) + 1) * sizeof(WCHAR) + sizeof(mskeyW);
1091 WCHAR *ret;
1092
1093 if (!(ret = RtlAllocateHeap( RtlGetProcessHeap(), 0, size ))) return NULL;
1094
1095 strcpyW( ret, arch );
1096 strcatW( ret, undW );
1097 strcatW( ret, name );
1098 strcatW( ret, undW );
1099 strcatW( ret, key );
1100 strcatW( ret, undW );
1102 ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
1103 strcatW( ret, undW );
1104 strcatW( ret, lang );
1105 strcatW( ret, undW );
1106 strcatW( ret, mskeyW );
1107 return ret;
1108}
GLsizeiptr size
Definition: glext.h:5919
#define sprintfW
Definition: unicode.h:58
static const WCHAR version_formatW[]
Definition: actctx.c:761
WCHAR * public_key
Definition: actctx.c:94
WCHAR * language
Definition: actctx.c:95
Definition: copy.c:22
Definition: name.c:39
ULONG_PTR SIZE_T
Definition: typedefs.h:80
static const WCHAR lang[]
Definition: wbemdisp.c:287
int ret

Referenced by lookup_assembly().

◆ build_assembly_id()

static WCHAR * build_assembly_id ( const struct assembly_identity ai)
static

Definition at line 1124 of file actctx.c.

1125{
1126 static const WCHAR archW[] =
1127 {',','p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',0};
1128 static const WCHAR public_keyW[] =
1129 {',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',0};
1130 static const WCHAR typeW2[] =
1131 {',','t','y','p','e','=',0};
1132 static const WCHAR versionW2[] =
1133 {',','v','e','r','s','i','o','n','=',0};
1134
1135 WCHAR version[64], *ret;
1136 SIZE_T size = 0;
1137
1139 ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
1140 if (ai->name) size += strlenW(ai->name) * sizeof(WCHAR);
1141 if (ai->arch) size += strlenW(archW) + strlenW(ai->arch) + 2;
1142 if (ai->public_key) size += strlenW(public_keyW) + strlenW(ai->public_key) + 2;
1143 if (ai->type) size += strlenW(typeW2) + strlenW(ai->type) + 2;
1144 size += strlenW(versionW2) + strlenW(version) + 2;
1145
1146 if (!(ret = RtlAllocateHeap( RtlGetProcessHeap(), 0, (size + 1) * sizeof(WCHAR) )))
1147 return NULL;
1148
1149 if (ai->name) strcpyW( ret, ai->name );
1150 else *ret = 0;
1151 append_string( ret, archW, ai->arch );
1152 append_string( ret, public_keyW, ai->public_key );
1153 append_string( ret, typeW2, ai->type );
1154 append_string( ret, versionW2, version );
1155 return ret;
1156}
static const WCHAR version[]
Definition: asmname.c:66
static const WCHAR archW[]
Definition: name.c:49
static void append_string(WCHAR *buffer, const WCHAR *prefix, const WCHAR *str)
Definition: actctx.c:1110
WCHAR * type
Definition: actctx.c:96

Referenced by RtlQueryInformationActivationContext().

◆ build_clr_surrogate_section()

static _Must_inspect_result_ NTSTATUS build_clr_surrogate_section ( ACTIVATION_CONTEXT actctx,
struct guidsection_header **  section 
)
static

Definition at line 4606 of file actctx.c.

4607{
4608 unsigned int i, j, total_len = 0, count = 0;
4609 struct guidsection_header *header;
4610 struct clrsurrogate_data *data;
4611 struct guid_index *index;
4613
4614 /* compute section length */
4615 for (i = 0; i < actctx->num_assemblies; i++)
4616 {
4617 struct assembly *assembly = &actctx->assemblies[i];
4618 for (j = 0; j < assembly->entities.num; j++)
4619 {
4620 struct entity *entity = &assembly->entities.base[j];
4621 if (entity->kind == ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)
4622 {
4623 ULONG len;
4624
4625 total_len += sizeof(*index) + sizeof(*data);
4626 len = strlenW(entity->u.clrsurrogate.name) + 1;
4627 if (entity->u.clrsurrogate.version)
4628 len += strlenW(entity->u.clrsurrogate.version) + 1;
4629 total_len += aligned_string_len(len*sizeof(WCHAR));
4630
4631 count++;
4632 }
4633 }
4634 }
4635
4636 total_len += sizeof(*header);
4637
4638 header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
4639 if (!header) return STATUS_NO_MEMORY;
4640
4641 memset(header, 0, sizeof(*header));
4642 header->magic = GUIDSECTION_MAGIC;
4643 header->size = sizeof(*header);
4644 header->count = count;
4645 header->index_offset = sizeof(*header);
4646 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4647 data_offset = header->index_offset + count*sizeof(*index);
4648
4649 for (i = 0; i < actctx->num_assemblies; i++)
4650 {
4651 struct assembly *assembly = &actctx->assemblies[i];
4652 for (j = 0; j < assembly->entities.num; j++)
4653 {
4654 struct entity *entity = &assembly->entities.base[j];
4655 if (entity->kind == ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)
4656 {
4657 ULONG version_len, name_len;
4659 WCHAR *ptrW;
4661
4662 if (entity->u.clrsurrogate.version)
4663 version_len = strlenW(entity->u.clrsurrogate.version)*sizeof(WCHAR);
4664 else
4665 version_len = 0;
4666 name_len = strlenW(entity->u.clrsurrogate.name)*sizeof(WCHAR);
4667
4668 /* setup new index entry */
4670 Status = RtlGUIDFromString(&str, &index->guid);
4671 if (!NT_SUCCESS(Status))
4672 {
4673 RtlFreeHeap(RtlGetProcessHeap(), 0, header);
4674 return Status;
4675 }
4676
4677 index->data_offset = data_offset;
4678 index->data_len = sizeof(*data) + aligned_string_len(name_len + sizeof(WCHAR) + (version_len ? version_len + sizeof(WCHAR) : 0));
4679 index->rosterindex = i + 1;
4680
4681 /* setup data */
4682 data = (struct clrsurrogate_data*)((BYTE*)header + index->data_offset);
4683 data->size = sizeof(*data);
4684 data->res = 0;
4685 data->clsid = index->guid;
4686 data->version_offset = version_len ? data->size : 0;
4687 data->version_len = version_len;
4688 data->name_offset = data->size + version_len;
4689 if (version_len)
4690 data->name_offset += sizeof(WCHAR);
4691 data->name_len = name_len;
4692
4693 /* surrogate name */
4694 ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
4695 memcpy(ptrW, entity->u.clrsurrogate.name, data->name_len);
4696 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4697
4698 /* runtime version */
4699 if (data->version_len)
4700 {
4701 ptrW = (WCHAR*)((BYTE*)data + data->version_offset);
4702 memcpy(ptrW, entity->u.clrsurrogate.version, data->version_len);
4703 ptrW[data->version_len/sizeof(WCHAR)] = 0;
4704 }
4705
4706 data_offset += index->data_offset;
4707 index++;
4708 }
4709 }
4710 }
4711
4712 *section = header;
4713
4714 return STATUS_SUCCESS;
4715}
#define index(s, c)
Definition: various.h:29
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define GUIDSECTION_MAGIC
Definition: actctx.c:39
ULONG version_len
Definition: actctx.c:1638
struct entity::@4975::@4980 clrsurrogate

Referenced by find_clr_surrogate().

◆ build_comserver_section()

static _Must_inspect_result_ NTSTATUS build_comserver_section ( ACTIVATION_CONTEXT actctx,
struct guidsection_header **  section 
)
static

Definition at line 4272 of file actctx.c.

4273{
4274 unsigned int i, j, total_len = 0, class_count = 0, names_len = 0;
4275 struct guidsection_header *header;
4276 ULONG module_offset, data_offset;
4277 struct guid_index *index;
4278 ULONG seed;
4280
4281 /* compute section length */
4282 for (i = 0; i < actctx->num_assemblies; i++)
4283 {
4284 struct assembly *assembly = &actctx->assemblies[i];
4285 get_comserver_datalen(&assembly->entities, NULL, &class_count, &total_len, &names_len);
4286 for (j = 0; j < assembly->num_dlls; j++)
4287 {
4288 struct dll_redirect *dll = &assembly->dlls[j];
4289 get_comserver_datalen(&dll->entities, dll, &class_count, &total_len, &names_len);
4290 }
4291 }
4292
4293 total_len += aligned_string_len(names_len);
4294 total_len += sizeof(*header);
4295
4296 header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
4297 if (!header) return STATUS_NO_MEMORY;
4298
4299 memset(header, 0, sizeof(*header));
4300 header->magic = GUIDSECTION_MAGIC;
4301 header->size = sizeof(*header);
4302 header->count = 2*class_count;
4303 header->index_offset = sizeof(*header) + aligned_string_len(names_len);
4304 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4305 module_offset = sizeof(*header);
4306 data_offset = header->index_offset + 2*class_count*sizeof(*index);
4307
4308 seed = NtGetTickCount();
4309 for (i = 0; i < actctx->num_assemblies; i++)
4310 {
4311 struct assembly *assembly = &actctx->assemblies[i];
4312 Status = add_comserver_record(header, &assembly->entities, NULL, &index, &data_offset, &module_offset, &seed, i+1);
4313 if (!NT_SUCCESS(Status))
4314 {
4315 RtlFreeHeap(RtlGetProcessHeap(), 0, header);
4316 return Status;
4317 }
4318 for (j = 0; j < assembly->num_dlls; j++)
4319 {
4320 struct dll_redirect *dll = &assembly->dlls[j];
4321 Status = add_comserver_record(header, &dll->entities, dll, &index, &data_offset, &module_offset, &seed, i+1);
4322 if (!NT_SUCCESS(Status))
4323 {
4324 RtlFreeHeap(RtlGetProcessHeap(), 0, header);
4325 return Status;
4326 }
4327 }
4328 }
4329
4330 *section = header;
4331
4332 return STATUS_SUCCESS;
4333}
#define NtGetTickCount
Definition: rtlp.h:163
static _Must_inspect_result_ NTSTATUS add_comserver_record(const struct guidsection_header *section, const struct entity_array *entities, const struct dll_redirect *dll, struct guid_index **index, ULONG *data_offset, ULONG *module_offset, ULONG *seed, ULONG rosterindex)
Definition: actctx.c:4086
static void get_comserver_datalen(const struct entity_array *entities, const struct dll_redirect *dll, unsigned int *count, unsigned int *len, unsigned int *module_len)
Definition: actctx.c:4035

Referenced by find_comserver_redirection(), and find_progid_redirection().

◆ build_dllredirect_section()

static NTSTATUS build_dllredirect_section ( ACTIVATION_CONTEXT actctx,
struct strsection_header **  section 
)
static

Definition at line 3438 of file actctx.c.

3439{
3440 unsigned int i, j, total_len = 0, dll_count = 0;
3441 struct strsection_header *header;
3442 struct dllredirect_data *data;
3443 struct string_index *index;
3445
3446 DPRINT("actctx %p, num_assemblies %d\n", actctx, actctx->num_assemblies);
3447
3448 /* compute section length */
3449 for (i = 0; i < actctx->num_assemblies; i++)
3450 {
3451 struct assembly *assembly = &actctx->assemblies[i];
3452 for (j = 0; j < assembly->num_dlls; j++)
3453 {
3454 struct dll_redirect *dll = &assembly->dlls[j];
3455
3456 /* each entry needs index, data and string data */
3457 total_len += sizeof(*index);
3458 total_len += sizeof(*data);
3459 total_len += aligned_string_len((strlenW(dll->name)+1)*sizeof(WCHAR));
3460
3461 DPRINT("assembly %d (%p), dll %d: dll name %S\n", i, assembly, j, dll->name);
3462 }
3463
3465 }
3466
3467 total_len += sizeof(*header);
3468
3469 header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
3470 if (!header) return STATUS_NO_MEMORY;
3471
3472 memset(header, 0, sizeof(*header));
3473 header->magic = STRSECTION_MAGIC;
3474 header->size = sizeof(*header);
3475 header->count = dll_count;
3476 header->index_offset = sizeof(*header);
3477 index = (struct string_index*)((BYTE*)header + header->index_offset);
3478 name_offset = header->index_offset + header->count*sizeof(*index);
3479
3480 for (i = 0; i < actctx->num_assemblies; i++)
3481 {
3482 struct assembly *assembly = &actctx->assemblies[i];
3483
3484 DPRINT("assembly->num_dlls %d\n", assembly->num_dlls);
3485
3486 for (j = 0; j < assembly->num_dlls; j++)
3487 {
3488 struct dll_redirect *dll = &assembly->dlls[j];
3490 WCHAR *ptrW;
3491
3492 DPRINT("%d: dll name %S\n", j, dll->name);
3493 /* setup new index entry */
3494 str.Buffer = dll->name;
3495 str.Length = (USHORT)strlenW(dll->name)*sizeof(WCHAR);
3496 str.MaximumLength = str.Length + sizeof(WCHAR);
3497 /* hash original class name */
3499
3500 index->name_offset = name_offset;
3501 index->name_len = str.Length;
3502 index->data_offset = index->name_offset + aligned_string_len(str.MaximumLength);
3503 index->data_len = sizeof(*data);
3504 index->rosterindex = i + 1;
3505
3506 /* setup data */
3507 data = (struct dllredirect_data*)((BYTE*)header + index->data_offset);
3508 data->size = sizeof(*data);
3509 data->unk = 2; /* FIXME: seems to be constant */
3510 memset(data->res, 0, sizeof(data->res));
3511
3512 /* dll name */
3513 ptrW = (WCHAR*)((BYTE*)header + index->name_offset);
3514 memcpy(ptrW, dll->name, index->name_len);
3515 ptrW[index->name_len/sizeof(WCHAR)] = 0;
3516
3517 name_offset += sizeof(*data) + aligned_string_len(str.MaximumLength);
3518
3519 index++;
3520 }
3521 }
3522
3523 *section = header;
3524
3525 return STATUS_SUCCESS;
3526}
LONG dll_count
Definition: itss.c:49
#define HASH_STRING_ALGORITHM_X65599
Definition: rtlstr.c:33
NTSYSAPI NTSTATUS NTAPI RtlHashUnicodeString(_In_ CONST UNICODE_STRING *String, _In_ BOOLEAN CaseInSensitive, _In_ ULONG HashAlgorithm, _Out_ PULONG HashValue)
unsigned short USHORT
Definition: pedump.c:61
#define STRSECTION_MAGIC
Definition: actctx.c:38
ULONG name_offset
Definition: actctx.c:1062

Referenced by find_dll_redirection().

◆ build_ifaceps_section()

static _Must_inspect_result_ NTSTATUS build_ifaceps_section ( ACTIVATION_CONTEXT actctx,
struct guidsection_header **  section 
)
static

Definition at line 4495 of file actctx.c.

4496{
4497 unsigned int i, j, total_len = 0, count = 0;
4498 struct guidsection_header *header;
4499 struct guid_index *index;
4501
4502 /* compute section length */
4503 for (i = 0; i < actctx->num_assemblies; i++)
4504 {
4505 struct assembly *assembly = &actctx->assemblies[i];
4506
4507 get_ifaceps_datalen(&assembly->entities, &count, &total_len);
4508 for (j = 0; j < assembly->num_dlls; j++)
4509 {
4510 struct dll_redirect *dll = &assembly->dlls[j];
4511 get_ifaceps_datalen(&dll->entities, &count, &total_len);
4512 }
4513 }
4514
4515 total_len += sizeof(*header);
4516
4517 header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
4518 if (!header) return STATUS_NO_MEMORY;
4519
4520 memset(header, 0, sizeof(*header));
4521 header->magic = GUIDSECTION_MAGIC;
4522 header->size = sizeof(*header);
4523 header->count = count;
4524 header->index_offset = sizeof(*header);
4525 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4526 data_offset = header->index_offset + count*sizeof(*index);
4527
4528 for (i = 0; i < actctx->num_assemblies; i++)
4529 {
4530 struct assembly *assembly = &actctx->assemblies[i];
4532
4533 Status = add_ifaceps_record(header, &assembly->entities, &index, &data_offset, i + 1);
4534 if (!NT_SUCCESS(Status))
4535 {
4536 RtlFreeHeap(RtlGetProcessHeap(), 0, header);
4537 return Status;
4538 }
4539
4540 for (j = 0; j < assembly->num_dlls; j++)
4541 {
4542 struct dll_redirect *dll = &assembly->dlls[j];
4543 Status = add_ifaceps_record(header, &dll->entities, &index, &data_offset, i + 1);
4544 if (!NT_SUCCESS(Status))
4545 {
4546 RtlFreeHeap(RtlGetProcessHeap(), 0, header);
4547 return Status;
4548 }
4549 }
4550 }
4551
4552 *section = header;
4553
4554 return STATUS_SUCCESS;
4555}
static void get_ifaceps_datalen(const struct entity_array *entities, unsigned int *count, unsigned int *len)
Definition: actctx.c:4383
static _Must_inspect_result_ NTSTATUS add_ifaceps_record(struct guidsection_header *section, struct entity_array *entities, struct guid_index **index, ULONG *data_offset, ULONG rosterindex)
Definition: actctx.c:4403

Referenced by find_cominterface_redirection().

◆ build_progid_section()

static _Must_inspect_result_ NTSTATUS build_progid_section ( ACTIVATION_CONTEXT actctx,
struct strsection_header **  section 
)
static

Definition at line 4878 of file actctx.c.

4879{
4880 unsigned int i, j, total_len = 0, count = 0;
4881 struct strsection_header *header;
4882 ULONG data_offset, global_offset;
4883 struct string_index *index;
4885
4886 /* compute section length */
4887 for (i = 0; i < actctx->num_assemblies; i++)
4888 {
4889 struct assembly *assembly = &actctx->assemblies[i];
4890
4891 get_progid_datalen(&assembly->entities, &count, &total_len);
4892 for (j = 0; j < assembly->num_dlls; j++)
4893 {
4894 struct dll_redirect *dll = &assembly->dlls[j];
4895 get_progid_datalen(&dll->entities, &count, &total_len);
4896 }
4897 }
4898
4899 total_len += sizeof(*header);
4900
4901 header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
4902 if (!header) return STATUS_NO_MEMORY;
4903
4904 memset(header, 0, sizeof(*header));
4905 header->magic = STRSECTION_MAGIC;
4906 header->size = sizeof(*header);
4907 header->count = count;
4908 header->global_offset = header->size;
4909 header->global_len = count*sizeof(GUID);
4910 header->index_offset = header->size + header->global_len;
4911
4912 index = (struct string_index*)((BYTE*)header + header->index_offset);
4913 data_offset = header->index_offset + count*sizeof(*index);
4914 global_offset = header->global_offset;
4915
4916 for (i = 0; i < actctx->num_assemblies; i++)
4917 {
4918 struct assembly *assembly = &actctx->assemblies[i];
4919
4920 Status = add_progid_record(actctx, header, &assembly->entities, &index, &data_offset, &global_offset, i + 1);
4921 if (!NT_SUCCESS(Status))
4922 {
4923 RtlFreeHeap(RtlGetProcessHeap(), 0, header);
4924 return Status;
4925 }
4926
4927 for (j = 0; j < assembly->num_dlls; j++)
4928 {
4929 struct dll_redirect *dll = &assembly->dlls[j];
4930 Status = add_progid_record(actctx, header, &dll->entities, &index, &data_offset, &global_offset, i + 1);
4931 if (!NT_SUCCESS(Status))
4932 {
4933 RtlFreeHeap(RtlGetProcessHeap(), 0, header);
4934 return Status;
4935 }
4936 }
4937 }
4938
4939 *section = header;
4940
4941 return STATUS_SUCCESS;
4942}
static _Must_inspect_result_ NTSTATUS add_progid_record(ACTIVATION_CONTEXT *actctx, struct strsection_header *section, const struct entity_array *entities, struct string_index **index, ULONG *data_offset, ULONG *global_offset, ULONG rosterindex)
Definition: actctx.c:4838
static void get_progid_datalen(struct entity_array *entities, unsigned int *count, unsigned int *total_len)
Definition: actctx.c:4767
ULONG data_offset
Definition: actctx.c:1064

Referenced by find_progid_redirection().

◆ build_tlib_section()

static _Must_inspect_result_ NTSTATUS build_tlib_section ( ACTIVATION_CONTEXT actctx,
struct guidsection_header **  section 
)
static

Definition at line 3846 of file actctx.c.

3847{
3848 unsigned int i, j, k, total_len = 0, tlib_count = 0, names_len = 0;
3849 struct guidsection_header *header;
3850 ULONG module_offset, data_offset;
3851 struct tlibredirect_data *data;
3852 struct guid_index *index;
3853
3854 /* compute section length */
3855 for (i = 0; i < actctx->num_assemblies; i++)
3856 {
3857 struct assembly *assembly = &actctx->assemblies[i];
3858 for (j = 0; j < assembly->num_dlls; j++)
3859 {
3860 struct dll_redirect *dll = &assembly->dlls[j];
3861 for (k = 0; k < dll->entities.num; k++)
3862 {
3863 struct entity *entity = &dll->entities.base[k];
3864 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)
3865 {
3866 /* each entry needs index, data and string data for module name and help string */
3867 total_len += sizeof(*index);
3868 total_len += sizeof(*data);
3869 /* help string is stored separately */
3870 if (*entity->u.typelib.helpdir)
3871 total_len += aligned_string_len((strlenW(entity->u.typelib.helpdir)+1)*sizeof(WCHAR));
3872
3873 /* module names are packed one after another */
3874 names_len += (strlenW(dll->name)+1)*sizeof(WCHAR);
3875
3876 tlib_count++;
3877 }
3878 }
3879 }
3880 }
3881
3882 total_len += aligned_string_len(names_len);
3883 total_len += sizeof(*header);
3884
3885 header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
3886 if (!header) return STATUS_NO_MEMORY;
3887
3888 memset(header, 0, sizeof(*header));
3889 header->magic = GUIDSECTION_MAGIC;
3890 header->size = sizeof(*header);
3891 header->count = tlib_count;
3892 header->index_offset = sizeof(*header) + aligned_string_len(names_len);
3893 index = (struct guid_index*)((BYTE*)header + header->index_offset);
3894 module_offset = sizeof(*header);
3895 data_offset = header->index_offset + tlib_count*sizeof(*index);
3896
3897 for (i = 0; i < actctx->num_assemblies; i++)
3898 {
3899 struct assembly *assembly = &actctx->assemblies[i];
3900 for (j = 0; j < assembly->num_dlls; j++)
3901 {
3902 struct dll_redirect *dll = &assembly->dlls[j];
3903 for (k = 0; k < dll->entities.num; k++)
3904 {
3905 struct entity *entity = &dll->entities.base[k];
3906 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)
3907 {
3908 ULONG module_len, help_len;
3910 WCHAR *ptrW;
3912
3913 if (*entity->u.typelib.helpdir)
3914 help_len = strlenW(entity->u.typelib.helpdir)*sizeof(WCHAR);
3915 else
3916 help_len = 0;
3917
3918 module_len = strlenW(dll->name)*sizeof(WCHAR);
3919
3920 /* setup new index entry */
3922 Status = RtlGUIDFromString(&str, &index->guid);
3923 if (!NT_SUCCESS(Status))
3924 {
3925 RtlFreeHeap(RtlGetProcessHeap(), 0, header);
3926 return Status;
3927 }
3928 index->data_offset = data_offset;
3929 index->data_len = sizeof(*data) + aligned_string_len(help_len);
3930 index->rosterindex = i + 1;
3931
3932 /* setup data */
3933 data = (struct tlibredirect_data*)((BYTE*)header + index->data_offset);
3934 data->size = sizeof(*data);
3935 data->res = 0;
3936 data->name_len = module_len;
3937 data->name_offset = module_offset;
3938 /* FIXME: resourceid handling is really weird, and it doesn't seem to be useful */
3939 data->langid = 0;
3940 data->flags = entity->u.typelib.flags;
3941 data->help_len = help_len;
3942 data->help_offset = sizeof(*data);
3943 data->major_version = entity->u.typelib.major;
3944 data->minor_version = entity->u.typelib.minor;
3945
3946 /* module name */
3947 ptrW = (WCHAR*)((BYTE*)header + data->name_offset);
3948 memcpy(ptrW, dll->name, data->name_len);
3949 ptrW[data->name_len/sizeof(WCHAR)] = 0;
3950
3951 /* help string */
3952 if (data->help_len)
3953 {
3954 ptrW = (WCHAR*)((BYTE*)data + data->help_offset);
3955 memcpy(ptrW, entity->u.typelib.helpdir, data->help_len);
3956 ptrW[data->help_len/sizeof(WCHAR)] = 0;
3957 }
3958
3959 data_offset += sizeof(*data);
3960 if (help_len)
3961 data_offset += aligned_string_len(help_len + sizeof(WCHAR));
3962
3963 module_offset += module_len + sizeof(WCHAR);
3964
3965 index++;
3966 }
3967 }
3968 }
3969 }
3970
3971 *section = header;
3972
3973 return STATUS_SUCCESS;
3974}
int k
Definition: mpi.c:3369
struct entity::@4975::@4976 typelib
ULONG help_len
Definition: oleaut.c:795

Referenced by find_tlib_redirection().

◆ build_wndclass_section()

static NTSTATUS build_wndclass_section ( ACTIVATION_CONTEXT actctx,
struct strsection_header **  section 
)
static

Definition at line 3640 of file actctx.c.

3641{
3642 unsigned int i, j, k, total_len = 0, class_count = 0;
3644 struct strsection_header *header;
3645 struct string_index *index;
3647
3648 /* compute section length */
3649 for (i = 0; i < actctx->num_assemblies; i++)
3650 {
3651 struct assembly *assembly = &actctx->assemblies[i];
3652 for (j = 0; j < assembly->num_dlls; j++)
3653 {
3654 struct dll_redirect *dll = &assembly->dlls[j];
3655 for (k = 0; k < dll->entities.num; k++)
3656 {
3657 struct entity *entity = &dll->entities.base[k];
3658 if (entity->kind == ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)
3659 {
3660 int class_len = strlenW(entity->u.class.name) + 1;
3661 int len;
3662
3663 /* each class entry needs index, data and string data */
3664 total_len += sizeof(*index);
3665 total_len += sizeof(*data);
3666 /* original name is stored separately */
3667 total_len += aligned_string_len(class_len*sizeof(WCHAR));
3668 /* versioned name and module name are stored one after another */
3669 if (entity->u.class.versioned)
3670 len = get_assembly_version(assembly, NULL) + class_len + 1 /* '!' separator */;
3671 else
3672 len = class_len;
3673 len += strlenW(dll->name) + 1;
3674 total_len += aligned_string_len(len*sizeof(WCHAR));
3675
3676 class_count++;
3677 }
3678 }
3679 }
3680 }
3681
3682 total_len += sizeof(*header);
3683
3684 header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
3685 if (!header) return STATUS_NO_MEMORY;
3686
3687 memset(header, 0, sizeof(*header));
3688 header->magic = STRSECTION_MAGIC;
3689 header->size = sizeof(*header);
3690 header->count = class_count;
3691 header->index_offset = sizeof(*header);
3692 index = (struct string_index*)((BYTE*)header + header->index_offset);
3693 name_offset = header->index_offset + header->count*sizeof(*index);
3694
3695 for (i = 0; i < actctx->num_assemblies; i++)
3696 {
3697 struct assembly *assembly = &actctx->assemblies[i];
3698 for (j = 0; j < assembly->num_dlls; j++)
3699 {
3700 struct dll_redirect *dll = &assembly->dlls[j];
3701 for (k = 0; k < dll->entities.num; k++)
3702 {
3703 struct entity *entity = &dll->entities.base[k];
3704 if (entity->kind == ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)
3705 {
3706 static const WCHAR exclW[] = {'!',0};
3707 ULONG versioned_len, module_len;
3709 WCHAR *ptrW;
3710
3711 /* setup new index entry */
3712 str.Buffer = entity->u.class.name;
3713 str.Length = (USHORT)strlenW(entity->u.class.name)*sizeof(WCHAR);
3714 str.MaximumLength = str.Length + sizeof(WCHAR);
3715 /* hash original class name */
3717
3718 /* include '!' separator too */
3719 if (entity->u.class.versioned)
3720 versioned_len = (get_assembly_version(assembly, NULL) + 1)*sizeof(WCHAR) + str.Length;
3721 else
3722 versioned_len = str.Length;
3723 module_len = strlenW(dll->name)*sizeof(WCHAR);
3724
3725 index->name_offset = name_offset;
3726 index->name_len = str.Length;
3727 index->data_offset = index->name_offset + aligned_string_len(str.MaximumLength);
3728 index->data_len = sizeof(*data) + versioned_len + module_len + 2*sizeof(WCHAR) /* two nulls */;
3729 index->rosterindex = i + 1;
3730
3731 /* setup data */
3732 data = (struct wndclass_redirect_data*)((BYTE*)header + index->data_offset);
3733 data->size = sizeof(*data);
3734 data->res = 0;
3735 data->name_len = versioned_len;
3736 data->name_offset = sizeof(*data);
3737 data->module_len = module_len;
3738 data->module_offset = index->data_offset + data->name_offset + data->name_len + sizeof(WCHAR);
3739
3740 /* original class name */
3741 ptrW = (WCHAR*)((BYTE*)header + index->name_offset);
3742 memcpy(ptrW, entity->u.class.name, index->name_len);
3743 ptrW[index->name_len/sizeof(WCHAR)] = 0;
3744
3745 /* module name */
3746 ptrW = (WCHAR*)((BYTE*)header + data->module_offset);
3747 memcpy(ptrW, dll->name, data->module_len);
3748 ptrW[data->module_len/sizeof(WCHAR)] = 0;
3749
3750 /* versioned name */
3751 ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
3752 if (entity->u.class.versioned)
3753 {
3755 strcatW(ptrW, exclW);
3756 strcatW(ptrW, entity->u.class.name);
3757 }
3758 else
3759 {
3760 memcpy(ptrW, entity->u.class.name, index->name_len);
3761 ptrW[index->name_len/sizeof(WCHAR)] = 0;
3762 }
3763
3764 name_offset += sizeof(*data);
3765 name_offset += aligned_string_len(str.MaximumLength) + aligned_string_len(versioned_len + module_len + 2*sizeof(WCHAR));
3766
3767 index++;
3768 }
3769 }
3770 }
3771 }
3772
3773 *section = header;
3774
3775 return STATUS_SUCCESS;
3776}
static int get_assembly_version(struct assembly *assembly, WCHAR *ret)
Definition: actctx.c:1963
struct entity::@4975::@4979 class

Referenced by find_window_class().

◆ check_actctx()

static ACTIVATION_CONTEXT * check_actctx ( HANDLE  h)
static

Definition at line 1158 of file actctx.c.

1159{
1162
1163 if (!h || h == INVALID_HANDLE_VALUE) return NULL;
1164 _SEH2_TRY
1165 {
1166 if (actctx)
1167 {
1168 pActual = CONTAINING_RECORD(actctx, ACTIVATION_CONTEXT_WRAPPED, ActivationContext);
1169 if (pActual->MagicMarker == ACTCTX_MAGIC_MARKER) ret = &pActual->ActivationContext;
1170 }
1171 }
1173 {
1174 DPRINT1("Invalid activation context handle!\n");
1175 }
1176 _SEH2_END;
1177 return ret;
1178}
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define ACTCTX_MAGIC_MARKER
Definition: actctx.c:41
ACTIVATION_CONTEXT ActivationContext
Definition: actctx.c:566

Referenced by actctx_init(), RtlAddRefActivationContext(), RtlFindActivationContextSectionGuid(), RtlFindActivationContextSectionString(), RtlQueryInformationActivationContext(), and RtlReleaseActivationContext().

◆ com_class_add_progid()

static BOOL com_class_add_progid ( const xmlstr_t progid,
struct entity entity 
)
static

Definition at line 1635 of file actctx.c.

1636{
1637 struct progids *progids = &entity->u.comclass.progids;
1638
1639 if (progids->allocated == 0)
1640 {
1641 progids->allocated = 4;
1642 if (!(progids->progids = RtlAllocateHeap(RtlGetProcessHeap(), 0, progids->allocated * sizeof(WCHAR*)))) return FALSE;
1643 }
1644
1645 if (progids->allocated == progids->num)
1646 {
1647 WCHAR **new_progids = RtlReAllocateHeap(RtlGetProcessHeap(), 0, progids->progids,
1648 2 * progids->allocated * sizeof(WCHAR*));
1649 if (!new_progids) return FALSE;
1650 progids->allocated *= 2;
1651 progids->progids = new_progids;
1652 }
1653
1654 if (!(progids->progids[progids->num] = xmlstrdupW(progid))) return FALSE;
1655 progids->num++;
1656
1657 return TRUE;
1658}
#define progid(str)
Definition: exdisp.idl:31
static WCHAR * xmlstrdupW(const xmlstr_t *str)
Definition: actctx.c:777
unsigned int allocated
Definition: actctx.c:384

Referenced by parse_com_class_progid().

◆ find_clr_surrogate()

static _Must_inspect_result_ NTSTATUS find_clr_surrogate ( ACTIVATION_CONTEXT actctx,
const GUID guid,
ACTCTX_SECTION_KEYED_DATA *  data 
)
static

Definition at line 4725 of file actctx.c.

4726{
4727 struct clrsurrogate_data *surrogate;
4728 struct guid_index *index = NULL;
4729
4730 if (!(actctx->sections & CLRSURROGATES_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4731
4732 if (!actctx->clrsurrogate_section)
4733 {
4735
4737 if (status) return status;
4738
4739 if (InterlockedCompareExchangePointer((void**)&actctx->clrsurrogate_section, section, NULL))
4740 RtlFreeHeap(RtlGetProcessHeap(), 0, section);
4741 }
4742
4743 index = find_guid_index(actctx->clrsurrogate_section, guid);
4744 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4745
4746 surrogate = get_surrogate_data(actctx, index);
4747
4748 data->ulDataFormatVersion = 1;
4749 data->lpData = surrogate;
4750 /* full length includes string length with nulls */
4751 data->ulLength = surrogate->size + surrogate->name_len + sizeof(WCHAR);
4752 if (surrogate->version_len)
4753 data->ulLength += surrogate->version_len + sizeof(WCHAR);
4754
4755 data->lpSectionGlobalData = NULL;
4756 data->ulSectionGlobalDataLength = 0;
4757 data->lpSectionBase = actctx->clrsurrogate_section;
4758 data->ulSectionTotalLength = RtlSizeHeap( RtlGetProcessHeap(), 0, actctx->clrsurrogate_section );
4759 data->hActCtx = NULL;
4760
4761 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4762 data->ulAssemblyRosterIndex = index->rosterindex;
4763
4764 return STATUS_SUCCESS;
4765}
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
const GUID * guid
NTSYSAPI SIZE_T NTAPI RtlSizeHeap(_In_ PVOID HeapHandle, _In_ ULONG Flags, _In_ PVOID MemoryPointer)
#define STATUS_SXS_KEY_NOT_FOUND
Definition: ntstatus.h:1389
static _Must_inspect_result_ NTSTATUS build_clr_surrogate_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4606
static struct clrsurrogate_data * get_surrogate_data(ACTIVATION_CONTEXT *actctx, const struct guid_index *index)
Definition: actctx.c:4717
Definition: ps.c:97
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by find_guid().

◆ find_cominterface_redirection()

static _Must_inspect_result_ NTSTATUS find_cominterface_redirection ( ACTIVATION_CONTEXT actctx,
const GUID guid,
ACTCTX_SECTION_KEYED_DATA *  data 
)
static

Definition at line 4565 of file actctx.c.

4566{
4567 struct ifacepsredirect_data *iface;
4568 struct guid_index *index = NULL;
4569
4570 if (!(actctx->sections & IFACEREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4571
4572 if (!actctx->ifaceps_section)
4573 {
4575
4577 if (status) return status;
4578
4579 if (InterlockedCompareExchangePointer((void**)&actctx->ifaceps_section, section, NULL))
4580 RtlFreeHeap(RtlGetProcessHeap(), 0, section);
4581 }
4582
4583 index = find_guid_index(actctx->ifaceps_section, guid);
4584 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4585
4586 iface = get_ifaceps_data(actctx, index);
4587
4588 data->ulDataFormatVersion = 1;
4589 data->lpData = iface;
4590 data->ulLength = iface->size + (iface->name_len ? iface->name_len + sizeof(WCHAR) : 0);
4591 data->lpSectionGlobalData = NULL;
4592 data->ulSectionGlobalDataLength = 0;
4593 data->lpSectionBase = actctx->ifaceps_section;
4594 data->ulSectionTotalLength = RtlSizeHeap( RtlGetProcessHeap(), 0, actctx->ifaceps_section );
4595 data->hActCtx = NULL;
4596
4597 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4598 data->ulAssemblyRosterIndex = index->rosterindex;
4599
4600 return STATUS_SUCCESS;
4601}
static struct ifacepsredirect_data * get_ifaceps_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:4557
static _Must_inspect_result_ NTSTATUS build_ifaceps_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4495

Referenced by find_guid().

◆ find_comserver_redirection()

static _Must_inspect_result_ NTSTATUS find_comserver_redirection ( ACTIVATION_CONTEXT actctx,
const GUID guid,
ACTCTX_SECTION_KEYED_DATA *  data 
)
static

Definition at line 4343 of file actctx.c.

4344{
4345 struct comclassredirect_data *comclass;
4346 struct guid_index *index = NULL;
4347
4348 if (!(actctx->sections & SERVERREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4349
4350 if (!actctx->comserver_section)
4351 {
4353
4355 if (status) return status;
4356
4357 if (InterlockedCompareExchangePointer((void**)&actctx->comserver_section, section, NULL))
4358 RtlFreeHeap(RtlGetProcessHeap(), 0, section);
4359 }
4360
4361 index = find_guid_index(actctx->comserver_section, guid);
4362 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4363
4364 comclass = get_comclass_data(actctx, index);
4365
4366 data->ulDataFormatVersion = 1;
4367 data->lpData = comclass;
4368 /* full length includes string length with nulls */
4369 data->ulLength = comclass->size + comclass->clrdata_len;
4370 if (comclass->progid_len) data->ulLength += comclass->progid_len + sizeof(WCHAR);
4371 data->lpSectionGlobalData = (BYTE*)actctx->comserver_section + actctx->comserver_section->names_offset;
4372 data->ulSectionGlobalDataLength = actctx->comserver_section->names_len;
4373 data->lpSectionBase = actctx->comserver_section;
4374 data->ulSectionTotalLength = RtlSizeHeap( RtlGetProcessHeap(), 0, actctx->comserver_section );
4375 data->hActCtx = NULL;
4376
4377 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4378 data->ulAssemblyRosterIndex = index->rosterindex;
4379
4380 return STATUS_SUCCESS;
4381}
static _Must_inspect_result_ NTSTATUS build_comserver_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4272

Referenced by find_guid().

◆ find_dll_redirection()

static NTSTATUS find_dll_redirection ( ACTIVATION_CONTEXT actctx,
const UNICODE_STRING name,
PACTCTX_SECTION_KEYED_DATA  data 
)
static

Definition at line 3585 of file actctx.c.

3587{
3588 struct dllredirect_data *dll;
3589 struct string_index *index;
3590
3591 DPRINT("sections: 0x%08X\n", actctx->sections);
3592 if (!(actctx->sections & DLLREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
3593
3594 DPRINT("actctx->dllredirect_section: %p\n", actctx->dllredirect_section);
3595 if (!actctx->dllredirect_section)
3596 {
3597 struct strsection_header *section;
3598
3600 if (status) return status;
3601
3602 if (InterlockedCompareExchangePointer((void**)&actctx->dllredirect_section, section, NULL))
3603 RtlFreeHeap(RtlGetProcessHeap(), 0, section);
3604 }
3605
3606 index = find_string_index(actctx->dllredirect_section, name);
3607 DPRINT("index: %d\n", index);
3608 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
3609
3610 if (data)
3611 {
3613
3614 data->ulDataFormatVersion = 1;
3615 data->lpData = dll;
3616 data->ulLength = dll->size;
3617 data->lpSectionGlobalData = NULL;
3618 data->ulSectionGlobalDataLength = 0;
3619 data->lpSectionBase = actctx->dllredirect_section;
3620 data->ulSectionTotalLength = RtlSizeHeap( RtlGetProcessHeap(), 0, actctx->dllredirect_section );
3621 data->hActCtx = NULL;
3622
3623 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
3624 data->ulAssemblyRosterIndex = index->rosterindex;
3625 }
3626
3627 return STATUS_SUCCESS;
3628}
static NTSTATUS build_dllredirect_section(ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
Definition: actctx.c:3438
static struct dllredirect_data * get_dllredirect_data(ACTIVATION_CONTEXT *ctxt, struct string_index *index)
Definition: actctx.c:3580
static struct string_index * find_string_index(const struct strsection_header *section, const UNICODE_STRING *name)
Definition: actctx.c:3528

Referenced by find_string().

◆ find_entry_by_name()

IMAGE_RESOURCE_DIRECTORY * find_entry_by_name ( IMAGE_RESOURCE_DIRECTORY dir,
LPCWSTR  name,
void root,
int  want_dir 
)

Definition at line 130 of file res.c.

133{
136 int min, max, res, pos;
137 size_t namelen;
138
139 if (!((ULONG_PTR)name & 0xFFFF0000)) return find_entry_by_id( dir, (ULONG_PTR)name & 0xFFFF, root, want_dir );
142 min = 0;
143 max = dir->NumberOfNamedEntries - 1;
144 while (min <= max)
145 {
146 pos = (min + max) / 2;
147 str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const char *)root + entry[pos].NameOffset);
148 res = _wcsnicmp( name, str->NameString, str->Length );
149 if (!res && namelen == str->Length)
150 {
151 if (!entry[pos].DataIsDirectory == !want_dir)
152 {
153 DPRINT("root %p dir %p name %ws ret %p\n",
154 root, dir, name, (const char*)root + entry[pos].OffsetToDirectory);
155 return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].OffsetToDirectory);
156 }
157 break;
158 }
159 if (res < 0) max = pos - 1;
160 else min = pos + 1;
161 }
162 DPRINT("root %p dir %p name %ws not found\n", root, dir, name);
163 return NULL;
164}
unsigned int dir
Definition: maze.c:112
GLuint res
Definition: glext.h:9613
GLint namelen
Definition: glext.h:7232
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
uint32_t entry
Definition: isohybrid.c:63
#define min(a, b)
Definition: monoChain.cc:55
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
IMAGE_RESOURCE_DIRECTORY * find_entry_by_id(IMAGE_RESOURCE_DIRECTORY *dir, WORD id, void *root, int want_dir)
Definition: res.c:95
Definition: pedump.c:414
#define max(a, b)
Definition: svc.c:63
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by search_manifest_in_module().

◆ find_first_entry()

IMAGE_RESOURCE_DIRECTORY * find_first_entry ( IMAGE_RESOURCE_DIRECTORY dir,
void root,
int  want_dir 
)

Definition at line 75 of file res.c.

77{
79 int pos;
80
81 for (pos = 0; pos < dir->NumberOfNamedEntries + dir->NumberOfIdEntries; pos++)
82 {
83 if (!entry[pos].DataIsDirectory == !want_dir)
84 return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].OffsetToDirectory);
85 }
86 return NULL;
87}

Referenced by search_manifest_in_module().

◆ find_first_id_entry()

static IMAGE_RESOURCE_DIRECTORY * find_first_id_entry ( IMAGE_RESOURCE_DIRECTORY dir,
void root,
int  want_dir 
)
static

Definition at line 2928 of file actctx.c.

2930{
2932 int pos;
2933
2934 for (pos = dir->NumberOfNamedEntries; pos < dir->NumberOfNamedEntries + dir->NumberOfIdEntries; pos++)
2935 {
2936 if (!entry[pos].DataIsDirectory == !want_dir)
2937 return (IMAGE_RESOURCE_DIRECTORY *)((char *)root + entry[pos].OffsetToDirectory);
2938 }
2939 return NULL;
2940}

Referenced by search_manifest_in_module().

◆ find_guid()

static NTSTATUS find_guid ( ACTIVATION_CONTEXT actctx,
ULONG  section_kind,
const GUID guid,
DWORD  flags,
PACTCTX_SECTION_KEYED_DATA  data 
)
static

Definition at line 5040 of file actctx.c.

5042{
5044
5045 switch (section_kind)
5046 {
5047 case ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION:
5049 break;
5050 case ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION:
5052 break;
5053 case ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION:
5055 break;
5056 case ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES:
5058 break;
5059 default:
5060 DPRINT("Unknown section_kind %x\n", section_kind);
5062 }
5063
5064 if (status != STATUS_SUCCESS) return status;
5065
5066 if (flags & FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX)
5067 {
5069 data->hActCtx = actctx;
5070 }
5071 return STATUS_SUCCESS;
5072}
GLbitfield flags
Definition: glext.h:7161
#define STATUS_SXS_SECTION_NOT_FOUND
Definition: ntstatus.h:1382
static _Must_inspect_result_ NTSTATUS find_clr_surrogate(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4725
static void actctx_addref(ACTIVATION_CONTEXT *actctx)
Definition: actctx.c:1180
static _Must_inspect_result_ NTSTATUS find_cominterface_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4565
static _Must_inspect_result_ NTSTATUS find_comserver_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4343
static NTSTATUS find_tlib_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:3981

Referenced by RtlFindActivationContextSectionGuid().

◆ find_guid_index()

static struct guid_index * find_guid_index ( const struct guidsection_header section,
const GUID guid 
)
static

Definition at line 3560 of file actctx.c.

3561{
3562 struct guid_index *iter, *index = NULL;
3563 ULONG i;
3564
3565 iter = (struct guid_index*)((BYTE*)section + section->index_offset);
3566
3567 for (i = 0; i < section->count; i++)
3568 {
3569 if (!memcmp(guid, &iter->guid, sizeof(*guid)))
3570 {
3571 index = iter;
3572 break;
3573 }
3574 iter++;
3575 }
3576
3577 return index;
3578}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112

Referenced by add_progid_record(), find_clr_surrogate(), find_cominterface_redirection(), find_comserver_redirection(), and find_tlib_redirection().

◆ find_progid_redirection()

static NTSTATUS find_progid_redirection ( ACTIVATION_CONTEXT actctx,
const UNICODE_STRING name,
PACTCTX_SECTION_KEYED_DATA  data 
)
static

Definition at line 4949 of file actctx.c.

4951{
4953 struct string_index *index;
4954
4955 if (!(actctx->sections & PROGIDREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4956
4957 if (!actctx->comserver_section)
4958 {
4960
4962 if (status) return status;
4963
4964 if (InterlockedCompareExchangePointer((void**)&actctx->comserver_section, section, NULL))
4965 RtlFreeHeap(RtlGetProcessHeap(), 0, section);
4966 }
4967
4968 if (!actctx->progid_section)
4969 {
4970 struct strsection_header *section;
4971
4973 if (status) return status;
4974
4975 if (InterlockedCompareExchangePointer((void**)&actctx->progid_section, section, NULL))
4976 RtlFreeHeap(RtlGetProcessHeap(), 0, section);
4977 }
4978
4979 index = find_string_index(actctx->progid_section, name);
4980 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4981
4982 if (data)
4983 {
4985
4986 data->ulDataFormatVersion = 1;
4987 data->lpData = progid;
4988 data->ulLength = progid->size;
4989 data->lpSectionGlobalData = (BYTE*)actctx->progid_section + actctx->progid_section->global_offset;
4990 data->ulSectionGlobalDataLength = actctx->progid_section->global_len;
4991 data->lpSectionBase = actctx->progid_section;
4992 data->ulSectionTotalLength = RtlSizeHeap( RtlGetProcessHeap(), 0, actctx->progid_section );
4993 data->hActCtx = NULL;
4994
4995 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4996 data->ulAssemblyRosterIndex = index->rosterindex;
4997 }
4998
4999 return STATUS_SUCCESS;
5000}
static struct progidredirect_data * get_progid_data(ACTIVATION_CONTEXT *actctx, const struct string_index *index)
Definition: actctx.c:4944
static _Must_inspect_result_ NTSTATUS build_progid_section(ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
Definition: actctx.c:4878

Referenced by find_string().

◆ find_query_actctx()

static NTSTATUS find_query_actctx ( HANDLE handle,
DWORD  flags,
ULONG  class 
)
static

Definition at line 3403 of file actctx.c.

3404{
3406
3408 {
3409 if (*handle) return STATUS_INVALID_PARAMETER;
3410
3411 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
3412 *handle = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext;
3413 }
3415 {
3418
3419 if (!*handle) return STATUS_INVALID_PARAMETER;
3420
3422 if (!LdrFindEntryForAddress( *handle, &pldr ))
3423 {
3426 else
3428 }
3431 }
3432 else if (!*handle && (class != ActivationContextBasicInformation))
3434
3435 return status;
3436}
NTSTATUS NTAPI LdrUnlockLoaderLock(_In_ ULONG Flags, _In_opt_ ULONG_PTR Cookie)
Definition: ldrapi.c:101
NTSTATUS NTAPI LdrLockLoaderLock(_In_ ULONG Flags, _Out_opt_ PULONG Disposition, _Out_opt_ PULONG_PTR Cookie)
Definition: ldrapi.c:174
NTSTATUS NTAPI LdrFindEntryForAddress(_In_ PVOID Address, _Out_ PLDR_DATA_TABLE_ENTRY *Module)
Definition: ldrapi.c:446
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_IS_ADDRESS
Definition: rtltypes.h:118
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_IS_HMODULE
Definition: rtltypes.h:117
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_USE_ACTIVE_ACTIVATION_CONTEXT
Definition: rtltypes.h:116
u32_t magic(void)
#define STATUS_DLL_NOT_FOUND
Definition: ntstatus.h:545
Definition: btrfs_drv.h:1876
PACTIVATION_CONTEXT EntryPointActivationContext
Definition: ldrtypes.h:163
PVOID DllBase
Definition: btrfs_drv.h:1880
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

Referenced by RtlQueryInformationActivationContext().

◆ find_string()

static NTSTATUS find_string ( ACTIVATION_CONTEXT actctx,
ULONG  section_kind,
const UNICODE_STRING section_name,
DWORD  flags,
PACTCTX_SECTION_KEYED_DATA  data 
)
static

Definition at line 5002 of file actctx.c.

5005{
5007
5008 switch (section_kind)
5009 {
5010 case ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION:
5011 DPRINT1("Unsupported yet section_kind %x\n", section_kind);
5013 case ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION:
5014 status = find_dll_redirection(actctx, section_name, data);
5015 break;
5016 case ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION:
5017 status = find_window_class(actctx, section_name, data);
5018 break;
5019 case ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION:
5020 status = find_progid_redirection(actctx, section_name, data);
5021 break;
5022 case ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE:
5023 DPRINT1("Unsupported yet section_kind %x\n", section_kind);
5025 default:
5026 DPRINT1("Unknown section_kind %x\n", section_kind);
5028 }
5029
5030 if (status != STATUS_SUCCESS) return status;
5031
5032 if (data && (flags & FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX))
5033 {
5035 data->hActCtx = actctx;
5036 }
5037 return STATUS_SUCCESS;
5038}
static NTSTATUS find_progid_redirection(ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:4949
static NTSTATUS find_window_class(ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:3778
static NTSTATUS find_dll_redirection(ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:3585

Referenced by RtlFindActivationContextSectionString().

◆ find_string_index()

static struct string_index * find_string_index ( const struct strsection_header section,
const UNICODE_STRING name 
)
static

Definition at line 3528 of file actctx.c.

3529{
3530 struct string_index *iter, *index = NULL;
3531 ULONG hash = 0, i;
3532
3533 DPRINT("section %p, name %wZ\n", section, name);
3535 iter = (struct string_index*)((BYTE*)section + section->index_offset);
3536
3537 for (i = 0; i < section->count; i++)
3538 {
3539 DPRINT("iter->hash 0x%x ?= 0x%x\n", iter->hash, hash);
3540 DPRINT("iter->name %S\n", (WCHAR*)((BYTE*)section + iter->name_offset));
3541 if (iter->hash == hash)
3542 {
3543 const WCHAR *nameW = (WCHAR*)((BYTE*)section + iter->name_offset);
3544
3545 if (!_wcsnicmp(nameW, name->Buffer, name->Length / sizeof(WCHAR)) &&
3546 wcslen(nameW) == name->Length / sizeof(WCHAR))
3547 {
3548 index = iter;
3549 break;
3550 }
3551 else
3552 DPRINT1("hash collision 0x%08x, %wZ, %S\n", hash, name, nameW);
3553 }
3554 iter++;
3555 }
3556
3557 return index;
3558}
static const WCHAR nameW[]
Definition: main.c:46
Definition: _hash_fun.h:40
ULONG hash
Definition: actctx.c:1061

Referenced by find_dll_redirection(), and find_progid_redirection().

◆ find_tlib_redirection()

static NTSTATUS find_tlib_redirection ( ACTIVATION_CONTEXT actctx,
const GUID guid,
ACTCTX_SECTION_KEYED_DATA *  data 
)
static

Definition at line 3981 of file actctx.c.

3982{
3983 struct guid_index *index = NULL;
3984 struct tlibredirect_data *tlib;
3985
3986 if (!(actctx->sections & TLIBREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
3987
3988 if (!actctx->tlib_section)
3989 {
3991
3993 if (status) return status;
3994
3995 if (InterlockedCompareExchangePointer((void**)&actctx->tlib_section, section, NULL))
3996 RtlFreeHeap(RtlGetProcessHeap(), 0, section);
3997 }
3998
3999 index = find_guid_index(actctx->tlib_section, guid);
4000 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4001
4002 tlib = get_tlib_data(actctx, index);
4003
4004 data->ulDataFormatVersion = 1;
4005 data->lpData = tlib;
4006 /* full length includes string length with nulls */
4007 data->ulLength = tlib->size + tlib->help_len + sizeof(WCHAR);
4008 data->lpSectionGlobalData = (BYTE*)actctx->tlib_section + actctx->tlib_section->names_offset;
4009 data->ulSectionGlobalDataLength = actctx->tlib_section->names_len;
4010 data->lpSectionBase = actctx->tlib_section;
4011 data->ulSectionTotalLength = RtlSizeHeap( RtlGetProcessHeap(), 0, actctx->tlib_section );
4012 data->hActCtx = NULL;
4013
4014 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4015 data->ulAssemblyRosterIndex = index->rosterindex;
4016
4017 return STATUS_SUCCESS;
4018}
static struct tlibredirect_data * get_tlib_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:3976
static _Must_inspect_result_ NTSTATUS build_tlib_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:3846

Referenced by find_guid().

◆ find_window_class()

static NTSTATUS find_window_class ( ACTIVATION_CONTEXT actctx,
const UNICODE_STRING name,
PACTCTX_SECTION_KEYED_DATA  data 
)
static

Definition at line 3778 of file actctx.c.

3780{
3781 struct string_index *iter, *index = NULL;
3782 struct wndclass_redirect_data *class;
3783 ULONG hash;
3784 int i;
3785
3786 if (!(actctx->sections & WINDOWCLASS_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
3787
3788 if (!actctx->wndclass_section)
3789 {
3790 struct strsection_header *section;
3791
3793 if (status) return status;
3794
3795 if (InterlockedCompareExchangePointer((void**)&actctx->wndclass_section, section, NULL))
3796 RtlFreeHeap(RtlGetProcessHeap(), 0, section);
3797 }
3798
3799 hash = 0;
3802
3803 for (i = 0; i < actctx->wndclass_section->count; i++)
3804 {
3805 if (iter->hash == hash)
3806 {
3807 const WCHAR *nameW = (WCHAR*)((BYTE*)actctx->wndclass_section + iter->name_offset);
3808
3809 if (!strcmpiW(nameW, name->Buffer))
3810 {
3811 index = iter;
3812 break;
3813 }
3814 else
3815 DPRINT1("hash collision 0x%08x, %wZ, %S\n", hash, name, nameW);
3816 }
3817 iter++;
3818 }
3819
3820 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
3821
3822 if (data)
3823 {
3824 class = get_wndclass_data(actctx, index);
3825
3826 data->ulDataFormatVersion = 1;
3827 data->lpData = class;
3828 /* full length includes string length with nulls */
3829 data->ulLength = class->size + class->name_len + class->module_len + 2*sizeof(WCHAR);
3830 data->lpSectionGlobalData = NULL;
3831 data->ulSectionGlobalDataLength = 0;
3832 data->lpSectionBase = actctx->wndclass_section;
3833 data->ulSectionTotalLength = RtlSizeHeap( RtlGetProcessHeap(), 0, actctx->wndclass_section );
3834 data->hActCtx = NULL;
3835
3836 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
3837 data->ulAssemblyRosterIndex = index->rosterindex;
3838 }
3839
3840 return STATUS_SUCCESS;
3841}
#define strcmpiW(s1, s2)
Definition: unicode.h:39
static struct wndclass_redirect_data * get_wndclass_data(ACTIVATION_CONTEXT *ctxt, struct string_index *index)
Definition: actctx.c:3635
static NTSTATUS build_wndclass_section(ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
Definition: actctx.c:3640
static struct string_index * get_wndclass_first_index(ACTIVATION_CONTEXT *actctx)
Definition: actctx.c:3630

Referenced by find_string().

◆ find_xmlns()

static xmlstr_t find_xmlns ( xmlbuf_t xmlbuf,
const xmlstr_t name 
)
static

Definition at line 1262 of file actctx.c.

1263{
1264 int i;
1265
1266 for (i = xmlbuf->ns_pos - 1; i >= 0; i--)
1267 {
1268 if (xmlbuf->namespaces[i].name.len == name->len &&
1269 !wcsncmp( xmlbuf->namespaces[i].name.ptr, name->ptr, name->len ))
1270 return xmlbuf->namespaces[i].value;
1271 }
1272
1273 return empty_xmlstr;
1274}
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
static const xmlstr_t empty_xmlstr
Definition: actctx.c:545
int ns_pos
Definition: actctx.c:72
struct xml_attr namespaces[MAX_NAMESPACES]
Definition: actctx.c:71

Referenced by next_xml_elem().

◆ free_assembly_identity()

static void free_assembly_identity ( struct assembly_identity ai)
static

Definition at line 915 of file actctx.c.

916{
917 RtlFreeHeap( RtlGetProcessHeap(), 0, ai->name );
918 RtlFreeHeap( RtlGetProcessHeap(), 0, ai->arch );
919 RtlFreeHeap( RtlGetProcessHeap(), 0, ai->public_key );
920 RtlFreeHeap( RtlGetProcessHeap(), 0, ai->language );
921 RtlFreeHeap( RtlGetProcessHeap(), 0, ai->type );
922}

Referenced by actctx_release(), and free_depend_manifests().

◆ free_depend_manifests()

static void free_depend_manifests ( struct actctx_loader acl)
static

Definition at line 1071 of file actctx.c.

1072{
1073 unsigned int i;
1074 for (i = 0; i < acl->num_dependencies; i++)
1076 RtlFreeHeap(RtlGetProcessHeap(), 0, acl->dependencies);
1077}

Referenced by RtlCreateActivationContext().

◆ free_entity_array()

static void free_entity_array ( struct entity_array array)
static

Definition at line 952 of file actctx.c.

953{
954 unsigned int i, j;
955 for (i = 0; i < array->num; i++)
956 {
957 struct entity *entity = &array->base[i];
958 switch (entity->kind)
959 {
960 case ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION:
961 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.comclass.clsid);
962 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.comclass.tlbid);
963 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.comclass.progid);
964 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.comclass.name);
965 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.comclass.version);
966 for (j = 0; j < entity->u.comclass.progids.num; j++)
967 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.comclass.progids.progids[j]);
968 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.comclass.progids.progids);
969 break;
970 case ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION:
971 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.ifaceps.iid);
972 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.ifaceps.base);
973 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.ifaceps.ps32);
974 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.ifaceps.name);
975 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.ifaceps.tlib);
976 break;
977 case ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION:
978 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.typelib.tlbid);
979 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.typelib.helpdir);
980 break;
981 case ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION:
982 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.class.name);
983 break;
984 case ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES:
985 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.clrsurrogate.name);
986 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.clrsurrogate.clsid);
987 RtlFreeHeap(RtlGetProcessHeap(), 0, entity->u.clrsurrogate.version);
988 break;
989 default:
990 DPRINT1("Unknown entity kind %u\n", entity->kind);
991 }
992 }
993 RtlFreeHeap( RtlGetProcessHeap(), 0, array->base );
994}

Referenced by actctx_release().

◆ generate_uuid()

static void generate_uuid ( ULONG seed,
GUID guid 
)
static

Definition at line 4020 of file actctx.c.

4021{
4022 ULONG *ptr = (ULONG*)guid;
4023 int i;
4024
4025 /* GUID is 16 bytes long */
4026 for (i = 0; i < sizeof(GUID)/sizeof(ULONG); i++, ptr++)
4027 *ptr = RtlUniform(seed);
4028
4029 guid->Data3 &= 0x0fff;
4030 guid->Data3 |= (4 << 12);
4031 guid->Data4[0] &= 0x3f;
4032 guid->Data4[0] |= 0x80;
4033}
NTSYSAPI ULONG NTAPI RtlUniform(_In_ PULONG Seed)

Referenced by add_comserver_record().

◆ get_assembly_version()

static int get_assembly_version ( struct assembly assembly,
WCHAR ret 
)
static

Definition at line 1963 of file actctx.c.

1964{
1965 static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
1966 struct assembly_version *ver = &assembly->id.version;
1967 WCHAR buff[25];
1968
1969 if (!ret) ret = buff;
1970 return sprintfW(ret, fmtW, ver->major, ver->minor, ver->build, ver->revision);
1971}
static unsigned char buff[32768]
Definition: fatten.c:17
USHORT major
Definition: actctx.c:84
USHORT revision
Definition: actctx.c:87
USHORT build
Definition: actctx.c:86
USHORT minor
Definition: actctx.c:85

Referenced by build_wndclass_section().

◆ get_comclass_data()

static struct comclassredirect_data * get_comclass_data ( ACTIVATION_CONTEXT actctx,
struct guid_index index 
)
inlinestatic

Definition at line 4335 of file actctx.c.

4336{
4337 return (struct comclassredirect_data*)((BYTE*)actctx->comserver_section + index->data_offset);
4338}

Referenced by add_progid_record(), and find_comserver_redirection().

◆ get_comserver_datalen()

static void get_comserver_datalen ( const struct entity_array entities,
const struct dll_redirect dll,
unsigned int count,
unsigned int len,
unsigned int module_len 
)
static

Definition at line 4035 of file actctx.c.

4037{
4038 unsigned int i;
4039
4040 for (i = 0; i < entities->num; i++)
4041 {
4042 struct entity *entity = &entities->base[i];
4043 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4044 {
4045 /* each entry needs two index entries, extra one goes for alias GUID */
4046 *len += 2*sizeof(struct guid_index);
4047 /* To save some memory we don't allocated two data structures,
4048 instead alias index and normal index point to the same data structure. */
4049 *len += sizeof(struct comclassredirect_data);
4050
4051 /* for clrClass store some more */
4052 if (entity->u.comclass.name)
4053 {
4054 unsigned int str_len;
4055
4056 /* all string data is stored together in aligned block */
4057 str_len = strlenW(entity->u.comclass.name)+1;
4058 if (entity->u.comclass.progid)
4059 str_len += strlenW(entity->u.comclass.progid)+1;
4060 if (entity->u.comclass.version)
4061 str_len += strlenW(entity->u.comclass.version)+1;
4062
4063 *len += sizeof(struct clrclass_data);
4064 *len += aligned_string_len(str_len*sizeof(WCHAR));
4065
4066 /* module name is forced to mscoree.dll, and stored two times with different case */
4067 *module_len += sizeof(mscoreeW) + sizeof(mscoree2W);
4068 }
4069 else
4070 {
4071 /* progid string is stored separately */
4072 if (entity->u.comclass.progid)
4073 *len += aligned_string_len((strlenW(entity->u.comclass.progid)+1)*sizeof(WCHAR));
4074
4075 *module_len += (strlenW(dll->name)+1)*sizeof(WCHAR);
4076 }
4077
4078 *count += 1;
4079 }
4080 }
4081}

Referenced by build_comserver_section().

◆ get_dllredirect_data()

static struct dllredirect_data * get_dllredirect_data ( ACTIVATION_CONTEXT ctxt,
struct string_index index 
)
inlinestatic

Definition at line 3580 of file actctx.c.

3581{
3582 return (struct dllredirect_data*)((BYTE*)ctxt->dllredirect_section + index->data_offset);
3583}
struct strsection_header * dllredirect_section
Definition: actctx.c:529

Referenced by find_dll_redirection().

◆ get_ifaceps_data()

static struct ifacepsredirect_data * get_ifaceps_data ( ACTIVATION_CONTEXT actctx,
struct guid_index index 
)
inlinestatic

Definition at line 4557 of file actctx.c.

4558{
4559 return (struct ifacepsredirect_data*)((BYTE*)actctx->ifaceps_section + index->data_offset);
4560}

Referenced by find_cominterface_redirection().

◆ get_ifaceps_datalen()

static void get_ifaceps_datalen ( const struct entity_array entities,
unsigned int count,
unsigned int len 
)
static

Definition at line 4383 of file actctx.c.

4384{
4385 unsigned int i;
4386
4387 for (i = 0; i < entities->num; i++)
4388 {
4389 struct entity *entity = &entities->base[i];
4390 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)
4391 {
4392 *len += sizeof(struct guid_index) + sizeof(struct ifacepsredirect_data);
4393 if (entity->u.ifaceps.name)
4394 *len += aligned_string_len((strlenW(entity->u.ifaceps.name)+1)*sizeof(WCHAR));
4395 *count += 1;
4396 }
4397 }
4398}
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by build_ifaceps_section().

◆ get_manifest_in_associated_manifest()

static NTSTATUS get_manifest_in_associated_manifest ( struct actctx_loader acl,
struct assembly_identity ai,
LPCWSTR  filename,
LPCWSTR  directory,
HMODULE  module,
LPCWSTR  resname 
)
static

Definition at line 3082 of file actctx.c.

3084{
3085 static const WCHAR fmtW[] = { '.','%','l','u',0 };
3086 WCHAR *buffer;
3089 HANDLE file;
3091
3092 if (!((ULONG_PTR)resname >> 16)) resid = (ULONG_PTR)resname & 0xffff;
3093
3094 DPRINT( "looking for manifest associated with %S id %lu\n", filename, resid );
3095
3096 if (module) /* use the module filename */
3097 {
3099
3100 if (!(status = get_module_filename( module, &name, sizeof(dotManifestW) + 10*sizeof(WCHAR) )))
3101 {
3102 if (resid != 1) sprintfW( name.Buffer + strlenW(name.Buffer), fmtW, resid );
3103 strcatW( name.Buffer, dotManifestW );
3104 if (!RtlDosPathNameToNtPathName_U( name.Buffer, &nameW, NULL, NULL ))
3107 }
3108 if (status) return status;
3109 }
3110 else
3111 {
3112 if (!(buffer = RtlAllocateHeap( RtlGetProcessHeap(), 0,
3113 (strlenW(filename) + 10) * sizeof(WCHAR) + sizeof(dotManifestW) )))
3114 return STATUS_NO_MEMORY;
3116 if (resid != 1) sprintfW( buffer + strlenW(buffer), fmtW, resid );
3119 }
3120
3121 if (!open_nt_file( &file, &nameW ))
3122 {
3124 NtClose( file );
3125 }
3128 return status;
3129}
#define ULONG_PTR
Definition: config.h:101
const char * filename
Definition: ioapi.h:137
NTSYSAPI BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(_In_opt_z_ PCWSTR DosPathName, _Out_ PUNICODE_STRING NtPathName, _Out_opt_ PCWSTR *NtFileNamePart, _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define STATUS_RESOURCE_TYPE_NOT_FOUND
Definition: ntstatus.h:374
#define STATUS_RESOURCE_DATA_NOT_FOUND
Definition: ntstatus.h:373
static NTSTATUS open_nt_file(HANDLE *handle, UNICODE_STRING *name)
Definition: actctx.c:2821
static const WCHAR dotManifestW[]
Definition: actctx.c:760
static NTSTATUS get_manifest_in_manifest_file(struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, HANDLE file)
Definition: actctx.c:3035
static NTSTATUS get_module_filename(HMODULE module, UNICODE_STRING *str, USHORT extra_len)
Definition: actctx.c:2835
Definition: fci.c:127

Referenced by RtlCreateActivationContext().

◆ get_manifest_in_manifest_file()

static NTSTATUS get_manifest_in_manifest_file ( struct actctx_loader acl,
struct assembly_identity ai,
LPCWSTR  filename,
LPCWSTR  directory,
BOOL  shared,
HANDLE  file 
)
static

Definition at line 3035 of file actctx.c.

3037{
3045 SIZE_T count;
3046 void *base;
3047
3048 DPRINT( "loading manifest file %S\n", filename );
3049
3050 attr.Length = sizeof(attr);
3051 attr.RootDirectory = 0;
3052 attr.ObjectName = NULL;
3053 attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF;
3054 attr.SecurityDescriptor = NULL;
3055 attr.SecurityQualityOfService = NULL;
3056
3057 size.QuadPart = 0;
3060
3061 if (status != STATUS_SUCCESS) return status;
3062
3063 offset.QuadPart = 0;
3064 count = 0;
3065 base = NULL;
3068 NtClose( mapping );
3069 if (status != STATUS_SUCCESS) return status;
3070
3071 /* Fixme: WINE uses FileEndOfFileInformation with NtQueryInformationFile. */
3073
3074 if (status == STATUS_SUCCESS)
3075 status = parse_manifest(acl, ai, filename, directory, shared, base, (SIZE_T)info.EndOfFile.QuadPart);
3076
3078 return status;
3079}
NTSTATUS NTAPI NtUnmapViewOfSection(IN HANDLE ProcessHandle, IN PVOID BaseAddress)
Definition: section.c:3848
NTSTATUS NTAPI NtCreateSection(OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER MaximumSize OPTIONAL, IN ULONG SectionPageProtection OPTIONAL, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL)
Definition: section.c:3441
NTSTATUS NTAPI NtMapViewOfSection(IN HANDLE SectionHandle, IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
Definition: section.c:3622
#define PAGE_READONLY
Definition: compat.h:138
#define SECTION_MAP_READ
Definition: compat.h:139
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
GLintptr offset
Definition: glext.h:5920
#define OBJ_OPENIF
Definition: winternl.h:229
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
Definition: file.c:100
#define SEC_COMMIT
Definition: mmtypes.h:100
#define SECTION_QUERY
Definition: nt_native.h:1287
#define NtCurrentProcess()
Definition: nt_native.h:1657
NTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, OUT PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
@ ViewShare
Definition: nt_native.h:1278
#define STANDARD_RIGHTS_REQUIRED
Definition: nt_native.h:63
#define FileStandardInformation
Definition: propsheet.cpp:61
static NTSTATUS parse_manifest(struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, const void *buffer, SIZE_T size)
Definition: actctx.c:2746
Definition: cookie.c:202

Referenced by get_manifest_in_associated_manifest(), lookup_assembly(), lookup_winsxs(), and RtlCreateActivationContext().

◆ get_manifest_in_module()

static NTSTATUS get_manifest_in_module ( struct actctx_loader acl,
struct assembly_identity ai,
LPCWSTR  filename,
LPCWSTR  directory,
BOOL  shared,
HANDLE  hModule,
LPCWSTR  resname,
ULONG  lang 
)
static

Definition at line 2858 of file actctx.c.

2861{
2866 void *ptr;
2867
2868 //DPRINT( "looking for res %s in module %p %s\n", resname,
2869 // hModule, filename );
2870 DPRINT("get_manifest_in_module %p\n", hModule);
2871
2872#if 0
2873 if (TRACE_ON(actctx))
2874 {
2875 if (!filename && !get_module_filename( hModule, &nameW, 0 ))
2876 {
2877 DPRINT( "looking for res %s in module %p %s\n", debugstr_w(resname),
2878 hModule, debugstr_w(nameW.Buffer) );
2880 }
2881 else DPRINT( "looking for res %s in module %p %s\n", debugstr_w(resname),
2883 }
2884#endif
2885
2886 if (!resname) return STATUS_INVALID_PARAMETER;
2887
2888 info.Type = (ULONG_PTR)RT_MANIFEST;
2889 info.Language = lang;
2890 if (!((ULONG_PTR)resname >> 16))
2891 {
2892 info.Name = (ULONG_PTR)resname;
2894 }
2895 else if (resname[0] == '#')
2896 {
2897 ULONG value;
2898 RtlInitUnicodeString(&nameW, resname + 1);
2901 info.Name = value;
2903 }
2904 else
2905 {
2906 RtlCreateUnicodeString(&nameW, resname);
2908 info.Name = (ULONG_PTR)nameW.Buffer;
2911 }
2913
2914 if (status == STATUS_SUCCESS)
2915 status = parse_manifest(acl, ai, filename, directory, shared, ptr, entry->Size);
2916
2917 return status;
2918}
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
HMODULE hModule
Definition: animate.c:44
#define TRACE_ON(x)
Definition: compat.h:75
NTSTATUS RtlUpcaseUnicodeString(PUNICODE_STRING dst, PUNICODE_STRING src, BOOLEAN Alloc)
Definition: string_lib.cpp:46
#define debugstr_w
Definition: kernel32.h:32
NTSTATUS NTAPI LdrAccessResource(_In_ PVOID BaseAddress, _In_ PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry, _Out_opt_ PVOID *Resource, _Out_opt_ PULONG Size)
NTSTATUS NTAPI LdrFindResource_U(_In_ PVOID BaseAddress, _In_ PLDR_RESOURCE_INFO ResourceInfo, _In_ ULONG Level, _Out_ PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, PULONG Value)
Definition: pedump.c:458
#define HIWORD(l)
Definition: typedefs.h:247
Definition: pdh_main.c:94
#define RT_MANIFEST
Definition: winuser.h:621

Referenced by get_manifest_in_pe_file(), and RtlCreateActivationContext().

◆ get_manifest_in_pe_file()

static NTSTATUS get_manifest_in_pe_file ( struct actctx_loader acl,
struct assembly_identity ai,
LPCWSTR  filename,
LPCWSTR  directory,
BOOL  shared,
HANDLE  file,
LPCWSTR  resname,
ULONG  lang 
)
static

Definition at line 2979 of file actctx.c.

2982{
2988 SIZE_T count;
2989 void *base;
2990 WCHAR resnameBuf[20];
2991 LPCWSTR resptr = resname;
2992
2993 if ((!((ULONG_PTR)resname >> 16)))
2994 {
2995 sprintfW(resnameBuf, L"#%u", PtrToUlong(resname));
2996 resptr = resnameBuf;
2997 }
2998
2999 DPRINT( "looking for res %S in %S\n", resptr, filename ? filename : L"<NULL>");
3000
3001 attr.Length = sizeof(attr);
3002 attr.RootDirectory = 0;
3003 attr.ObjectName = NULL;
3004 attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF;
3005 attr.SecurityDescriptor = NULL;
3006 attr.SecurityQualityOfService = NULL;
3007
3008 size.QuadPart = 0;
3011 if (status != STATUS_SUCCESS) return status;
3012
3013 offset.QuadPart = 0;
3014 count = 0;
3015 base = NULL;
3018 NtClose( mapping );
3019 if (status != STATUS_SUCCESS) return status;
3020
3021 if (RtlImageNtHeader(base)) /* we got a PE file */
3022 {
3023 HANDLE module = (HMODULE)((ULONG_PTR)base | 1); /* make it a LOAD_LIBRARY_AS_DATAFILE handle */
3024 if (resname)
3025 status = get_manifest_in_module( acl, ai, filename, directory, shared, module, resname, lang );
3026 else
3028 }
3030
3032 return status;
3033}
#define RtlImageNtHeader
Definition: compat.h:806
#define PtrToUlong(u)
Definition: config.h:107
#define STATUS_INVALID_IMAGE_FORMAT
Definition: ntstatus.h:359
static NTSTATUS get_manifest_in_module(struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, HANDLE hModule, LPCWSTR resname, ULONG lang)
Definition: actctx.c:2858
static NTSTATUS search_manifest_in_module(struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, HANDLE hModule, ULONG lang)
Definition: actctx.c:2943
HANDLE HMODULE
Definition: typedefs.h:77

Referenced by lookup_assembly(), and RtlCreateActivationContext().

◆ get_module_filename()

static NTSTATUS get_module_filename ( HMODULE  module,
UNICODE_STRING str,
USHORT  extra_len 
)
static

Definition at line 2835 of file actctx.c.

2836{
2840
2843 if (status == STATUS_SUCCESS)
2844 {
2845 if ((str->Buffer = RtlAllocateHeap( RtlGetProcessHeap(), 0,
2846 pldr->FullDllName.Length + extra_len + sizeof(WCHAR) )))
2847 {
2848 memcpy( str->Buffer, pldr->FullDllName.Buffer, pldr->FullDllName.Length + sizeof(WCHAR) );
2849 str->Length = pldr->FullDllName.Length;
2850 str->MaximumLength = pldr->FullDllName.Length + extra_len + sizeof(WCHAR);
2851 }
2852 else status = STATUS_NO_MEMORY;
2853 }
2855 return status;
2856}
UNICODE_STRING FullDllName
Definition: btrfs_drv.h:1882

Referenced by get_manifest_in_associated_manifest(), get_manifest_in_module(), and RtlCreateActivationContext().

◆ get_olemisc_value()

static OLEMISC get_olemisc_value ( const WCHAR str,
int  len 
)
static

Definition at line 1586 of file actctx.c.

1587{
1588 int min, max;
1589
1590 min = 0;
1591 max = sizeof(olemisc_values)/sizeof(struct olemisc_entry) - 1;
1592
1593 while (min <= max)
1594 {
1595 int n, c;
1596
1597 n = (min+max)/2;
1598
1600 if (!c && !olemisc_values[n].name[len])
1601 return olemisc_values[n].value;
1602
1603 if (c >= 0)
1604 max = n-1;
1605 else
1606 min = n+1;
1607 }
1608
1609 DPRINT1("unknown flag %S\n", str);
1610 return 0;
1611}
GLdouble n
Definition: glext.h:7729
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
#define strncmpW(s1, s2, n)
Definition: unicode.h:36
static const struct olemisc_entry olemisc_values[]
Definition: actctx.c:729
Definition: actctx.c:724

Referenced by parse_com_class_misc().

◆ get_progid_data()

static struct progidredirect_data * get_progid_data ( ACTIVATION_CONTEXT actctx,
const struct string_index index 
)
inlinestatic

Definition at line 4944 of file actctx.c.

4945{
4946 return (struct progidredirect_data*)((BYTE*)actctx->progid_section + index->data_offset);
4947}

Referenced by find_progid_redirection().

◆ get_progid_datalen()

static void get_progid_datalen ( struct entity_array entities,
unsigned int count,
unsigned int total_len 
)
static

Definition at line 4767 of file actctx.c.

4768{
4769 unsigned int i, j, single_len;
4770
4771 single_len = sizeof(struct progidredirect_data) + sizeof(struct string_index) + sizeof(GUID);
4772 for (i = 0; i < entities->num; i++)
4773 {
4774 struct entity *entity = &entities->base[i];
4775 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4776 {
4777 if (entity->u.comclass.progid)
4778 {
4779 *total_len += single_len + aligned_string_len((strlenW(entity->u.comclass.progid)+1)*sizeof(WCHAR));
4780 *count += 1;
4781 }
4782
4783 for (j = 0; j < entity->u.comclass.progids.num; j++)
4784 *total_len += aligned_string_len((strlenW(entity->u.comclass.progids.progids[j])+1)*sizeof(WCHAR));
4785
4786 *total_len += single_len*entity->u.comclass.progids.num;
4787 *count += entity->u.comclass.progids.num;
4788 }
4789 }
4790}

Referenced by build_progid_section().

◆ get_surrogate_data()

static struct clrsurrogate_data * get_surrogate_data ( ACTIVATION_CONTEXT actctx,
const struct guid_index index 
)
inlinestatic

Definition at line 4717 of file actctx.c.

4718{
4719 return (struct clrsurrogate_data*)((BYTE*)actctx->clrsurrogate_section + index->data_offset);
4720}

Referenced by find_clr_surrogate().

◆ get_tlib_data()

static struct tlibredirect_data * get_tlib_data ( ACTIVATION_CONTEXT actctx,
struct guid_index index 
)
inlinestatic

Definition at line 3976 of file actctx.c.

3977{
3978 return (struct tlibredirect_data*)((BYTE*)actctx->tlib_section + index->data_offset);
3979}

Referenced by find_tlib_redirection().

◆ get_wndclass_data()

static struct wndclass_redirect_data * get_wndclass_data ( ACTIVATION_CONTEXT ctxt,
struct string_index index 
)
inlinestatic

Definition at line 3635 of file actctx.c.

3636{
3637 return (struct wndclass_redirect_data*)((BYTE*)ctxt->wndclass_section + index->data_offset);
3638}
struct strsection_header * wndclass_section
Definition: actctx.c:528

Referenced by find_window_class().

◆ get_wndclass_first_index()

static struct string_index * get_wndclass_first_index ( ACTIVATION_CONTEXT actctx)
inlinestatic

Definition at line 3630 of file actctx.c.

3631{
3632 return (struct string_index*)((BYTE*)actctx->wndclass_section + actctx->wndclass_section->index_offset);
3633}

Referenced by find_window_class().

◆ is_matching_identity()

static BOOL is_matching_identity ( const struct assembly_identity id1,
const struct assembly_identity id2 
)
static

Definition at line 1002 of file actctx.c.

1004{
1005 if (!is_matching_string( id1->name, id2->name )) return FALSE;
1006 if (!is_matching_string( id1->arch, id2->arch )) return FALSE;
1007 if (!is_matching_string( id1->public_key, id2->public_key )) return FALSE;
1008
1009 if (id1->language && id2->language && strcmpiW( id1->language, id2->language ))
1010 {
1011 if (strcmpW( wildcardW, id1->language ) && strcmpW( wildcardW, id2->language ))
1012 return FALSE;
1013 }
1014 if (id1->version.major != id2->version.major) return FALSE;
1015 if (id1->version.minor != id2->version.minor) return FALSE;
1016 if (id1->version.build > id2->version.build) return FALSE;
1017 if (id1->version.build == id2->version.build &&
1018 id1->version.revision > id2->version.revision) return FALSE;
1019 return TRUE;
1020}
#define strcmpW(s1, s2)
Definition: unicode.h:38
static BOOL is_matching_string(const WCHAR *str1, const WCHAR *str2)
Definition: actctx.c:996
static const WCHAR wildcardW[]
Definition: actctx.c:762

Referenced by add_dependent_assembly_id().

◆ is_matching_string()

static BOOL is_matching_string ( const WCHAR str1,
const WCHAR str2 
)
static

Definition at line 996 of file actctx.c.

997{
998 if (!str1) return !str2;
999 return str2 && !strcmpiW( str1, str2 );
1000}

Referenced by is_matching_identity().

◆ is_xmlns_attr()

static BOOL is_xmlns_attr ( const struct xml_attr attr)
static

Definition at line 1233 of file actctx.c.

1234{
1235 const int len = wcslen( xmlnsW );
1236 if (attr->name.len < len) return FALSE;
1237 if (wcsncmp( attr->name.ptr, xmlnsW, len )) return FALSE;
1238 return (attr->name.len == len || attr->name.ptr[len] == ':');
1239}
static const WCHAR xmlnsW[]
Definition: actctx.c:653
WCHAR * name
Definition: cookie.c:203

Referenced by next_xml_elem().

◆ isxmlspace()

static BOOL isxmlspace ( WCHAR  ch)
inlinestatic

Definition at line 834 of file actctx.c.

835{
836 return (ch == ' ' || ch == '\r' || ch == '\n' || ch == '\t');
837}

Referenced by next_xml_attr(), next_xml_elem(), and read_xml_elem().

◆ lookup_assembly()

static NTSTATUS lookup_assembly ( struct actctx_loader acl,
struct assembly_identity ai 
)
static

Definition at line 3290 of file actctx.c.

3292{
3293 static const WCHAR dotDllW[] = {'.','d','l','l',0};
3294 unsigned int i;
3295 WCHAR *buffer, *p, *directory;
3298 HANDLE file;
3299 DWORD len;
3300
3301 DPRINT( "looking for name=%S version=%u.%u.%u.%u arch=%S\n",
3302 ai->name, ai->version.major, ai->version.minor, ai->version.build, ai->version.revision, ai->arch );
3303
3304 if ((status = lookup_winsxs(acl, ai)) != STATUS_NO_SUCH_FILE) return status;
3305
3306 /* FIXME: add support for language specific lookup */
3307
3308 len = max(RtlGetFullPathName_U(acl->actctx->assemblies->manifest.info, 0, NULL, NULL) / sizeof(WCHAR),
3309 strlenW(acl->actctx->appdir.info));
3310
3311 nameW.Buffer = NULL;
3312 if (!(buffer = RtlAllocateHeap( RtlGetProcessHeap(), 0,
3313 (len + 2 * strlenW(ai->name) + 2) * sizeof(WCHAR) + sizeof(dotManifestW) )))
3314 return STATUS_NO_MEMORY;
3315
3316 if (!(directory = build_assembly_dir( ai )))
3317 {
3318 RtlFreeHeap( RtlGetProcessHeap(), 0, buffer );
3319 return STATUS_NO_MEMORY;
3320 }
3321
3322 /* Lookup in <dir>\name.dll
3323 * <dir>\name.manifest
3324 * <dir>\name\name.dll
3325 * <dir>\name\name.manifest
3326 *
3327 * First 'appdir' is used as <dir>, if that failed
3328 * it tries application manifest file path.
3329 */
3330 strcpyW( buffer, acl->actctx->appdir.info );
3331 p = buffer + strlenW(buffer);
3332 for (i = 0; i < 4; i++)
3333 {
3334 if (i == 2)
3335 {
3336 struct assembly *assembly = acl->actctx->assemblies;
3337 if (!RtlGetFullPathName_U(assembly->manifest.info, len * sizeof(WCHAR), buffer, &p)) break;
3338 }
3339 else *p++ = '\\';
3340
3341 strcpyW( p, ai->name );
3342 p += strlenW(p);
3343
3344 strcpyW( p, dotDllW );
3346 {
3347 status = open_nt_file( &file, &nameW );
3348 if (!status)
3349 {
3351 (LPCWSTR)0, 0 );
3352 NtClose( file );
3353 break;
3354 }
3356 }
3357
3360 {
3361 status = open_nt_file( &file, &nameW );
3362 if (!status)
3363 {
3365 NtClose( file );
3366 break;
3367 }
3369 }
3371 }
3373 RtlFreeHeap( RtlGetProcessHeap(), 0, directory );
3374 RtlFreeHeap( RtlGetProcessHeap(), 0, buffer );
3375 return status;
3376}
unsigned long DWORD
Definition: ntddk_ex.h:95
NTSYSAPI ULONG NTAPI RtlGetFullPathName_U(_In_ PCWSTR FileName, _In_ ULONG Size, _Out_z_bytecap_(Size) PWSTR Buffer, _Out_opt_ PWSTR *ShortName)
Definition: path.c:1987
#define STATUS_SXS_ASSEMBLY_NOT_FOUND
Definition: ntstatus.h:1385
static WCHAR * build_assembly_dir(struct assembly_identity *ai)
Definition: actctx.c:1079
static NTSTATUS lookup_winsxs(struct actctx_loader *acl, struct assembly_identity *ai)
Definition: actctx.c:3216
static NTSTATUS get_manifest_in_pe_file(struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, HANDLE file, LPCWSTR resname, ULONG lang)
Definition: actctx.c:2979
struct file_info appdir
Definition: actctx.c:522
#define STATUS_NO_SUCH_FILE
Definition: udferr_usr.h:137

Referenced by parse_depend_manifests().

◆ lookup_manifest_file()

static WCHAR * lookup_manifest_file ( HANDLE  dir,
struct assembly_identity ai 
)
static

Definition at line 3131 of file actctx.c.

3132{
3133 static const WCHAR lookup_fmtW[] =
3134 {'%','s','_','%','s','_','%','s','_','%','u','.','%','u','.','*','.','*','_',
3135 '%','s','_','*','.','m','a','n','i','f','e','s','t',0};
3136 static const WCHAR wine_trailerW[] = {'d','e','a','d','b','e','e','f','.','m','a','n','i','f','e','s','t'};
3137
3138 WCHAR *lookup, *ret = NULL;
3139 UNICODE_STRING lookup_us;
3141 const WCHAR *lang = ai->language;
3142 unsigned int data_pos = 0, data_len;
3143 char buffer[8192];
3144
3145 if (!(lookup = RtlAllocateHeap( RtlGetProcessHeap(), 0,
3146 (strlenW(ai->arch) + strlenW(ai->name)
3147 + strlenW(ai->public_key) + 20) * sizeof(WCHAR)
3148 + sizeof(lookup_fmtW) )))
3149 return NULL;
3150
3151 if (!lang || !strcmpiW( lang, neutralW )) lang = wildcardW;
3152 sprintfW( lookup, lookup_fmtW, ai->arch, ai->name, ai->public_key,
3153 ai->version.major, ai->version.minor, lang );
3154 RtlInitUnicodeString( &lookup_us, lookup );
3155
3156 if (!NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer),
3157 FileBothDirectoryInformation, FALSE, &lookup_us, TRUE ))
3158 {
3159 ULONG min_build = ai->version.build, min_revision = ai->version.revision;
3160 FILE_BOTH_DIR_INFORMATION *dir_info;
3161 WCHAR *tmp;
3162 ULONG build, revision;
3163
3164 data_len = (ULONG)io.Information;
3165
3166 for (;;)
3167 {
3168 if (data_pos >= data_len)
3169 {
3170 if (NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer),
3172 break;
3173 data_len = (ULONG)io.Information;
3174 data_pos = 0;
3175 }
3176 dir_info = (FILE_BOTH_DIR_INFORMATION*)(buffer + data_pos);
3177
3178 if (dir_info->NextEntryOffset) data_pos += dir_info->NextEntryOffset;
3179 else data_pos = data_len;
3180
3181 tmp = (WCHAR *)dir_info->FileName + (strchrW(lookup, '*') - lookup);
3182 build = atoiW(tmp);
3183 if (build < min_build) continue;
3184 tmp = strchrW(tmp, '.') + 1;
3185 revision = atoiW(tmp);
3186 if (build == min_build && revision < min_revision) continue;
3187 tmp = strchrW(tmp, '_') + 1;
3188 tmp = strchrW(tmp, '_') + 1;
3189 if (dir_info->FileNameLength - (tmp - dir_info->FileName) * sizeof(WCHAR) == sizeof(wine_trailerW) &&
3190 !memicmpW( tmp, wine_trailerW, sizeof(wine_trailerW) / sizeof(WCHAR) ))
3191 {
3192 /* prefer a non-Wine manifest if we already have one */
3193 /* we'll still load the builtin dll if specified through DllOverrides */
3194 if (ret) continue;
3195 }
3196 else
3197 {
3198 min_build = build;
3199 min_revision = revision;
3200 }
3201 ai->version.build = build;
3202 ai->version.revision = revision;
3203 RtlFreeHeap( RtlGetProcessHeap(), 0, ret );
3204 if ((ret = RtlAllocateHeap( RtlGetProcessHeap(), 0, dir_info->FileNameLength + sizeof(WCHAR) )))
3205 {
3206 memcpy( ret, dir_info->FileName, dir_info->FileNameLength );
3207 ret[dir_info->FileNameLength/sizeof(WCHAR)] = 0;
3208 }
3209 }
3210 }
3211 else DPRINT1("no matching file for %S\n", lookup);
3212 RtlFreeHeap( RtlGetProcessHeap(), 0, lookup );
3213 return ret;
3214}
static ULONG lookup[16]
Definition: vga.c:48
@ FileBothDirectoryInformation
Definition: from_kernel.h:64
NTSTATUS NTAPI NtQueryDirectoryFile(IN HANDLE FileHandle, IN HANDLE EventHandle OPTIONAL, IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, IN PVOID ApcContext OPTIONAL, OUT PIO_STATUS_BLOCK IoStatusBlock, OUT PVOID FileInformation, IN ULONG Length, IN FILE_INFORMATION_CLASS FileInformationClass, IN BOOLEAN ReturnSingleEntry, IN PUNICODE_STRING FileName OPTIONAL, IN BOOLEAN RestartScan)
Definition: iofunc.c:1994
#define for
Definition: utility.h:88
#define atoiW(s)
Definition: unicode.h:54
#define strchrW(s, c)
Definition: unicode.h:34
#define memicmpW(s1, s2, n)
Definition: unicode.h:27
static const WCHAR neutralW[]
Definition: actctx.c:642

Referenced by lookup_winsxs().

◆ lookup_winsxs()

static NTSTATUS lookup_winsxs ( struct actctx_loader acl,
struct assembly_identity ai 
)
static

Definition at line 3216 of file actctx.c.

3217{
3218 struct assembly_identity sxs_ai;
3219 UNICODE_STRING path_us;
3222 WCHAR *path, *file = NULL;
3223 HANDLE handle;
3224
3225 static const WCHAR manifest_dirW[] =
3226 {'\\','w','i','n','s','x','s','\\','m','a','n','i','f','e','s','t','s',0};
3227
3228 if (!ai->arch || !ai->name || !ai->public_key) return STATUS_NO_SUCH_FILE;
3229
3230 if (!(path = RtlAllocateHeap( RtlGetProcessHeap(), 0,
3231 ((strlenW(SharedUserData->NtSystemRoot) + 1) *sizeof(WCHAR)) + sizeof(manifest_dirW) )))
3232 return STATUS_NO_MEMORY;
3233
3234 memcpy( path, SharedUserData->NtSystemRoot, strlenW(SharedUserData->NtSystemRoot) * sizeof(WCHAR) );
3235 memcpy( path + strlenW(SharedUserData->NtSystemRoot), manifest_dirW, sizeof(manifest_dirW) );
3236
3237 if (!RtlDosPathNameToNtPathName_U( path, &path_us, NULL, NULL ))
3238 {
3239 RtlFreeHeap( RtlGetProcessHeap(), 0, path );
3240 return STATUS_NO_SUCH_FILE;
3241 }
3242 RtlFreeHeap( RtlGetProcessHeap(), 0, path );
3243
3244 attr.Length = sizeof(attr);
3245 attr.RootDirectory = 0;
3246 attr.Attributes = OBJ_CASE_INSENSITIVE;
3247 attr.ObjectName = &path_us;
3248 attr.SecurityDescriptor = NULL;
3249 attr.SecurityQualityOfService = NULL;
3250
3253 {
3254 sxs_ai = *ai;
3255 file = lookup_manifest_file( handle, &sxs_ai );
3256 NtClose( handle );
3257 }
3258 if (!file)
3259 {
3260 RtlFreeUnicodeString( &path_us );
3261 return STATUS_NO_SUCH_FILE;
3262 }
3263
3264 /* append file name to directory path */
3265 if (!(path = RtlReAllocateHeap( RtlGetProcessHeap(), 0, path_us.Buffer,
3266 path_us.Length + (strlenW(file) + 2) * sizeof(WCHAR) )))
3267 {
3268 RtlFreeHeap( RtlGetProcessHeap(), 0, file );
3269 RtlFreeUnicodeString( &path_us );
3270 return STATUS_NO_MEMORY;
3271 }
3272
3273 path[path_us.Length/sizeof(WCHAR)] = '\\';
3274 strcpyW( path + path_us.Length/sizeof(WCHAR) + 1, file );
3275 RtlInitUnicodeString( &path_us, path );
3276 *strrchrW(file, '.') = 0; /* remove .manifest extension */
3277
3278 if (!open_nt_file( &handle, &path_us ))
3279 {
3280 io.Status = get_manifest_in_manifest_file(acl, &sxs_ai, path_us.Buffer, file, TRUE, handle);
3281 NtClose( handle );
3282 }
3283 else io.Status = STATUS_NO_SUCH_FILE;
3284
3285 RtlFreeHeap( RtlGetProcessHeap(), 0, file );
3286 RtlFreeUnicodeString( &path_us );
3287 return io.Status;
3288}
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
#define GENERIC_READ
Definition: compat.h:135
#define FILE_SHARE_READ
Definition: compat.h:136
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
Definition: file.c:3952
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define SYNCHRONIZE
Definition: nt_native.h:61
#define strrchrW(s, c)
Definition: unicode.h:35
static WCHAR * lookup_manifest_file(HANDLE dir, struct assembly_identity *ai)
Definition: actctx.c:3131

Referenced by lookup_assembly().

◆ next_xml_attr()

static BOOL next_xml_attr ( xmlbuf_t xmlbuf,
struct xml_attr attr,
BOOL end 
)
static

Definition at line 1276 of file actctx.c.

1277{
1278 const WCHAR* ptr;
1279 WCHAR quote;
1280
1281 if (xmlbuf->error) return FALSE;
1282
1283 while (xmlbuf->ptr < xmlbuf->end && isxmlspace(*xmlbuf->ptr))
1284 xmlbuf->ptr++;
1285
1286 if (xmlbuf->ptr == xmlbuf->end) return set_error( xmlbuf );
1287
1288 if (*xmlbuf->ptr == '/')
1289 {
1290 xmlbuf->ptr++;
1291 if (xmlbuf->ptr == xmlbuf->end || *xmlbuf->ptr != '>')
1292 return set_error( xmlbuf );
1293
1294 xmlbuf->ptr++;
1295 *end = TRUE;
1296 return FALSE;
1297 }
1298
1299 if (*xmlbuf->ptr == '>')
1300 {
1301 xmlbuf->ptr++;
1302 return FALSE;
1303 }
1304
1305 ptr = xmlbuf->ptr;
1306 while (ptr < xmlbuf->end && *ptr != '=' && *ptr != '>' && !isxmlspace(*ptr)) ptr++;
1307
1308 if (ptr == xmlbuf->end) return set_error( xmlbuf );
1309
1310 attr->name.ptr = xmlbuf->ptr;
1311 attr->name.len = ptr-xmlbuf->ptr;
1312 xmlbuf->ptr = ptr;
1313
1314 /* skip spaces before '=' */
1315 while (ptr < xmlbuf->end && *ptr != '=' && isxmlspace(*ptr)) ptr++;
1316 if (ptr == xmlbuf->end || *ptr != '=') return set_error( xmlbuf );
1317
1318 /* skip '=' itself */
1319 ptr++;
1320 if (ptr == xmlbuf->end) return set_error( xmlbuf );
1321
1322 /* skip spaces after '=' */
1323 while (ptr < xmlbuf->end && *ptr != '"' && *ptr != '\'' && isxmlspace(*ptr)) ptr++;
1324
1325 if (ptr == xmlbuf->end || (*ptr != '"' && *ptr != '\'')) return set_error( xmlbuf );
1326
1327 quote = *ptr++;
1328 attr->value.ptr = ptr;
1329 if (ptr == xmlbuf->end) return set_error( xmlbuf );
1330
1331 while (ptr < xmlbuf->end && *ptr != quote) ptr++;
1332 if (ptr == xmlbuf->end)
1333 {
1334 xmlbuf->ptr = xmlbuf->end;
1335 return set_error( xmlbuf );
1336 }
1337
1338 attr->value.len = ptr - attr->value.ptr;
1339 xmlbuf->ptr = ptr + 1;
1340 if (xmlbuf->ptr != xmlbuf->end) return TRUE;
1341
1342 return set_error( xmlbuf );
1343}
static const WCHAR quote[]
Definition: reg.c:40
GLuint GLuint end
Definition: gl.h:1545
static BOOL isxmlspace(WCHAR ch)
Definition: actctx.c:834
static BOOL set_error(xmlbuf_t *xmlbuf)
Definition: actctx.c:1227
WCHAR * value
Definition: cookie.c:204
BOOL error
Definition: actctx.c:73
const WCHAR * end
Definition: actctx.c:70
const WCHAR * ptr
Definition: actctx.c:69

Referenced by next_xml_elem(), parse_assembly_elem(), parse_assembly_identity_elem(), parse_binding_redirect_elem(), parse_clr_class_elem(), parse_clr_surrogate_elem(), parse_com_class_elem(), parse_com_interface_external_proxy_stub_elem(), parse_cominterface_proxy_stub_elem(), parse_dependency_elem(), parse_dependent_assembly_elem(), parse_description_elem(), parse_expect_no_attr(), parse_file_elem(), parse_requested_execution_level_elem(), parse_settings_elem(), parse_supportedos_elem(), parse_typelib_elem(), parse_unknown_elem(), and parse_window_class_elem().

◆ next_xml_elem()

static BOOL next_xml_elem ( xmlbuf_t xmlbuf,
struct xml_elem elem,
const struct xml_elem parent 
)
static

Definition at line 1365 of file actctx.c.

1366{
1367 const WCHAR* ptr;
1368 struct xml_attr attr;
1369 xmlbuf_t attr_buf;
1370 BOOL end = FALSE;
1371
1372 xmlbuf->ns_pos = parent->ns_pos; /* restore namespace stack to parent state */
1373
1374 if (xmlbuf->error) return FALSE;
1375
1376 for (;;)
1377 {
1378 for (ptr = xmlbuf->ptr; ptr < xmlbuf->end; ptr++) if (*ptr == '<') break;
1379 if (ptr == xmlbuf->end)
1380 {
1381 xmlbuf->ptr = xmlbuf->end;
1382 return set_error( xmlbuf );
1383 }
1384 ptr++;
1385 if (ptr + 3 < xmlbuf->end && ptr[0] == '!' && ptr[1] == '-' && ptr[2] == '-') /* skip comment */
1386 {
1387 for (ptr += 3; ptr + 3 <= xmlbuf->end; ptr++)
1388 if (ptr[0] == '-' && ptr[1] == '-' && ptr[2] == '>') break;
1389
1390 if (ptr + 3 > xmlbuf->end)
1391 {
1392 xmlbuf->ptr = xmlbuf->end;
1393 return set_error( xmlbuf );
1394 }
1395 xmlbuf->ptr = ptr + 3;
1396 }
1397 else break;
1398 }
1399
1400 xmlbuf->ptr = ptr;
1401 /* check for element terminating the parent element */
1402 if (ptr < xmlbuf->end && *ptr == '/')
1403 {
1404 xmlbuf->ptr++;
1405 read_xml_elem( xmlbuf, elem );
1406 elem->ns = find_xmlns( xmlbuf, &elem->ns );
1407 if (!xml_name_cmp( elem, parent ))
1408 {
1409 /*ERR( "wrong closing element %s for %s\n",
1410 debugstr_xmlstr(&elem->name), debugstr_xmlstr(&parent->name ));*/
1411 return set_error( xmlbuf );
1412 }
1413 while (xmlbuf->ptr < xmlbuf->end && isxmlspace(*xmlbuf->ptr)) xmlbuf->ptr++;
1414 if (xmlbuf->ptr == xmlbuf->end || *xmlbuf->ptr++ != '>') return set_error( xmlbuf );
1415 return FALSE;
1416 }
1417
1418 read_xml_elem( xmlbuf, elem );
1419
1420 /* parse namespace attributes */
1421 attr_buf = *xmlbuf;
1422 while (next_xml_attr( &attr_buf, &attr, &end ))
1423 {
1424 if (is_xmlns_attr( &attr )) push_xmlns( xmlbuf, &attr );
1425 }
1426 elem->ns = find_xmlns( xmlbuf, &elem->ns );
1427 elem->ns_pos = xmlbuf->ns_pos;
1428
1429 if (xmlbuf->ptr != xmlbuf->end) return TRUE;
1430
1431 return set_error( xmlbuf );
1432}
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
static size_t elem
Definition: string.c:68
static void read_xml_elem(xmlbuf_t *xmlbuf, struct xml_elem *elem)
Definition: actctx.c:1345
static BOOL next_xml_attr(xmlbuf_t *xmlbuf, struct xml_attr *attr, BOOL *end)
Definition: actctx.c:1276
static void push_xmlns(xmlbuf_t *xmlbuf, const struct xml_attr *attr)
Definition: actctx.c:1241
static BOOL xml_name_cmp(const struct xml_elem *elem1, const struct xml_elem *elem2)
Definition: actctx.c:810
static BOOL is_xmlns_attr(const struct xml_attr *attr)
Definition: actctx.c:1233
static xmlstr_t find_xmlns(xmlbuf_t *xmlbuf, const xmlstr_t *name)
Definition: actctx.c:1262

Referenced by parse_application_elem(), parse_assembly_elem(), parse_clr_class_elem(), parse_com_class_elem(), parse_compatibility_application_elem(), parse_compatibility_elem(), parse_dependency_elem(), parse_dependent_assembly_elem(), parse_description_elem(), parse_expect_end_elem(), parse_file_elem(), parse_manifest_buffer(), parse_requested_execution_level_elem(), parse_requested_privileges_elem(), parse_security_elem(), parse_settings_elem(), parse_trust_info_elem(), parse_unknown_elem(), parse_window_class_elem(), and parse_windows_settings_elem().

◆ open_nt_file()

static NTSTATUS open_nt_file ( HANDLE handle,
UNICODE_STRING name 
)
static

Definition at line 2821 of file actctx.c.

2822{
2825
2826 attr.Length = sizeof(attr);
2827 attr.RootDirectory = 0;
2828 attr.Attributes = OBJ_CASE_INSENSITIVE;
2829 attr.ObjectName = name;
2830 attr.SecurityDescriptor = NULL;
2831 attr.SecurityQualityOfService = NULL;
2833}
#define FILE_SYNCHRONOUS_IO_ALERT
Definition: from_kernel.h:30

Referenced by get_manifest_in_associated_manifest(), lookup_assembly(), lookup_winsxs(), and RtlCreateActivationContext().

◆ parse_add_interface_class()

static void parse_add_interface_class ( xmlbuf_t xmlbuf,
struct entity_array entities,
struct actctx_loader acl,
WCHAR clsid 
)
static

Definition at line 1773 of file actctx.c.

1775{
1776 struct entity *entity;
1777 WCHAR *str;
1778
1779 if (!clsid) return;
1780
1781 if (!(str = strdupW(clsid)))
1782 {
1783 set_error( xmlbuf );
1784 return;
1785 }
1786
1787 if (!(entity = add_entity(entities, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)))
1788 {
1789 RtlFreeHeap(RtlGetProcessHeap(), 0, str);
1790 set_error( xmlbuf );
1791 return;
1792 }
1793
1794 entity->u.comclass.clsid = str;
1796
1798}
static struct entity * add_entity(struct entity_array *array, DWORD kind)
Definition: actctx.c:924
static WCHAR * strdupW(const WCHAR *str)
Definition: actctx.c:768

Referenced by parse_cominterface_proxy_stub_elem().

◆ parse_application_elem()

static void parse_application_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2480 of file actctx.c.

2482{
2483 struct xml_elem elem;
2484
2485 while (next_xml_elem( xmlbuf, &elem, parent ))
2486 {
2488 {
2489 parse_windows_settings_elem( xmlbuf, assembly, acl, &elem );
2490 }
2491 else
2492 {
2493 parse_unknown_elem( xmlbuf, &elem );
2494 }
2495 }
2496}
static const WCHAR asmv3W[]
Definition: actctx.c:561
static const WCHAR windowsSettingsW[]
Definition: actctx.c:706
static BOOL next_xml_elem(xmlbuf_t *xmlbuf, struct xml_elem *elem, const struct xml_elem *parent)
Definition: actctx.c:1365
static void parse_windows_settings_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2452
static void parse_unknown_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:1516
static BOOL xml_elem_cmp(const struct xml_elem *elem, const WCHAR *str, const WCHAR *namespace)
Definition: actctx.c:818

Referenced by parse_assembly_elem().

◆ parse_assembly_elem()

static void parse_assembly_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent,
struct assembly_identity expected_ai 
)
static

Definition at line 2598 of file actctx.c.

2601{
2602 struct xml_elem elem;
2603 struct xml_attr attr;
2604 BOOL end = FALSE, version = FALSE;
2605
2606 while (next_xml_attr(xmlbuf, &attr, &end))
2607 {
2609 {
2610 static const WCHAR v10W[] = {'1','.','0',0};
2611 if (!xmlstr_cmp(&attr.value, v10W))
2612 {
2613 break;
2614 }
2615 version = TRUE;
2616 }
2617 }
2618
2619 if (end || !version)
2620 {
2621 set_error( xmlbuf );
2622 return;
2623 }
2624
2625 while (next_xml_elem(xmlbuf, &elem, parent))
2626 {
2628 {
2629 parse_noinherit_elem(xmlbuf, &elem);
2631 }
2633 {
2635 }
2636 else if (xml_elem_cmp(&elem, descriptionW, asmv1W))
2637 {
2638 parse_description_elem(xmlbuf, &elem);
2639 }
2641 {
2643 }
2644 else if (xml_elem_cmp(&elem, dependencyW, asmv1W))
2645 {
2646 parse_dependency_elem(xmlbuf, acl, &elem);
2647 }
2648 else if (xml_elem_cmp(&elem, fileW, asmv1W))
2649 {
2650 parse_file_elem(xmlbuf, assembly, acl, &elem);
2651 }
2652 else if (xml_elem_cmp(&elem, clrClassW, asmv1W))
2653 {
2654 parse_clr_class_elem(xmlbuf, assembly, acl, &elem);
2655 }
2657 {
2658 parse_clr_surrogate_elem(xmlbuf, assembly, acl, &elem);
2659 }
2660 else if (xml_elem_cmp(&elem, trustInfoW, asmv1W))
2661 {
2662 parse_trust_info_elem(xmlbuf, assembly, acl, &elem);
2663 }
2665 {
2667
2668 if (!xmlbuf->error && expected_ai)
2669 {
2670 /* FIXME: more tests */
2672 memcmp(&assembly->id.version, &expected_ai->version, sizeof(assembly->id.version)))
2673 {
2674 set_error( xmlbuf );
2675 }
2676 else if (assembly->type == ASSEMBLY_SHARED_MANIFEST &&
2677 (assembly->id.version.major != expected_ai->version.major ||
2678 assembly->id.version.minor != expected_ai->version.minor ||
2679 assembly->id.version.build < expected_ai->version.build ||
2680 (assembly->id.version.build == expected_ai->version.build &&
2681 assembly->id.version.revision < expected_ai->version.revision)))
2682 {
2683 set_error( xmlbuf );
2684 }
2685 }
2686 }
2688 {
2689 parse_compatibility_elem(xmlbuf, assembly, acl, &elem);
2690 }
2691 else if (xml_elem_cmp(&elem, applicationW, asmv3W))
2692 {
2693 parse_application_elem(xmlbuf, assembly, acl, &elem);
2694 }
2695 else
2696 {
2697 parse_unknown_elem(xmlbuf, &elem);
2698 }
2699 }
2700
2703 {
2704 set_error( xmlbuf );
2705 }
2706}
static void parse_noinheritable_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2275
static const WCHAR fileW[]
Definition: actctx.c:628
static const WCHAR trustInfoW[]
Definition: actctx.c:705
static const WCHAR noInheritW[]
Definition: actctx.c:630
static const WCHAR clrSurrogateW[]
Definition: actctx.c:621
static void parse_noinherit_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2267
static const WCHAR applicationW[]
Definition: actctx.c:699
static const WCHAR comInterfaceExternalProxyStubW[]
Definition: actctx.c:623
static const WCHAR assemblyIdentityW[]
Definition: actctx.c:618
static const WCHAR compatibilityW[]
Definition: actctx.c:697
static const WCHAR asmv1W[]
Definition: actctx.c:559
static void parse_file_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2283
static void parse_description_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2032
static void parse_application_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2480
static const WCHAR manifestVersionW[]
Definition: actctx.c:640
static void parse_com_interface_external_proxy_stub_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2050
static const WCHAR dependencyW[]
Definition: actctx.c:625
static BOOL xml_attr_cmp(const struct xml_attr *attr, const WCHAR *str)
Definition: actctx.c:805
static const WCHAR noInheritableW[]
Definition: actctx.c:631
static BOOL xmlstr_cmp(const xmlstr_t *xmlstr, const WCHAR *str)
Definition: actctx.c:789
static const WCHAR clrClassW[]
Definition: actctx.c:620
static void parse_assembly_identity_elem(xmlbuf_t *xmlbuf, ACTIVATION_CONTEXT *actctx, struct assembly_identity *ai, const struct xml_elem *parent)
Definition: actctx.c:1529
static void parse_clr_class_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2099
static void parse_compatibility_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2401
static void parse_clr_surrogate_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2163
static void parse_trust_info_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2580
static void parse_dependency_elem(xmlbuf_t *xmlbuf, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2238
static const WCHAR compatibilityNSW[]
Definition: actctx.c:698
static const WCHAR descriptionW[]
Definition: actctx.c:627
BOOL no_inherit
Definition: actctx.c:471

Referenced by parse_manifest_buffer().

◆ parse_assembly_identity_elem()

static void parse_assembly_identity_elem ( xmlbuf_t xmlbuf,
ACTIVATION_CONTEXT actctx,
struct assembly_identity ai,
const struct xml_elem parent 
)
static

Definition at line 1529 of file actctx.c.

1531{
1532 struct xml_attr attr;
1533 BOOL end = FALSE;
1534
1535 while (next_xml_attr(xmlbuf, &attr, &end))
1536 {
1537 if (xml_attr_cmp(&attr, g_nameW))
1538 {
1539 if (!(ai->name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1540 }
1541 else if (xml_attr_cmp(&attr, typeW))
1542 {
1543 if (!(ai->type = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1544 }
1545 else if (xml_attr_cmp(&attr, versionW))
1546 {
1547 if (!parse_version(&attr.value, &ai->version)) set_error( xmlbuf );
1548 }
1550 {
1551 if (!(ai->arch = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1552 }
1553 else if (xml_attr_cmp(&attr, publicKeyTokenW))
1554 {
1555 if (!(ai->public_key = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1556 }
1557 else if (xml_attr_cmp(&attr, languageW))
1558 {
1559 if (!(ai->language = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1560 }
1561 }
1562
1563 if (!end) parse_expect_end_elem(xmlbuf, parent);
1564}
static const WCHAR versionW[]
Definition: name.c:52
static const WCHAR processorArchitectureW[]
Definition: actctx.c:646
static const WCHAR languageW[]
Definition: actctx.c:639
static void parse_expect_end_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:1505
static const WCHAR typeW[]
Definition: actctx.c:651
static const WCHAR publicKeyTokenW[]
Definition: actctx.c:648
static BOOL parse_version(const xmlstr_t *str, struct assembly_version *version)
Definition: actctx.c:1463
static const WCHAR g_nameW[]
Definition: actctx.c:641

Referenced by parse_assembly_elem(), and parse_dependent_assembly_elem().

◆ parse_binding_redirect_elem()

static void parse_binding_redirect_elem ( xmlbuf_t xmlbuf,
const struct xml_elem parent 
)
static

Definition at line 2012 of file actctx.c.

2013{
2014 struct xml_attr attr;
2015 BOOL end = FALSE;
2016
2017 while (next_xml_attr(xmlbuf, &attr, &end))
2018 {
2020 {
2021 // FIXME("Not stored yet %s\n", debugstr_xml_attr(&attr));
2022 }
2023 else if (xml_attr_cmp(&attr, newVersionW))
2024 {
2025 // FIXME("Not stored yet %s\n", debugstr_xml_attr(&attr));
2026 }
2027 }
2028
2029 if (!end) parse_expect_end_elem(xmlbuf, parent);
2030}
static const WCHAR newVersionW[]
Definition: actctx.c:643
static const WCHAR oldVersionW[]
Definition: actctx.c:644

Referenced by parse_dependent_assembly_elem().

◆ parse_clr_class_elem()

static void parse_clr_class_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2099 of file actctx.c.

2102{
2103 struct xml_elem elem;
2104 struct xml_attr attr;
2105 BOOL end = FALSE;
2106 struct entity* entity;
2107
2108 if (!(entity = add_entity(&assembly->entities, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)))
2109 {
2110 set_error( xmlbuf );
2111 return;
2112 }
2113
2114 while (next_xml_attr(xmlbuf, &attr, &end))
2115 {
2116 if (xml_attr_cmp(&attr, g_nameW))
2117 {
2118 if (!(entity->u.comclass.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2119 }
2120 else if (xml_attr_cmp(&attr, clsidW))
2121 {
2122 if (!(entity->u.comclass.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2123 }
2124 else if (xml_attr_cmp(&attr, progidW))
2125 {
2126 if (!(entity->u.comclass.progid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2127 }
2128 else if (xml_attr_cmp(&attr, tlbidW))
2129 {
2130 if (!(entity->u.comclass.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2131 }
2132 else if (xml_attr_cmp(&attr, threadingmodelW))
2133 {
2135 }
2136 else if (xml_attr_cmp(&attr, runtimeVersionW))
2137 {
2138 if (!(entity->u.comclass.version = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2139 }
2140 }
2141
2143 if (entity->u.comclass.progid)
2145 if (end) return;
2146
2147 while (next_xml_elem(xmlbuf, &elem, parent))
2148 {
2150 {
2152 }
2153 else
2154 {
2155 parse_unknown_elem(xmlbuf, &elem);
2156 }
2157 }
2158
2159 if (entity->u.comclass.progids.num)
2161}
static const WCHAR progidW[]
Definition: compobj.c:112
static const WCHAR runtimeVersionW[]
Definition: actctx.c:670
static const WCHAR threadingmodelW[]
Definition: actctx.c:649
static void parse_com_class_progid(xmlbuf_t *xmlbuf, struct entity *entity, const struct xml_elem *parent)
Definition: actctx.c:1660
static const WCHAR tlbidW[]
Definition: actctx.c:650
static enum comclass_threadingmodel parse_com_class_threadingmodel(xmlstr_t *value)
Definition: actctx.c:1566
static const WCHAR clsidW[]
Definition: actctx.c:635

Referenced by parse_assembly_elem().

◆ parse_clr_surrogate_elem()

static void parse_clr_surrogate_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2163 of file actctx.c.

2165{
2166 struct xml_attr attr;
2167 BOOL end = FALSE;
2168 struct entity* entity;
2169
2170 if (!(entity = add_entity(&assembly->entities, ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)))
2171 {
2172 set_error( xmlbuf );
2173 return;
2174 }
2175
2176 while (next_xml_attr(xmlbuf, &attr, &end))
2177 {
2178 if (xml_attr_cmp(&attr, g_nameW))
2179 {
2180 if (!(entity->u.clrsurrogate.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2181 }
2182 else if (xml_attr_cmp(&attr, clsidW))
2183 {
2184 if (!(entity->u.clrsurrogate.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2185 }
2186 else if (xml_attr_cmp(&attr, runtimeVersionW))
2187 {
2188 if (!(entity->u.clrsurrogate.version = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2189 }
2190 }
2191
2193 if (!end) parse_expect_end_elem(xmlbuf, parent);
2194}

Referenced by parse_assembly_elem().

◆ parse_com_class_elem()

static void parse_com_class_elem ( xmlbuf_t xmlbuf,
struct dll_redirect dll,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 1673 of file actctx.c.

1675{
1676 struct xml_elem elem;
1677 struct xml_attr attr;
1678 BOOL end = FALSE;
1679 struct entity* entity;
1680
1681 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)))
1682 {
1683 set_error( xmlbuf );
1684 return;
1685 }
1686
1687 while (next_xml_attr(xmlbuf, &attr, &end))
1688 {
1689 if (xml_attr_cmp(&attr, clsidW))
1690 {
1691 if (!(entity->u.comclass.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1692 }
1693 else if (xml_attr_cmp(&attr, progidW))
1694 {
1695 if (!(entity->u.comclass.progid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1696 }
1697 else if (xml_attr_cmp(&attr, tlbidW))
1698 {
1699 if (!(entity->u.comclass.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1700 }
1701 else if (xml_attr_cmp(&attr, threadingmodelW))
1702 {
1704 }
1705 else if (xml_attr_cmp(&attr, miscstatusW))
1706 {
1708 }
1710 {
1711 entity->u.comclass.miscstatuscontent = parse_com_class_misc(&attr.value);
1712 }
1714 {
1715 entity->u.comclass.miscstatusthumbnail = parse_com_class_misc(&attr.value);
1716 }
1717 else if (xml_attr_cmp(&attr, miscstatusiconW))
1718 {
1719 entity->u.comclass.miscstatusicon = parse_com_class_misc(&attr.value);
1720 }
1722 {
1723 entity->u.comclass.miscstatusdocprint = parse_com_class_misc(&attr.value);
1724 }
1725 else if (xml_attr_cmp(&attr, descriptionW))
1726 {
1727 /* not stored */
1728 }
1729 }
1730
1732 if (entity->u.comclass.progid)
1734
1735 if (end) return;
1736
1737 while (next_xml_elem(xmlbuf, &elem, parent))
1738 {
1740 {
1742 }
1743 else
1744 {
1745 parse_unknown_elem(xmlbuf, &elem);
1746 }
1747 }
1748
1749 if (entity->u.comclass.progids.num)
1751}
static const WCHAR miscstatusdocprintW[]
Definition: actctx.c:666
static DWORD parse_com_class_misc(const xmlstr_t *value)
Definition: actctx.c:1613
static const WCHAR miscstatusW[]
Definition: actctx.c:662
static const WCHAR miscstatuscontentW[]
Definition: actctx.c:664
static const WCHAR miscstatusiconW[]
Definition: actctx.c:663
static const WCHAR miscstatusthumbnailW[]
Definition: actctx.c:665

Referenced by parse_file_elem().

◆ parse_com_class_misc()

static DWORD parse_com_class_misc ( const xmlstr_t value)
static

Definition at line 1613 of file actctx.c.

1614{
1615 const WCHAR *str = value->ptr, *start;
1616 DWORD flags = 0;
1617 int i = 0;
1618
1619 /* it's comma separated list of flags */
1620 while (i < value->len)
1621 {
1622 start = str;
1623 while (*str != ',' && (i++ < value->len)) str++;
1624
1626
1627 /* skip separator */
1628 str++;
1629 i++;
1630 }
1631
1632 return flags;
1633}
GLuint start
Definition: gl.h:1545
static OLEMISC get_olemisc_value(const WCHAR *str, int len)
Definition: actctx.c:1586

Referenced by parse_com_class_elem().

◆ parse_com_class_progid()

static void parse_com_class_progid ( xmlbuf_t xmlbuf,
struct entity entity,
const struct xml_elem parent 
)
static

Definition at line 1660 of file actctx.c.

1661{
1663 BOOL end = FALSE;
1664
1665 parse_expect_no_attr(xmlbuf, &end);
1666 if (end) set_error( xmlbuf );
1667 if (!parse_text_content(xmlbuf, &content)) return;
1668
1669 if (!com_class_add_progid(&content, entity)) set_error( xmlbuf );
1671}
content
Definition: atl_ax.c:994
static BOOL parse_text_content(xmlbuf_t *xmlbuf, xmlstr_t *content)
Definition: actctx.c:1450
static void parse_expect_no_attr(xmlbuf_t *xmlbuf, BOOL *end)
Definition: actctx.c:1494
static BOOL com_class_add_progid(const xmlstr_t *progid, struct entity *entity)
Definition: actctx.c:1635

Referenced by parse_clr_class_elem(), and parse_com_class_elem().

◆ parse_com_class_threadingmodel()

static enum comclass_threadingmodel parse_com_class_threadingmodel ( xmlstr_t value)
static

Definition at line 1566 of file actctx.c.

1567{
1568 static const WCHAR apartW[] = {'A','p','a','r','t','m','e','n','t',0};
1569 static const WCHAR neutralW[] = {'N','e','u','t','r','a','l',0};
1570 static const WCHAR freeW[] = {'F','r','e','e',0};
1571 static const WCHAR bothW[] = {'B','o','t','h',0};
1572
1573 if (value->len == 0) return ThreadingModel_No;
1574 if (xmlstr_cmp(value, apartW))
1576 else if (xmlstr_cmp(value, freeW))
1577 return ThreadingModel_Free;
1578 else if (xmlstr_cmp(value, bothW))
1579 return ThreadingModel_Both;
1580 else if (xmlstr_cmp(value, neutralW))
1582 else
1583 return ThreadingModel_No;
1584};

Referenced by parse_clr_class_elem(), and parse_com_class_elem().

◆ parse_com_interface_external_proxy_stub_elem()

static void parse_com_interface_external_proxy_stub_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2050 of file actctx.c.

2054{
2055 struct xml_attr attr;
2056 BOOL end = FALSE;
2057 struct entity* entity;
2058
2059 if (!(entity = add_entity(&assembly->entities, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)))
2060 {
2061 set_error( xmlbuf );
2062 return;
2063 }
2064
2065 while (next_xml_attr(xmlbuf, &attr, &end))
2066 {
2067 if (xml_attr_cmp(&attr, iidW))
2068 {
2069 if (!(entity->u.ifaceps.iid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2070 }
2071 else if (xml_attr_cmp(&attr, g_nameW))
2072 {
2073 if (!(entity->u.ifaceps.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2074 }
2075 else if (xml_attr_cmp(&attr, baseInterfaceW))
2076 {
2077 if (!(entity->u.ifaceps.base = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2078 entity->u.ifaceps.mask |= BaseIface;
2079 }
2080 else if (xml_attr_cmp(&attr, nummethodsW))
2081 {
2082 if (!(parse_nummethods(&attr.value, entity))) set_error( xmlbuf );
2083 entity->u.ifaceps.mask |= NumMethods;
2084 }
2086 {
2087 if (!(entity->u.ifaceps.ps32 = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2088 }
2089 else if (xml_attr_cmp(&attr, tlbidW))
2090 {
2091 if (!(entity->u.ifaceps.tlib = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2092 }
2093 }
2094
2096 if (!end) parse_expect_end_elem(xmlbuf, parent);
2097}
static const WCHAR proxyStubClsid32W[]
Definition: actctx.c:669
static const WCHAR iidW[]
Definition: actctx.c:638
static const WCHAR baseInterfaceW[]
Definition: actctx.c:667
static BOOL parse_nummethods(const xmlstr_t *str, struct entity *entity)
Definition: actctx.c:1753
static const WCHAR nummethodsW[]
Definition: actctx.c:668

Referenced by parse_assembly_elem().

◆ parse_cominterface_proxy_stub_elem()

static void parse_cominterface_proxy_stub_elem ( xmlbuf_t xmlbuf,
struct dll_redirect dll,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 1800 of file actctx.c.

1802{
1803 WCHAR *psclsid = NULL;
1804 struct entity *entity;
1805 struct xml_attr attr;
1806 BOOL end = FALSE;
1807
1808 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)))
1809 {
1810 set_error( xmlbuf );
1811 return;
1812 }
1813
1814 while (next_xml_attr(xmlbuf, &attr, &end))
1815 {
1816 if (xml_attr_cmp(&attr, iidW))
1817 {
1818 if (!(entity->u.ifaceps.iid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1819 }
1820 else if (xml_attr_cmp(&attr, g_nameW))
1821 {
1822 if (!(entity->u.ifaceps.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1823 }
1824 else if (xml_attr_cmp(&attr, baseInterfaceW))
1825 {
1826 if (!(entity->u.ifaceps.base = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1827 entity->u.ifaceps.mask |= BaseIface;
1828 }
1829 else if (xml_attr_cmp(&attr, nummethodsW))
1830 {
1831 if (!(parse_nummethods(&attr.value, entity))) set_error( xmlbuf );
1832 entity->u.ifaceps.mask |= NumMethods;
1833 }
1834 else if (xml_attr_cmp(&attr, tlbidW))
1835 {
1836 if (!(entity->u.ifaceps.tlib = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1837 }
1839 {
1840 if (!(psclsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1841 }
1842 /* not used */
1843 else if (xml_attr_cmp(&attr, threadingmodelW))
1844 {
1845 }
1846 }
1847
1849 if (!end) parse_expect_end_elem(xmlbuf, parent);
1850
1851 parse_add_interface_class(xmlbuf, &dll->entities, acl, psclsid ? psclsid : entity->u.ifaceps.iid);
1852
1853 RtlFreeHeap(RtlGetProcessHeap(), 0, psclsid);
1854}
static void parse_add_interface_class(xmlbuf_t *xmlbuf, struct entity_array *entities, struct actctx_loader *acl, WCHAR *clsid)
Definition: actctx.c:1773

Referenced by parse_file_elem().

◆ parse_compatibility_application_elem()

static void parse_compatibility_application_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2383 of file actctx.c.

2385{
2386 struct xml_elem elem;
2387
2388 while (next_xml_elem(xmlbuf, &elem, parent))
2389 {
2391 {
2392 parse_supportedos_elem(xmlbuf, assembly, acl, &elem);
2393 }
2394 else
2395 {
2396 parse_unknown_elem(xmlbuf, &elem);
2397 }
2398 }
2399}
static const WCHAR supportedOSW[]
Definition: actctx.c:700
static void parse_supportedos_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2351

Referenced by parse_compatibility_elem().

◆ parse_compatibility_elem()

static void parse_compatibility_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2401 of file actctx.c.

2403{
2404 struct xml_elem elem;
2405
2406 while (next_xml_elem(xmlbuf, &elem, parent))
2407 {
2409 {
2411 }
2412 else
2413 {
2414 parse_unknown_elem(xmlbuf, &elem);
2415 }
2416 }
2417}
static void parse_compatibility_application_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2383

Referenced by parse_assembly_elem().

◆ parse_depend_manifests()

static NTSTATUS parse_depend_manifests ( struct actctx_loader acl)
static

Definition at line 3378 of file actctx.c.

3379{
3381 unsigned int i;
3382
3383 for (i = 0; i < acl->num_dependencies; i++)
3384 {
3385 if (lookup_assembly(acl, &acl->dependencies[i]) != STATUS_SUCCESS)
3386 {
3387 if (!acl->dependencies[i].optional && !acl->dependencies[i].delayed)
3388 {
3389 const struct assembly_version *ver = &acl->dependencies[i].version;
3390 DPRINT1( "Could not find dependent assembly %S (%u.%u.%u.%u)\n",
3391 acl->dependencies[i].name,
3392 ver->major, ver->minor, ver->build, ver->revision );
3394 break;
3395 }
3396 }
3397 }
3398 /* FIXME should now iterate through all refs */
3399 return status;
3400}
#define STATUS_SXS_CANT_GEN_ACTCTX
Definition: ntstatus.h:1383
static NTSTATUS lookup_assembly(struct actctx_loader *acl, struct assembly_identity *ai)
Definition: actctx.c:3290

Referenced by RtlCreateActivationContext().

◆ parse_dependency_elem()

static void parse_dependency_elem ( xmlbuf_t xmlbuf,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2238 of file actctx.c.

2241{
2242 struct xml_elem elem;
2243 struct xml_attr attr;
2245
2246 while (next_xml_attr(xmlbuf, &attr, &end))
2247 {
2249 {
2251 }
2252 }
2253
2254 while (next_xml_elem(xmlbuf, &elem, parent))
2255 {
2257 {
2259 }
2260 else
2261 {
2262 parse_unknown_elem(xmlbuf, &elem);
2263 }
2264 }
2265}
@ optional
Definition: SystemMenu.c:34
static const WCHAR yesW[]
Definition: actctx.c:655
static const WCHAR optionalW[]
Definition: actctx.c:645
static BOOL xmlstr_cmpi(const xmlstr_t *xmlstr, const WCHAR *str)
Definition: actctx.c:794
static void parse_dependent_assembly_elem(xmlbuf_t *xmlbuf, struct actctx_loader *acl, const struct xml_elem *parent, BOOL optional)
Definition: actctx.c:2196
static const WCHAR dependentAssemblyW[]
Definition: actctx.c:626

Referenced by parse_assembly_elem().

◆ parse_dependent_assembly_elem()

static void parse_dependent_assembly_elem ( xmlbuf_t xmlbuf,
struct actctx_loader acl,
const struct xml_elem parent,
BOOL  optional 
)
static

Definition at line 2196 of file actctx.c.

2198{
2199 struct xml_elem elem;
2200 struct xml_attr attr;
2201 struct assembly_identity ai;
2202 BOOL end = FALSE;
2203
2204 memset(&ai, 0, sizeof(ai));
2205 ai.optional = optional;
2206
2207 while (next_xml_attr(xmlbuf, &attr, &end))
2208 {
2209 static const WCHAR allowDelayedBindingW[] = {'a','l','l','o','w','D','e','l','a','y','e','d','B','i','n','d','i','n','g',0};
2210 static const WCHAR trueW[] = {'t','r','u','e',0};
2211
2212 if (xml_attr_cmp(&attr, allowDelayedBindingW))
2213 ai.delayed = xmlstr_cmp(&attr.value, trueW);
2214 }
2215
2216 if (end) return;
2217
2218 while (next_xml_elem(xmlbuf, &elem, parent))
2219 {
2221 {
2222 parse_assembly_identity_elem(xmlbuf, acl->actctx, &ai, &elem);
2223 /* store the newly found identity for later loading */
2224 if (ai.arch && !wcscmp(ai.arch, wildcardW)) ai.arch = strdupW( current_archW );
2225 if (!add_dependent_assembly_id(acl, &ai)) set_error( xmlbuf );
2226 }
2228 {
2230 }
2231 else
2232 {
2233 parse_unknown_elem(xmlbuf, &elem);
2234 }
2235 }
2236}
static const WCHAR trueW[]
Definition: json.c:33
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
static void parse_binding_redirect_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2012
static const WCHAR current_archW[]
Definition: actctx.c:556
static const WCHAR bindingRedirectW[]
Definition: actctx.c:619
static BOOL add_dependent_assembly_id(struct actctx_loader *acl, struct assembly_identity *ai)
Definition: actctx.c:1022

Referenced by parse_dependency_elem().

◆ parse_description_elem()

static void parse_description_elem ( xmlbuf_t xmlbuf,
const struct xml_elem parent 
)
static

Definition at line 2032 of file actctx.c.

2033{
2034 struct xml_elem elem;
2035 struct xml_attr attr;
2037 BOOL end = FALSE;
2038
2039 while (next_xml_attr(xmlbuf, &attr, &end));
2040
2041 if (end) return;
2042 if (!parse_text_content(xmlbuf, &content)) return;
2043
2044 while (next_xml_elem(xmlbuf, &elem, parent))
2045 {
2046 parse_unknown_elem(xmlbuf, &elem);
2047 }
2048}

Referenced by parse_assembly_elem().

◆ parse_expect_end_elem()

static void parse_expect_end_elem ( xmlbuf_t xmlbuf,
const struct xml_elem parent 
)
static

Definition at line 1505 of file actctx.c.

1506{
1507 struct xml_elem elem;
1508
1509 if (next_xml_elem(xmlbuf, &elem, parent))
1510 {
1511 // FIXME( "unexpected element %s\n", debugstr_xml_elem(&elem) );
1512 set_error( xmlbuf );
1513 }
1514}

Referenced by parse_assembly_identity_elem(), parse_binding_redirect_elem(), parse_clr_surrogate_elem(), parse_com_class_progid(), parse_com_interface_external_proxy_stub_elem(), parse_cominterface_proxy_stub_elem(), parse_noinherit_elem(), parse_noinheritable_elem(), parse_supportedos_elem(), and parse_typelib_elem().

◆ parse_expect_no_attr()

static void parse_expect_no_attr ( xmlbuf_t xmlbuf,
BOOL end 
)
static

Definition at line 1494 of file actctx.c.

1495{
1496 struct xml_attr attr;
1497
1498 while (next_xml_attr(xmlbuf, &attr, end))
1499 {
1500 // TODO: report error
1501 // if (!is_xmlns_attr( &attr )) WARN("unexpected attr %s\n", debugstr_xml_attr(&attr));
1502 }
1503}

Referenced by parse_com_class_progid(), parse_noinherit_elem(), and parse_noinheritable_elem().

◆ parse_file_elem()

static void parse_file_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2283 of file actctx.c.

2285{
2286 struct xml_elem elem;
2287 struct xml_attr attr;
2288 BOOL end = FALSE;
2289 struct dll_redirect* dll;
2290
2291 if (!(dll = add_dll_redirect(assembly)))
2292 {
2293 set_error( xmlbuf );
2294 return;
2295 }
2296
2297 while (next_xml_attr(xmlbuf, &attr, &end))
2298 {
2299 if (xml_attr_cmp(&attr, g_nameW))
2300 {
2301 if (!(dll->name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2302 }
2303 else if (xml_attr_cmp(&attr, hashW))
2304 {
2305 if (!(dll->hash = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2306 }
2307 else if (xml_attr_cmp(&attr, hashalgW))
2308 {
2309 static const WCHAR sha1W[] = {'S','H','A','1',0};
2310 if (!xmlstr_cmpi(&attr.value, sha1W)) {
2311 //FIXME("hashalg should be SHA1, got %s\n", debugstr_xmlstr(&attr.value));
2312 }
2313 }
2314 }
2315
2316 if (!dll->name) set_error( xmlbuf );
2317
2319
2320 if (end) return;
2321
2322 while (next_xml_elem(xmlbuf, &elem, parent))
2323 {
2325 {
2326 parse_com_class_elem(xmlbuf, dll, acl, &elem);
2327 }
2329 {
2331 }
2332 else if (xml_elem_cmp(&elem, hashW, asmv2W))
2333 {
2334 parse_unknown_elem(xmlbuf, &elem);
2335 }
2336 else if (xml_elem_cmp(&elem, typelibW, asmv1W))
2337 {
2338 parse_typelib_elem(xmlbuf, dll, acl, &elem);
2339 }
2340 else if (xml_elem_cmp(&elem, windowClassW, asmv1W))
2341 {
2342 parse_window_class_elem(xmlbuf, dll, acl, &elem);
2343 }
2344 else
2345 {
2346 parse_unknown_elem( xmlbuf, &elem );
2347 }
2348 }
2349}
static const WCHAR asmv2W[]
Definition: actctx.c:560
static const WCHAR comInterfaceProxyStubW[]
Definition: actctx.c:624
static void parse_com_class_elem(xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:1673
static void parse_typelib_elem(xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:1921
static const WCHAR typelibW[]
Definition: actctx.c:632
static const WCHAR hashW[]
Definition: actctx.c:629
static const WCHAR comClassW[]
Definition: actctx.c:622
static void parse_cominterface_proxy_stub_elem(xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:1800
static const WCHAR windowClassW[]
Definition: actctx.c:633
static void parse_window_class_elem(xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:1973
static struct dll_redirect * add_dll_redirect(struct assembly *assembly)
Definition: actctx.c:870
static const WCHAR hashalgW[]
Definition: actctx.c:636

Referenced by parse_assembly_elem().

◆ parse_manifest()

static NTSTATUS parse_manifest ( struct actctx_loader acl,
struct assembly_identity ai,
LPCWSTR  filename,
LPCWSTR  directory,
BOOL  shared,
const void buffer,
SIZE_T  size 
)
static

Definition at line 2746 of file actctx.c.

2749{
2750 xmlbuf_t xmlbuf;
2752 struct assembly *assembly;
2753 int unicode_tests;
2754
2755 DPRINT( "parsing manifest loaded from %S base dir %S\n", filename, directory );
2756
2759
2761 return STATUS_NO_MEMORY;
2762
2763 if (filename) assembly->manifest.info = strdupW( filename + 4 /* skip \??\ prefix */ );
2764 assembly->manifest.type = assembly->manifest.info ? ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE
2765 : ACTIVATION_CONTEXT_PATH_TYPE_NONE;
2766
2768 if (RtlIsTextUnicode(buffer, size, &unicode_tests ))
2769 {
2770 xmlbuf.ptr = buffer;
2771 xmlbuf.end = xmlbuf.ptr + size / sizeof(WCHAR);
2772 status = parse_manifest_buffer( acl, assembly, ai, &xmlbuf );
2773 }
2774 else if (unicode_tests & IS_TEXT_UNICODE_REVERSE_SIGNATURE)
2775 {
2776 const WCHAR *buf = buffer;
2777 WCHAR *new_buff;
2778 unsigned int i;
2779
2780 if (!(new_buff = RtlAllocateHeap( RtlGetProcessHeap(), 0, size )))
2781 return STATUS_NO_MEMORY;
2782 for (i = 0; i < size / sizeof(WCHAR); i++)
2783 new_buff[i] = RtlUshortByteSwap( buf[i] );
2784 xmlbuf.ptr = new_buff;
2785 xmlbuf.end = xmlbuf.ptr + size / sizeof(WCHAR);
2786 status = parse_manifest_buffer( acl, assembly, ai, &xmlbuf );
2787 RtlFreeHeap( RtlGetProcessHeap(), 0, new_buff );
2788 }
2789 else
2790 {
2791 /* TODO: this doesn't handle arbitrary encodings */
2792 WCHAR *new_buff;
2793 ULONG sizeU;
2794
2796 if (!NT_SUCCESS(status))
2797 {
2798 DPRINT1("RtlMultiByteToUnicodeSize failed with %lx\n", status);
2800 }
2801
2802 new_buff = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeU);
2803 if (!new_buff)
2804 return STATUS_NO_MEMORY;
2805
2806 status = RtlMultiByteToUnicodeN(new_buff, sizeU, &sizeU, buffer, size);
2807 if (!NT_SUCCESS(status))
2808 {
2809 DPRINT1("RtlMultiByteToUnicodeN failed with %lx\n", status);
2811 }
2812
2813 xmlbuf.ptr = new_buff;
2814 xmlbuf.end = xmlbuf.ptr + sizeU / sizeof(WCHAR);
2815 status = parse_manifest_buffer(acl, assembly, ai, &xmlbuf);
2816 RtlFreeHeap(RtlGetProcessHeap(), 0, new_buff);
2817 }
2818 return status;
2819}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
NTSYSAPI BOOLEAN NTAPI RtlIsTextUnicode(_In_ CONST VOID *Buffer, _In_ INT Size, _Inout_opt_ INT *Flags)
_Use_decl_annotations_ NTSTATUS NTAPI RtlMultiByteToUnicodeN(_Out_ PWCH UnicodeString, _In_ ULONG UnicodeSize, _Out_opt_ PULONG ResultSize, _In_ PCCH MbString, _In_ ULONG MbSize)
Definition: nlsboot.c:62
_Use_decl_annotations_ NTSTATUS NTAPI RtlMultiByteToUnicodeSize(_Out_ PULONG UnicodeSize, _In_ PCCH MbString, _In_ ULONG MbSize)
Definition: nlsboot.c:93
static struct assembly * add_assembly(ACTIVATION_CONTEXT *actctx, enum assembly_type at)
Definition: actctx.c:839
static NTSTATUS parse_manifest_buffer(struct actctx_loader *acl, struct assembly *assembly, struct assembly_identity *ai, xmlbuf_t *xmlbuf)
Definition: actctx.c:2708
#define IS_TEXT_UNICODE_REVERSE_SIGNATURE
Definition: winnt_old.h:893
#define IS_TEXT_UNICODE_SIGNATURE
Definition: winnt_old.h:892
#define RtlUshortByteSwap(_x)
Definition: rtlfuncs.h:3197

Referenced by get_manifest_in_manifest_file(), get_manifest_in_module(), and search_manifest_in_module().

◆ parse_manifest_buffer()

static NTSTATUS parse_manifest_buffer ( struct actctx_loader acl,
struct assembly assembly,
struct assembly_identity ai,
xmlbuf_t xmlbuf 
)
static

Definition at line 2708 of file actctx.c.

2710{
2711 struct xml_elem elem;
2712 struct xml_elem parent = {0};
2713
2714 xmlbuf->error = FALSE;
2715 xmlbuf->ns_pos = 0;
2716
2717 if (!next_xml_elem(xmlbuf, &elem, &parent)) return STATUS_SXS_CANT_GEN_ACTCTX;
2718
2719 if (xmlstr_cmp(&elem.name, g_xmlW) &&
2720 (!parse_xml_header(xmlbuf) || !next_xml_elem(xmlbuf, &elem, &parent)))
2722
2724 {
2726 }
2727
2728 parse_assembly_elem(xmlbuf, assembly, acl, &elem, ai);
2729 if (xmlbuf->error)
2730 {
2732 }
2733
2734 if (next_xml_elem(xmlbuf, &elem, &parent))
2735 {
2737 }
2738
2739 if (xmlbuf->ptr != xmlbuf->end)
2740 {
2742 }
2743 return STATUS_SUCCESS;
2744}
static const WCHAR assemblyW[]
Definition: actctx.c:617
static void parse_assembly_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent, struct assembly_identity *expected_ai)
Definition: actctx.c:2598
static const WCHAR g_xmlW[]
Definition: actctx.c:755
static BOOL parse_xml_header(xmlbuf_t *xmlbuf)
Definition: actctx.c:1434

Referenced by parse_manifest().

◆ parse_noinherit_elem()

static void parse_noinherit_elem ( xmlbuf_t xmlbuf,
const struct xml_elem parent 
)
static

Definition at line 2267 of file actctx.c.

2268{
2269 BOOL end = FALSE;
2270
2271 parse_expect_no_attr(xmlbuf, &end);
2272 if (!end) parse_expect_end_elem(xmlbuf, parent);
2273}

Referenced by parse_assembly_elem().

◆ parse_noinheritable_elem()

static void parse_noinheritable_elem ( xmlbuf_t xmlbuf,
const struct xml_elem parent 
)
static

Definition at line 2275 of file actctx.c.

2276{
2277 BOOL end = FALSE;
2278
2279 parse_expect_no_attr(xmlbuf, &end);
2280 if (!end) parse_expect_end_elem(xmlbuf, parent);
2281}

Referenced by parse_assembly_elem().

◆ parse_nummethods()

static BOOL parse_nummethods ( const xmlstr_t str,
struct entity entity 
)
static

Definition at line 1753 of file actctx.c.

1754{
1755 const WCHAR *curr;
1756 ULONG num = 0;
1757
1758 for (curr = str->ptr; curr < str->ptr + str->len; curr++)
1759 {
1760 if (*curr >= '0' && *curr <= '9')
1761 num = num * 10 + *curr - '0';
1762 else
1763 {
1764 // DPRINT1("wrong numeric value %wZ\n", &strU);
1765 return FALSE;
1766 }
1767 }
1768 entity->u.ifaceps.nummethods = num;
1769
1770 return TRUE;
1771}
GLuint GLuint num
Definition: glext.h:9618

Referenced by parse_com_interface_external_proxy_stub_elem(), and parse_cominterface_proxy_stub_elem().

◆ parse_requested_execution_level_elem()

static void parse_requested_execution_level_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2498 of file actctx.c.

2500{
2501 static const WCHAR levelW[] = {'l','e','v','e','l',0};
2502 static const WCHAR asInvokerW[] = {'a','s','I','n','v','o','k','e','r',0};
2503 static const WCHAR requireAdministratorW[] = {'r','e','q','u','i','r','e','A','d','m','i','n','i','s','t','r','a','t','o','r',0};
2504 static const WCHAR highestAvailableW[] = {'h','i','g','h','e','s','t','A','v','a','i','l','a','b','l','e',0};
2505 static const WCHAR uiAccessW[] = {'u','i','A','c','c','e','s','s',0};
2506 static const WCHAR falseW[] = {'f','a','l','s','e',0};
2507 static const WCHAR trueW[] = {'t','r','u','e',0};
2508
2509 struct xml_elem elem;
2510 struct xml_attr attr;
2511 BOOL end = FALSE;
2512
2513 /* Multiple requestedExecutionLevel elements are not supported. */
2514 if (assembly->run_level != ACTCTX_RUN_LEVEL_UNSPECIFIED) set_error( xmlbuf );
2515
2516 while (next_xml_attr(xmlbuf, &attr, &end))
2517 {
2518 if (xml_attr_cmp(&attr, levelW))
2519 {
2520 if (xmlstr_cmpi(&attr.value, asInvokerW))
2521 assembly->run_level = ACTCTX_RUN_LEVEL_AS_INVOKER;
2522 else if (xmlstr_cmpi(&attr.value, highestAvailableW))
2523 assembly->run_level = ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE;
2524 else if (xmlstr_cmpi(&attr.value, requireAdministratorW))
2525 assembly->run_level = ACTCTX_RUN_LEVEL_REQUIRE_ADMIN;
2526 }
2527 else if (xml_attr_cmp(&attr, uiAccessW))
2528 {
2531 else if (xmlstr_cmpi(&attr.value, trueW))
2533 }
2534 }
2535
2536 if (end) return;
2537
2538 while (next_xml_elem(xmlbuf, &elem, parent))
2539 {
2540 parse_unknown_elem(xmlbuf, &elem);
2541 }
2542}
static const WCHAR falseW[]
Definition: json.c:34
ULONG ui_access
Definition: actctx.c:479
ACTCTX_REQUESTED_RUN_LEVEL run_level
Definition: actctx.c:478

Referenced by parse_requested_privileges_elem().

◆ parse_requested_privileges_elem()

static void parse_requested_privileges_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2544 of file actctx.c.

2546{
2547 struct xml_elem elem;
2548
2549 while (next_xml_elem(xmlbuf, &elem, parent))
2550 {
2552 {
2554 }
2555 else
2556 {
2557 parse_unknown_elem(xmlbuf, &elem);
2558 }
2559 }
2560}
static const WCHAR requestedExecutionLevelW[]
Definition: actctx.c:702
static void parse_requested_execution_level_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2498

Referenced by parse_security_elem().

◆ parse_security_elem()

static void parse_security_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2562 of file actctx.c.

2564{
2565 struct xml_elem elem;
2566
2567 while (next_xml_elem(xmlbuf, &elem, parent))
2568 {
2570 {
2572 }
2573 else
2574 {
2575 parse_unknown_elem(xmlbuf, &elem);
2576 }
2577 }
2578}
static const WCHAR requestedPrivilegesW[]
Definition: actctx.c:703
static void parse_requested_privileges_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2544

Referenced by parse_trust_info_elem().

◆ parse_settings_elem()

static void parse_settings_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
struct xml_elem parent 
)
static

Definition at line 2419 of file actctx.c.

2421{
2422 struct xml_elem elem;
2423 struct xml_attr attr;
2425 BOOL end = FALSE;
2426 struct entity *entity;
2427
2428 while (next_xml_attr( xmlbuf, &attr, &end ))
2429 {
2430 }
2431
2432 if (end) return;
2433
2434 if (!parse_text_content( xmlbuf, &content )) return;
2435
2436 entity = add_entity( &assembly->entities, ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS );
2437 if (!entity)
2438 {
2439 set_error( xmlbuf );
2440 return;
2441 }
2442 entity->u.settings.name = xmlstrdupW( &parent->name );
2443 entity->u.settings.value = xmlstrdupW( &content );
2444 entity->u.settings.ns = xmlstrdupW( &parent->ns );
2445
2446 while (next_xml_elem(xmlbuf, &elem, parent))
2447 {
2448 parse_unknown_elem( xmlbuf, &elem );
2449 }
2450}
struct entity::@4975::@4981 settings

Referenced by parse_windows_settings_elem().

◆ parse_supportedos_elem()

static void parse_supportedos_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2351 of file actctx.c.

2353{
2354 struct xml_attr attr;
2355 BOOL end = FALSE;
2356
2357 while (next_xml_attr(xmlbuf, &attr, &end))
2358 {
2359 if (xml_attr_cmp(&attr, IdW))
2360 {
2361 COMPATIBILITY_CONTEXT_ELEMENT *compat;
2363 GUID compat_id;
2364
2365 str.Buffer = (PWSTR)attr.value.ptr;
2366 str.Length = str.MaximumLength = (USHORT)attr.value.len * sizeof(WCHAR);
2367 if (RtlGUIDFromString(&str, &compat_id) == STATUS_SUCCESS)
2368 {
2369 if (!(compat = add_compat_context(assembly)))
2370 {
2371 set_error( xmlbuf );
2372 return;
2373 }
2374 compat->Type = ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS;
2375 compat->Id = compat_id;
2376 }
2377 }
2378 }
2379
2380 if (!end) parse_expect_end_elem(xmlbuf, parent);
2381}
static const WCHAR IdW[]
Definition: actctx.c:701
static PCOMPATIBILITY_CONTEXT_ELEMENT add_compat_context(struct assembly *assembly)
Definition: actctx.c:896
uint16_t * PWSTR
Definition: typedefs.h:56

Referenced by parse_compatibility_application_elem().

◆ parse_text_content()

static BOOL parse_text_content ( xmlbuf_t xmlbuf,
xmlstr_t content 
)
static

Definition at line 1450 of file actctx.c.

1451{
1452 const WCHAR *ptr = memchrW(xmlbuf->ptr, '<', xmlbuf->end - xmlbuf->ptr);
1453
1454 if (!ptr) return FALSE;
1455
1456 content->ptr = xmlbuf->ptr;
1457 content->len = ptr - xmlbuf->ptr;
1458 xmlbuf->ptr = ptr;
1459
1460 return TRUE;
1461}
WINE_UNICODE_INLINE WCHAR * memchrW(const WCHAR *ptr, WCHAR ch, size_t n)
Definition: unicode.h:295

Referenced by parse_com_class_progid(), parse_description_elem(), parse_settings_elem(), and parse_window_class_elem().

◆ parse_trust_info_elem()

static void parse_trust_info_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2580 of file actctx.c.

2582{
2583 struct xml_elem elem;
2584
2585 while (next_xml_elem(xmlbuf, &elem, parent))
2586 {
2588 {
2589 parse_security_elem(xmlbuf, assembly, acl, &elem);
2590 }
2591 else
2592 {
2593 parse_unknown_elem(xmlbuf, &elem);
2594 }
2595 }
2596}
static const WCHAR securityW[]
Definition: actctx.c:704
static void parse_security_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2562

Referenced by parse_assembly_elem().

◆ parse_typelib_elem()

static void parse_typelib_elem ( xmlbuf_t xmlbuf,
struct dll_redirect dll,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 1921 of file actctx.c.

1923{
1924 struct xml_attr attr;
1925 BOOL end = FALSE;
1926 struct entity* entity;
1927
1928 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)))
1929 {
1930 set_error( xmlbuf );
1931 return;
1932 }
1933
1934 while (next_xml_attr(xmlbuf, &attr, &end))
1935 {
1936 if (xml_attr_cmp(&attr, tlbidW))
1937 {
1938 if (!(entity->u.typelib.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1939 }
1940 else if (xml_attr_cmp(&attr, versionW))
1941 {
1942 if (!parse_typelib_version(&attr.value, entity)) set_error( xmlbuf );
1943 }
1944 else if (xml_attr_cmp(&attr, helpdirW))
1945 {
1946 if (!(entity->u.typelib.helpdir = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1947 }
1948 else if (xml_attr_cmp(&attr, flagsW))
1949 {
1950 if (!parse_typelib_flags(&attr.value, entity)) set_error( xmlbuf );
1951 }
1952 }
1953
1955 if (!end) parse_expect_end_elem(xmlbuf, parent);
1956}
static BOOL parse_typelib_version(const xmlstr_t *str, struct entity *entity)
Definition: actctx.c:1892
static const WCHAR helpdirW[]
Definition: actctx.c:637
static BOOL parse_typelib_flags(const xmlstr_t *value, struct entity *entity)
Definition: actctx.c:1856
static const WCHAR flagsW[]
Definition: actctx.c:661

Referenced by parse_file_elem().

◆ parse_typelib_flags()

static BOOL parse_typelib_flags ( const xmlstr_t value,
struct entity entity 
)
static

Definition at line 1856 of file actctx.c.

1857{
1858 WORD *flags = &entity->u.typelib.flags;
1859 const WCHAR *str = value->ptr, *start;
1860 int i = 0;
1861
1862 *flags = 0;
1863
1864 /* it's comma separated list of flags */
1865 while (i < value->len)
1866 {
1867 start = str;
1868 while (*str != ',' && (i++ < value->len)) str++;
1869
1871 *flags |= LIBFLAG_FRESTRICTED;
1872 else if (!strncmpiW(start, controlW, str-start))
1873 *flags |= LIBFLAG_FCONTROL;
1874 else if (!strncmpiW(start, hiddenW, str-start))
1875 *flags |= LIBFLAG_FHIDDEN;
1876 else if (!strncmpiW(start, hasdiskimageW, str-start))
1877 *flags |= LIBFLAG_FHASDISKIMAGE;
1878 else
1879 {
1880 // DPRINT1("unknown flags value %wZ\n", &valueU);
1881 return FALSE;
1882 }
1883
1884 /* skip separator */
1885 str++;
1886 i++;
1887 }
1888
1889 return TRUE;
1890}
unsigned short WORD
Definition: ntddk_ex.h:93
#define strncmpiW(s1, s2, n)
Definition: unicode.h:40
static const WCHAR hasdiskimageW[]
Definition: actctx.c:660
static const WCHAR restrictedW[]
Definition: actctx.c:657
static const WCHAR controlW[]
Definition: actctx.c:658
static const WCHAR hiddenW[]
Definition: actctx.c:659

Referenced by parse_typelib_elem().

◆ parse_typelib_version()

static BOOL parse_typelib_version ( const xmlstr_t str,
struct entity entity 
)
static

Definition at line 1892 of file actctx.c.

1893{
1894 unsigned int ver[2];
1895 unsigned int pos;
1896 const WCHAR *curr;
1897
1898 /* major.minor */
1899 ver[0] = ver[1] = pos = 0;
1900 for (curr = str->ptr; curr < str->ptr + str->len; curr++)
1901 {
1902 if (*curr >= '0' && *curr <= '9')
1903 {
1904 ver[pos] = ver[pos] * 10 + *curr - '0';
1905 if (ver[pos] >= 0x10000) goto error;
1906 }
1907 else if (*curr == '.')
1908 {
1909 if (++pos >= 2) goto error;
1910 }
1911 else goto error;
1912 }
1913 entity->u.typelib.major = ver[0];
1914 entity->u.typelib.minor = ver[1];
1915 return TRUE;
1916
1917error:
1918 return FALSE;
1919}
#define error(str)
Definition: mkdosfs.c:1605

Referenced by parse_typelib_elem().

◆ parse_unknown_elem()

◆ parse_version()

static BOOL parse_version ( const xmlstr_t str,
struct assembly_version version 
)
static

Definition at line 1463 of file actctx.c.

1464{
1465 unsigned int ver[4];
1466 unsigned int pos;
1467 const WCHAR *curr;
1468
1469 /* major.minor.build.revision */
1470 ver[0] = ver[1] = ver[2] = ver[3] = pos = 0;
1471 for (curr = str->ptr; curr < str->ptr + str->len; curr++)
1472 {
1473 if (*curr >= '0' && *curr <= '9')
1474 {
1475 ver[pos] = ver[pos] * 10 + *curr - '0';
1476 if (ver[pos] >= 0x10000) goto error;
1477 }
1478 else if (*curr == '.')
1479 {
1480 if (++pos >= 4) goto error;
1481 }
1482 else goto error;
1483 }
1484 version->major = ver[0];
1485 version->minor = ver[1];
1486 version->build = ver[2];
1487 version->revision = ver[3];
1488 return TRUE;
1489
1490error:
1491 return FALSE;
1492}

Referenced by parse_assembly_identity_elem().

◆ parse_window_class_elem()

static void parse_window_class_elem ( xmlbuf_t xmlbuf,
struct dll_redirect dll,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 1973 of file actctx.c.

1975{
1976 struct xml_elem elem;
1977 struct xml_attr attr;
1979 BOOL end = FALSE;
1980 struct entity* entity;
1981
1982 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)))
1983 {
1984 set_error( xmlbuf );
1985 return;
1986 }
1987 entity->u.class.versioned = TRUE;
1988 while (next_xml_attr(xmlbuf, &attr, &end))
1989 {
1991 {
1992 if (xmlstr_cmpi(&attr.value, noW))
1993 entity->u.class.versioned = FALSE;
1994 else if (!xmlstr_cmpi(&attr.value, yesW))
1995 set_error( xmlbuf );
1996 }
1997 }
1998
1999 if (end) return;
2000
2001 if (!parse_text_content(xmlbuf, &content)) return;
2002 if (!(entity->u.class.name = xmlstrdupW(&content))) set_error( xmlbuf );
2003
2005
2006 while (next_xml_elem(xmlbuf, &elem, parent))
2007 {
2008 parse_unknown_elem(xmlbuf, &elem);
2009 }
2010}
static const WCHAR noW[]
Definition: actctx.c:656
static const WCHAR versionedW[]
Definition: actctx.c:654

Referenced by parse_file_elem().

◆ parse_windows_settings_elem()

static void parse_windows_settings_elem ( xmlbuf_t xmlbuf,
struct assembly assembly,
struct actctx_loader acl,
const struct xml_elem parent 
)
static

Definition at line 2452 of file actctx.c.

2454{
2455 struct xml_elem elem;
2456
2457 while (next_xml_elem( xmlbuf, &elem, parent ))
2458 {
2470 {
2471 parse_settings_elem( xmlbuf, assembly, acl, &elem );
2472 }
2473 else
2474 {
2475 parse_unknown_elem( xmlbuf, &elem );
2476 }
2477 }
2478}
static const WCHAR autoElevateW[]
Definition: actctx.c:707
static const WCHAR longPathAwareW[]
Definition: actctx.c:718
static const WCHAR gdiScalingW[]
Definition: actctx.c:716
static const WCHAR dpiAwarenessW[]
Definition: actctx.c:715
static const WCHAR windowsSettings2011NSW[]
Definition: actctx.c:711
static const WCHAR printerDriverIsolationW[]
Definition: actctx.c:720
static const WCHAR ultraHighResolutionScrollingAwareW[]
Definition: actctx.c:721
static const WCHAR disableWindowFilteringW[]
Definition: actctx.c:709
static void parse_settings_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, struct xml_elem *parent)
Definition: actctx.c:2419
static const WCHAR highResolutionScrollingAwareW[]
Definition: actctx.c:717
static const WCHAR dpiAwareW[]
Definition: actctx.c:714
static const WCHAR disableThemingW[]
Definition: actctx.c:708
static const WCHAR windowsSettings2017NSW[]
Definition: actctx.c:713
static const WCHAR windowsSettings2016NSW[]
Definition: actctx.c:712
static const WCHAR magicFutureSettingW[]
Definition: actctx.c:719
static const WCHAR windowsSettings2005NSW[]
Definition: actctx.c:710

Referenced by parse_application_elem().

◆ parse_xml_header()

static BOOL parse_xml_header ( xmlbuf_t xmlbuf)
static

Definition at line 1434 of file actctx.c.

1435{
1436 /* FIXME: parse attributes */
1437 const WCHAR *ptr;
1438
1439 for (ptr = xmlbuf->ptr; ptr < xmlbuf->end - 1; ptr++)
1440 {
1441 if (ptr[0] == '?' && ptr[1] == '>')
1442 {
1443 xmlbuf->ptr = ptr + 2;
1444 return TRUE;
1445 }
1446 }
1447 return FALSE;
1448}

Referenced by parse_manifest_buffer().

◆ push_xmlns()

static void push_xmlns ( xmlbuf_t xmlbuf,
const struct xml_attr attr 
)
static

Definition at line 1241 of file actctx.c.

1242{
1243 const int len = wcslen( xmlnsW );
1244 struct xml_attr *ns;
1245
1246 if (xmlbuf->ns_pos == MAX_NAMESPACES - 1)
1247 {
1248 // FIXME( "too many namespaces in manifest\n" );
1249 set_error( xmlbuf );
1250 return;
1251 }
1252 ns = &xmlbuf->namespaces[xmlbuf->ns_pos++];
1253 ns->value = attr->value;
1254 if (attr->name.len > len)
1255 {
1256 ns->name.ptr = attr->name.ptr + len + 1;
1257 ns->name.len = attr->name.len - len - 1;
1258 }
1259 else ns->name = empty_xmlstr;
1260}
#define MAX_NAMESPACES
Definition: actctx.c:46
Definition: mxnamespace.c:45

Referenced by next_xml_elem().

◆ read_xml_elem()

static void read_xml_elem ( xmlbuf_t xmlbuf,
struct xml_elem elem 
)
static

Definition at line 1345 of file actctx.c.

1346{
1347 const WCHAR* ptr = xmlbuf->ptr;
1348
1349 elem->ns = empty_xmlstr;
1350 elem->name.ptr = ptr;
1351 while (ptr < xmlbuf->end && !isxmlspace(*ptr) && *ptr != '>' && *ptr != '/')
1352 {
1353 if (*ptr == ':')
1354 {
1355 elem->ns.ptr = elem->name.ptr;
1356 elem->ns.len = ptr - elem->ns.ptr;
1357 elem->name.ptr = ptr + 1;
1358 }
1359 ptr++;
1360 }
1361 elem->name.len = ptr - elem->name.ptr;
1362 xmlbuf->ptr = ptr;
1363}

Referenced by next_xml_elem().

◆ RtlActivateActivationContext()

NTSTATUS NTAPI RtlActivateActivationContext ( ULONG  flags,
HANDLE  handle,
PULONG_PTR  cookie 
)

Definition at line 5394 of file actctx.c.

5395{
5397}
NTSTATUS NTAPI RtlActivateActivationContextEx(ULONG flags, PTEB tebAddress, HANDLE handle, PULONG_PTR cookie)
Definition: actctx.c:5368
Definition: cookie.c:34

◆ RtlActivateActivationContextEx()

NTSTATUS NTAPI RtlActivateActivationContextEx ( ULONG  flags,
PTEB  tebAddress,
HANDLE  handle,
PULONG_PTR  cookie 
)

Definition at line 5368 of file actctx.c.

5369{
5371
5372 if (!(frame = RtlAllocateHeap( RtlGetProcessHeap(), 0, sizeof(*frame) )))
5373 return STATUS_NO_MEMORY;
5374
5375 frame->Previous = tebAddress->ActivationContextStackPointer->ActiveFrame;
5376 frame->ActivationContext = handle;
5377 frame->Flags = 0;
5378
5379 DPRINT("ActiveSP %p: ACTIVATE (ActiveFrame %p -> NewFrame %p, Context %p)\n",
5380 tebAddress->ActivationContextStackPointer, tebAddress->ActivationContextStackPointer->ActiveFrame,
5381 frame, handle);
5382
5383 tebAddress->ActivationContextStackPointer->ActiveFrame = frame;
5385
5386 *cookie = (ULONG_PTR)frame;
5387 DPRINT( "%p cookie=%lx\n", handle, *cookie );
5388 return STATUS_SUCCESS;
5389}
NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE)
Definition: actctx.c:5333
struct _ACTIVATION_CONTEXT * ActivationContext
Definition: winternl.h:250
struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME * Previous
Definition: winternl.h:249
PVOID ActivationContextStackPointer
Definition: compat.h:854

Referenced by CreateRemoteThread(), and RtlActivateActivationContext().

◆ RtlActivateActivationContextUnsafeFast()

PRTL_ACTIVATION_CONTEXT_STACK_FRAME FASTCALL RtlActivateActivationContextUnsafeFast ( IN PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED  Frame,
IN PVOID  Context 
)

Definition at line 5934 of file actctx.c.

5936{
5939
5940 /* Get the current active frame */
5941 ActiveFrame = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame;
5942
5943 DPRINT("ActiveSP %p: ACTIVATE (ActiveFrame %p -> NewFrame %p, Context %p)\n",
5944 NtCurrentTeb()->ActivationContextStackPointer, ActiveFrame,
5945 &Frame->Frame, Context);
5946
5947 /* Ensure it's in the right format and at least fits basic info */
5949 ASSERT(Frame->Size >= sizeof(RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC));
5950
5951 /* Set debug info if size allows*/
5952 if (Frame->Size >= sizeof(RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED))
5953 {
5954 Frame->Extra1 = (PVOID)(~(ULONG_PTR)ActiveFrame);
5955 Frame->Extra2 = (PVOID)(~(ULONG_PTR)Context);
5956 //Frame->Extra3 = ...;
5957 }
5958
5959 if (ActiveFrame)
5960 {
5961 /*ASSERT((ActiveFrame->Flags &
5962 (RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_ACTIVATED |
5963 RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_DEACTIVATED |
5964 RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_NOT_REALLY_ACTIVATED)) == RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_ACTIVATED);*/
5965
5967 {
5968 // TODO: Perform some additional checks if it was not heap allocated
5969 }
5970 }
5971
5972 /* Save pointer to the new activation frame */
5973 NewFrame = &Frame->Frame;
5974
5975 /* Actually activate it */
5976 Frame->Frame.Previous = ActiveFrame;
5977 Frame->Frame.ActivationContext = Context;
5979
5980 /* Check if we can activate this context */
5981 if ((ActiveFrame && (ActiveFrame->ActivationContext != Context)) ||
5982 Context)
5983 {
5984 /* Set new active frame */
5985 DPRINT("Setting new active frame %p instead of old %p\n", NewFrame, ActiveFrame);
5986 NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame = NewFrame;
5987 return NewFrame;
5988 }
5989
5990 /* We can get here only one way: it was already activated */
5991 DPRINT("Trying to activate already activated activation context\n");
5992
5993 /* Activate only if we are allowing multiple activation */
5994#if 0
5996 {
5998 NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame = NewFrame;
5999 }
6000#else
6001 // Activate it anyway
6002 NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame = NewFrame;
6003#endif
6004
6005 /* Return pointer to the activation frame */
6006 return NewFrame;
6007}
#define ASSERT(a)
Definition: mode.c:44
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_NOT_REALLY_ACTIVATED
Definition: rtltypes.h:94
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_ACTIVATED
Definition: rtltypes.h:95
#define RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_FORMAT_WHISTLER
Definition: rtltypes.h:101
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_HEAP_ALLOCATED
Definition: rtltypes.h:93
BOOLEAN RtlpNotAllowingMultipleActivation
Definition: actctx.c:26
void * PVOID
Definition: typedefs.h:50

Referenced by BaseDispatchApc(), BasepIoCompletion(), LdrpInitializeThread(), LdrpRunInitializeRoutines(), LdrpUpdateLoadCount3(), LdrpWalkImportDescriptor(), LdrShutdownProcess(), LdrShutdownThread(), LdrUnloadDll(), SignalObjectAndWait(), SleepEx(), VersionRegisterClass(), WaitForMultipleObjectsEx(), and WaitForSingleObjectEx().

◆ RtlAddRefActivationContext()

VOID NTAPI RtlAddRefActivationContext ( HANDLE  handle)

◆ RtlAllocateActivationContextStack()

NTSTATUS NTAPI RtlAllocateActivationContextStack ( IN PACTIVATION_CONTEXT_STACK Stack)

Definition at line 5906 of file actctx.c.

5907{
5908 PACTIVATION_CONTEXT_STACK ContextStack;
5909
5910 /* Check if it's already allocated */
5911 if (*Stack) return STATUS_SUCCESS;
5912
5913 /* Allocate space for the context stack */
5914 ContextStack = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ACTIVATION_CONTEXT_STACK));
5915 if (!ContextStack)
5916 {
5917 return STATUS_NO_MEMORY;
5918 }
5919
5920 /* Initialize the context stack */
5921 ContextStack->Flags = 0;
5922 ContextStack->ActiveFrame = NULL;
5923 InitializeListHead(&ContextStack->FrameListCache);
5924 ContextStack->NextCookieSequenceNumber = 1;
5925 ContextStack->StackId = 1; //TODO: Timer-based
5926
5927 *Stack = ContextStack;
5928
5929 return STATUS_SUCCESS;
5930}
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
LIST_ENTRY FrameListCache
Definition: rtltypes.h:974
struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME * ActiveFrame
Definition: rtltypes.h:973
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639

Referenced by CreateFiberEx(), CreateRemoteThread(), LdrpInitializeProcess(), and LdrpInitializeThread().

◆ RtlCreateActivationContext()

NTSTATUS NTAPI RtlCreateActivationContext ( IN ULONG  Flags,
IN PACTIVATION_CONTEXT_DATA  ActivationContextData,
IN ULONG  ExtraBytes,
IN PVOID  NotificationRoutine,
IN PVOID  NotificationContext,
OUT PACTIVATION_CONTEXT ActCtx 
)

Definition at line 5133 of file actctx.c.

5139{
5140 const ACTCTXW *pActCtx = (PVOID)ActivationContextData;
5141 const WCHAR *directory = NULL;
5142 PACTIVATION_CONTEXT_WRAPPED ActualActCtx;
5145 ULONG lang = 0;
5147 HANDLE file = 0;
5148 struct actctx_loader acl;
5149
5150 DPRINT("RtlCreateActivationContext %p %08x, Image Base: %p\n", pActCtx, pActCtx ? pActCtx->dwFlags : 0, ((ACTCTXW*)ActivationContextData)->hModule);
5151
5152 if (!pActCtx || pActCtx->cbSize < sizeof(*pActCtx) ||
5153 (pActCtx->dwFlags & ~ACTCTX_FLAGS_ALL))
5155
5156
5157 if (!(ActualActCtx = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ActualActCtx))))
5158 return STATUS_NO_MEMORY;
5159
5160 ActualActCtx->MagicMarker = ACTCTX_MAGIC_MARKER;
5161
5162 actctx = &ActualActCtx->ActivationContext;
5163 actctx->RefCount = 1;
5164 actctx->config.type = ACTIVATION_CONTEXT_PATH_TYPE_NONE;
5165 actctx->config.info = NULL;
5166 actctx->appdir.type = ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE;
5167 if (pActCtx->dwFlags & ACTCTX_FLAG_APPLICATION_NAME_VALID)
5168 {
5169 if (!(actctx->appdir.info = strdupW( pActCtx->lpApplicationName ))) goto error;
5170 }
5171 else
5172 {
5174 WCHAR *p;
5176
5177 if (pActCtx->dwFlags & ACTCTX_FLAG_HMODULE_VALID) module = pActCtx->hModule;
5178 else module = NtCurrentTeb()->ProcessEnvironmentBlock->ImageBaseAddress;
5179
5181 if (!NT_SUCCESS(status)) goto error;
5182 if ((p = strrchrW( dir.Buffer, '\\' ))) p[1] = 0;
5183 actctx->appdir.info = dir.Buffer;
5184 }
5185
5186 nameW.Buffer = NULL;
5187
5188 /* open file only if it's going to be used */
5189 if (pActCtx->lpSource && !((pActCtx->dwFlags & ACTCTX_FLAG_RESOURCE_NAME_VALID) &&
5190 (pActCtx->dwFlags & ACTCTX_FLAG_HMODULE_VALID)))
5191 {
5192 WCHAR *source = NULL;
5193 BOOLEAN ret;
5194
5195 if (pActCtx->dwFlags & ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID &&
5197 {
5198 DWORD dir_len, source_len;
5199
5200 dir_len = strlenW(pActCtx->lpAssemblyDirectory);
5201 source_len = strlenW(pActCtx->lpSource);
5202 if (!(source = RtlAllocateHeap( RtlGetProcessHeap(), 0, (dir_len+source_len+2)*sizeof(WCHAR))))
5203 {
5205 goto error;
5206 }
5207
5208 memcpy(source, pActCtx->lpAssemblyDirectory, dir_len*sizeof(WCHAR));
5209 source[dir_len] = '\\';
5210 memcpy(source+dir_len+1, pActCtx->lpSource, (source_len+1)*sizeof(WCHAR));
5211 }
5212
5213 ret = RtlDosPathNameToNtPathName_U(source ? source : pActCtx->lpSource, &nameW, NULL, NULL);
5214 RtlFreeHeap( RtlGetProcessHeap(), 0, source );
5215 if (!ret)
5216 {
5218 goto error;
5219 }
5220 status = open_nt_file( &file, &nameW );
5221 if (!NT_SUCCESS(status))
5222 {
5224 goto error;
5225 }
5226 }
5227
5228 acl.actctx = actctx;
5229 acl.dependencies = NULL;
5230 acl.num_dependencies = 0;
5231 acl.allocated_dependencies = 0;
5232
5233 if (pActCtx->dwFlags & ACTCTX_FLAG_LANGID_VALID) lang = pActCtx->wLangId;
5234 if (pActCtx->dwFlags & ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID) directory = pActCtx->lpAssemblyDirectory;
5235
5236 if (pActCtx->dwFlags & ACTCTX_FLAG_RESOURCE_NAME_VALID)
5237 {
5238 /* if we have a resource it's a PE file */
5239 if (pActCtx->dwFlags & ACTCTX_FLAG_HMODULE_VALID)
5240 {
5241 status = get_manifest_in_module( &acl, NULL, NULL, directory, FALSE, pActCtx->hModule,
5242 pActCtx->lpResourceName, lang );
5244 /* FIXME: what to do if pActCtx->lpSource is set */
5246 pActCtx->hModule, pActCtx->lpResourceName );
5247 }
5248 else if (pActCtx->lpSource && pActCtx->lpResourceName)
5249 {
5251 file, pActCtx->lpResourceName, lang );
5254 NULL, pActCtx->lpResourceName );
5255 }
5257 }
5258 else
5259 {
5261 }
5262
5263 if (file) NtClose( file );
5265
5267 free_depend_manifests( &acl );
5268
5269 if (NT_SUCCESS(status))
5270 *ActCtx = actctx;
5271 else actctx_release( actctx );
5272 return status;
5273
5274error:
5275 if (file) NtClose( file );
5277 return status;
5278}
unsigned char BOOLEAN
_In_ PCWSTR _Out_ PVOID * ActCtx
Definition: ldrtypes.h:247
NTSYSAPI RTL_PATH_TYPE NTAPI RtlDetermineDosPathNameType_U(_In_ PCWSTR Path)
@ RtlPathTypeRelative
Definition: rtltypes.h:476
static NTSTATUS get_manifest_in_associated_manifest(struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, HMODULE module, LPCWSTR resname)
Definition: actctx.c:3082
static void free_depend_manifests(struct actctx_loader *acl)
Definition: actctx.c:1071
static NTSTATUS parse_depend_manifests(struct actctx_loader *acl)
Definition: actctx.c:3378
#define ACTCTX_FLAGS_ALL
Definition: actctx.c:28
static void actctx_release(ACTIVATION_CONTEXT *actctx)
Definition: actctx.c:1185

◆ RtlDeactivateActivationContext()

NTSTATUS NTAPI RtlDeactivateActivationContext ( ULONG  flags,
ULONG_PTR  cookie 
)

Definition at line 5402 of file actctx.c.

5403{
5405
5406 DPRINT( "%x cookie=%lx\n", flags, cookie );
5407
5408 /* find the right frame */
5409 top = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame;
5410 for (frame = top; frame; frame = frame->Previous)
5411 if ((ULONG_PTR)frame == cookie) break;
5412
5413 if (!frame)
5415
5418
5419 DPRINT("ActiveSP %p: DEACTIVATE (ActiveFrame %p -> PreviousFrame %p)\n",
5420 NtCurrentTeb()->ActivationContextStackPointer,
5421 NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame,
5422 frame->Previous);
5423
5424 /* pop everything up to and including frame */
5425 NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame = frame->Previous;
5426
5427 while (top != NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5428 {
5429 frame = top->Previous;
5430 RtlReleaseActivationContext( top->ActivationContext );
5431 RtlFreeHeap( RtlGetProcessHeap(), 0, top );
5432 top = frame;
5433 }
5434
5435 return STATUS_SUCCESS;
5436}
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE)
Definition: actctx.c:5344
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
#define RTL_DEACTIVATE_ACTIVATION_CONTEXT_FLAG_FORCE_EARLY_DEACTIVATION
Definition: rtltypes.h:111
#define STATUS_SXS_EARLY_DEACTIVATION
Definition: ntstatus.h:1395
#define STATUS_SXS_INVALID_DEACTIVATION
Definition: ntstatus.h:1396

◆ RtlDeactivateActivationContextUnsafeFast()

PRTL_ACTIVATION_CONTEXT_STACK_FRAME FASTCALL RtlDeactivateActivationContextUnsafeFast ( IN PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED  Frame)

Definition at line 6011 of file actctx.c.

6012{
6013 PRTL_ACTIVATION_CONTEXT_STACK_FRAME ActiveFrame, NewFrame;
6014
6015 ActiveFrame = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame;
6016
6017 /* Ensure it's in the right format and at least fits basic info */
6019 ASSERT(Frame->Size >= sizeof(RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC));
6020
6021 /* Make sure it is not deactivated and it is activated */
6025
6026 /* Check debug info if it is present */
6027 if (Frame->Size >= sizeof(RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED))
6028 {
6029 ASSERT(Frame->Extra1 == (PVOID)(~(ULONG_PTR)Frame->Frame.Previous));
6030 ASSERT(Frame->Extra2 == (PVOID)(~(ULONG_PTR)Frame->Frame.ActivationContext));
6031 //Frame->Extra3 = ...;
6032 }
6033
6034 if (ActiveFrame)
6035 {
6036 // TODO: Perform some additional checks here
6037 }
6038
6039 /* Special handling for not-really-activated */
6041 {
6042 DPRINT1("Deactivating not really activated activation context\n");
6044 return &Frame->Frame;
6045 }
6046
6047 /* find the right frame */
6048 NewFrame = &Frame->Frame;
6049 if (ActiveFrame != NewFrame)
6050 {
6051 DPRINT1("Deactivating wrong active frame: %p != %p\n", ActiveFrame, NewFrame);
6052 }
6053
6054 DPRINT("ActiveSP %p: DEACTIVATE (ActiveFrame %p -> PreviousFrame %p)\n",
6055 NtCurrentTeb()->ActivationContextStackPointer, NewFrame, NewFrame->Previous);
6056
6057 /* Pop everything up to and including frame */
6058 NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame = NewFrame->Previous;
6059
6061 return NewFrame->Previous;
6062}
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_DEACTIVATED
Definition: rtltypes.h:96

Referenced by BaseDispatchApc(), BasepIoCompletion(), LdrpInitializeThread(), LdrpRunInitializeRoutines(), LdrpUpdateLoadCount3(), LdrpWalkImportDescriptor(), LdrShutdownProcess(), LdrShutdownThread(), LdrUnloadDll(), SignalObjectAndWait(), SleepEx(), VersionRegisterClass(), WaitForMultipleObjectsEx(), and WaitForSingleObjectEx().

◆ RtlFindActivationContextSectionGuid()

NTSTATUS WINAPI RtlFindActivationContextSectionGuid ( ULONG  flags,
const GUID extguid,
ULONG  section_kind,
const GUID guid,
void ptr 
)

Definition at line 5866 of file actctx.c.

5868{
5869 ACTCTX_SECTION_KEYED_DATA *data = ptr;
5871
5872 if (extguid)
5873 {
5874 DPRINT1("expected extguid == NULL\n");
5876 }
5877
5878 if (flags & ~FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX)
5879 {
5880 DPRINT1("unknown flags %08x\n", flags);
5882 }
5883
5884 if (!data || data->cbSize < FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) || !guid)
5886
5887 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5888 {
5889 ACTIVATION_CONTEXT *actctx = check_actctx(NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext);
5890 if (actctx) status = find_guid( actctx, section_kind, guid, flags, data );
5891 }
5892
5893 if (status != STATUS_SUCCESS)
5894 status = find_guid( process_actctx, section_kind, guid, flags, data );
5895
5896 if (status != STATUS_SUCCESS)
5897 status = find_guid( implicit_actctx, section_kind, guid, flags, data );
5898
5899 return status;
5900}
static NTSTATUS find_guid(ACTIVATION_CONTEXT *actctx, ULONG section_kind, const GUID *guid, DWORD flags, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:5040

Referenced by FindActCtxSectionGuid().

◆ RtlFindActivationContextSectionString()

NTSTATUS NTAPI RtlFindActivationContextSectionString ( ULONG  flags,
const GUID guid,
ULONG  section_kind,
const UNICODE_STRING section_name,
PVOID  ptr 
)

Definition at line 5815 of file actctx.c.

5817{
5820
5821 DPRINT("RtlFindActivationContextSectionString(%x %p %x %wZ %p)\n", flags, guid, section_kind, section_name, ptr);
5823 if (!NT_SUCCESS(status))
5824 {
5825 DPRINT1("RtlFindActivationContextSectionString() failed with status %x\n", status);
5826 return status;
5827 }
5828
5830
5831 /* if there is no data, but params are valid,
5832 we return that sxs key is not found to be at least somehow compatible */
5833 if (!data)
5834 {
5835 DPRINT("RtlFindActivationContextSectionString() failed with status %x\n", status);
5836 return status;
5837 }
5838
5840 ASSERT(NtCurrentTeb()->ActivationContextStackPointer);
5841
5842 DPRINT("ActiveFrame: %p\n",NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame);
5843 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5844 {
5845 ACTIVATION_CONTEXT *actctx = check_actctx(NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext);
5846 if (actctx) status = find_string( actctx, section_kind, section_name, flags, data );
5847 }
5848
5849 DPRINT("status %x\n", status);
5850 if (status != STATUS_SUCCESS)
5851 status = find_string( process_actctx, section_kind, section_name, flags, data );
5852
5853 if (status != STATUS_SUCCESS)
5854 status = find_string( implicit_actctx, section_kind, section_name, flags, data );
5855
5856 DPRINT("RtlFindActivationContextSectionString() returns status %x\n", status);
5857 return status;
5858}
static const GUID PACTCTX_SECTION_KEYED_DATA
Definition: actctx.c:36
NTSTATUS NTAPI RtlpFindActivationContextSection_CheckParameters(ULONG flags, const GUID *guid, ULONG section_kind, const UNICODE_STRING *section_name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:5785
static NTSTATUS find_string(ACTIVATION_CONTEXT *actctx, ULONG section_kind, const UNICODE_STRING *section_name, DWORD flags, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:5002

Referenced by ClassNameToVersion(), find_actctx_dll(), FindActCtxSectionStringW(), init_funcs(), and LdrpCheckForKnownDll().

◆ RtlFreeActivationContextStack()

VOID NTAPI RtlFreeActivationContextStack ( IN PACTIVATION_CONTEXT_STACK  Stack)

Definition at line 5440 of file actctx.c.

5441{
5442 PRTL_ACTIVATION_CONTEXT_STACK_FRAME ActiveFrame, PrevFrame;
5443
5444 /* Nothing to do if there is no stack */
5445 if (!Stack) return;
5446
5447 /* Get the current active frame */
5448 ActiveFrame = Stack->ActiveFrame;
5449
5450 /* Go through them in backwards order and release */
5451 while (ActiveFrame)
5452 {
5453 PrevFrame = ActiveFrame->Previous;
5455 RtlFreeHeap(RtlGetProcessHeap(), 0, ActiveFrame);
5456 ActiveFrame = PrevFrame;
5457 }
5458
5459 /* Zero out the active frame */
5460 Stack->ActiveFrame = NULL;
5461
5462 /* TODO: Empty the Frame List Cache */
5463 ASSERT(IsListEmpty(&Stack->FrameListCache));
5464
5465 /* Free activation stack memory */
5466 RtlFreeHeap(RtlGetProcessHeap(), 0, Stack);
5467}
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954

Referenced by CreateFiberEx(), CreateRemoteThread(), DeleteFiber(), and RtlFreeThreadActivationContextStack().

◆ RtlFreeThreadActivationContextStack()

VOID NTAPI RtlFreeThreadActivationContextStack ( VOID  )

Definition at line 5472 of file actctx.c.

5473{
5474 RtlFreeActivationContextStack(NtCurrentTeb()->ActivationContextStackPointer);
5475 NtCurrentTeb()->ActivationContextStackPointer = NULL;
5476}
VOID NTAPI RtlFreeActivationContextStack(IN PACTIVATION_CONTEXT_STACK Stack)
Definition: actctx.c:5440

Referenced by LdrShutdownThread().

◆ RtlGetActiveActivationContext()

NTSTATUS NTAPI RtlGetActiveActivationContext ( HANDLE handle)

Definition at line 5482 of file actctx.c.

5483{
5484 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5485 {
5486 *handle = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext;
5488 }
5489 else
5490 *handle = 0;
5491
5492 return STATUS_SUCCESS;
5493}

Referenced by GetCurrentActCtx(), and LdrpWalkImportDescriptor().

◆ RtlIsActivationContextActive()

BOOLEAN NTAPI RtlIsActivationContextActive ( HANDLE  handle)

Definition at line 5499 of file actctx.c.

5500{
5502
5503 for (frame = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame; frame; frame = frame->Previous)
5504 if (frame->ActivationContext == handle) return TRUE;
5505 return FALSE;
5506}

◆ RtlpFindActivationContextSection_CheckParameters()

NTSTATUS NTAPI RtlpFindActivationContextSection_CheckParameters ( ULONG  flags,
const GUID guid,
ULONG  section_kind,
const UNICODE_STRING section_name,
PACTCTX_SECTION_KEYED_DATA  data 
)

Definition at line 5785 of file actctx.c.

5787{
5788 /* Check general parameter combinations */
5789 if (!section_name || !section_name->Buffer ||
5791 ((flags & FIND_ACTCTX_VALID_MASK) && !data) ||
5792 (data && data->cbSize < offsetof(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex)))
5793 {
5794 DPRINT1("invalid parameter\n");
5796 }
5797
5798 /* TODO */
5801 {
5802 DPRINT1("unknown flags %08x\n", flags);
5804 }
5805
5806 return STATUS_SUCCESS;
5807}
#define offsetof(TYPE, MEMBER)
#define FIND_ACTCTX_RETURN_ASSEMBLY_METADATA
Definition: actctx.c:5780
#define FIND_ACTCTX_VALID_MASK
Definition: actctx.c:5781
#define FIND_ACTCTX_RETURN_FLAGS
Definition: actctx.c:5779

Referenced by RtlFindActivationContextSectionString().

◆ RtlpSxsBreakOnInvalidMarker()

VOID NTAPI RtlpSxsBreakOnInvalidMarker ( IN PACTIVATION_CONTEXT  ActCtx,
IN ULONG  FailureCode 
)

Definition at line 571 of file actctx.c.

573{
574 EXCEPTION_RECORD ExceptionRecord;
575
576 /* Fatal SxS exception header */
577 ExceptionRecord.ExceptionRecord = NULL;
578 ExceptionRecord.ExceptionCode = STATUS_SXS_CORRUPTION;
580
581 /* With SxS-specific information plus the context itself */
582 ExceptionRecord.ExceptionInformation[0] = 1;
583 ExceptionRecord.ExceptionInformation[1] = FailureCode;
584 ExceptionRecord.ExceptionInformation[2] = (ULONG_PTR)ActCtx;
585 ExceptionRecord.NumberParameters = 3;
586
587 /* Raise it */
588 RtlRaiseException(&ExceptionRecord);
589}
NTSYSAPI VOID NTAPI RtlRaiseException(_In_ PEXCEPTION_RECORD ExceptionRecord)
#define STATUS_SXS_CORRUPTION
Definition: ntstatus.h:1401
struct _EXCEPTION_RECORD * ExceptionRecord
Definition: compat.h:210
DWORD ExceptionCode
Definition: compat.h:208
DWORD NumberParameters
Definition: compat.h:212
DWORD ExceptionFlags
Definition: compat.h:209
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
Definition: compat.h:213
#define EXCEPTION_NONCONTINUABLE
Definition: stubs.h:23

Referenced by RtlpValidateActCtx().

◆ RtlpValidateActCtx()

FORCEINLINE VOID RtlpValidateActCtx ( IN PACTIVATION_CONTEXT  ActCtx)

Definition at line 593 of file actctx.c.

594{
596
597 /* Get the caller-opaque header */
598 pActual = CONTAINING_RECORD(ActCtx,
600 ActivationContext);
601
602 /* Check if the header matches as expected */
603 if (pActual->MagicMarker != ACTCTX_MAGIC_MARKER)
604 {
605 /* Nope, print out a warning, assert, and then throw an exception */
606 DbgPrint("%s : Invalid activation context marker %p found in activation context %p\n"
607 " This means someone stepped on the allocation, or someone is using a\n"
608 " deallocated activation context\n",
610 pActual->MagicMarker,
611 ActCtx);
614 }
615}
#define __FUNCTION__
Definition: types.h:116
#define DbgPrint
Definition: hal.h:12
VOID NTAPI RtlpSxsBreakOnInvalidMarker(IN PACTIVATION_CONTEXT ActCtx, IN ULONG FailureCode)
Definition: actctx.c:571

◆ RtlQueryInformationActivationContext()

NTSTATUS NTAPI RtlQueryInformationActivationContext ( ULONG  flags,
HANDLE  handle,
PVOID  subinst,
ULONG  class,
PVOID  buffer,
SIZE_T  bufsize,
SIZE_T retlen 
)

Definition at line 5515 of file actctx.c.

5518{
5521
5522 DPRINT("%08x %p %p %u %p %Iu %p\n", flags, handle,
5523 subinst, class, buffer, bufsize, retlen);
5524
5525 if (retlen) *retlen = 0;
5526 if ((status = find_query_actctx( &handle, flags, class ))) return status;
5527
5528 switch (class)
5529 {
5530 case ActivationContextBasicInformation:
5531 {
5532 ACTIVATION_CONTEXT_BASIC_INFORMATION *info = buffer;
5533
5534 if (retlen) *retlen = sizeof(*info);
5535 if (!info || bufsize < sizeof(*info)) return STATUS_BUFFER_TOO_SMALL;
5536
5537 info->hActCtx = handle;
5538 info->dwFlags = 0; /* FIXME */
5540 }
5541 break;
5542
5543 case ActivationContextDetailedInformation:
5544 {
5545 ACTIVATION_CONTEXT_DETAILED_INFORMATION *acdi = buffer;
5546 struct assembly *assembly = NULL;
5547 SIZE_T len, manifest_len = 0, config_len = 0, appdir_len = 0;
5548 LPWSTR ptr;
5549
5551
5552 if (actctx->num_assemblies) assembly = actctx->assemblies;
5553
5554 if (assembly && assembly->manifest.info)
5555 manifest_len = strlenW(assembly->manifest.info) + 1;
5556 if (actctx->config.info) config_len = strlenW(actctx->config.info) + 1;
5557 if (actctx->appdir.info) appdir_len = strlenW(actctx->appdir.info) + 1;
5558 len = sizeof(*acdi) + (manifest_len + config_len + appdir_len) * sizeof(WCHAR);
5559
5560 if (retlen) *retlen = len;
5561 if (!buffer || bufsize < len) return STATUS_BUFFER_TOO_SMALL;
5562
5563 acdi->dwFlags = 0;
5564 acdi->ulFormatVersion = assembly ? 1 : 0; /* FIXME */
5565 acdi->ulAssemblyCount = actctx->num_assemblies;
5566 acdi->ulRootManifestPathType = assembly ? assembly->manifest.type : 0 /* FIXME */;
5567 acdi->ulRootManifestPathChars = assembly && assembly->manifest.info ? (DWORD)manifest_len - 1 : 0;
5568 acdi->ulRootConfigurationPathType = actctx->config.type;
5569 acdi->ulRootConfigurationPathChars = actctx->config.info ? (DWORD)config_len - 1 : 0;
5570 acdi->ulAppDirPathType = actctx->appdir.type;
5571 acdi->ulAppDirPathChars = actctx->appdir.info ? (DWORD)appdir_len - 1 : 0;
5572 ptr = (LPWSTR)(acdi + 1);
5573 if (manifest_len)
5574 {
5575 acdi->lpRootManifestPath = ptr;
5576 memcpy(ptr, assembly->manifest.info, manifest_len * sizeof(WCHAR));
5577 ptr += manifest_len;
5578 }
5579 else acdi->lpRootManifestPath = NULL;
5580 if (config_len)
5581 {
5582 acdi->lpRootConfigurationPath = ptr;
5583 memcpy(ptr, actctx->config.info, config_len * sizeof(WCHAR));
5584 ptr += config_len;
5585 }
5586 else acdi->lpRootConfigurationPath = NULL;
5587 if (appdir_len)
5588 {
5589 acdi->lpAppDirPath = ptr;
5590 memcpy(ptr, actctx->appdir.info, appdir_len * sizeof(WCHAR));
5591 }
5592 else acdi->lpAppDirPath = NULL;
5593 }
5594 break;
5595
5596 case AssemblyDetailedInformationInActivationContext:
5597 {
5598 ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *afdi = buffer;
5599 struct assembly *assembly;
5600 WCHAR *assembly_id;
5601 DWORD index;
5602 SIZE_T len, id_len = 0, ad_len = 0, path_len = 0;
5603 LPWSTR ptr;
5604
5606 if (!subinst) return STATUS_INVALID_PARAMETER;
5607
5608 index = *(DWORD*)subinst;
5609 if (!index || index > actctx->num_assemblies) return STATUS_INVALID_PARAMETER;
5610
5611 assembly = &actctx->assemblies[index - 1];
5612
5613 if (!(assembly_id = build_assembly_id( &assembly->id ))) return STATUS_NO_MEMORY;
5614 id_len = strlenW(assembly_id) + 1;
5615 if (assembly->directory) ad_len = strlenW(assembly->directory) + 1;
5616
5617 if (assembly->manifest.info &&
5619 path_len = strlenW(assembly->manifest.info) + 1;
5620
5621 len = sizeof(*afdi) + (id_len + ad_len + path_len) * sizeof(WCHAR);
5622
5623 if (retlen) *retlen = len;
5624 if (!buffer || bufsize < len)
5625 {
5626 RtlFreeHeap( RtlGetProcessHeap(), 0, assembly_id );
5628 }
5629
5630 afdi->ulFlags = 0; /* FIXME */
5631 afdi->ulEncodedAssemblyIdentityLength = (DWORD)(id_len - 1) * sizeof(WCHAR);
5632 afdi->ulManifestPathType = assembly->manifest.type;
5633 afdi->ulManifestPathLength = assembly->manifest.info ? (DWORD)(path_len - 1) * sizeof(WCHAR) : 0;
5634 /* FIXME afdi->liManifestLastWriteTime = 0; */
5635 afdi->ulPolicyPathType = ACTIVATION_CONTEXT_PATH_TYPE_NONE; /* FIXME */
5636 afdi->ulPolicyPathLength = 0;
5637 /* FIXME afdi->liPolicyLastWriteTime = 0; */
5638 afdi->ulMetadataSatelliteRosterIndex = 0; /* FIXME */
5639 afdi->ulManifestVersionMajor = 1;
5640 afdi->ulManifestVersionMinor = 0;
5641 afdi->ulPolicyVersionMajor = 0; /* FIXME */
5642 afdi->ulPolicyVersionMinor = 0; /* FIXME */
5643 afdi->ulAssemblyDirectoryNameLength = ad_len ? (DWORD)(ad_len - 1) * sizeof(WCHAR) : 0;
5644 ptr = (LPWSTR)(afdi + 1);
5645 afdi->lpAssemblyEncodedAssemblyIdentity = ptr;
5646 memcpy( ptr, assembly_id, id_len * sizeof(WCHAR) );
5647 ptr += id_len;
5648 if (path_len)
5649 {
5650 afdi->lpAssemblyManifestPath = ptr;
5651 memcpy(ptr, assembly->manifest.info, path_len * sizeof(WCHAR));
5652 ptr += path_len;
5653 } else afdi->lpAssemblyManifestPath = NULL;
5654 afdi->lpAssemblyPolicyPath = NULL; /* FIXME */
5655 if (ad_len)
5656 {
5657 afdi->lpAssemblyDirectoryName = ptr;
5658 memcpy(ptr, assembly->directory, ad_len * sizeof(WCHAR));
5659 }
5660 else afdi->lpAssemblyDirectoryName = NULL;
5661 RtlFreeHeap( RtlGetProcessHeap(), 0, assembly_id );
5662 }
5663 break;
5664
5665 case FileInformationInAssemblyOfAssemblyInActivationContext:
5666 {
5667 const ACTIVATION_CONTEXT_QUERY_INDEX *acqi = subinst;
5668 ASSEMBLY_FILE_DETAILED_INFORMATION *afdi = buffer;
5669 struct assembly *assembly;
5670 struct dll_redirect *dll;
5671 SIZE_T len, dll_len = 0;
5672 LPWSTR ptr;
5673
5675 if (!acqi) return STATUS_INVALID_PARAMETER;
5676
5677 if (acqi->ulAssemblyIndex >= actctx->num_assemblies)
5679 assembly = &actctx->assemblies[acqi->ulAssemblyIndex];
5680
5681 if (acqi->ulFileIndexInAssembly >= assembly->num_dlls)
5683 dll = &assembly->dlls[acqi->ulFileIndexInAssembly];
5684
5685 if (dll->name) dll_len = strlenW(dll->name) + 1;
5686 len = sizeof(*afdi) + dll_len * sizeof(WCHAR);
5687
5688 if (!buffer || bufsize < len)
5689 {
5690 if (retlen) *retlen = len;
5692 }
5693 if (retlen) *retlen = 0; /* yes that's what native does !! */
5694 afdi->ulFlags = ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION;
5695 afdi->ulFilenameLength = dll_len ? (DWORD)(dll_len - 1) * sizeof(WCHAR) : 0;
5696 afdi->ulPathLength = 0; /* FIXME */
5697 ptr = (LPWSTR)(afdi + 1);
5698 if (dll_len)
5699 {
5700 afdi->lpFileName = ptr;
5701 memcpy( ptr, dll->name, dll_len * sizeof(WCHAR) );
5702 } else afdi->lpFileName = NULL;
5703 afdi->lpFilePath = NULL; /* FIXME */
5704 }
5705 break;
5706
5707 case CompatibilityInformationInActivationContext:
5708 {
5709 /*ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION*/DWORD *acci = buffer;
5710 COMPATIBILITY_CONTEXT_ELEMENT *elements;
5711 struct assembly *assembly = NULL;
5713 SIZE_T len;
5714
5716
5717 if (actctx->num_assemblies) assembly = actctx->assemblies;
5718
5719 if (assembly)
5721 len = sizeof(*acci) + num_compat_contexts * sizeof(COMPATIBILITY_CONTEXT_ELEMENT);
5722
5723 if (retlen) *retlen = len;
5724 if (!buffer || bufsize < len) return STATUS_BUFFER_TOO_SMALL;
5725
5726 *acci = num_compat_contexts;
5727 elements = (COMPATIBILITY_CONTEXT_ELEMENT*)(acci + 1);
5728 for (n = 0; n < num_compat_contexts; ++n)
5729 {
5730 elements[n] = assembly->compat_contexts[n];
5731 }
5732 }
5733 break;
5734
5735 case RunlevelInformationInActivationContext:
5736 {
5737 ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION *acrli = buffer;
5738 struct assembly *assembly;
5739 SIZE_T len;
5740
5742
5743 len = sizeof(*acrli);
5744 if (retlen) *retlen = len;
5745 if (!buffer || bufsize < len)
5747
5748 assembly = actctx->assemblies;
5749
5750 acrli->ulFlags = 0;
5751 acrli->RunLevel = assembly ? assembly->run_level : ACTCTX_RUN_LEVEL_UNSPECIFIED;
5752 acrli->UiAccess = assembly ? assembly->ui_access : 0;
5753 }
5754 break;
5755
5756 default:
5757 DPRINT( "class %u not implemented\n", class );
5759 }
5760 return STATUS_SUCCESS;
5761}
GLenum GLuint GLsizei bufsize
Definition: glext.h:7473
static DWORD path_len
Definition: batch.c:31
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_NO_ADDREF
Definition: rtltypes.h:119
#define DWORD
Definition: nt_native.h:44
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
static WCHAR * build_assembly_id(const struct assembly_identity *ai)
Definition: actctx.c:1124
static NTSTATUS find_query_actctx(HANDLE *handle, DWORD flags, ULONG class)
Definition: actctx.c:3403
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by BasepAllocateActivationContextActivationBlock(), CreateRemoteThread(), find_actctx_dll(), LdrpInitializeProcessCompat(), QueryActCtxW(), QueueUserAPC(), and RtlQueryInformationActiveActivationContext().

◆ RtlQueryInformationActiveActivationContext()

NTSTATUS NTAPI RtlQueryInformationActiveActivationContext ( ULONG  ulInfoClass,
PVOID  pvBuffer,
SIZE_T cbBuffer  OPTIONAL,
SIZE_T *pcbWrittenOrRequired  OPTIONAL 
)

Definition at line 5765 of file actctx.c.

5769{
5771 NULL,
5772 NULL,
5773 ulInfoClass,
5774 pvBuffer,
5775 cbBuffer,
5776 pcbWrittenOrRequired);
5777}
NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG, HANDLE, PVOID, ULONG, PVOID, SIZE_T, SIZE_T *)
Definition: actctx.c:5515

◆ RtlReleaseActivationContext()

◆ RtlZombifyActivationContext()

NTSTATUS NTAPI RtlZombifyActivationContext ( PVOID  Context)

Definition at line 5357 of file actctx.c.

5358{
5360
5362 return STATUS_SUCCESS;
5363
5365}
#define UNIMPLEMENTED
Definition: debug.h:115
#define ACTCTX_FAKE_HANDLE
Definition: actctx.c:43

Referenced by ZombifyActCtx().

◆ search_manifest_in_module()

static NTSTATUS search_manifest_in_module ( struct actctx_loader acl,
struct assembly_identity ai,
LPCWSTR  filename,
LPCWSTR  directory,
BOOL  shared,
HANDLE  hModule,
ULONG  lang 
)
static

Definition at line 2943 of file actctx.c.

2946{
2947 ULONG size;
2948 PVOID root, ptr;
2949 IMAGE_RESOURCE_DIRECTORY *resdirptr;
2952
2955 if (size < sizeof(*resdirptr)) return STATUS_RESOURCE_DATA_NOT_FOUND;
2956 resdirptr = root;
2957
2958 if (!(ptr = find_entry_by_name(resdirptr, (LPCWSTR)RT_MANIFEST, root, 1)))
2960
2961 resdirptr = ptr;
2962 if (!(ptr = find_first_id_entry(resdirptr, root, 1)))
2964
2965 resdirptr = ptr;
2966 if (!(ptr = find_first_entry(resdirptr, root, 0)))
2968
2969 entry = ptr;
2971
2972 if (status == STATUS_SUCCESS)
2973 status = parse_manifest(acl, ai, filename, directory, shared, ptr, entry->Size);
2974
2975 return status;
2976}
struct _root root
#define RtlImageDirectoryEntryToData
Definition: compat.h:809
#define IMAGE_DIRECTORY_ENTRY_RESOURCE
Definition: pedump.c:261
static IMAGE_RESOURCE_DIRECTORY * find_first_id_entry(IMAGE_RESOURCE_DIRECTORY *dir, void *root, int want_dir)
Definition: actctx.c:2928
IMAGE_RESOURCE_DIRECTORY * find_entry_by_name(IMAGE_RESOURCE_DIRECTORY *dir, LPCWSTR name, void *root, int want_dir)
Definition: res.c:130
IMAGE_RESOURCE_DIRECTORY * find_first_entry(IMAGE_RESOURCE_DIRECTORY *dir, void *root, int want_dir)
Definition: res.c:75

Referenced by get_manifest_in_pe_file().

◆ set_error()

◆ strdupW()

static WCHAR * strdupW ( const WCHAR str)
static

Definition at line 768 of file actctx.c.

769{
770 WCHAR* ptr;
771
772 if (!(ptr = RtlAllocateHeap(RtlGetProcessHeap(), 0, (strlenW(str) + 1) * sizeof(WCHAR))))
773 return NULL;
774 return strcpyW(ptr, str);
775}

Referenced by parse_add_interface_class(), parse_dependent_assembly_elem(), parse_manifest(), and RtlCreateActivationContext().

◆ write_progid_record()

static void write_progid_record ( struct strsection_header section,
const WCHAR progid,
const GUID alias,
struct string_index **  index,
ULONG data_offset,
ULONG global_offset,
ULONG  rosterindex 
)
static

Definition at line 4792 of file actctx.c.

4794{
4795 struct progidredirect_data *data;
4797 GUID *guid_ptr;
4798 WCHAR *ptrW;
4799
4800 /* setup new index entry */
4801
4802 /* hash progid name */
4805
4806 (*index)->name_offset = *data_offset;
4807 (*index)->name_len = str.Length;
4808 (*index)->data_offset = (*index)->name_offset + aligned_string_len(str.MaximumLength);
4809 (*index)->data_len = sizeof(*data);
4810 (*index)->rosterindex = rosterindex;
4811
4812 *data_offset += aligned_string_len(str.MaximumLength);
4813
4814 /* setup data structure */
4815 data = (struct progidredirect_data*)((BYTE*)section + *data_offset);
4816 data->size = sizeof(*data);
4817 data->reserved = 0;
4818 data->clsid_offset = *global_offset;
4819
4820 /* write progid string */
4821 ptrW = (WCHAR*)((BYTE*)section + (*index)->name_offset);
4822 memcpy(ptrW, progid, (*index)->name_len);
4823 ptrW[(*index)->name_len/sizeof(WCHAR)] = 0;
4824
4825 /* write guid to global area */
4826 guid_ptr = (GUID*)((BYTE*)section + data->clsid_offset);
4827 *guid_ptr = *alias;
4828
4829 /* to next entry */
4830 *global_offset += sizeof(GUID);
4831 *data_offset += data->size;
4832 (*index) += 1;
4833}
const WCHAR * alias
Definition: main.c:67

Referenced by add_progid_record().

◆ xml_attr_cmp()

◆ xml_elem_cmp()

static BOOL xml_elem_cmp ( const struct xml_elem elem,
const WCHAR str,
const WCHAR namespace 
)
inlinestatic

Definition at line 818 of file actctx.c.

819{
820 if (!xmlstr_cmp( &elem->name, str )) return FALSE;
821 if (xmlstr_cmp( &elem->ns, namespace )) return TRUE;
822 if (!wcscmp( namespace, asmv1W ))
823 {
824 if (xmlstr_cmp( &elem->ns, asmv2W )) return TRUE;
825 if (xmlstr_cmp( &elem->ns, asmv3W )) return TRUE;
826 }
827 else if (!wcscmp( namespace, asmv2W ))
828 {
829 if (xmlstr_cmp( &elem->ns, asmv3W )) return TRUE;
830 }
831 return FALSE;
832}

Referenced by parse_application_elem(), parse_assembly_elem(), parse_clr_class_elem(), parse_com_class_elem(), parse_compatibility_application_elem(), parse_compatibility_elem(), parse_dependency_elem(), parse_dependent_assembly_elem(), parse_file_elem(), parse_manifest_buffer(), parse_requested_privileges_elem(), parse_security_elem(), parse_trust_info_elem(), and parse_windows_settings_elem().

◆ xml_name_cmp()

static BOOL xml_name_cmp ( const struct xml_elem elem1,
const struct xml_elem elem2 
)
static

Definition at line 810 of file actctx.c.

811{
812 return (elem1->name.len == elem2->name.len &&
813 elem1->ns.len == elem2->ns.len &&
814 !wcsncmp( elem1->name.ptr, elem2->name.ptr, elem1->name.len ) &&
815 !wcsncmp( elem1->ns.ptr, elem2->ns.ptr, elem1->ns.len ));
816}
xmlstr_t name
Definition: actctx.c:56
xmlstr_t ns
Definition: actctx.c:57
const WCHAR * ptr
Definition: actctx.c:50
unsigned int len
Definition: actctx.c:51

Referenced by next_xml_elem().

◆ xmlstr_cmp()

static BOOL xmlstr_cmp ( const xmlstr_t xmlstr,
const WCHAR str 
)
inlinestatic

Definition at line 789 of file actctx.c.

790{
791 return !strncmpW(xmlstr->ptr, str, xmlstr->len) && !str[xmlstr->len];
792}

Referenced by parse_assembly_elem(), parse_com_class_threadingmodel(), parse_dependent_assembly_elem(), parse_manifest_buffer(), xml_attr_cmp(), and xml_elem_cmp().

◆ xmlstr_cmp_end()

static BOOL xmlstr_cmp_end ( const xmlstr_t xmlstr,
const WCHAR str 
)
inlinestatic

Definition at line 799 of file actctx.c.

800{
801 return (xmlstr->len && xmlstr->ptr[0] == '/' &&
802 !strncmpW(xmlstr->ptr + 1, str, xmlstr->len - 1) && !str[xmlstr->len - 1]);
803}

◆ xmlstr_cmpi()

static BOOL xmlstr_cmpi ( const xmlstr_t xmlstr,
const WCHAR str 
)
inlinestatic

Definition at line 794 of file actctx.c.

795{
796 return !strncmpiW(xmlstr->ptr, str, xmlstr->len) && !str[xmlstr->len];
797}

Referenced by parse_dependency_elem(), parse_file_elem(), parse_requested_execution_level_elem(), and parse_window_class_elem().

◆ xmlstrdupW()

static WCHAR * xmlstrdupW ( const xmlstr_t str)
static

Definition at line 777 of file actctx.c.

778{
779 WCHAR *strW;
780
781 if ((strW = RtlAllocateHeap(RtlGetProcessHeap(), 0, (str->len + 1) * sizeof(WCHAR))))
782 {
783 memcpy( strW, str->ptr, str->len * sizeof(WCHAR) );
784 strW[str->len] = 0;
785 }
786 return strW;
787}
WCHAR strW[12]
Definition: clipboard.c:2029

Referenced by com_class_add_progid(), parse_assembly_identity_elem(), parse_clr_class_elem(), parse_clr_surrogate_elem(), parse_com_class_elem(), parse_com_interface_external_proxy_stub_elem(), parse_cominterface_proxy_stub_elem(), parse_file_elem(), parse_settings_elem(), parse_typelib_elem(), and parse_window_class_elem().

Variable Documentation

◆ activatewhenvisibleW

const WCHAR activatewhenvisibleW[] = {'a','c','t','i','v','a','t','e','w','h','e','n','v','i','s','i','b','l','e',0}
static

Definition at line 674 of file actctx.c.

◆ actslikebuttonW

const WCHAR actslikebuttonW[] = {'a','c','t','s','l','i','k','e','b','u','t','t','o','n',0}
static

Definition at line 675 of file actctx.c.

◆ actslikelabelW

const WCHAR actslikelabelW[] = {'a','c','t','s','l','i','k','e','l','a','b','e','l',0}
static

Definition at line 676 of file actctx.c.

◆ alignableW

const WCHAR alignableW[] = {'a','l','i','g','n','a','b','l','e',0}
static

Definition at line 677 of file actctx.c.

◆ alwaysrunW

const WCHAR alwaysrunW[] = {'a','l','w','a','y','s','r','u','n',0}
static

Definition at line 678 of file actctx.c.

◆ applicationW

const WCHAR applicationW[] = {'a','p','p','l','i','c','a','t','i','o','n',0}
static

Definition at line 699 of file actctx.c.

Referenced by get_gif_loopcount(), parse_assembly_elem(), and parse_compatibility_elem().

◆ asmv1W

const WCHAR asmv1W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','1',0}
static

◆ asmv2W

const WCHAR asmv2W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','2',0}
static

Definition at line 560 of file actctx.c.

Referenced by parse_file_elem(), and xml_elem_cmp().

◆ asmv3W

const WCHAR asmv3W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','3',0}
static

Definition at line 561 of file actctx.c.

Referenced by parse_application_elem(), parse_assembly_elem(), and xml_elem_cmp().

◆ assemblyIdentityW

const WCHAR assemblyIdentityW[] = {'a','s','s','e','m','b','l','y','I','d','e','n','t','i','t','y',0}
static

Definition at line 618 of file actctx.c.

Referenced by parse_assembly_elem(), and parse_dependent_assembly_elem().

◆ assemblyW

const WCHAR assemblyW[] = {'a','s','s','e','m','b','l','y',0}
static

Definition at line 617 of file actctx.c.

Referenced by parse_manifest_buffer().

◆ autoElevateW

const WCHAR autoElevateW[] = {'a','u','t','o','E','l','e','v','a','t','e',0}
static

Definition at line 707 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ baseInterfaceW

const WCHAR baseInterfaceW[] = {'b','a','s','e','I','n','t','e','r','f','a','c','e',0}
static

◆ bindingRedirectW

const WCHAR bindingRedirectW[] = {'b','i','n','d','i','n','g','R','e','d','i','r','e','c','t',0}
static

Definition at line 619 of file actctx.c.

Referenced by parse_dependent_assembly_elem().

◆ canlinkbyole1W

const WCHAR canlinkbyole1W[] = {'c','a','n','l','i','n','k','b','y','o','l','e','1',0}
static

Definition at line 679 of file actctx.c.

◆ cantlinkinsideW

const WCHAR cantlinkinsideW[] = {'c','a','n','t','l','i','n','k','i','n','s','i','d','e',0}
static

Definition at line 680 of file actctx.c.

◆ clrClassW

const WCHAR clrClassW[] = {'c','l','r','C','l','a','s','s',0}
static

Definition at line 620 of file actctx.c.

Referenced by parse_assembly_elem().

◆ clrSurrogateW

const WCHAR clrSurrogateW[] = {'c','l','r','S','u','r','r','o','g','a','t','e',0}
static

Definition at line 621 of file actctx.c.

Referenced by parse_assembly_elem().

◆ clsidW

const WCHAR clsidW[] = {'c','l','s','i','d',0}
static

Definition at line 635 of file actctx.c.

Referenced by parse_clr_class_elem(), parse_clr_surrogate_elem(), and parse_com_class_elem().

◆ comClassW

const WCHAR comClassW[] = {'c','o','m','C','l','a','s','s',0}
static

Definition at line 622 of file actctx.c.

Referenced by parse_file_elem().

◆ comInterfaceExternalProxyStubW

const WCHAR comInterfaceExternalProxyStubW[] = {'c','o','m','I','n','t','e','r','f','a','c','e','E','x','t','e','r','n','a','l','P','r','o','x','y','S','t','u','b',0}
static

Definition at line 623 of file actctx.c.

Referenced by parse_assembly_elem().

◆ comInterfaceProxyStubW

const WCHAR comInterfaceProxyStubW[] = {'c','o','m','I','n','t','e','r','f','a','c','e','P','r','o','x','y','S','t','u','b',0}
static

Definition at line 624 of file actctx.c.

Referenced by parse_file_elem().

◆ compatibilityNSW

const WCHAR compatibilityNSW[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','c','o','m','p','a','t','i','b','i','l','i','t','y','.','v','1',0}
static

◆ compatibilityW

const WCHAR compatibilityW[] = {'c','o','m','p','a','t','i','b','i','l','i','t','y',0}
static

Definition at line 697 of file actctx.c.

Referenced by parse_assembly_elem().

◆ controlW

◆ current_archW

const WCHAR current_archW[] = {'n','o','n','e',0}
static

Definition at line 556 of file actctx.c.

Referenced by parse_dependent_assembly_elem().

◆ dependencyW

const WCHAR dependencyW[] = {'d','e','p','e','n','d','e','n','c','y',0}
static

Definition at line 625 of file actctx.c.

Referenced by parse_assembly_elem().

◆ dependentAssemblyW

const WCHAR dependentAssemblyW[] = {'d','e','p','e','n','d','e','n','t','A','s','s','e','m','b','l','y',0}
static

Definition at line 626 of file actctx.c.

Referenced by parse_dependency_elem().

◆ descriptionW

const WCHAR descriptionW[] = {'d','e','s','c','r','i','p','t','i','o','n',0}
static

Definition at line 627 of file actctx.c.

Referenced by parse_assembly_elem(), and parse_com_class_elem().

◆ disableThemingW

const WCHAR disableThemingW[] = {'d','i','s','a','b','l','e','T','h','e','m','i','n','g',0}
static

Definition at line 708 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ disableWindowFilteringW

const WCHAR disableWindowFilteringW[] = {'d','i','s','a','b','l','e','W','i','n','d','o','w','F','i','l','t','e','r','i','n','g',0}
static

Definition at line 709 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ dotManifestW

const WCHAR dotManifestW[] = {'.','m','a','n','i','f','e','s','t',0}
static

Definition at line 760 of file actctx.c.

Referenced by find_actctx_dll(), get_manifest_in_associated_manifest(), and lookup_assembly().

◆ dpiAwarenessW

const WCHAR dpiAwarenessW[] = {'d','p','i','A','w','a','r','e','n','e','s','s',0}
static

Definition at line 715 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ dpiAwareW

const WCHAR dpiAwareW[] = {'d','p','i','A','w','a','r','e',0}
static

Definition at line 714 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ empty_xmlstr

const xmlstr_t empty_xmlstr
static

Definition at line 545 of file actctx.c.

Referenced by find_xmlns(), push_xmlns(), and read_xml_elem().

◆ fileW

const WCHAR fileW[] = {'f','i','l','e',0}
static

Definition at line 628 of file actctx.c.

Referenced by parse_assembly_elem().

◆ flagsW

const WCHAR flagsW[] = {'f','l','a','g','s',0}
static

Definition at line 661 of file actctx.c.

Referenced by parse_typelib_elem().

◆ g_nameW

◆ g_xmlW

const WCHAR g_xmlW[] = {'?','x','m','l',0}
static

Definition at line 755 of file actctx.c.

Referenced by parse_manifest_buffer().

◆ gdiScalingW

const WCHAR gdiScalingW[] = {'g','d','i','S','c','a','l','i','n','g',0}
static

Definition at line 716 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ hasdiskimageW

const WCHAR hasdiskimageW[] = {'H','A','S','D','I','S','K','I','M','A','G','E',0}
static

Definition at line 660 of file actctx.c.

Referenced by parse_typelib_flags().

◆ hashalgW

const WCHAR hashalgW[] = {'h','a','s','h','a','l','g',0}
static

Definition at line 636 of file actctx.c.

Referenced by parse_file_elem().

◆ hashW

const WCHAR hashW[] = {'h','a','s','h',0}
static

Definition at line 629 of file actctx.c.

Referenced by parse_file_elem().

◆ helpdirW

const WCHAR helpdirW[] = {'h','e','l','p','d','i','r',0}
static

Definition at line 637 of file actctx.c.

Referenced by parse_typelib_elem().

◆ hiddenW

const WCHAR hiddenW[] = {'H','I','D','D','E','N',0}
static

Definition at line 659 of file actctx.c.

Referenced by parse_typelib_flags().

◆ highResolutionScrollingAwareW

const WCHAR highResolutionScrollingAwareW[] = {'h','i','g','h','R','e','s','o','l','u','t','i','o','n','S','c','r','o','l','l','i','n','g','A','w','a','r','e',0}
static

Definition at line 717 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ IdW

const WCHAR IdW[] = {'I','d',0}
static

Definition at line 701 of file actctx.c.

Referenced by parse_supportedos_elem().

◆ ignoreactivatewhenvisibleW

const WCHAR ignoreactivatewhenvisibleW[] = {'i','g','n','o','r','e','a','c','t','i','v','a','t','e','w','h','e','n','v','i','s','i','b','l','e',0}
static

Definition at line 681 of file actctx.c.

◆ iidW

const WCHAR iidW[] = {'i','i','d',0}
static

◆ imemodeW

const WCHAR imemodeW[] = {'i','m','e','m','o','d','e',0}
static

Definition at line 682 of file actctx.c.

◆ implicit_actctx

ACTIVATION_CONTEXT* implicit_actctx = &system_actctx.ActivationContext
static

◆ insertnotreplaceW

const WCHAR insertnotreplaceW[] = {'i','n','s','e','r','t','n','o','t','r','e','p','l','a','c','e',0}
static

Definition at line 683 of file actctx.c.

◆ insideoutW

const WCHAR insideoutW[] = {'i','n','s','i','d','e','o','u','t',0}
static

Definition at line 684 of file actctx.c.

◆ invisibleatruntimeW

const WCHAR invisibleatruntimeW[] = {'i','n','v','i','s','i','b','l','e','a','t','r','u','n','t','i','m','e',0}
static

Definition at line 685 of file actctx.c.

◆ islinkobjectW

const WCHAR islinkobjectW[] = {'i','s','l','i','n','k','o','b','j','e','c','t',0}
static

Definition at line 686 of file actctx.c.

◆ languageW

const WCHAR languageW[] = {'l','a','n','g','u','a','g','e',0}
static

Definition at line 639 of file actctx.c.

Referenced by parse_assembly_identity_elem().

◆ longPathAwareW

const WCHAR longPathAwareW[] = {'l','o','n','g','P','a','t','h','A','w','a','r','e',0}
static

Definition at line 718 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ magicFutureSettingW

const WCHAR magicFutureSettingW[] = {'m','a','g','i','c','F','u','t','u','r','e','S','e','t','t','i','n','g',0}
static

Definition at line 719 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ manifestv1W

const WCHAR manifestv1W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','1',0}
static

Definition at line 756 of file actctx.c.

◆ manifestv2W

const WCHAR manifestv2W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','2',0}
static

Definition at line 757 of file actctx.c.

◆ manifestv3W

const WCHAR manifestv3W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','3',0}
static

Definition at line 758 of file actctx.c.

◆ manifestVersionW

const WCHAR manifestVersionW[] = {'m','a','n','i','f','e','s','t','V','e','r','s','i','o','n',0}
static

Definition at line 640 of file actctx.c.

Referenced by parse_assembly_elem().

◆ miscstatuscontentW

const WCHAR miscstatuscontentW[] = {'m','i','s','c','S','t','a','t','u','s','C','o','n','t','e','n','t',0}
static

Definition at line 664 of file actctx.c.

Referenced by parse_com_class_elem().

◆ miscstatusdocprintW

const WCHAR miscstatusdocprintW[] = {'m','i','s','c','S','t','a','t','u','s','D','o','c','P','r','i','n','t',0}
static

Definition at line 666 of file actctx.c.

Referenced by parse_com_class_elem().

◆ miscstatusiconW

const WCHAR miscstatusiconW[] = {'m','i','s','c','S','t','a','t','u','s','I','c','o','n',0}
static

Definition at line 663 of file actctx.c.

Referenced by parse_com_class_elem().

◆ miscstatusthumbnailW

const WCHAR miscstatusthumbnailW[] = {'m','i','s','c','S','t','a','t','u','s','T','h','u','m','b','n','a','i','l',0}
static

Definition at line 665 of file actctx.c.

Referenced by parse_com_class_elem().

◆ miscstatusW

const WCHAR miscstatusW[] = {'m','i','s','c','S','t','a','t','u','s',0}
static

Definition at line 662 of file actctx.c.

Referenced by OleRegGetMiscStatus(), and parse_com_class_elem().

◆ mscoree2W

const WCHAR mscoree2W[] = {'m','s','c','o','r','e','e','.','d','l','l',0}
static

◆ mscoreeW

const WCHAR mscoreeW[] = {'M','S','C','O','R','E','E','.','D','L','L',0}
static

◆ neutralW

const WCHAR neutralW[] = {'n','e','u','t','r','a','l',0}
static

Definition at line 642 of file actctx.c.

Referenced by lookup_manifest_file(), and parse_com_class_threadingmodel().

◆ newVersionW

const WCHAR newVersionW[] = {'n','e','w','V','e','r','s','i','o','n',0}
static

Definition at line 643 of file actctx.c.

Referenced by parse_binding_redirect_elem().

◆ noInheritableW

const WCHAR noInheritableW[] = {'n','o','I','n','h','e','r','i','t','a','b','l','e',0}
static

Definition at line 631 of file actctx.c.

Referenced by parse_assembly_elem().

◆ noInheritW

const WCHAR noInheritW[] = {'n','o','I','n','h','e','r','i','t',0}
static

Definition at line 630 of file actctx.c.

Referenced by parse_assembly_elem().

◆ nouiactivateW

const WCHAR nouiactivateW[] = {'n','o','u','i','a','c','t','i','v','a','t','e',0}
static

Definition at line 687 of file actctx.c.

◆ noW

const WCHAR noW[] = {'n','o',0}
static

Definition at line 656 of file actctx.c.

Referenced by parse_window_class_elem().

◆ nummethodsW

const WCHAR nummethodsW[] = {'n','u','m','M','e','t','h','o','d','s',0}
static

◆ oldVersionW

const WCHAR oldVersionW[] = {'o','l','d','V','e','r','s','i','o','n',0}
static

Definition at line 644 of file actctx.c.

Referenced by parse_binding_redirect_elem().

◆ olemisc_values

const struct olemisc_entry olemisc_values[]
static
Initial value:
=
{
{ activatewhenvisibleW, OLEMISC_ACTIVATEWHENVISIBLE },
{ actslikebuttonW, OLEMISC_ACTSLIKEBUTTON },
{ actslikelabelW, OLEMISC_ACTSLIKELABEL },
{ alignableW, OLEMISC_ALIGNABLE },
{ alwaysrunW, OLEMISC_ALWAYSRUN },
{ canlinkbyole1W, OLEMISC_CANLINKBYOLE1 },
{ cantlinkinsideW, OLEMISC_CANTLINKINSIDE },
{ ignoreactivatewhenvisibleW, OLEMISC_IGNOREACTIVATEWHENVISIBLE },
{ imemodeW, OLEMISC_IMEMODE },
{ insertnotreplaceW, OLEMISC_INSERTNOTREPLACE },
{ insideoutW, OLEMISC_INSIDEOUT },
{ invisibleatruntimeW, OLEMISC_INVISIBLEATRUNTIME },
{ islinkobjectW, OLEMISC_ISLINKOBJECT },
{ nouiactivateW, OLEMISC_NOUIACTIVATE },
{ onlyiconicW, OLEMISC_ONLYICONIC },
{ recomposeonresizeW, OLEMISC_RECOMPOSEONRESIZE },
{ renderingisdeviceindependentW, OLEMISC_RENDERINGISDEVICEINDEPENDENT },
{ setclientsitefirstW, OLEMISC_SETCLIENTSITEFIRST },
{ simpleframeW, OLEMISC_SIMPLEFRAME },
{ staticW, OLEMISC_STATIC },
{ supportsmultilevelundoW, OLEMISC_SUPPORTSMULTILEVELUNDO },
{ wantstomenumergeW, OLEMISC_WANTSTOMENUMERGE }
}
static const WCHAR alignableW[]
Definition: actctx.c:677
static const WCHAR nouiactivateW[]
Definition: actctx.c:687
static const WCHAR supportsmultilevelundoW[]
Definition: actctx.c:694
static const WCHAR activatewhenvisibleW[]
Definition: actctx.c:674
static const WCHAR actslikelabelW[]
Definition: actctx.c:676
static const WCHAR insideoutW[]
Definition: actctx.c:684
static const WCHAR staticW[]
Definition: actctx.c:693
static const WCHAR cantlinkinsideW[]
Definition: actctx.c:680
static const WCHAR canlinkbyole1W[]
Definition: actctx.c:679
static const WCHAR imemodeW[]
Definition: actctx.c:682
static const WCHAR actslikebuttonW[]
Definition: actctx.c:675
static const WCHAR recomposeonresizeW[]
Definition: actctx.c:689
static const WCHAR ignoreactivatewhenvisibleW[]
Definition: actctx.c:681
static const WCHAR islinkobjectW[]
Definition: actctx.c:686
static const WCHAR simpleframeW[]
Definition: actctx.c:692
static const WCHAR wantstomenumergeW[]
Definition: actctx.c:695
static const WCHAR invisibleatruntimeW[]
Definition: actctx.c:685
static const WCHAR onlyiconicW[]
Definition: actctx.c:688
static const WCHAR alwaysrunW[]
Definition: actctx.c:678
static const WCHAR renderingisdeviceindependentW[]
Definition: actctx.c:690
static const WCHAR insertnotreplaceW[]
Definition: actctx.c:683
static const WCHAR setclientsitefirstW[]
Definition: actctx.c:691

Definition at line 729 of file actctx.c.

Referenced by get_olemisc_value().

◆ onlyiconicW

const WCHAR onlyiconicW[] = {'o','n','l','y','i','c','o','n','i','c',0}
static

Definition at line 688 of file actctx.c.

◆ optionalW

const WCHAR optionalW[] = {'o','p','t','i','o','n','a','l',0}
static

Definition at line 645 of file actctx.c.

Referenced by parse_dependency_elem().

◆ printerDriverIsolationW

const WCHAR printerDriverIsolationW[] = {'p','r','i','n','t','e','r','D','r','i','v','e','r','I','s','o','l','a','t','i','o','n',0}
static

Definition at line 720 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ process_actctx

ACTIVATION_CONTEXT* process_actctx = &system_actctx.ActivationContext
static

◆ processorArchitectureW

const WCHAR processorArchitectureW[] = {'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e',0}
static

Definition at line 646 of file actctx.c.

Referenced by parse_assembly_identity_elem().

◆ progidW

const WCHAR progidW[] = {'p','r','o','g','i','d',0}
static

Definition at line 647 of file actctx.c.

◆ proxyStubClsid32W

const WCHAR proxyStubClsid32W[] = {'p','r','o','x','y','S','t','u','b','C','l','s','i','d','3','2',0}
static

◆ publicKeyTokenW

const WCHAR publicKeyTokenW[] = {'p','u','b','l','i','c','K','e','y','T','o','k','e','n',0}
static

Definition at line 648 of file actctx.c.

Referenced by parse_assembly_identity_elem().

◆ recomposeonresizeW

const WCHAR recomposeonresizeW[] = {'r','e','c','o','m','p','o','s','e','o','n','r','e','s','i','z','e',0}
static

Definition at line 689 of file actctx.c.

◆ renderingisdeviceindependentW

const WCHAR renderingisdeviceindependentW[] = {'r','e','n','d','e','r','i','n','g','i','s','d','e','v','i','c','e','i','n','d','e','p','e','n','d','e','n','t',0}
static

Definition at line 690 of file actctx.c.

◆ requestedExecutionLevelW

const WCHAR requestedExecutionLevelW[] = {'r','e','q','u','e','s','t','e','d','E','x','e','c','u','t','i','o','n','L','e','v','e','l',0}
static

Definition at line 702 of file actctx.c.

Referenced by parse_requested_privileges_elem().

◆ requestedPrivilegesW

const WCHAR requestedPrivilegesW[] = {'r','e','q','u','e','s','t','e','d','P','r','i','v','i','l','e','g','e','s',0}
static

Definition at line 703 of file actctx.c.

Referenced by parse_security_elem().

◆ restrictedW

const WCHAR restrictedW[] = {'R','E','S','T','R','I','C','T','E','D',0}
static

Definition at line 657 of file actctx.c.

Referenced by parse_typelib_flags().

◆ RtlpNotAllowingMultipleActivation

BOOLEAN RtlpNotAllowingMultipleActivation

Definition at line 26 of file actctx.c.

Referenced by RtlActivateActivationContextUnsafeFast().

◆ runtimeVersionW

const WCHAR runtimeVersionW[] = {'r','u','n','t','i','m','e','V','e','r','s','i','o','n',0}
static

Definition at line 670 of file actctx.c.

Referenced by parse_clr_class_elem(), and parse_clr_surrogate_elem().

◆ securityW

const WCHAR securityW[] = {'s','e','c','u','r','i','t','y',0}
static

Definition at line 704 of file actctx.c.

Referenced by parse_trust_info_elem().

◆ setclientsitefirstW

const WCHAR setclientsitefirstW[] = {'s','e','t','c','l','i','e','n','t','s','i','t','e','f','i','r','s','t',0}
static

Definition at line 691 of file actctx.c.

◆ simpleframeW

const WCHAR simpleframeW[] = {'s','i','m','p','l','e','f','r','a','m','e',0}
static

Definition at line 692 of file actctx.c.

◆ staticW

const WCHAR staticW[] = {'s','t','a','t','i','c',0}
static

Definition at line 693 of file actctx.c.

Referenced by test_GetClassInfo(), and test_PostMessage().

◆ supportedOSW

const WCHAR supportedOSW[] = {'s','u','p','p','o','r','t','e','d','O','S',0}
static

Definition at line 700 of file actctx.c.

Referenced by parse_compatibility_application_elem().

◆ supportsmultilevelundoW

const WCHAR supportsmultilevelundoW[] = {'s','u','p','p','o','r','t','s','m','u','l','t','i','l','e','v','e','l','u','n','d','o',0}
static

Definition at line 694 of file actctx.c.

◆ system_actctx

ACTIVATION_CONTEXT_WRAPPED system_actctx = { ACTCTX_MAGIC_MARKER, { 1 } }
static

Definition at line 764 of file actctx.c.

◆ threadingmodelW

const WCHAR threadingmodelW[] = {'t','h','r','e','a','d','i','n','g','M','o','d','e','l',0}
static

◆ tlbidW

◆ trustInfoW

const WCHAR trustInfoW[] = {'t','r','u','s','t','I','n','f','o',0}
static

Definition at line 705 of file actctx.c.

Referenced by parse_assembly_elem().

◆ typelibW

const WCHAR typelibW[] = {'t','y','p','e','l','i','b',0}
static

◆ typeW

const WCHAR typeW[] = {'t','y','p','e',0}
static

Definition at line 651 of file actctx.c.

Referenced by parse_assembly_identity_elem().

◆ ultraHighResolutionScrollingAwareW

const WCHAR ultraHighResolutionScrollingAwareW[] = {'u','l','t','r','a','H','i','g','h','R','e','s','o','l','u','t','i','o','n','S','c','r','o','l','l','i','n','g','A','w','a','r','e',0}
static

Definition at line 721 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ version_formatW

const WCHAR version_formatW[] = {'%','u','.','%','u','.','%','u','.','%','u',0}
static

Definition at line 761 of file actctx.c.

Referenced by build_assembly_dir(), and build_assembly_id().

◆ versionedW

const WCHAR versionedW[] = {'v','e','r','s','i','o','n','e','d',0}
static

Definition at line 654 of file actctx.c.

Referenced by parse_window_class_elem().

◆ versionW

const WCHAR versionW[] = {'v','e','r','s','i','o','n',0}
static

Definition at line 652 of file actctx.c.

◆ wantstomenumergeW

const WCHAR wantstomenumergeW[] = {'w','a','n','t','s','t','o','m','e','n','u','m','e','r','g','e',0}
static

Definition at line 695 of file actctx.c.

◆ wildcardW

◆ windowClassW

const WCHAR windowClassW[] = {'w','i','n','d','o','w','C','l','a','s','s',0}
static

Definition at line 633 of file actctx.c.

Referenced by AddIndexPopup(), HH_CreateHelpWindow(), and parse_file_elem().

◆ windowsSettings2005NSW

const WCHAR windowsSettings2005NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','0','5','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}
static

Definition at line 710 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ windowsSettings2011NSW

const WCHAR windowsSettings2011NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','1','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}
static

Definition at line 711 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ windowsSettings2016NSW

const WCHAR windowsSettings2016NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','6','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}
static

Definition at line 712 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ windowsSettings2017NSW

const WCHAR windowsSettings2017NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','7','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}
static

Definition at line 713 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ windowsSettingsW

const WCHAR windowsSettingsW[] = {'w','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}
static

Definition at line 706 of file actctx.c.

Referenced by parse_application_elem().

◆ xmlnsW

const WCHAR xmlnsW[] = {'x','m','l','n','s',0}
static

Definition at line 653 of file actctx.c.

Referenced by is_xmlns_attr(), and push_xmlns().

◆ yesW

const WCHAR yesW[] = {'y','e','s',0}
static

Definition at line 655 of file actctx.c.

Referenced by parse_dependency_elem(), and parse_window_class_elem().