ReactOS 0.4.15-dev-8002-gbbb3b00
actctx.c File Reference

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  _ACTIVATION_CONTEXT
 
struct  actctx_loader
 
struct  olemisc_entry
 

Macros

#define ACTCTX_FLAGS_ALL
 
#define ACTCTX_MAGIC   0xC07E3E11
 
#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 RT_MANIFEST   ((ULONG_PTR)24)
 
#define CREATEPROCESS_MANIFEST_RESOURCE_ID   ((ULONG_PTR)1)
 
#define MAX_NAMESPACES   64
 

Typedefs

typedef enum tagLIBFLAGS LIBFLAGS
 
typedef enum tagOLEMISC OLEMISC
 
typedef struct _ACTIVATION_CONTEXT ACTIVATION_CONTEXT
 
typedef struct _ACTIVATION_CONTEXTPIACTIVATION_CONTEXT
 

Enumerations

enum  tagLIBFLAGS { LIBFLAG_FRESTRICTED = 0x1 , LIBFLAG_FCONTROL = 0x2 , LIBFLAG_FHIDDEN = 0x4 , LIBFLAG_FHASDISKIMAGE = 0x8 }
 
enum  tagOLEMISC {
  OLEMISC_RECOMPOSEONRESIZE = 0x1 , OLEMISC_ONLYICONIC = 0x2 , OLEMISC_INSERTNOTREPLACE = 0x4 , OLEMISC_STATIC = 0x8 ,
  OLEMISC_CANTLINKINSIDE = 0x10 , OLEMISC_CANLINKBYOLE1 = 0x20 , OLEMISC_ISLINKOBJECT = 0x40 , OLEMISC_INSIDEOUT = 0x80 ,
  OLEMISC_ACTIVATEWHENVISIBLE = 0x100 , OLEMISC_RENDERINGISDEVICEINDEPENDENT = 0x200 , OLEMISC_INVISIBLEATRUNTIME = 0x400 , OLEMISC_ALWAYSRUN = 0x800 ,
  OLEMISC_ACTSLIKEBUTTON = 0x1000 , OLEMISC_ACTSLIKELABEL = 0x2000 , OLEMISC_NOUIACTIVATE = 0x4000 , OLEMISC_ALIGNABLE = 0x8000 ,
  OLEMISC_SIMPLEFRAME = 0x10000 , OLEMISC_SETCLIENTSITEFIRST = 0x20000 , OLEMISC_IMEMODE = 0x40000 , OLEMISC_IGNOREACTIVATEWHENVISIBLE = 0x80000 ,
  OLEMISC_WANTSTOMENUMERGE = 0x100000 , OLEMISC_SUPPORTSMULTILEVELUNDO = 0x200000
}
 
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

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 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 const chardebugstr_xmlstr (const xmlstr_t *str)
 
static const chardebugstr_version (const struct assembly_version *ver)
 
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, unsigned int 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)
 
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 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 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 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 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 NTSTATUS add_ifaceps_record (struct guidsection_header *section, struct entity_array *entities, struct guid_index **index, ULONG *data_offset, ULONG rosterindex)
 
static 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 NTSTATUS find_cominterface_redirection (ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
 
static 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 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 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 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 WINAPI RtlAddRefActivationContext (HANDLE handle)
 
void WINAPI RtlReleaseActivationContext (HANDLE handle)
 
NTSTATUS WINAPI RtlZombifyActivationContext (HANDLE handle)
 
NTSTATUS NTAPI RtlActivateActivationContextEx (ULONG flags, PTEB tebAddress, HANDLE handle, PULONG_PTR cookie)
 
NTSTATUS NTAPI RtlActivateActivationContext (ULONG flags, HANDLE handle, PULONG_PTR cookie)
 
NTSTATUS WINAPI RtlDeactivateActivationContext (ULONG flags, ULONG_PTR cookie)
 
void WINAPI RtlFreeThreadActivationContextStack (void)
 
NTSTATUS WINAPI RtlGetActiveActivationContext (HANDLE *handle)
 
BOOLEAN WINAPI RtlIsActivationContextActive (HANDLE handle)
 
NTSTATUS WINAPI RtlQueryInformationActivationContext (ULONG flags, HANDLE handle, PVOID subinst, ULONG class, PVOID buffer, SIZE_T bufsize, SIZE_T *retlen)
 
NTSTATUS WINAPI 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)
 

Variables

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

◆ ACTCTX_FAKE_HANDLE

#define ACTCTX_FAKE_HANDLE   ((HANDLE) 0xf00baa)

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

◆ ACTCTX_MAGIC

#define ACTCTX_MAGIC   0xC07E3E11

Definition at line 55 of file actctx.c.

◆ ACTCTX_MAGIC_MARKER

#define ACTCTX_MAGIC_MARKER   (PVOID)'gMcA'

Definition at line 59 of file actctx.c.

◆ CREATEPROCESS_MANIFEST_RESOURCE_ID

#define CREATEPROCESS_MANIFEST_RESOURCE_ID   ((ULONG_PTR)1)

Definition at line 66 of file actctx.c.

◆ GUIDSECTION_MAGIC

#define GUIDSECTION_MAGIC   0x64487347 /* dHsG */

Definition at line 57 of file actctx.c.

◆ MAX_NAMESPACES

#define MAX_NAMESPACES   64

Definition at line 105 of file actctx.c.

◆ RT_MANIFEST

#define RT_MANIFEST   ((ULONG_PTR)24)

Definition at line 65 of file actctx.c.

◆ STRSECTION_MAGIC

#define STRSECTION_MAGIC   0x64487353 /* dHsS */

Definition at line 56 of file actctx.c.

Typedef Documentation

◆ ACTIVATION_CONTEXT

◆ LIBFLAGS

◆ OLEMISC

◆ PIACTIVATION_CONTEXT

Enumeration Type Documentation

◆ assembly_type

Enumerator
APPLICATION_MANIFEST 
ASSEMBLY_MANIFEST 
ASSEMBLY_SHARED_MANIFEST 

Definition at line 517 of file actctx.c.

518{
522};
@ APPLICATION_MANIFEST
Definition: actctx.c:519
@ ASSEMBLY_SHARED_MANIFEST
Definition: actctx.c:521
@ ASSEMBLY_MANIFEST
Definition: actctx.c:520

◆ comclass_miscfields

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

Definition at line 243 of file actctx.c.

244{
245 MiscStatus = 1,
246 MiscStatusIcon = 2,
250};
@ 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 234 of file actctx.c.

235{
241};
@ 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 541 of file actctx.c.

542{
550};
@ SERVERREDIRECT_SECTION
Definition: actctx.c:546
@ IFACEREDIRECT_SECTION
Definition: actctx.c:547
@ CLRSURROGATES_SECTION
Definition: actctx.c:548
@ PROGIDREDIRECT_SECTION
Definition: actctx.c:549
@ TLIBREDIRECT_SECTION
Definition: actctx.c:545
@ WINDOWCLASS_SECTION
Definition: actctx.c:543
@ DLLREDIRECT_SECTION
Definition: actctx.c:544

◆ ifaceps_mask

Enumerator
NumMethods 
BaseIface 
NumMethods 
BaseIface 

Definition at line 276 of file actctx.c.

277{
278 NumMethods = 1,
279 BaseIface = 2
280};
@ BaseIface
Definition: actctx.c:1557
@ NumMethods
Definition: actctx.c:1556

◆ tagLIBFLAGS

Enumerator
LIBFLAG_FRESTRICTED 
LIBFLAG_FCONTROL 
LIBFLAG_FHIDDEN 
LIBFLAG_FHASDISKIMAGE 

Definition at line 70 of file actctx.c.

70 {
72 LIBFLAG_FCONTROL = 0x2,
73 LIBFLAG_FHIDDEN = 0x4,
75} LIBFLAGS;
enum tagLIBFLAGS LIBFLAGS
@ LIBFLAG_FRESTRICTED
Definition: actctx.c:71
@ LIBFLAG_FHASDISKIMAGE
Definition: actctx.c:74
@ LIBFLAG_FCONTROL
Definition: actctx.c:72
@ LIBFLAG_FHIDDEN
Definition: actctx.c:73

◆ tagOLEMISC

Enumerator
OLEMISC_RECOMPOSEONRESIZE 
OLEMISC_ONLYICONIC 
OLEMISC_INSERTNOTREPLACE 
OLEMISC_STATIC 
OLEMISC_CANTLINKINSIDE 
OLEMISC_CANLINKBYOLE1 
OLEMISC_ISLINKOBJECT 
OLEMISC_INSIDEOUT 
OLEMISC_ACTIVATEWHENVISIBLE 
OLEMISC_RENDERINGISDEVICEINDEPENDENT 
OLEMISC_INVISIBLEATRUNTIME 
OLEMISC_ALWAYSRUN 
OLEMISC_ACTSLIKEBUTTON 
OLEMISC_ACTSLIKELABEL 
OLEMISC_NOUIACTIVATE 
OLEMISC_ALIGNABLE 
OLEMISC_SIMPLEFRAME 
OLEMISC_SETCLIENTSITEFIRST 
OLEMISC_IMEMODE 
OLEMISC_IGNOREACTIVATEWHENVISIBLE 
OLEMISC_WANTSTOMENUMERGE 
OLEMISC_SUPPORTSMULTILEVELUNDO 

Definition at line 78 of file actctx.c.

79{
83 OLEMISC_STATIC = 0x8,
87 OLEMISC_INSIDEOUT = 0x80,
91 OLEMISC_ALWAYSRUN = 0x800,
93 OLEMISC_ACTSLIKELABEL = 0x2000,
94 OLEMISC_NOUIACTIVATE = 0x4000,
95 OLEMISC_ALIGNABLE = 0x8000,
96 OLEMISC_SIMPLEFRAME = 0x10000,
98 OLEMISC_IMEMODE = 0x40000,
100 OLEMISC_WANTSTOMENUMERGE = 0x100000,
102} OLEMISC;
@ OLEMISC_INSIDEOUT
Definition: actctx.c:87
@ OLEMISC_ACTIVATEWHENVISIBLE
Definition: actctx.c:88
@ OLEMISC_RENDERINGISDEVICEINDEPENDENT
Definition: actctx.c:89
@ OLEMISC_ACTSLIKEBUTTON
Definition: actctx.c:92
@ OLEMISC_WANTSTOMENUMERGE
Definition: actctx.c:100
@ OLEMISC_IGNOREACTIVATEWHENVISIBLE
Definition: actctx.c:99
@ OLEMISC_INSERTNOTREPLACE
Definition: actctx.c:82
@ OLEMISC_IMEMODE
Definition: actctx.c:98
@ OLEMISC_CANLINKBYOLE1
Definition: actctx.c:85
@ OLEMISC_ALIGNABLE
Definition: actctx.c:95
@ OLEMISC_ALWAYSRUN
Definition: actctx.c:91
@ OLEMISC_SETCLIENTSITEFIRST
Definition: actctx.c:97
@ OLEMISC_ISLINKOBJECT
Definition: actctx.c:86
@ OLEMISC_NOUIACTIVATE
Definition: actctx.c:94
@ OLEMISC_SUPPORTSMULTILEVELUNDO
Definition: actctx.c:101
@ OLEMISC_SIMPLEFRAME
Definition: actctx.c:96
@ OLEMISC_ONLYICONIC
Definition: actctx.c:81
@ OLEMISC_ACTSLIKELABEL
Definition: actctx.c:93
@ OLEMISC_INVISIBLEATRUNTIME
Definition: actctx.c:90
@ OLEMISC_RECOMPOSEONRESIZE
Definition: actctx.c:80
@ OLEMISC_STATIC
Definition: actctx.c:83
@ OLEMISC_CANTLINKINSIDE
Definition: actctx.c:84
enum tagOLEMISC OLEMISC

Function Documentation

◆ actctx_addref()

static void actctx_addref ( ACTIVATION_CONTEXT actctx)
inlinestatic

Definition at line 1251 of file actctx.c.

1252{
1253 InterlockedExchangeAdd( &actctx->RefCount, 1 );
1254}
#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 5113 of file actctx.c.

5114{
5115 ACTCTXW ctx;
5116 HANDLE handle;
5117 WCHAR buffer[1024];
5119
5120 ctx.cbSize = sizeof(ctx);
5121 ctx.lpSource = NULL;
5122 ctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
5123 ctx.hModule = NtCurrentTeb()->ProcessEnvironmentBlock->ImageBaseAddress;
5125
5127 {
5129 }
5130
5131 /* ReactOS specific:
5132 Now that we have found the process_actctx we can initialize the process compat subsystem */
5134
5135
5136 ctx.dwFlags = 0;
5137 ctx.hModule = NULL;
5138 ctx.lpResourceName = NULL;
5139 ctx.lpSource = buffer;
5141 RtlStringCchCatW(buffer, RTL_NUMBER_OF(buffer), L"\\winsxs\\manifests\\systemcompatible.manifest");
5142
5144 if (NT_SUCCESS(Status))
5145 {
5147 }
5148 else
5149 {
5150 DPRINT1("Failed to create the implicit act ctx. Status: 0x%x!!!\n", Status);
5151 }
5152}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#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:831
static ACTIVATION_CONTEXT * process_actctx
Definition: actctx.c:830
#define CREATEPROCESS_MANIFEST_RESOURCE_ID
Definition: actctx.c:66
static ACTIVATION_CONTEXT * check_actctx(HANDLE h)
Definition: actctx.c:1229
__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 1256 of file actctx.c.

1257{
1258 PACTIVATION_CONTEXT_WRAPPED pActual;
1259
1260 if (InterlockedExchangeAdd(&actctx->RefCount, -1) == 1)
1261 {
1262 unsigned int i, j;
1263
1264 for (i = 0; i < actctx->num_assemblies; i++)
1265 {
1266 struct assembly *assembly = &actctx->assemblies[i];
1267 for (j = 0; j < assembly->num_dlls; j++)
1268 {
1269 struct dll_redirect *dll = &assembly->dlls[j];
1270 free_entity_array( &dll->entities );
1271 RtlFreeHeap( GetProcessHeap(), 0, dll->name );
1272 RtlFreeHeap( GetProcessHeap(), 0, dll->hash );
1273 }
1280 }
1281 RtlFreeHeap( GetProcessHeap(), 0, actctx->config.info );
1282 RtlFreeHeap( GetProcessHeap(), 0, actctx->appdir.info );
1283 RtlFreeHeap( GetProcessHeap(), 0, actctx->assemblies );
1284 RtlFreeHeap( GetProcessHeap(), 0, actctx->dllredirect_section );
1285 RtlFreeHeap( GetProcessHeap(), 0, actctx->wndclass_section );
1286 RtlFreeHeap( GetProcessHeap(), 0, actctx->tlib_section );
1287 RtlFreeHeap( GetProcessHeap(), 0, actctx->comserver_section );
1288 RtlFreeHeap( GetProcessHeap(), 0, actctx->ifaceps_section );
1289 RtlFreeHeap( GetProcessHeap(), 0, actctx->clrsurrogate_section );
1290 RtlFreeHeap( GetProcessHeap(), 0, actctx->progid_section );
1291
1292 pActual = CONTAINING_RECORD(actctx, ACTIVATION_CONTEXT_WRAPPED, ActivationContext);
1293 pActual->MagicMarker = 0;
1294 RtlFreeHeap(GetProcessHeap(), 0, pActual);
1295 }
1296}
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
#define GetProcessHeap()
Definition: compat.h:736
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:1023
static void free_assembly_identity(struct assembly_identity *ai)
Definition: actctx.c:986
WCHAR * directory
Definition: actctx.c:529
struct dll_redirect * dlls
Definition: actctx.c:531
struct assembly_identity id
Definition: actctx.c:527
unsigned int num_dlls
Definition: actctx.c:532
struct file_info manifest
Definition: actctx.c:528
struct entity_array entities
Definition: actctx.c:534
COMPATIBILITY_CONTEXT_ELEMENT * compat_contexts
Definition: actctx.c:535
#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 910 of file actctx.c.

911{
912 struct assembly *assembly;
913
914 DPRINT("add_assembly() actctx %p, activeframe ??\n", actctx);
915
916 if (actctx->num_assemblies == actctx->allocated_assemblies)
917 {
918 void *ptr;
919 unsigned int new_count;
920 if (actctx->assemblies)
921 {
922 new_count = actctx->allocated_assemblies * 2;
924 actctx->assemblies, new_count * sizeof(*assembly) );
925 }
926 else
927 {
928 new_count = 4;
929 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*assembly) );
930 }
931 if (!ptr) return NULL;
932 actctx->assemblies = ptr;
933 actctx->allocated_assemblies = new_count;
934 }
935
936 assembly = &actctx->assemblies[actctx->num_assemblies++];
937 assembly->type = at;
938 return assembly;
939}
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 967 of file actctx.c.

968{
969 void *ptr;
971 {
972 unsigned int new_count = assembly->num_compat_contexts + 1;
975 new_count * sizeof(COMPATIBILITY_CONTEXT_ELEMENT) );
976 }
977 else
978 {
979 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(COMPATIBILITY_CONTEXT_ELEMENT) );
980 }
981 if (!ptr) return NULL;
984}
ULONG num_compat_contexts
Definition: actctx.c:536

Referenced by parse_supportedos_elem().

◆ add_comserver_record()

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

4152{
4153 unsigned int i;
4155
4156 for (i = 0; i < entities->num; i++)
4157 {
4158 struct entity *entity = &entities->base[i];
4159 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4160 {
4161 ULONG module_len, progid_len, str_len = 0;
4163 struct guid_index *alias_index;
4164 struct clrclass_data *clrdata;
4166 WCHAR *ptrW;
4167
4168 if (entity->u.comclass.progid)
4169 progid_len = strlenW(entity->u.comclass.progid)*sizeof(WCHAR);
4170 else
4171 progid_len = 0;
4172
4173 module_len = dll ? strlenW(dll->name)*sizeof(WCHAR) : strlenW(mscoreeW)*sizeof(WCHAR);
4174
4175 /* setup new index entry */
4177 Status = RtlGUIDFromString(&str, &(*index)->guid);
4178 if (!NT_SUCCESS(Status))
4179 return Status;
4180
4181 (*index)->data_offset = *data_offset;
4182 (*index)->data_len = sizeof(*data); /* additional length added later */
4183 (*index)->rosterindex = rosterindex;
4184
4185 /* Setup new index entry for alias guid. Alias index records are placed after
4186 normal records, so normal guids are hit first on search. Note that class count
4187 is doubled. */
4188 alias_index = (*index) + section->count/2;
4189 generate_uuid(seed, &alias_index->guid);
4190 alias_index->data_offset = (*index)->data_offset;
4191 alias_index->data_len = 0;
4192 alias_index->rosterindex = (*index)->rosterindex;
4193
4194 /* setup data */
4195 data = (struct comclassredirect_data*)((BYTE*)section + (*index)->data_offset);
4196 data->size = sizeof(*data);
4197 data->res = 0;
4198 data->res1[0] = 0;
4199 data->res1[1] = 0;
4200 data->model = entity->u.comclass.model;
4201 data->clsid = (*index)->guid;
4202 data->alias = alias_index->guid;
4203 data->clsid2 = data->clsid;
4204 if (entity->u.comclass.tlbid)
4205 {
4207 Status = RtlGUIDFromString(&str, &data->tlbid);
4208 if (!NT_SUCCESS(Status))
4209 return Status;
4210 }
4211 else
4212 memset(&data->tlbid, 0, sizeof(data->tlbid));
4213 data->name_len = module_len;
4214 data->name_offset = *module_offset;
4215 data->progid_len = progid_len;
4216 data->progid_offset = data->progid_len ? data->size : 0; /* in case of clrClass additional offset is added later */
4217 data->clrdata_len = 0; /* will be set later */
4218 data->clrdata_offset = entity->u.comclass.name ? sizeof(*data) : 0;
4219 data->miscstatus = entity->u.comclass.miscstatus;
4220 data->miscstatuscontent = entity->u.comclass.miscstatuscontent;
4221 data->miscstatusthumbnail = entity->u.comclass.miscstatusthumbnail;
4222 data->miscstatusicon = entity->u.comclass.miscstatusicon;
4223 data->miscstatusdocprint = entity->u.comclass.miscstatusdocprint;
4224
4225 /* mask describes which misc* data is available */
4226 data->miscmask = 0;
4227 if (data->miscstatus)
4228 data->miscmask |= MiscStatus;
4229 if (data->miscstatuscontent)
4230 data->miscmask |= MiscStatusContent;
4231 if (data->miscstatusthumbnail)
4232 data->miscmask |= MiscStatusThumbnail;
4233 if (data->miscstatusicon)
4234 data->miscmask |= MiscStatusIcon;
4235 if (data->miscstatusdocprint)
4236 data->miscmask |= MiscStatusDocPrint;
4237
4238 if (data->clrdata_offset)
4239 {
4240 clrdata = (struct clrclass_data*)((BYTE*)data + data->clrdata_offset);
4241
4242 clrdata->size = sizeof(*clrdata);
4243 clrdata->res[0] = 0;
4244 clrdata->res[1] = 2; /* FIXME: unknown field */
4245 clrdata->module_len = strlenW(mscoreeW)*sizeof(WCHAR);
4246 clrdata->module_offset = *module_offset + data->name_len + sizeof(WCHAR);
4247 clrdata->name_len = strlenW(entity->u.comclass.name)*sizeof(WCHAR);
4248 clrdata->name_offset = clrdata->size;
4249 clrdata->version_len = entity->u.comclass.version ? strlenW(entity->u.comclass.version)*sizeof(WCHAR) : 0;
4250 clrdata->version_offset = clrdata->version_len ? clrdata->name_offset + clrdata->name_len + sizeof(WCHAR) : 0;
4251 clrdata->res2[0] = 0;
4252 clrdata->res2[1] = 0;
4253
4254 data->clrdata_len = clrdata->size + clrdata->name_len + sizeof(WCHAR);
4255
4256 /* module name */
4257 ptrW = (WCHAR*)((BYTE*)section + clrdata->module_offset);
4258 memcpy(ptrW, mscoree2W, clrdata->module_len);
4259 ptrW[clrdata->module_len/sizeof(WCHAR)] = 0;
4260
4261 ptrW = (WCHAR*)((BYTE*)section + data->name_offset);
4262 memcpy(ptrW, mscoreeW, data->name_len);
4263 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4264
4265 /* class name */
4266 ptrW = (WCHAR*)((BYTE*)clrdata + clrdata->name_offset);
4267 memcpy(ptrW, entity->u.comclass.name, clrdata->name_len);
4268 ptrW[clrdata->name_len/sizeof(WCHAR)] = 0;
4269
4270 /* runtime version, optional */
4271 if (clrdata->version_len)
4272 {
4273 data->clrdata_len += clrdata->version_len + sizeof(WCHAR);
4274
4275 ptrW = (WCHAR*)((BYTE*)clrdata + clrdata->version_offset);
4276 memcpy(ptrW, entity->u.comclass.version, clrdata->version_len);
4277 ptrW[clrdata->version_len/sizeof(WCHAR)] = 0;
4278 }
4279
4280 if (data->progid_len)
4281 data->progid_offset += data->clrdata_len;
4282 (*index)->data_len += sizeof(*clrdata);
4283 }
4284 else
4285 {
4286 clrdata = NULL;
4287
4288 /* module name */
4289 ptrW = (WCHAR*)((BYTE*)section + data->name_offset);
4290 memcpy(ptrW, dll->name, data->name_len);
4291 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4292 }
4293
4294 /* progid string */
4295 if (data->progid_len)
4296 {
4297 ptrW = (WCHAR*)((BYTE*)data + data->progid_offset);
4298 memcpy(ptrW, entity->u.comclass.progid, data->progid_len);
4299 ptrW[data->progid_len/sizeof(WCHAR)] = 0;
4300 }
4301
4302 /* string block length */
4303 str_len = 0;
4304 if (clrdata)
4305 {
4306 str_len += clrdata->name_len + sizeof(WCHAR);
4307 if (clrdata->version_len)
4308 str_len += clrdata->version_len + sizeof(WCHAR);
4309 }
4310 if (progid_len)
4311 str_len += progid_len + sizeof(WCHAR);
4312
4313 (*index)->data_len += aligned_string_len(str_len);
4314 alias_index->data_len = (*index)->data_len;
4315
4316 /* move to next data record */
4317 (*data_offset) += sizeof(*data) + aligned_string_len(str_len);
4318 (*module_offset) += module_len + sizeof(WCHAR);
4319
4320 if (clrdata)
4321 {
4322 (*data_offset) += sizeof(*clrdata);
4323 (*module_offset) += clrdata->module_len + sizeof(WCHAR);
4324 }
4325 (*index) += 1;
4326 }
4327 }
4328
4329 return STATUS_SUCCESS;
4330}
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:2029
static const WCHAR mscoree2W[]
Definition: actctx.c:740
static void generate_uuid(ULONG *seed, GUID *guid)
Definition: actctx.c:4086
static const WCHAR mscoreeW[]
Definition: actctx.c:739
#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:506
struct entity * base
Definition: actctx.c:505
Definition: actctx.c:447
union entity::@4976 u
struct entity::@4976::@4978 comclass
DWORD kind
Definition: actctx.c:448
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 1093 of file actctx.c.

1095{
1096 unsigned int i;
1097
1098 /* check if we already have that assembly */
1099
1100 for (i = 0; i < acl->actctx->num_assemblies; i++)
1101 if (is_matching_identity( ai, &acl->actctx->assemblies[i].id ))
1102 {
1103 TRACE( "reusing existing assembly for %S arch %S version %u.%u.%u.%u\n",
1104 ai->name, ai->arch, ai->version.major, ai->version.minor,
1105 ai->version.build, ai->version.revision );
1106 return TRUE;
1107 }
1108
1109 for (i = 0; i < acl->num_dependencies; i++)
1110 if (is_matching_identity( ai, &acl->dependencies[i] ))
1111 {
1112 TRACE( "reusing existing dependency for %S arch %S version %u.%u.%u.%u\n",
1113 ai->name, ai->arch, ai->version.major, ai->version.minor,
1114 ai->version.build, ai->version.revision );
1115 return TRUE;
1116 }
1117
1119 {
1120 void *ptr;
1121 unsigned int new_count;
1122 if (acl->dependencies)
1123 {
1124 new_count = acl->allocated_dependencies * 2;
1126 new_count * sizeof(acl->dependencies[0]));
1127 }
1128 else
1129 {
1130 new_count = 4;
1131 ptr = RtlAllocateHeap(GetProcessHeap(), 0, new_count * sizeof(acl->dependencies[0]));
1132 }
1133 if (!ptr) return FALSE;
1134 acl->dependencies = ptr;
1135 acl->allocated_dependencies = new_count;
1136 }
1137 acl->dependencies[acl->num_dependencies++] = *ai;
1138
1139 return TRUE;
1140}
#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:1073
#define TRACE(s)
Definition: solgame.cpp:4
struct assembly * assemblies
Definition: actctx.c:589
unsigned int num_assemblies
Definition: actctx.c:590
unsigned int allocated_dependencies
Definition: actctx.c:608
struct assembly_identity * dependencies
Definition: actctx.c:606
unsigned int num_dependencies
Definition: actctx.c:607
ACTIVATION_CONTEXT * actctx
Definition: actctx.c:605
WCHAR * name
Definition: actctx.c:151
WCHAR * arch
Definition: actctx.c:152
struct assembly_version version
Definition: actctx.c:156

Referenced by parse_dependent_assembly_elem().

◆ add_dll_redirect()

static struct dll_redirect * add_dll_redirect ( struct assembly assembly)
static

Definition at line 941 of file actctx.c.

942{
943 DPRINT("add_dll_redirect() to assembly %p, num_dlls %d\n", assembly, assembly->allocated_dlls);
944
946 {
947 void *ptr;
948 unsigned int new_count;
949 if (assembly->dlls)
950 {
951 new_count = assembly->allocated_dlls * 2;
953 assembly->dlls, new_count * sizeof(*assembly->dlls) );
954 }
955 else
956 {
957 new_count = 4;
958 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*assembly->dlls) );
959 }
960 if (!ptr) return NULL;
961 assembly->dlls = ptr;
962 assembly->allocated_dlls = new_count;
963 }
964 return &assembly->dlls[assembly->num_dlls++];
965}
unsigned int allocated_dlls
Definition: actctx.c:533

Referenced by parse_file_elem().

◆ add_entity()

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

Definition at line 995 of file actctx.c.

996{
997 struct entity* entity;
998
999 if (array->num == array->allocated)
1000 {
1001 void *ptr;
1002 unsigned int new_count;
1003 if (array->base)
1004 {
1005 new_count = array->allocated * 2;
1007 array->base, new_count * sizeof(*array->base) );
1008 }
1009 else
1010 {
1011 new_count = 4;
1012 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*array->base) );
1013 }
1014 if (!ptr) return NULL;
1015 array->base = ptr;
1016 array->allocated = new_count;
1017 }
1018 entity = &array->base[array->num++];
1019 entity->kind = kind;
1020 return entity;
1021}
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 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 4457 of file actctx.c.

4459{
4460 unsigned int i;
4461
4462 for (i = 0; i < entities->num; i++)
4463 {
4464 struct entity *entity = &entities->base[i];
4465 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)
4466 {
4467 struct ifacepsredirect_data *data = (struct ifacepsredirect_data*)((BYTE*)section + *data_offset);
4471
4472 if (entity->u.ifaceps.name)
4473 name_len = strlenW(entity->u.ifaceps.name)*sizeof(WCHAR);
4474 else
4475 name_len = 0;
4476
4477 /* setup index */
4479 Status = RtlGUIDFromString(&str, &(*index)->guid);
4480 if (!NT_SUCCESS(Status))
4481 return Status;
4482 (*index)->data_offset = *data_offset;
4483 (*index)->data_len = sizeof(*data) + name_len ? aligned_string_len(name_len + sizeof(WCHAR)) : 0;
4484 (*index)->rosterindex = rosterindex;
4485
4486 /* setup data record */
4487 data->size = sizeof(*data);
4488 data->mask = entity->u.ifaceps.mask;
4489
4490 /* proxyStubClsid32 value is only stored for external PS,
4491 if set it's used as iid, otherwise 'iid' attribute value is used */
4492 if (entity->u.ifaceps.ps32)
4493 {
4495 Status = RtlGUIDFromString(&str, &data->iid);
4496 if (!NT_SUCCESS(Status))
4497 return Status;
4498 }
4499 else
4500 data->iid = (*index)->guid;
4501
4502 data->nummethods = entity->u.ifaceps.nummethods;
4503
4504 if (entity->u.ifaceps.tlib)
4505 {
4507 Status = RtlGUIDFromString(&str, &data->tlbid);
4508 if (!NT_SUCCESS(Status))
4509 return Status;
4510 }
4511 else
4512 memset(&data->tlbid, 0, sizeof(data->tlbid));
4513
4514 if (entity->u.ifaceps.base)
4515 {
4517 Status = RtlGUIDFromString(&str, &data->base);
4518 if (!NT_SUCCESS(Status))
4519 return Status;
4520 }
4521 else
4522 memset(&data->base, 0, sizeof(data->base));
4523
4524 data->name_len = name_len;
4525 data->name_offset = data->name_len ? sizeof(*data) : 0;
4526
4527 /* name string */
4528 if (data->name_len)
4529 {
4530 WCHAR *ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
4531 memcpy(ptrW, entity->u.ifaceps.name, data->name_len);
4532 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4533 }
4534
4535 /* move to next record */
4536 (*index) += 1;
4537 *data_offset += sizeof(*data);
4538 if (data->name_len)
4539 *data_offset += aligned_string_len(data->name_len + sizeof(WCHAR));
4540 }
4541 }
4542
4543 return STATUS_SUCCESS;
4544}
struct entity::@4976::@4979 ifaceps

Referenced by build_ifaceps_section().

◆ add_progid_record()

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

4879{
4880 unsigned int i, j;
4882
4883 for (i = 0; i < entities->num; i++)
4884 {
4885 struct entity *entity = &entities->base[i];
4886 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4887 {
4888 const struct progids *progids = &entity->u.comclass.progids;
4889 struct comclassredirect_data *comclass;
4890 struct guid_index *guid_index;
4892 GUID clsid;
4893
4896 if (!NT_SUCCESS(Status))
4897 return Status;
4898
4899 guid_index = find_guid_index(actctx->comserver_section, &clsid);
4900 comclass = get_comclass_data(actctx, guid_index);
4901
4902 if (entity->u.comclass.progid)
4903 write_progid_record(section, entity->u.comclass.progid, &comclass->alias,
4904 index, data_offset, global_offset, rosterindex);
4905
4906 for (j = 0; j < progids->num; j++)
4908 index, data_offset, global_offset, rosterindex);
4909 }
4910 }
4911 return Status;
4912}
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:4834
static struct comclassredirect_data * get_comclass_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:4395
static struct guid_index * find_guid_index(const struct guidsection_header *section, const GUID *guid)
Definition: actctx.c:3629
WCHAR ** progids
Definition: actctx.c:441
unsigned int num
Definition: actctx.c:442

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

1182{
1183 WCHAR *p = buffer;
1184
1185 if (!str) return;
1186 strcatW( buffer, prefix );
1187 p += strlenW(p);
1188 *p++ = '"';
1189 strcpyW( p, str );
1190 p += strlenW(p);
1191 *p++ = '"';
1192 *p = 0;
1193}
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 1150 of file actctx.c.

1151{
1152 static const WCHAR undW[] = {'_',0};
1153 static const WCHAR noneW[] = {'n','o','n','e',0};
1154 static const WCHAR mskeyW[] = {'d','e','a','d','b','e','e','f',0};
1155
1156 const WCHAR *arch = ai->arch ? ai->arch : noneW;
1157 const WCHAR *key = ai->public_key ? ai->public_key : noneW;
1158 const WCHAR *lang = ai->language ? ai->language : noneW;
1159 const WCHAR *name = ai->name ? ai->name : noneW;
1160 SIZE_T size = (strlenW(arch) + 1 + strlenW(name) + 1 + strlenW(key) + 24 + 1 +
1161 strlenW(lang) + 1) * sizeof(WCHAR) + sizeof(mskeyW);
1162 WCHAR *ret;
1163
1164 if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, size ))) return NULL;
1165
1166 strcpyW( ret, arch );
1167 strcatW( ret, undW );
1168 strcatW( ret, name );
1169 strcatW( ret, undW );
1170 strcatW( ret, key );
1171 strcatW( ret, undW );
1173 ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
1174 strcatW( ret, undW );
1175 strcatW( ret, lang );
1176 strcatW( ret, undW );
1177 strcatW( ret, mskeyW );
1178 return ret;
1179}
GLsizeiptr size
Definition: glext.h:5919
#define sprintfW
Definition: unicode.h:58
static const WCHAR version_formatW[]
Definition: actctx.c:826
WCHAR * public_key
Definition: actctx.c:153
WCHAR * language
Definition: actctx.c:154
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 1195 of file actctx.c.

1196{
1197 static const WCHAR archW[] =
1198 {',','p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',0};
1199 static const WCHAR public_keyW[] =
1200 {',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',0};
1201 static const WCHAR typeW2[] =
1202 {',','t','y','p','e','=',0};
1203 static const WCHAR versionW2[] =
1204 {',','v','e','r','s','i','o','n','=',0};
1205
1206 WCHAR version[64], *ret;
1207 SIZE_T size = 0;
1208
1210 ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
1211 if (ai->name) size += strlenW(ai->name) * sizeof(WCHAR);
1212 if (ai->arch) size += strlenW(archW) + strlenW(ai->arch) + 2;
1213 if (ai->public_key) size += strlenW(public_keyW) + strlenW(ai->public_key) + 2;
1214 if (ai->type) size += strlenW(typeW2) + strlenW(ai->type) + 2;
1215 size += strlenW(versionW2) + strlenW(version) + 2;
1216
1217 if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR) )))
1218 return NULL;
1219
1220 if (ai->name) strcpyW( ret, ai->name );
1221 else *ret = 0;
1222 append_string( ret, archW, ai->arch );
1223 append_string( ret, public_keyW, ai->public_key );
1224 append_string( ret, typeW2, ai->type );
1225 append_string( ret, versionW2, version );
1226 return ret;
1227}
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:1181
WCHAR * type
Definition: actctx.c:155

Referenced by RtlQueryInformationActivationContext().

◆ build_clr_surrogate_section()

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

Definition at line 4651 of file actctx.c.

4652{
4653 unsigned int i, j, total_len = 0, count = 0;
4654 struct guidsection_header *header;
4655 struct clrsurrogate_data *data;
4656 struct guid_index *index;
4658
4659 /* compute section length */
4660 for (i = 0; i < actctx->num_assemblies; i++)
4661 {
4662 struct assembly *assembly = &actctx->assemblies[i];
4663 for (j = 0; j < assembly->entities.num; j++)
4664 {
4665 struct entity *entity = &assembly->entities.base[j];
4666 if (entity->kind == ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)
4667 {
4668 ULONG len;
4669
4670 total_len += sizeof(*index) + sizeof(*data);
4671 len = strlenW(entity->u.clrsurrogate.name) + 1;
4672 if (entity->u.clrsurrogate.version)
4673 len += strlenW(entity->u.clrsurrogate.version) + 1;
4674 total_len += aligned_string_len(len*sizeof(WCHAR));
4675
4676 count++;
4677 }
4678 }
4679 }
4680
4681 total_len += sizeof(*header);
4682
4683 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4684 if (!header) return STATUS_NO_MEMORY;
4685
4686 memset(header, 0, sizeof(*header));
4687 header->magic = GUIDSECTION_MAGIC;
4688 header->size = sizeof(*header);
4689 header->count = count;
4690 header->index_offset = sizeof(*header);
4691 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4692 data_offset = header->index_offset + count*sizeof(*index);
4693
4694 for (i = 0; i < actctx->num_assemblies; i++)
4695 {
4696 struct assembly *assembly = &actctx->assemblies[i];
4697 for (j = 0; j < assembly->entities.num; j++)
4698 {
4699 struct entity *entity = &assembly->entities.base[j];
4700 if (entity->kind == ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)
4701 {
4702 ULONG version_len, name_len;
4704 WCHAR *ptrW;
4706
4707 if (entity->u.clrsurrogate.version)
4708 version_len = strlenW(entity->u.clrsurrogate.version)*sizeof(WCHAR);
4709 else
4710 version_len = 0;
4711 name_len = strlenW(entity->u.clrsurrogate.name)*sizeof(WCHAR);
4712
4713 /* setup new index entry */
4715 Status = RtlGUIDFromString(&str, &index->guid);
4716 if (!NT_SUCCESS(Status))
4717 {
4719 return Status;
4720 }
4721
4722 index->data_offset = data_offset;
4723 index->data_len = sizeof(*data) + aligned_string_len(name_len + sizeof(WCHAR) + (version_len ? version_len + sizeof(WCHAR) : 0));
4724 index->rosterindex = i + 1;
4725
4726 /* setup data */
4727 data = (struct clrsurrogate_data*)((BYTE*)header + index->data_offset);
4728 data->size = sizeof(*data);
4729 data->res = 0;
4730 data->clsid = index->guid;
4731 data->version_offset = version_len ? data->size : 0;
4732 data->version_len = version_len;
4733 data->name_offset = data->size + version_len;
4734 if (version_len)
4735 data->name_offset += sizeof(WCHAR);
4736 data->name_len = name_len;
4737
4738 /* surrogate name */
4739 ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
4740 memcpy(ptrW, entity->u.clrsurrogate.name, data->name_len);
4741 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4742
4743 /* runtime version */
4744 if (data->version_len)
4745 {
4746 ptrW = (WCHAR*)((BYTE*)data + data->version_offset);
4747 memcpy(ptrW, entity->u.clrsurrogate.version, data->version_len);
4748 ptrW[data->version_len/sizeof(WCHAR)] = 0;
4749 }
4750
4751 data_offset += index->data_offset;
4752 index++;
4753 }
4754 }
4755 }
4756
4757 *section = header;
4758
4759 return STATUS_SUCCESS;
4760}
#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:57
ULONG version_len
Definition: actctx.c:1638
struct entity::@4976::@4981 clrsurrogate

Referenced by find_clr_surrogate().

◆ build_comserver_section()

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

Definition at line 4332 of file actctx.c.

4333{
4334 unsigned int i, j, total_len = 0, class_count = 0, names_len = 0;
4335 struct guidsection_header *header;
4336 ULONG module_offset, data_offset;
4337 struct guid_index *index;
4338 ULONG seed;
4340
4341 /* compute section length */
4342 for (i = 0; i < actctx->num_assemblies; i++)
4343 {
4344 struct assembly *assembly = &actctx->assemblies[i];
4345 get_comserver_datalen(&assembly->entities, NULL, &class_count, &total_len, &names_len);
4346 for (j = 0; j < assembly->num_dlls; j++)
4347 {
4348 struct dll_redirect *dll = &assembly->dlls[j];
4349 get_comserver_datalen(&dll->entities, dll, &class_count, &total_len, &names_len);
4350 }
4351 }
4352
4353 total_len += aligned_string_len(names_len);
4354 total_len += sizeof(*header);
4355
4356 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4357 if (!header) return STATUS_NO_MEMORY;
4358
4359 memset(header, 0, sizeof(*header));
4360 header->magic = GUIDSECTION_MAGIC;
4361 header->size = sizeof(*header);
4362 header->count = 2*class_count;
4363 header->index_offset = sizeof(*header) + aligned_string_len(names_len);
4364 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4365 module_offset = sizeof(*header);
4366 data_offset = header->index_offset + 2*class_count*sizeof(*index);
4367
4368 seed = NtGetTickCount();
4369 for (i = 0; i < actctx->num_assemblies; i++)
4370 {
4371 struct assembly *assembly = &actctx->assemblies[i];
4372 Status = add_comserver_record(header, &assembly->entities, NULL, &index, &data_offset, &module_offset, &seed, i+1);
4373 if (!NT_SUCCESS(Status))
4374 {
4376 return Status;
4377 }
4378 for (j = 0; j < assembly->num_dlls; j++)
4379 {
4380 struct dll_redirect *dll = &assembly->dlls[j];
4381 Status = add_comserver_record(header, &dll->entities, dll, &index, &data_offset, &module_offset, &seed, i+1);
4382 if (!NT_SUCCESS(Status))
4383 {
4385 return Status;
4386 }
4387 }
4388 }
4389
4390 *section = header;
4391
4392 return STATUS_SUCCESS;
4393}
#define NtGetTickCount
Definition: rtlp.h:163
static 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:4149
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:4101

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

3508{
3509 unsigned int i, j, total_len = 0, dll_count = 0;
3510 struct strsection_header *header;
3511 struct dllredirect_data *data;
3512 struct string_index *index;
3514
3515 DPRINT("actctx %p, num_assemblies %d\n", actctx, actctx->num_assemblies);
3516
3517 /* compute section length */
3518 for (i = 0; i < actctx->num_assemblies; i++)
3519 {
3520 struct assembly *assembly = &actctx->assemblies[i];
3521 for (j = 0; j < assembly->num_dlls; j++)
3522 {
3523 struct dll_redirect *dll = &assembly->dlls[j];
3524
3525 /* each entry needs index, data and string data */
3526 total_len += sizeof(*index);
3527 total_len += sizeof(*data);
3528 total_len += aligned_string_len((strlenW(dll->name)+1)*sizeof(WCHAR));
3529
3530 DPRINT("assembly %d (%p), dll %d: dll name %S\n", i, assembly, j, dll->name);
3531 }
3532
3534 }
3535
3536 total_len += sizeof(*header);
3537
3538 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
3539 if (!header) return STATUS_NO_MEMORY;
3540
3541 memset(header, 0, sizeof(*header));
3542 header->magic = STRSECTION_MAGIC;
3543 header->size = sizeof(*header);
3544 header->count = dll_count;
3545 header->index_offset = sizeof(*header);
3546 index = (struct string_index*)((BYTE*)header + header->index_offset);
3547 name_offset = header->index_offset + header->count*sizeof(*index);
3548
3549 for (i = 0; i < actctx->num_assemblies; i++)
3550 {
3551 struct assembly *assembly = &actctx->assemblies[i];
3552
3553 DPRINT("assembly->num_dlls %d\n", assembly->num_dlls);
3554
3555 for (j = 0; j < assembly->num_dlls; j++)
3556 {
3557 struct dll_redirect *dll = &assembly->dlls[j];
3559 WCHAR *ptrW;
3560
3561 DPRINT("%d: dll name %S\n", j, dll->name);
3562 /* setup new index entry */
3563 str.Buffer = dll->name;
3564 str.Length = strlenW(dll->name)*sizeof(WCHAR);
3565 str.MaximumLength = str.Length + sizeof(WCHAR);
3566 /* hash original class name */
3568
3569 index->name_offset = name_offset;
3570 index->name_len = str.Length;
3571 index->data_offset = index->name_offset + aligned_string_len(str.MaximumLength);
3572 index->data_len = sizeof(*data);
3573 index->rosterindex = i + 1;
3574
3575 /* setup data */
3576 data = (struct dllredirect_data*)((BYTE*)header + index->data_offset);
3577 data->size = sizeof(*data);
3578 data->unk = 2; /* FIXME: seems to be constant */
3579 memset(data->res, 0, sizeof(data->res));
3580
3581 /* dll name */
3582 ptrW = (WCHAR*)((BYTE*)header + index->name_offset);
3583 memcpy(ptrW, dll->name, index->name_len);
3584 ptrW[index->name_len/sizeof(WCHAR)] = 0;
3585
3586 name_offset += sizeof(*data) + aligned_string_len(str.MaximumLength);
3587
3588 index++;
3589 }
3590 }
3591
3592 *section = header;
3593
3594 return STATUS_SUCCESS;
3595}
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)
#define STRSECTION_MAGIC
Definition: actctx.c:56
ULONG name_offset
Definition: actctx.c:1062

Referenced by find_dll_redirection().

◆ build_ifaceps_section()

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

Definition at line 4546 of file actctx.c.

4547{
4548 unsigned int i, j, total_len = 0, count = 0;
4549 struct guidsection_header *header;
4550 struct guid_index *index;
4552
4553 /* compute section length */
4554 for (i = 0; i < actctx->num_assemblies; i++)
4555 {
4556 struct assembly *assembly = &actctx->assemblies[i];
4557
4558 get_ifaceps_datalen(&assembly->entities, &count, &total_len);
4559 for (j = 0; j < assembly->num_dlls; j++)
4560 {
4561 struct dll_redirect *dll = &assembly->dlls[j];
4562 get_ifaceps_datalen(&dll->entities, &count, &total_len);
4563 }
4564 }
4565
4566 total_len += sizeof(*header);
4567
4568 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4569 if (!header) return STATUS_NO_MEMORY;
4570
4571 memset(header, 0, sizeof(*header));
4572 header->magic = GUIDSECTION_MAGIC;
4573 header->size = sizeof(*header);
4574 header->count = count;
4575 header->index_offset = sizeof(*header);
4576 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4577 data_offset = header->index_offset + count*sizeof(*index);
4578
4579 for (i = 0; i < actctx->num_assemblies; i++)
4580 {
4581 struct assembly *assembly = &actctx->assemblies[i];
4583
4584 Status = add_ifaceps_record(header, &assembly->entities, &index, &data_offset, i + 1);
4585 if (!NT_SUCCESS(Status))
4586 {
4588 return Status;
4589 }
4590
4591 for (j = 0; j < assembly->num_dlls; j++)
4592 {
4593 struct dll_redirect *dll = &assembly->dlls[j];
4594 Status = add_ifaceps_record(header, &dll->entities, &index, &data_offset, i + 1);
4595 if (!NT_SUCCESS(Status))
4596 {
4598 return Status;
4599 }
4600 }
4601 }
4602
4603 *section = header;
4604
4605 return STATUS_SUCCESS;
4606}
static NTSTATUS add_ifaceps_record(struct guidsection_header *section, struct entity_array *entities, struct guid_index **index, ULONG *data_offset, ULONG rosterindex)
Definition: actctx.c:4457
static void get_ifaceps_datalen(const struct entity_array *entities, unsigned int *count, unsigned int *len)
Definition: actctx.c:4440

Referenced by find_cominterface_redirection().

◆ build_progid_section()

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

Definition at line 4914 of file actctx.c.

4915{
4916 unsigned int i, j, total_len = 0, count = 0;
4917 struct strsection_header *header;
4918 ULONG data_offset, global_offset;
4919 struct string_index *index;
4921
4922 /* compute section length */
4923 for (i = 0; i < actctx->num_assemblies; i++)
4924 {
4925 struct assembly *assembly = &actctx->assemblies[i];
4926
4927 get_progid_datalen(&assembly->entities, &count, &total_len);
4928 for (j = 0; j < assembly->num_dlls; j++)
4929 {
4930 struct dll_redirect *dll = &assembly->dlls[j];
4931 get_progid_datalen(&dll->entities, &count, &total_len);
4932 }
4933 }
4934
4935 total_len += sizeof(*header);
4936
4937 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4938 if (!header) return STATUS_NO_MEMORY;
4939
4940 memset(header, 0, sizeof(*header));
4941 header->magic = STRSECTION_MAGIC;
4942 header->size = sizeof(*header);
4943 header->count = count;
4944 header->global_offset = header->size;
4945 header->global_len = count*sizeof(GUID);
4946 header->index_offset = header->size + header->global_len;
4947
4948 index = (struct string_index*)((BYTE*)header + header->index_offset);
4949 data_offset = header->index_offset + count*sizeof(*index);
4950 global_offset = header->global_offset;
4951
4952 for (i = 0; i < actctx->num_assemblies; i++)
4953 {
4954 struct assembly *assembly = &actctx->assemblies[i];
4955
4956 Status = add_progid_record(actctx, header, &assembly->entities, &index, &data_offset, &global_offset, i + 1);
4957 if (!NT_SUCCESS(Status))
4958 {
4960 return Status;
4961 }
4962
4963 for (j = 0; j < assembly->num_dlls; j++)
4964 {
4965 struct dll_redirect *dll = &assembly->dlls[j];
4966 Status = add_progid_record(actctx, header, &dll->entities, &index, &data_offset, &global_offset, i + 1);
4967 if (!NT_SUCCESS(Status))
4968 {
4970 return Status;
4971 }
4972 }
4973 }
4974
4975 *section = header;
4976
4977 return STATUS_SUCCESS;
4978}
static 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:4877
static void get_progid_datalen(struct entity_array *entities, unsigned int *count, unsigned int *total_len)
Definition: actctx.c:4809
ULONG data_offset
Definition: actctx.c:1064

Referenced by find_progid_redirection().

◆ build_tlib_section()

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

Definition at line 3912 of file actctx.c.

3913{
3914 unsigned int i, j, k, total_len = 0, tlib_count = 0, names_len = 0;
3915 struct guidsection_header *header;
3916 ULONG module_offset, data_offset;
3917 struct tlibredirect_data *data;
3918 struct guid_index *index;
3919
3920 /* compute section length */
3921 for (i = 0; i < actctx->num_assemblies; i++)
3922 {
3923 struct assembly *assembly = &actctx->assemblies[i];
3924 for (j = 0; j < assembly->num_dlls; j++)
3925 {
3926 struct dll_redirect *dll = &assembly->dlls[j];
3927 for (k = 0; k < dll->entities.num; k++)
3928 {
3929 struct entity *entity = &dll->entities.base[k];
3930 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)
3931 {
3932 /* each entry needs index, data and string data for module name and help string */
3933 total_len += sizeof(*index);
3934 total_len += sizeof(*data);
3935 /* help string is stored separately */
3936 if (*entity->u.typelib.helpdir)
3937 total_len += aligned_string_len((strlenW(entity->u.typelib.helpdir)+1)*sizeof(WCHAR));
3938
3939 /* module names are packed one after another */
3940 names_len += (strlenW(dll->name)+1)*sizeof(WCHAR);
3941
3942 tlib_count++;
3943 }
3944 }
3945 }
3946 }
3947
3948 total_len += aligned_string_len(names_len);
3949 total_len += sizeof(*header);
3950
3951 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
3952 if (!header) return STATUS_NO_MEMORY;
3953
3954 memset(header, 0, sizeof(*header));
3955 header->magic = GUIDSECTION_MAGIC;
3956 header->size = sizeof(*header);
3957 header->count = tlib_count;
3958 header->index_offset = sizeof(*header) + aligned_string_len(names_len);
3959 index = (struct guid_index*)((BYTE*)header + header->index_offset);
3960 module_offset = sizeof(*header);
3961 data_offset = header->index_offset + tlib_count*sizeof(*index);
3962
3963 for (i = 0; i < actctx->num_assemblies; i++)
3964 {
3965 struct assembly *assembly = &actctx->assemblies[i];
3966 for (j = 0; j < assembly->num_dlls; j++)
3967 {
3968 struct dll_redirect *dll = &assembly->dlls[j];
3969 for (k = 0; k < dll->entities.num; k++)
3970 {
3971 struct entity *entity = &dll->entities.base[k];
3972 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)
3973 {
3974 ULONG module_len, help_len;
3976 WCHAR *ptrW;
3978
3979 if (*entity->u.typelib.helpdir)
3980 help_len = strlenW(entity->u.typelib.helpdir)*sizeof(WCHAR);
3981 else
3982 help_len = 0;
3983
3984 module_len = strlenW(dll->name)*sizeof(WCHAR);
3985
3986 /* setup new index entry */
3988 Status = RtlGUIDFromString(&str, &index->guid);
3989 if (!NT_SUCCESS(Status))
3990 {
3992 return Status;
3993 }
3994 index->data_offset = data_offset;
3995 index->data_len = sizeof(*data) + aligned_string_len(help_len);
3996 index->rosterindex = i + 1;
3997
3998 /* setup data */
3999 data = (struct tlibredirect_data*)((BYTE*)header + index->data_offset);
4000 data->size = sizeof(*data);
4001 data->res = 0;
4002 data->name_len = module_len;
4003 data->name_offset = module_offset;
4004 /* FIXME: resourceid handling is really weird, and it doesn't seem to be useful */
4005 data->langid = 0;
4006 data->flags = entity->u.typelib.flags;
4007 data->help_len = help_len;
4008 data->help_offset = sizeof(*data);
4009 data->major_version = entity->u.typelib.major;
4010 data->minor_version = entity->u.typelib.minor;
4011
4012 /* module name */
4013 ptrW = (WCHAR*)((BYTE*)header + data->name_offset);
4014 memcpy(ptrW, dll->name, data->name_len);
4015 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4016
4017 /* help string */
4018 if (data->help_len)
4019 {
4020 ptrW = (WCHAR*)((BYTE*)data + data->help_offset);
4021 memcpy(ptrW, entity->u.typelib.helpdir, data->help_len);
4022 ptrW[data->help_len/sizeof(WCHAR)] = 0;
4023 }
4024
4025 data_offset += sizeof(*data);
4026 if (help_len)
4027 data_offset += aligned_string_len(help_len + sizeof(WCHAR));
4028
4029 module_offset += module_len + sizeof(WCHAR);
4030
4031 index++;
4032 }
4033 }
4034 }
4035 }
4036
4037 *section = header;
4038
4039 return STATUS_SUCCESS;
4040}
int k
Definition: mpi.c:3369
struct entity::@4976::@4977 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 3709 of file actctx.c.

3710{
3711 unsigned int i, j, k, total_len = 0, class_count = 0;
3713 struct strsection_header *header;
3714 struct string_index *index;
3716
3717 /* compute section length */
3718 for (i = 0; i < actctx->num_assemblies; i++)
3719 {
3720 struct assembly *assembly = &actctx->assemblies[i];
3721 for (j = 0; j < assembly->num_dlls; j++)
3722 {
3723 struct dll_redirect *dll = &assembly->dlls[j];
3724 for (k = 0; k < dll->entities.num; k++)
3725 {
3726 struct entity *entity = &dll->entities.base[k];
3727 if (entity->kind == ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)
3728 {
3729 int class_len = strlenW(entity->u.class.name) + 1;
3730 int len;
3731
3732 /* each class entry needs index, data and string data */
3733 total_len += sizeof(*index);
3734 total_len += sizeof(*data);
3735 /* original name is stored separately */
3736 total_len += aligned_string_len(class_len*sizeof(WCHAR));
3737 /* versioned name and module name are stored one after another */
3738 if (entity->u.class.versioned)
3739 len = get_assembly_version(assembly, NULL) + class_len + 1 /* '!' separator */;
3740 else
3741 len = class_len;
3742 len += strlenW(dll->name) + 1;
3743 total_len += aligned_string_len(len*sizeof(WCHAR));
3744
3745 class_count++;
3746 }
3747 }
3748 }
3749 }
3750
3751 total_len += sizeof(*header);
3752
3753 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
3754 if (!header) return STATUS_NO_MEMORY;
3755
3756 memset(header, 0, sizeof(*header));
3757 header->magic = STRSECTION_MAGIC;
3758 header->size = sizeof(*header);
3759 header->count = class_count;
3760 header->index_offset = sizeof(*header);
3761 index = (struct string_index*)((BYTE*)header + header->index_offset);
3762 name_offset = header->index_offset + header->count*sizeof(*index);
3763
3764 for (i = 0; i < actctx->num_assemblies; i++)
3765 {
3766 struct assembly *assembly = &actctx->assemblies[i];
3767 for (j = 0; j < assembly->num_dlls; j++)
3768 {
3769 struct dll_redirect *dll = &assembly->dlls[j];
3770 for (k = 0; k < dll->entities.num; k++)
3771 {
3772 struct entity *entity = &dll->entities.base[k];
3773 if (entity->kind == ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)
3774 {
3775 static const WCHAR exclW[] = {'!',0};
3776 ULONG versioned_len, module_len;
3778 WCHAR *ptrW;
3779
3780 /* setup new index entry */
3781 str.Buffer = entity->u.class.name;
3782 str.Length = strlenW(entity->u.class.name)*sizeof(WCHAR);
3783 str.MaximumLength = str.Length + sizeof(WCHAR);
3784 /* hash original class name */
3786
3787 /* include '!' separator too */
3788 if (entity->u.class.versioned)
3789 versioned_len = (get_assembly_version(assembly, NULL) + 1)*sizeof(WCHAR) + str.Length;
3790 else
3791 versioned_len = str.Length;
3792 module_len = strlenW(dll->name)*sizeof(WCHAR);
3793
3794 index->name_offset = name_offset;
3795 index->name_len = str.Length;
3796 index->data_offset = index->name_offset + aligned_string_len(str.MaximumLength);
3797 index->data_len = sizeof(*data) + versioned_len + module_len + 2*sizeof(WCHAR) /* two nulls */;
3798 index->rosterindex = i + 1;
3799
3800 /* setup data */
3801 data = (struct wndclass_redirect_data*)((BYTE*)header + index->data_offset);
3802 data->size = sizeof(*data);
3803 data->res = 0;
3804 data->name_len = versioned_len;
3805 data->name_offset = sizeof(*data);
3806 data->module_len = module_len;
3807 data->module_offset = index->data_offset + data->name_offset + data->name_len + sizeof(WCHAR);
3808
3809 /* original class name */
3810 ptrW = (WCHAR*)((BYTE*)header + index->name_offset);
3811 memcpy(ptrW, entity->u.class.name, index->name_len);
3812 ptrW[index->name_len/sizeof(WCHAR)] = 0;
3813
3814 /* module name */
3815 ptrW = (WCHAR*)((BYTE*)header + data->module_offset);
3816 memcpy(ptrW, dll->name, data->module_len);
3817 ptrW[data->module_len/sizeof(WCHAR)] = 0;
3818
3819 /* versioned name */
3820 ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
3821 if (entity->u.class.versioned)
3822 {
3824 strcatW(ptrW, exclW);
3825 strcatW(ptrW, entity->u.class.name);
3826 }
3827 else
3828 {
3829 memcpy(ptrW, entity->u.class.name, index->name_len);
3830 ptrW[index->name_len/sizeof(WCHAR)] = 0;
3831 }
3832
3833 name_offset += sizeof(*data);
3834 name_offset += aligned_string_len(str.MaximumLength) + aligned_string_len(versioned_len + module_len + 2*sizeof(WCHAR));
3835
3836 index++;
3837 }
3838 }
3839 }
3840 }
3841
3842 *section = header;
3843
3844 return STATUS_SUCCESS;
3845}
static int get_assembly_version(struct assembly *assembly, WCHAR *ret)
Definition: actctx.c:2034
struct entity::@4976::@4980 class

Referenced by find_window_class().

◆ check_actctx()

static ACTIVATION_CONTEXT * check_actctx ( HANDLE  h)
static

Definition at line 1229 of file actctx.c.

1230{
1232 PACTIVATION_CONTEXT_WRAPPED pActual;
1233
1234 if (!h || h == INVALID_HANDLE_VALUE) return NULL;
1235 __TRY
1236 {
1237 if (actctx)
1238 {
1239 pActual = CONTAINING_RECORD(actctx, ACTIVATION_CONTEXT_WRAPPED, ActivationContext);
1240 if (pActual->MagicMarker == ACTCTX_MAGIC_MARKER) ret = &pActual->ActivationContext;
1241 }
1242 }
1244 {
1245 DPRINT1("Invalid activation context handle!\n");
1246 }
1247 __ENDTRY
1248 return ret;
1249}
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define __TRY
Definition: compat.h:80
#define __ENDTRY
Definition: compat.h:82
#define __EXCEPT_PAGE_FAULT
Definition: compat.h:81
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define ACTCTX_MAGIC_MARKER
Definition: actctx.c:59

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

1707{
1708 struct progids *progids = &entity->u.comclass.progids;
1709
1710 if (progids->allocated == 0)
1711 {
1712 progids->allocated = 4;
1713 if (!(progids->progids = RtlAllocateHeap(GetProcessHeap(), 0, progids->allocated * sizeof(WCHAR*)))) return FALSE;
1714 }
1715
1716 if (progids->allocated == progids->num)
1717 {
1718 WCHAR **new_progids = RtlReAllocateHeap(GetProcessHeap(), 0, progids->progids,
1719 2 * progids->allocated * sizeof(WCHAR*));
1720 if (!new_progids) return FALSE;
1721 progids->allocated *= 2;
1722 progids->progids = new_progids;
1723 }
1724
1725 if (!(progids->progids[progids->num] = xmlstrdupW(progid))) return FALSE;
1726 progids->num++;
1727
1728 return TRUE;
1729}
#define progid(str)
Definition: exdisp.idl:31
static WCHAR * xmlstrdupW(const xmlstr_t *str)
Definition: actctx.c:842
unsigned int allocated
Definition: actctx.c:443

Referenced by parse_com_class_progid().

◆ debugstr_version()

static const char * debugstr_version ( const struct assembly_version ver)
inlinestatic

Definition at line 904 of file actctx.c.

905{
906 return wine_dbg_sprintf("%u.%u.%u.%u", ver->major, ver->minor, ver->build, ver->revision);
907}
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:296
USHORT major
Definition: actctx.c:143
USHORT revision
Definition: actctx.c:146
USHORT build
Definition: actctx.c:145
USHORT minor
Definition: actctx.c:144

◆ debugstr_xmlstr()

static const char * debugstr_xmlstr ( const xmlstr_t str)
inlinestatic

Definition at line 899 of file actctx.c.

900{
901 return debugstr_wn(str->ptr, str->len);
902}
#define debugstr_wn
Definition: kernel32.h:33

◆ find_clr_surrogate()

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

Definition at line 4767 of file actctx.c.

4768{
4769 struct clrsurrogate_data *surrogate;
4770 struct guid_index *index = NULL;
4771
4772 if (!(actctx->sections & CLRSURROGATES_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4773
4774 if (!actctx->clrsurrogate_section)
4775 {
4777
4779 if (status) return status;
4780
4781 if (InterlockedCompareExchangePointer((void**)&actctx->clrsurrogate_section, section, NULL))
4783 }
4784
4785 index = find_guid_index(actctx->clrsurrogate_section, guid);
4786 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4787
4788 surrogate = get_surrogate_data(actctx, index);
4789
4790 data->ulDataFormatVersion = 1;
4791 data->lpData = surrogate;
4792 /* full length includes string length with nulls */
4793 data->ulLength = surrogate->size + surrogate->name_len + sizeof(WCHAR);
4794 if (surrogate->version_len)
4795 data->ulLength += surrogate->version_len + sizeof(WCHAR);
4796
4797 data->lpSectionGlobalData = NULL;
4798 data->ulSectionGlobalDataLength = 0;
4799 data->lpSectionBase = actctx->clrsurrogate_section;
4800 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->clrsurrogate_section );
4801 data->hActCtx = NULL;
4802
4803 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4804 data->ulAssemblyRosterIndex = index->rosterindex;
4805
4806 return STATUS_SUCCESS;
4807}
#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 struct clrsurrogate_data * get_surrogate_data(ACTIVATION_CONTEXT *actctx, const struct guid_index *index)
Definition: actctx.c:4762
static NTSTATUS build_clr_surrogate_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4651
Definition: ps.c:97
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by find_guid().

◆ find_cominterface_redirection()

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

Definition at line 4613 of file actctx.c.

4614{
4615 struct ifacepsredirect_data *iface;
4616 struct guid_index *index = NULL;
4617
4618 if (!(actctx->sections & IFACEREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4619
4620 if (!actctx->ifaceps_section)
4621 {
4623
4625 if (status) return status;
4626
4627 if (InterlockedCompareExchangePointer((void**)&actctx->ifaceps_section, section, NULL))
4629 }
4630
4631 index = find_guid_index(actctx->ifaceps_section, guid);
4632 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4633
4634 iface = get_ifaceps_data(actctx, index);
4635
4636 data->ulDataFormatVersion = 1;
4637 data->lpData = iface;
4638 data->ulLength = iface->size + (iface->name_len ? iface->name_len + sizeof(WCHAR) : 0);
4639 data->lpSectionGlobalData = NULL;
4640 data->ulSectionGlobalDataLength = 0;
4641 data->lpSectionBase = actctx->ifaceps_section;
4642 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->ifaceps_section );
4643 data->hActCtx = NULL;
4644
4645 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4646 data->ulAssemblyRosterIndex = index->rosterindex;
4647
4648 return STATUS_SUCCESS;
4649}
static NTSTATUS build_ifaceps_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4546
static struct ifacepsredirect_data * get_ifaceps_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:4608

Referenced by find_guid().

◆ find_comserver_redirection()

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

Definition at line 4400 of file actctx.c.

4401{
4402 struct comclassredirect_data *comclass;
4403 struct guid_index *index = NULL;
4404
4405 if (!(actctx->sections & SERVERREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4406
4407 if (!actctx->comserver_section)
4408 {
4410
4412 if (status) return status;
4413
4414 if (InterlockedCompareExchangePointer((void**)&actctx->comserver_section, section, NULL))
4416 }
4417
4418 index = find_guid_index(actctx->comserver_section, guid);
4419 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4420
4421 comclass = get_comclass_data(actctx, index);
4422
4423 data->ulDataFormatVersion = 1;
4424 data->lpData = comclass;
4425 /* full length includes string length with nulls */
4426 data->ulLength = comclass->size + comclass->clrdata_len;
4427 if (comclass->progid_len) data->ulLength += comclass->progid_len + sizeof(WCHAR);
4428 data->lpSectionGlobalData = (BYTE*)actctx->comserver_section + actctx->comserver_section->names_offset;
4429 data->ulSectionGlobalDataLength = actctx->comserver_section->names_len;
4430 data->lpSectionBase = actctx->comserver_section;
4431 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->comserver_section );
4432 data->hActCtx = NULL;
4433
4434 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4435 data->ulAssemblyRosterIndex = index->rosterindex;
4436
4437 return STATUS_SUCCESS;
4438}
static NTSTATUS build_comserver_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4332

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

3656{
3657 struct dllredirect_data *dll;
3658 struct string_index *index;
3659
3660 DPRINT("sections: 0x%08X\n", actctx->sections);
3661 if (!(actctx->sections & DLLREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
3662
3663 DPRINT("actctx->dllredirect_section: %p\n", actctx->dllredirect_section);
3664 if (!actctx->dllredirect_section)
3665 {
3666 struct strsection_header *section;
3667
3669 if (status) return status;
3670
3671 if (InterlockedCompareExchangePointer((void**)&actctx->dllredirect_section, section, NULL))
3673 }
3674
3675 index = find_string_index(actctx->dllredirect_section, name);
3676 DPRINT("index: %d\n", index);
3677 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
3678
3679 if (data)
3680 {
3682
3683 data->ulDataFormatVersion = 1;
3684 data->lpData = dll;
3685 data->ulLength = dll->size;
3686 data->lpSectionGlobalData = NULL;
3687 data->ulSectionGlobalDataLength = 0;
3688 data->lpSectionBase = actctx->dllredirect_section;
3689 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->dllredirect_section );
3690 data->hActCtx = NULL;
3691
3692 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
3693 data->ulAssemblyRosterIndex = index->rosterindex;
3694 }
3695
3696 return STATUS_SUCCESS;
3697}
static NTSTATUS build_dllredirect_section(ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
Definition: actctx.c:3507
static struct dllredirect_data * get_dllredirect_data(ACTIVATION_CONTEXT *ctxt, struct string_index *index)
Definition: actctx.c:3649
static struct string_index * find_string_index(const struct strsection_header *section, const UNICODE_STRING *name)
Definition: actctx.c:3597

Referenced by find_string().

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

5080{
5082
5083 switch (section_kind)
5084 {
5085 case ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION:
5087 break;
5088 case ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION:
5090 break;
5091 case ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION:
5093 break;
5094 case ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES:
5096 break;
5097 default:
5098 WARN("Unknown section_kind %x\n", section_kind);
5100 }
5101
5102 if (status != STATUS_SUCCESS) return status;
5103
5104 if (flags & FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX)
5105 {
5107 data->hActCtx = actctx;
5108 }
5109 return STATUS_SUCCESS;
5110}
#define WARN(fmt,...)
Definition: debug.h:112
GLbitfield flags
Definition: glext.h:7161
#define STATUS_SXS_SECTION_NOT_FOUND
Definition: ntstatus.h:1382
static NTSTATUS find_cominterface_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4613
static void actctx_addref(ACTIVATION_CONTEXT *actctx)
Definition: actctx.c:1251
static NTSTATUS find_comserver_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4400
static NTSTATUS find_clr_surrogate(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4767
static NTSTATUS find_tlib_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4047

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

3630{
3631 struct guid_index *iter, *index = NULL;
3632 ULONG i;
3633
3634 iter = (struct guid_index*)((BYTE*)section + section->index_offset);
3635
3636 for (i = 0; i < section->count; i++)
3637 {
3638 if (!memcmp(guid, &iter->guid, sizeof(*guid)))
3639 {
3640 index = iter;
3641 break;
3642 }
3643 iter++;
3644 }
3645
3646 return index;
3647}
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 4985 of file actctx.c.

4987{
4989 struct string_index *index;
4990
4991 if (!(actctx->sections & PROGIDREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4992
4993 if (!actctx->comserver_section)
4994 {
4996
4998 if (status) return status;
4999
5000 if (InterlockedCompareExchangePointer((void**)&actctx->comserver_section, section, NULL))
5002 }
5003
5004 if (!actctx->progid_section)
5005 {
5006 struct strsection_header *section;
5007
5009 if (status) return status;
5010
5011 if (InterlockedCompareExchangePointer((void**)&actctx->progid_section, section, NULL))
5013 }
5014
5015 index = find_string_index(actctx->progid_section, name);
5016 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
5017
5018 if (data)
5019 {
5021
5022 data->ulDataFormatVersion = 1;
5023 data->lpData = progid;
5024 data->ulLength = progid->size;
5025 data->lpSectionGlobalData = (BYTE*)actctx->progid_section + actctx->progid_section->global_offset;
5026 data->ulSectionGlobalDataLength = actctx->progid_section->global_len;
5027 data->lpSectionBase = actctx->progid_section;
5028 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->progid_section );
5029 data->hActCtx = NULL;
5030
5031 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
5032 data->ulAssemblyRosterIndex = index->rosterindex;
5033 }
5034
5035 return STATUS_SUCCESS;
5036}
static struct progidredirect_data * get_progid_data(ACTIVATION_CONTEXT *actctx, const struct string_index *index)
Definition: actctx.c:4980
static NTSTATUS build_progid_section(ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
Definition: actctx.c:4914

Referenced by find_string().

◆ find_query_actctx()

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

Definition at line 3472 of file actctx.c.

3473{
3475
3477 {
3478 if (*handle) return STATUS_INVALID_PARAMETER;
3479
3480 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
3481 *handle = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext;
3482 }
3484 {
3487
3488 if (!*handle) return STATUS_INVALID_PARAMETER;
3489
3491 if (!LdrFindEntryForAddress( *handle, &pldr ))
3492 {
3495 else
3497 }
3500 }
3501 else if (!*handle && (class != ActivationContextBasicInformation))
3503
3504 return status;
3505}
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:425
#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
uint32_t ULONG_PTR
Definition: typedefs.h:65
#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 5038 of file actctx.c.

5041{
5043
5044 switch (section_kind)
5045 {
5046#ifdef __REACTOS__
5047 case ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION:
5048 DPRINT1("Unsupported yet section_kind %x\n", section_kind);
5050#endif // __REACTOS__
5051 case ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION:
5052 status = find_dll_redirection(actctx, section_name, data);
5053 break;
5054 case ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION:
5055 status = find_window_class(actctx, section_name, data);
5056 break;
5057 case ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION:
5058 status = find_progid_redirection(actctx, section_name, data);
5059 break;
5060 case ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE:
5061 FIXME("Unsupported yet section_kind %x\n", section_kind);
5063 default:
5064 WARN("Unknown section_kind %x\n", section_kind);
5066 }
5067
5068 if (status != STATUS_SUCCESS) return status;
5069
5070 if (data && (flags & FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX))
5071 {
5073 data->hActCtx = actctx;
5074 }
5075 return STATUS_SUCCESS;
5076}
#define FIXME(fmt,...)
Definition: debug.h:111
static NTSTATUS find_progid_redirection(ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:4985
static NTSTATUS find_window_class(ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:3847
static NTSTATUS find_dll_redirection(ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:3654

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

3598{
3599 struct string_index *iter, *index = NULL;
3600 ULONG hash = 0, i;
3601
3602 DPRINT("section %p, name %wZ\n", section, name);
3604 iter = (struct string_index*)((BYTE*)section + section->index_offset);
3605
3606 for (i = 0; i < section->count; i++)
3607 {
3608 DPRINT("iter->hash 0x%x ?= 0x%x\n", iter->hash, hash);
3609 DPRINT("iter->name %S\n", (WCHAR*)((BYTE*)section + iter->name_offset));
3610 if (iter->hash == hash)
3611 {
3612 const WCHAR *nameW = (WCHAR*)((BYTE*)section + iter->name_offset);
3613
3614 if (!_wcsnicmp(nameW, name->Buffer, name->Length / sizeof(WCHAR)) &&
3615 wcslen(nameW) == name->Length / sizeof(WCHAR))
3616 {
3617 index = iter;
3618 break;
3619 }
3620 else
3621 WARN("hash collision 0x%08x, %wZ, %S\n", hash, name, nameW);
3622 }
3623 iter++;
3624 }
3625
3626 return index;
3627}
static const WCHAR nameW[]
Definition: main.c:46
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_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)
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 4047 of file actctx.c.

4048{
4049 struct guid_index *index = NULL;
4050 struct tlibredirect_data *tlib;
4051
4052 if (!(actctx->sections & TLIBREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4053
4054 if (!actctx->tlib_section)
4055 {
4057
4059 if (status) return status;
4060
4061 if (InterlockedCompareExchangePointer((void**)&actctx->tlib_section, section, NULL))
4063 }
4064
4065 index = find_guid_index(actctx->tlib_section, guid);
4066 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4067
4068 tlib = get_tlib_data(actctx, index);
4069
4070 data->ulDataFormatVersion = 1;
4071 data->lpData = tlib;
4072 /* full length includes string length with nulls */
4073 data->ulLength = tlib->size + tlib->help_len + sizeof(WCHAR);
4074 data->lpSectionGlobalData = (BYTE*)actctx->tlib_section + actctx->tlib_section->names_offset;
4075 data->ulSectionGlobalDataLength = actctx->tlib_section->names_len;
4076 data->lpSectionBase = actctx->tlib_section;
4077 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->tlib_section );
4078 data->hActCtx = NULL;
4079
4080 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4081 data->ulAssemblyRosterIndex = index->rosterindex;
4082
4083 return STATUS_SUCCESS;
4084}
static struct tlibredirect_data * get_tlib_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:4042
static NTSTATUS build_tlib_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:3912

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

3849{
3850 struct string_index *iter, *index = NULL;
3851 struct wndclass_redirect_data *class;
3852 ULONG hash;
3853 int i;
3854
3855 if (!(actctx->sections & WINDOWCLASS_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
3856
3857 if (!actctx->wndclass_section)
3858 {
3859 struct strsection_header *section;
3860
3862 if (status) return status;
3863
3864 if (InterlockedCompareExchangePointer((void**)&actctx->wndclass_section, section, NULL))
3866 }
3867
3868 hash = 0;
3871
3872 for (i = 0; i < actctx->wndclass_section->count; i++)
3873 {
3874 if (iter->hash == hash)
3875 {
3876 const WCHAR *nameW = (WCHAR*)((BYTE*)actctx->wndclass_section + iter->name_offset);
3877
3878 if (!strcmpiW(nameW, name->Buffer))
3879 {
3880 index = iter;
3881 break;
3882 }
3883 else
3884 WARN("hash collision 0x%08x, %wZ, %S\n", hash, name, nameW);
3885 }
3886 iter++;
3887 }
3888
3889 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
3890
3891 if (data)
3892 {
3893 class = get_wndclass_data(actctx, index);
3894
3895 data->ulDataFormatVersion = 1;
3896 data->lpData = class;
3897 /* full length includes string length with nulls */
3898 data->ulLength = class->size + class->name_len + class->module_len + 2*sizeof(WCHAR);
3899 data->lpSectionGlobalData = NULL;
3900 data->ulSectionGlobalDataLength = 0;
3901 data->lpSectionBase = actctx->wndclass_section;
3902 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->wndclass_section );
3903 data->hActCtx = NULL;
3904
3905 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
3906 data->ulAssemblyRosterIndex = index->rosterindex;
3907 }
3908
3909 return STATUS_SUCCESS;
3910}
#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:3704
static NTSTATUS build_wndclass_section(ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
Definition: actctx.c:3709
static struct string_index * get_wndclass_first_index(ACTIVATION_CONTEXT *actctx)
Definition: actctx.c:3699

Referenced by find_string().

◆ find_xmlns()

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

Definition at line 1333 of file actctx.c.

1334{
1335 int i;
1336
1337 for (i = xmlbuf->ns_pos - 1; i >= 0; i--)
1338 {
1339 if (xmlbuf->namespaces[i].name.len == name->len &&
1340 !wcsncmp( xmlbuf->namespaces[i].name.ptr, name->ptr, name->len ))
1341 return xmlbuf->namespaces[i].value;
1342 }
1343
1344 return empty_xmlstr;
1345}
_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:611
int ns_pos
Definition: actctx.c:131
struct xml_attr namespaces[MAX_NAMESPACES]
Definition: actctx.c:130

Referenced by next_xml_elem().

◆ free_assembly_identity()

static void free_assembly_identity ( struct assembly_identity ai)
static

Definition at line 986 of file actctx.c.

987{
988 RtlFreeHeap( GetProcessHeap(), 0, ai->name );
989 RtlFreeHeap( GetProcessHeap(), 0, ai->arch );
992 RtlFreeHeap( GetProcessHeap(), 0, ai->type );
993}

Referenced by actctx_release(), and free_depend_manifests().

◆ free_depend_manifests()

static void free_depend_manifests ( struct actctx_loader acl)
static

Definition at line 1142 of file actctx.c.

1143{
1144 unsigned int i;
1145 for (i = 0; i < acl->num_dependencies; i++)
1148}

Referenced by RtlCreateActivationContext().

◆ free_entity_array()

static void free_entity_array ( struct entity_array array)
static

Definition at line 1023 of file actctx.c.

1024{
1025 unsigned int i, j;
1026 for (i = 0; i < array->num; i++)
1027 {
1028 struct entity *entity = &array->base[i];
1029 switch (entity->kind)
1030 {
1031 case ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION:
1036 RtlFreeHeap(GetProcessHeap(), 0, entity->u.comclass.version);
1037 for (j = 0; j < entity->u.comclass.progids.num; j++)
1038 RtlFreeHeap(GetProcessHeap(), 0, entity->u.comclass.progids.progids[j]);
1039 RtlFreeHeap(GetProcessHeap(), 0, entity->u.comclass.progids.progids);
1040 break;
1041 case ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION:
1047 break;
1048 case ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION:
1050 RtlFreeHeap(GetProcessHeap(), 0, entity->u.typelib.helpdir);
1051 break;
1052 case ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION:
1054 break;
1055 case ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES:
1059 break;
1060 default:
1061 FIXME("Unknown entity kind %d\n", entity->kind);
1062 }
1063 }
1064 RtlFreeHeap( GetProcessHeap(), 0, array->base );
1065}

Referenced by actctx_release().

◆ generate_uuid()

static void generate_uuid ( ULONG seed,
GUID guid 
)
static

Definition at line 4086 of file actctx.c.

4087{
4088 ULONG *ptr = (ULONG*)guid;
4089 int i;
4090
4091 /* GUID is 16 bytes long */
4092 for (i = 0; i < sizeof(GUID)/sizeof(ULONG); i++, ptr++)
4093 *ptr = RtlUniform(seed);
4094
4095 guid->Data3 &= 0x0fff;
4096 guid->Data3 |= (4 << 12);
4097 guid->Data4[0] &= 0x3f;
4098 guid->Data4[0] |= 0x80;
4099}
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 2034 of file actctx.c.

2035{
2036 static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
2037 struct assembly_version *ver = &assembly->id.version;
2038 WCHAR buff[25];
2039
2040 if (!ret) ret = buff;
2041 return sprintfW(ret, fmtW, ver->major, ver->minor, ver->build, ver->revision);
2042}
static unsigned char buff[32768]
Definition: fatten.c:17

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

4396{
4397 return (struct comclassredirect_data*)((BYTE*)actctx->comserver_section + index->data_offset);
4398}

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

4103{
4104 unsigned int i;
4105
4106 for (i = 0; i < entities->num; i++)
4107 {
4108 struct entity *entity = &entities->base[i];
4109 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4110 {
4111 /* each entry needs two index entries, extra one goes for alias GUID */
4112 *len += 2*sizeof(struct guid_index);
4113 /* To save some memory we don't allocated two data structures,
4114 instead alias index and normal index point to the same data structure. */
4115 *len += sizeof(struct comclassredirect_data);
4116
4117 /* for clrClass store some more */
4118 if (entity->u.comclass.name)
4119 {
4120 unsigned int str_len;
4121
4122 /* all string data is stored together in aligned block */
4123 str_len = strlenW(entity->u.comclass.name)+1;
4124 if (entity->u.comclass.progid)
4125 str_len += strlenW(entity->u.comclass.progid)+1;
4126 if (entity->u.comclass.version)
4127 str_len += strlenW(entity->u.comclass.version)+1;
4128
4129 *len += sizeof(struct clrclass_data);
4130 *len += aligned_string_len(str_len*sizeof(WCHAR));
4131
4132 /* module name is forced to mscoree.dll, and stored two times with different case */
4133 *module_len += sizeof(mscoreeW) + sizeof(mscoree2W);
4134 }
4135 else
4136 {
4137 /* progid string is stored separately */
4138 if (entity->u.comclass.progid)
4139 *len += aligned_string_len((strlenW(entity->u.comclass.progid)+1)*sizeof(WCHAR));
4140
4141 *module_len += (strlenW(dll->name)+1)*sizeof(WCHAR);
4142 }
4143
4144 *count += 1;
4145 }
4146 }
4147}

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

3650{
3651 return (struct dllredirect_data*)((BYTE*)ctxt->dllredirect_section + index->data_offset);
3652}
struct strsection_header * dllredirect_section
Definition: actctx.c:595

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

4609{
4610 return (struct ifacepsredirect_data*)((BYTE*)actctx->ifaceps_section + index->data_offset);
4611}

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

4441{
4442 unsigned int i;
4443
4444 for (i = 0; i < entities->num; i++)
4445 {
4446 struct entity *entity = &entities->base[i];
4447 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)
4448 {
4449 *len += sizeof(struct guid_index) + sizeof(struct ifacepsredirect_data);
4450 if (entity->u.ifaceps.name)
4451 *len += aligned_string_len((strlenW(entity->u.ifaceps.name)+1)*sizeof(WCHAR));
4452 *count += 1;
4453 }
4454 }
4455}
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 3151 of file actctx.c.

3153{
3154 static const WCHAR fmtW[] = { '.','%','l','u',0 };
3155 WCHAR *buffer;
3158 HANDLE file;
3160
3161 if (!((ULONG_PTR)resname >> 16)) resid = (ULONG_PTR)resname & 0xffff;
3162
3163 TRACE( "looking for manifest associated with %S id %lu\n", filename, resid );
3164
3165 if (module) /* use the module filename */
3166 {
3168
3169 if (!(status = get_module_filename( module, &name, sizeof(dotManifestW) + 10*sizeof(WCHAR) )))
3170 {
3171 if (resid != 1) sprintfW( name.Buffer + strlenW(name.Buffer), fmtW, resid );
3172 strcatW( name.Buffer, dotManifestW );
3173 if (!RtlDosPathNameToNtPathName_U( name.Buffer, &nameW, NULL, NULL ))
3176 }
3177 if (status) return status;
3178 }
3179 else
3180 {
3182 (strlenW(filename) + 10) * sizeof(WCHAR) + sizeof(dotManifestW) )))
3183 return STATUS_NO_MEMORY;
3185 if (resid != 1) sprintfW( buffer + strlenW(buffer), fmtW, resid );
3188 }
3189
3190 if (!open_nt_file( &file, &nameW ))
3191 {
3193 NtClose( file );
3194 }
3197 return status;
3198}
#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:2892
static const WCHAR dotManifestW[]
Definition: actctx.c:825
static NTSTATUS get_module_filename(HMODULE module, UNICODE_STRING *str, unsigned int extra_len)
Definition: actctx.c:2906
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:3107
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 3107 of file actctx.c.

3109{
3117 SIZE_T count;
3118 void *base;
3119
3120 TRACE( "loading manifest file %S\n", filename );
3121
3122 attr.Length = sizeof(attr);
3123 attr.RootDirectory = 0;
3124 attr.ObjectName = NULL;
3125 attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF;
3126 attr.SecurityDescriptor = NULL;
3127 attr.SecurityQualityOfService = NULL;
3128
3129 size.QuadPart = 0;
3132 if (status != STATUS_SUCCESS) return status;
3133
3134 offset.QuadPart = 0;
3135 count = 0;
3136 base = NULL;
3139 NtClose( mapping );
3140 if (status != STATUS_SUCCESS) return status;
3141
3143 if (status == STATUS_SUCCESS)
3144 status = parse_manifest(acl, ai, filename, directory, shared, base, info.EndOfFile.QuadPart);
3145
3147 return status;
3148}
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
#define GetCurrentProcess()
Definition: compat.h:759
@ FileEndOfFileInformation
Definition: from_kernel.h:81
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
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
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:2817
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 2929 of file actctx.c.

2932{
2937 void *ptr;
2938
2939 //DPRINT( "looking for res %s in module %p %s\n", resname,
2940 // hModule, filename );
2941 DPRINT("get_manifest_in_module %p\n", hModule);
2942
2943#if 0
2944 if (TRACE_ON(actctx))
2945 {
2946 if (!filename && !get_module_filename( hModule, &nameW, 0 ))
2947 {
2948 TRACE( "looking for res %s in module %p %s\n", debugstr_w(resname),
2949 hModule, debugstr_w(nameW.Buffer) );
2951 }
2952 else TRACE( "looking for res %s in module %p %s\n", debugstr_w(resname),
2954 }
2955#endif
2956
2957 if (!resname) return STATUS_INVALID_PARAMETER;
2958
2959 info.Type = RT_MANIFEST;
2960 info.Language = lang;
2961 if (!((ULONG_PTR)resname >> 16))
2962 {
2963 info.Name = (ULONG_PTR)resname;
2965 }
2966 else if (resname[0] == '#')
2967 {
2968 ULONG value;
2969 RtlInitUnicodeString(&nameW, resname + 1);
2972 info.Name = value;
2974 }
2975 else
2976 {
2977 RtlCreateUnicodeString(&nameW, resname);
2979 info.Name = (ULONG_PTR)nameW.Buffer;
2982 }
2984
2985 if (status == STATUS_SUCCESS)
2986 status = parse_manifest(acl, ai, filename, directory, shared, ptr, entry->Size);
2987
2988 return status;
2989}
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
uint32_t entry
Definition: isohybrid.c:63
#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 3051 of file actctx.c.

3054{
3060 SIZE_T count;
3061 void *base;
3062 WCHAR resnameBuf[20];
3063 LPCWSTR resptr = resname;
3064
3065 if ((!((ULONG_PTR)resname >> 16)))
3066 {
3067 sprintfW(resnameBuf, L"#%u", PtrToUlong(resname));
3068 resptr = resnameBuf;
3069 }
3070
3071 TRACE( "looking for res %S in %S\n", resptr, filename ? filename : L"<NULL>");
3072
3073 attr.Length = sizeof(attr);
3074 attr.RootDirectory = 0;
3075 attr.ObjectName = NULL;
3076 attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF;
3077 attr.SecurityDescriptor = NULL;
3078 attr.SecurityQualityOfService = NULL;
3079
3080 size.QuadPart = 0;
3083 if (status != STATUS_SUCCESS) return status;
3084
3085 offset.QuadPart = 0;
3086 count = 0;
3087 base = NULL;
3090 NtClose( mapping );
3091 if (status != STATUS_SUCCESS) return status;
3092
3093 if (RtlImageNtHeader(base)) /* we got a PE file */
3094 {
3095 HANDLE module = (HMODULE)((ULONG_PTR)base | 1); /* make it a LOAD_LIBRARY_AS_DATAFILE handle */
3096 if (resname)
3097 status = get_manifest_in_module( acl, ai, filename, directory, shared, module, resname, lang );
3098 else
3099 status = search_manifest_in_module(acl, ai, filename, directory, shared, module, lang);
3100 }
3102
3104 return status;
3105}
#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:2929
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,
unsigned int  extra_len 
)
static

Definition at line 2906 of file actctx.c.

2907{
2911
2914 if (status == STATUS_SUCCESS)
2915 {
2916 if ((str->Buffer = RtlAllocateHeap( GetProcessHeap(), 0,
2917 pldr->FullDllName.Length + extra_len + sizeof(WCHAR) )))
2918 {
2919 memcpy( str->Buffer, pldr->FullDllName.Buffer, pldr->FullDllName.Length + sizeof(WCHAR) );
2920 str->Length = pldr->FullDllName.Length;
2921 str->MaximumLength = pldr->FullDllName.Length + extra_len + sizeof(WCHAR);
2922 }
2923 else status = STATUS_NO_MEMORY;
2924 }
2926 return status;
2927}
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 1657 of file actctx.c.

1658{
1659 int min, max;
1660
1661 min = 0;
1662 max = sizeof(olemisc_values)/sizeof(struct olemisc_entry) - 1;
1663
1664 while (min <= max)
1665 {
1666 int n, c;
1667
1668 n = (min+max)/2;
1669
1671 if (!c && !olemisc_values[n].name[len])
1672 return olemisc_values[n].value;
1673
1674 if (c >= 0)
1675 max = n-1;
1676 else
1677 min = n+1;
1678 }
1679
1680 WARN("unknown flag %S\n", str);
1681 return 0;
1682}
GLdouble n
Definition: glext.h:7729
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
#define min(a, b)
Definition: monoChain.cc:55
#define strncmpW(s1, s2, n)
Definition: unicode.h:36
static const struct olemisc_entry olemisc_values[]
Definition: actctx.c:797
Definition: actctx.c:792
#define max(a, b)
Definition: svc.c:63

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

4981{
4982 return (struct progidredirect_data*)((BYTE*)actctx->progid_section + index->data_offset);
4983}

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

4810{
4811 unsigned int i, j, single_len;
4812
4813 single_len = sizeof(struct progidredirect_data) + sizeof(struct string_index) + sizeof(GUID);
4814 for (i = 0; i < entities->num; i++)
4815 {
4816 struct entity *entity = &entities->base[i];
4817 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4818 {
4819 if (entity->u.comclass.progid)
4820 {
4821 *total_len += single_len + aligned_string_len((strlenW(entity->u.comclass.progid)+1)*sizeof(WCHAR));
4822 *count += 1;
4823 }
4824
4825 for (j = 0; j < entity->u.comclass.progids.num; j++)
4826 *total_len += aligned_string_len((strlenW(entity->u.comclass.progids.progids[j])+1)*sizeof(WCHAR));
4827
4828 *total_len += single_len*entity->u.comclass.progids.num;
4829 *count += entity->u.comclass.progids.num;
4830 }
4831 }
4832}

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

4763{
4764 return (struct clrsurrogate_data*)((BYTE*)actctx->clrsurrogate_section + index->data_offset);
4765}

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

4043{
4044 return (struct tlibredirect_data*)((BYTE*)actctx->tlib_section + index->data_offset);
4045}

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

3705{
3706 return (struct wndclass_redirect_data*)((BYTE*)ctxt->wndclass_section + index->data_offset);
3707}
struct strsection_header * wndclass_section
Definition: actctx.c:594

Referenced by find_window_class().

◆ get_wndclass_first_index()

static struct string_index * get_wndclass_first_index ( ACTIVATION_CONTEXT actctx)
inlinestatic

Definition at line 3699 of file actctx.c.

3700{
3701 return (struct string_index*)((BYTE*)actctx->wndclass_section + actctx->wndclass_section->index_offset);
3702}

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

1075{
1076 if (!is_matching_string( id1->name, id2->name )) return FALSE;
1077 if (!is_matching_string( id1->arch, id2->arch )) return FALSE;
1078 if (!is_matching_string( id1->public_key, id2->public_key )) return FALSE;
1079
1080 if (id1->language && id2->language && strcmpiW( id1->language, id2->language ))
1081 {
1082 if (strcmpW( wildcardW, id1->language ) && strcmpW( wildcardW, id2->language ))
1083 return FALSE;
1084 }
1085 if (id1->version.major != id2->version.major) return FALSE;
1086 if (id1->version.minor != id2->version.minor) return FALSE;
1087 if (id1->version.build > id2->version.build) return FALSE;
1088 if (id1->version.build == id2->version.build &&
1089 id1->version.revision > id2->version.revision) return FALSE;
1090 return TRUE;
1091}
#define strcmpW(s1, s2)
Definition: unicode.h:38
static BOOL is_matching_string(const WCHAR *str1, const WCHAR *str2)
Definition: actctx.c:1067
static const WCHAR wildcardW[]
Definition: actctx.c:827

Referenced by add_dependent_assembly_id().

◆ is_matching_string()

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

Definition at line 1067 of file actctx.c.

1068{
1069 if (!str1) return !str2;
1070 return str2 && !strcmpiW( str1, str2 );
1071}

Referenced by is_matching_identity().

◆ is_xmlns_attr()

static BOOL is_xmlns_attr ( const struct xml_attr attr)
static

Definition at line 1304 of file actctx.c.

1305{
1306 const int len = wcslen( xmlnsW );
1307 if (attr->name.len < len) return FALSE;
1308 if (wcsncmp( attr->name.ptr, xmlnsW, len )) return FALSE;
1309 return (attr->name.len == len || attr->name.ptr[len] == ':');
1310}
static const WCHAR xmlnsW[]
Definition: actctx.c:721
WCHAR * name
Definition: cookie.c:203

Referenced by next_xml_elem().

◆ isxmlspace()

static BOOL isxmlspace ( WCHAR  ch)
inlinestatic

Definition at line 893 of file actctx.c.

894{
895 return (ch == ' ' || ch == '\r' || ch == '\n' || ch == '\t');
896}

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

3361{
3362 static const WCHAR dotDllW[] = {'.','d','l','l',0};
3363 unsigned int i;
3364 WCHAR *buffer, *p, *directory;
3367 HANDLE file;
3368 DWORD len;
3369
3370 TRACE( "looking for name=%S version=%u.%u.%u.%u arch=%S\n",
3371 ai->name, ai->version.major, ai->version.minor, ai->version.build, ai->version.revision, ai->arch );
3372
3373 if ((status = lookup_winsxs(acl, ai)) != STATUS_NO_SUCH_FILE) return status;
3374
3375 /* FIXME: add support for language specific lookup */
3376
3377 len = max(RtlGetFullPathName_U(acl->actctx->assemblies->manifest.info, 0, NULL, NULL) / sizeof(WCHAR),
3378 strlenW(acl->actctx->appdir.info));
3379
3380 nameW.Buffer = NULL;
3382 (len + 2 * strlenW(ai->name) + 2) * sizeof(WCHAR) + sizeof(dotManifestW) )))
3383 return STATUS_NO_MEMORY;
3384
3385 if (!(directory = build_assembly_dir( ai )))
3386 {
3388 return STATUS_NO_MEMORY;
3389 }
3390
3391 /* Lookup in <dir>\name.dll
3392 * <dir>\name.manifest
3393 * <dir>\name\name.dll
3394 * <dir>\name\name.manifest
3395 *
3396 * First 'appdir' is used as <dir>, if that failed
3397 * it tries application manifest file path.
3398 */
3399 strcpyW( buffer, acl->actctx->appdir.info );
3400 p = buffer + strlenW(buffer);
3401 for (i = 0; i < 4; i++)
3402 {
3403 if (i == 2)
3404 {
3405 struct assembly *assembly = acl->actctx->assemblies;
3406 if (!RtlGetFullPathName_U(assembly->manifest.info, len * sizeof(WCHAR), buffer, &p)) break;
3407 }
3408 else *p++ = '\\';
3409
3410 strcpyW( p, ai->name );
3411 p += strlenW(p);
3412
3413 strcpyW( p, dotDllW );
3415 {
3416 status = open_nt_file( &file, &nameW );
3417 if (!status)
3418 {
3421 NtClose( file );
3422 break;
3423 }
3425 }
3426
3429 {
3430 status = open_nt_file( &file, &nameW );
3431 if (!status)
3432 {
3434 NtClose( file );
3435 break;
3436 }
3438 }
3440 }
3444 return status;
3445}
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:1150
static NTSTATUS lookup_winsxs(struct actctx_loader *acl, struct assembly_identity *ai)
Definition: actctx.c:3285
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:3051
struct file_info appdir
Definition: actctx.c:588
#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 3200 of file actctx.c.

3201{
3202 static const WCHAR lookup_fmtW[] =
3203 {'%','s','_','%','s','_','%','s','_','%','u','.','%','u','.','*','.','*','_',
3204 '%','s','_','*','.','m','a','n','i','f','e','s','t',0};
3205 static const WCHAR wine_trailerW[] = {'d','e','a','d','b','e','e','f','.','m','a','n','i','f','e','s','t'};
3206
3207 WCHAR *lookup, *ret = NULL;
3208 UNICODE_STRING lookup_us;
3210 const WCHAR *lang = ai->language;
3211 unsigned int data_pos = 0, data_len;
3212 char buffer[8192];
3213
3215 (strlenW(ai->arch) + strlenW(ai->name)
3216 + strlenW(ai->public_key) + 20) * sizeof(WCHAR)
3217 + sizeof(lookup_fmtW) )))
3218 return NULL;
3219
3220 if (!lang || !strcmpiW( lang, neutralW )) lang = wildcardW;
3221 sprintfW( lookup, lookup_fmtW, ai->arch, ai->name, ai->public_key,
3222 ai->version.major, ai->version.minor, lang );
3223 RtlInitUnicodeString( &lookup_us, lookup );
3224
3225 if (!NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer),
3226 FileBothDirectoryInformation, FALSE, &lookup_us, TRUE ))
3227 {
3228 ULONG min_build = ai->version.build, min_revision = ai->version.revision;
3229 FILE_BOTH_DIR_INFORMATION *dir_info;
3230 WCHAR *tmp;
3231 ULONG build, revision;
3232
3233 data_len = io.Information;
3234
3235 for (;;)
3236 {
3237 if (data_pos >= data_len)
3238 {
3239 if (NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer),
3241 break;
3242 data_len = io.Information;
3243 data_pos = 0;
3244 }
3245 dir_info = (FILE_BOTH_DIR_INFORMATION*)(buffer + data_pos);
3246
3247 if (dir_info->NextEntryOffset) data_pos += dir_info->NextEntryOffset;
3248 else data_pos = data_len;
3249
3250 tmp = (WCHAR *)dir_info->FileName + (strchrW(lookup, '*') - lookup);
3251 build = atoiW(tmp);
3252 if (build < min_build) continue;
3253 tmp = strchrW(tmp, '.') + 1;
3254 revision = atoiW(tmp);
3255 if (build == min_build && revision < min_revision) continue;
3256 tmp = strchrW(tmp, '_') + 1;
3257 tmp = strchrW(tmp, '_') + 1;
3258 if (dir_info->FileNameLength - (tmp - dir_info->FileName) * sizeof(WCHAR) == sizeof(wine_trailerW) &&
3259 !memicmpW( tmp, wine_trailerW, sizeof(wine_trailerW) / sizeof(WCHAR) ))
3260 {
3261 /* prefer a non-Wine manifest if we already have one */
3262 /* we'll still load the builtin dll if specified through DllOverrides */
3263 if (ret) continue;
3264 }
3265 else
3266 {
3267 min_build = build;
3268 min_revision = revision;
3269 }
3270 ai->version.build = build;
3271 ai->version.revision = revision;
3273 if ((ret = RtlAllocateHeap( GetProcessHeap(), 0, dir_info->FileNameLength + sizeof(WCHAR) )))
3274 {
3275 memcpy( ret, dir_info->FileName, dir_info->FileNameLength );
3276 ret[dir_info->FileNameLength/sizeof(WCHAR)] = 0;
3277 }
3278 }
3279 }
3280 else WARN("no matching file for %S\n", lookup);
3282 return ret;
3283}
unsigned int dir
Definition: maze.c:112
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 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:710

Referenced by lookup_winsxs().

◆ lookup_winsxs()

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

Definition at line 3285 of file actctx.c.

3286{
3287 struct assembly_identity sxs_ai;
3288 UNICODE_STRING path_us;
3291 WCHAR *path, *file = NULL;
3292 HANDLE handle;
3293
3294 static const WCHAR manifest_dirW[] =
3295 {'\\','w','i','n','s','x','s','\\','m','a','n','i','f','e','s','t','s',0};
3296
3297 if (!ai->arch || !ai->name || !ai->public_key) return STATUS_NO_SUCH_FILE;
3298
3299 if (!(path = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(manifest_dirW) +
3300 strlenW(user_shared_data->NtSystemRoot) * sizeof(WCHAR) )))
3301 return STATUS_NO_MEMORY;
3302
3303 strcpyW( path, user_shared_data->NtSystemRoot );
3304 memcpy( path + strlenW(path), manifest_dirW, sizeof(manifest_dirW) );
3305
3306 if (!RtlDosPathNameToNtPathName_U( path, &path_us, NULL, NULL ))
3307 {
3309 return STATUS_NO_SUCH_FILE;
3310 }
3312
3313 attr.Length = sizeof(attr);
3314 attr.RootDirectory = 0;
3315 attr.Attributes = OBJ_CASE_INSENSITIVE;
3316 attr.ObjectName = &path_us;
3317 attr.SecurityDescriptor = NULL;
3318 attr.SecurityQualityOfService = NULL;
3319
3322 {
3323 sxs_ai = *ai;
3324 file = lookup_manifest_file( handle, &sxs_ai );
3325 NtClose( handle );
3326 }
3327 if (!file)
3328 {
3329 RtlFreeUnicodeString( &path_us );
3330 return STATUS_NO_SUCH_FILE;
3331 }
3332
3333 /* append file name to directory path */
3334 if (!(path = RtlReAllocateHeap( GetProcessHeap(), 0, path_us.Buffer,
3335 path_us.Length + (strlenW(file) + 2) * sizeof(WCHAR) )))
3336 {
3338 RtlFreeUnicodeString( &path_us );
3339 return STATUS_NO_MEMORY;
3340 }
3341
3342 path[path_us.Length/sizeof(WCHAR)] = '\\';
3343 strcpyW( path + path_us.Length/sizeof(WCHAR) + 1, file );
3344 RtlInitUnicodeString( &path_us, path );
3345 *strrchrW(file, '.') = 0; /* remove .manifest extension */
3346
3347 if (!open_nt_file( &handle, &path_us ))
3348 {
3349 io.Status = get_manifest_in_manifest_file(acl, &sxs_ai, path_us.Buffer, file, TRUE, handle);
3350 NtClose( handle );
3351 }
3352 else io.Status = STATUS_NO_SUCH_FILE;
3353
3355 RtlFreeUnicodeString( &path_us );
3356 return io.Status;
3357}
#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:3200

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

1348{
1349 const WCHAR* ptr;
1350 WCHAR quote;
1351
1352 if (xmlbuf->error) return FALSE;
1353
1354 while (xmlbuf->ptr < xmlbuf->end && isxmlspace(*xmlbuf->ptr))
1355 xmlbuf->ptr++;
1356
1357 if (xmlbuf->ptr == xmlbuf->end) return set_error( xmlbuf );
1358
1359 if (*xmlbuf->ptr == '/')
1360 {
1361 xmlbuf->ptr++;
1362 if (xmlbuf->ptr == xmlbuf->end || *xmlbuf->ptr != '>')
1363 return set_error( xmlbuf );
1364
1365 xmlbuf->ptr++;
1366 *end = TRUE;
1367 return FALSE;
1368 }
1369
1370 if (*xmlbuf->ptr == '>')
1371 {
1372 xmlbuf->ptr++;
1373 return FALSE;
1374 }
1375
1376 ptr = xmlbuf->ptr;
1377 while (ptr < xmlbuf->end && *ptr != '=' && *ptr != '>' && !isxmlspace(*ptr)) ptr++;
1378
1379 if (ptr == xmlbuf->end) return set_error( xmlbuf );
1380
1381 attr->name.ptr = xmlbuf->ptr;
1382 attr->name.len = ptr-xmlbuf->ptr;
1383 xmlbuf->ptr = ptr;
1384
1385 /* skip spaces before '=' */
1386 while (ptr < xmlbuf->end && *ptr != '=' && isxmlspace(*ptr)) ptr++;
1387 if (ptr == xmlbuf->end || *ptr != '=') return set_error( xmlbuf );
1388
1389 /* skip '=' itself */
1390 ptr++;
1391 if (ptr == xmlbuf->end) return set_error( xmlbuf );
1392
1393 /* skip spaces after '=' */
1394 while (ptr < xmlbuf->end && *ptr != '"' && *ptr != '\'' && isxmlspace(*ptr)) ptr++;
1395
1396 if (ptr == xmlbuf->end || (*ptr != '"' && *ptr != '\'')) return set_error( xmlbuf );
1397
1398 quote = *ptr++;
1399 attr->value.ptr = ptr;
1400 if (ptr == xmlbuf->end) return set_error( xmlbuf );
1401
1402 while (ptr < xmlbuf->end && *ptr != quote) ptr++;
1403 if (ptr == xmlbuf->end)
1404 {
1405 xmlbuf->ptr = xmlbuf->end;
1406 return set_error( xmlbuf );
1407 }
1408
1409 attr->value.len = ptr - attr->value.ptr;
1410 xmlbuf->ptr = ptr + 1;
1411 if (xmlbuf->ptr != xmlbuf->end) return TRUE;
1412
1413 return set_error( xmlbuf );
1414}
static const WCHAR quote[]
Definition: reg.c:40
GLuint GLuint end
Definition: gl.h:1545
static BOOL isxmlspace(WCHAR ch)
Definition: actctx.c:893
static BOOL set_error(xmlbuf_t *xmlbuf)
Definition: actctx.c:1298
WCHAR * value
Definition: cookie.c:204
BOOL error
Definition: actctx.c:132
const WCHAR * end
Definition: actctx.c:129
const WCHAR * ptr
Definition: actctx.c:128

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

1437{
1438 const WCHAR* ptr;
1439 struct xml_attr attr;
1440 xmlbuf_t attr_buf;
1441 BOOL end = FALSE;
1442
1443 xmlbuf->ns_pos = parent->ns_pos; /* restore namespace stack to parent state */
1444
1445 if (xmlbuf->error) return FALSE;
1446
1447 for (;;)
1448 {
1449 for (ptr = xmlbuf->ptr; ptr < xmlbuf->end; ptr++) if (*ptr == '<') break;
1450 if (ptr == xmlbuf->end)
1451 {
1452 xmlbuf->ptr = xmlbuf->end;
1453 return set_error( xmlbuf );
1454 }
1455 ptr++;
1456 if (ptr + 3 < xmlbuf->end && ptr[0] == '!' && ptr[1] == '-' && ptr[2] == '-') /* skip comment */
1457 {
1458 for (ptr += 3; ptr + 3 <= xmlbuf->end; ptr++)
1459 if (ptr[0] == '-' && ptr[1] == '-' && ptr[2] == '>') break;
1460
1461 if (ptr + 3 > xmlbuf->end)
1462 {
1463 xmlbuf->ptr = xmlbuf->end;
1464 return set_error( xmlbuf );
1465 }
1466 xmlbuf->ptr = ptr + 3;
1467 }
1468 else break;
1469 }
1470
1471 xmlbuf->ptr = ptr;
1472 /* check for element terminating the parent element */
1473 if (ptr < xmlbuf->end && *ptr == '/')
1474 {
1475 xmlbuf->ptr++;
1476 read_xml_elem( xmlbuf, elem );
1477 elem->ns = find_xmlns( xmlbuf, &elem->ns );
1478 if (!xml_name_cmp( elem, parent ))
1479 {
1480 /*ERR( "wrong closing element %s for %s\n",
1481 debugstr_xmlstr(&elem->name), debugstr_xmlstr(&parent->name ));*/
1482 return set_error( xmlbuf );
1483 }
1484 while (xmlbuf->ptr < xmlbuf->end && isxmlspace(*xmlbuf->ptr)) xmlbuf->ptr++;
1485 if (xmlbuf->ptr == xmlbuf->end || *xmlbuf->ptr++ != '>') return set_error( xmlbuf );
1486 return FALSE;
1487 }
1488
1489 read_xml_elem( xmlbuf, elem );
1490
1491 /* parse namespace attributes */
1492 attr_buf = *xmlbuf;
1493 while (next_xml_attr( &attr_buf, &attr, &end ))
1494 {
1495 if (is_xmlns_attr( &attr )) push_xmlns( xmlbuf, &attr );
1496 }
1497 elem->ns = find_xmlns( xmlbuf, &elem->ns );
1498 elem->ns_pos = xmlbuf->ns_pos;
1499
1500 if (xmlbuf->ptr != xmlbuf->end) return TRUE;
1501
1502 return set_error( xmlbuf );
1503}
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:1416
static BOOL next_xml_attr(xmlbuf_t *xmlbuf, struct xml_attr *attr, BOOL *end)
Definition: actctx.c:1347
static void push_xmlns(xmlbuf_t *xmlbuf, const struct xml_attr *attr)
Definition: actctx.c:1312
static BOOL xml_name_cmp(const struct xml_elem *elem1, const struct xml_elem *elem2)
Definition: actctx.c:869
static BOOL is_xmlns_attr(const struct xml_attr *attr)
Definition: actctx.c:1304
static xmlstr_t find_xmlns(xmlbuf_t *xmlbuf, const xmlstr_t *name)
Definition: actctx.c:1333

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

2893{
2896
2897 attr.Length = sizeof(attr);
2898 attr.RootDirectory = 0;
2899 attr.Attributes = OBJ_CASE_INSENSITIVE;
2900 attr.ObjectName = name;
2901 attr.SecurityDescriptor = NULL;
2902 attr.SecurityQualityOfService = NULL;
2904}
#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 1844 of file actctx.c.

1846{
1847 struct entity *entity;
1848 WCHAR *str;
1849
1850 if (!clsid) return;
1851
1852 if (!(str = strdupW(clsid)))
1853 {
1854 set_error( xmlbuf );
1855 return;
1856 }
1857
1858 if (!(entity = add_entity(entities, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)))
1859 {
1861 set_error( xmlbuf );
1862 return;
1863 }
1864
1865 entity->u.comclass.clsid = str;
1867
1869}
static struct entity * add_entity(struct entity_array *array, DWORD kind)
Definition: actctx.c:995
static WCHAR * strdupW(const WCHAR *str)
Definition: actctx.c:833

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

2553{
2554 struct xml_elem elem;
2555
2556 while (next_xml_elem( xmlbuf, &elem, parent ))
2557 {
2559 {
2560 parse_windows_settings_elem( xmlbuf, assembly, acl, &elem );
2561 }
2562 else
2563 {
2564 parse_unknown_elem( xmlbuf, &elem );
2565 }
2566 }
2567}
static const WCHAR asmv3W[]
Definition: actctx.c:627
static const WCHAR windowsSettingsW[]
Definition: actctx.c:774
static BOOL next_xml_elem(xmlbuf_t *xmlbuf, struct xml_elem *elem, const struct xml_elem *parent)
Definition: actctx.c:1436
static void parse_windows_settings_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2523
static void parse_unknown_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:1587
static BOOL xml_elem_cmp(const struct xml_elem *elem, const WCHAR *str, const WCHAR *namespace)
Definition: actctx.c:877

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

2672{
2673 struct xml_elem elem;
2674 struct xml_attr attr;
2675 BOOL end = FALSE, version = FALSE;
2676
2677 while (next_xml_attr(xmlbuf, &attr, &end))
2678 {
2680 {
2681 static const WCHAR v10W[] = {'1','.','0',0};
2682 if (!xmlstr_cmp(&attr.value, v10W))
2683 {
2684 break;
2685 }
2686 version = TRUE;
2687 }
2688 }
2689
2690 if (end || !version)
2691 {
2692 set_error( xmlbuf );
2693 return;
2694 }
2695
2696 while (next_xml_elem(xmlbuf, &elem, parent))
2697 {
2699 {
2700 parse_noinherit_elem(xmlbuf, &elem);
2702 }
2704 {
2706 }
2707 else if (xml_elem_cmp(&elem, descriptionW, asmv1W))
2708 {
2709 parse_description_elem(xmlbuf, &elem);
2710 }
2712 {
2714 }
2715 else if (xml_elem_cmp(&elem, dependencyW, asmv1W))
2716 {
2717 parse_dependency_elem(xmlbuf, acl, &elem);
2718 }
2719 else if (xml_elem_cmp(&elem, fileW, asmv1W))
2720 {
2721 parse_file_elem(xmlbuf, assembly, acl, &elem);
2722 }
2723 else if (xml_elem_cmp(&elem, clrClassW, asmv1W))
2724 {
2725 parse_clr_class_elem(xmlbuf, assembly, acl, &elem);
2726 }
2728 {
2729 parse_clr_surrogate_elem(xmlbuf, assembly, acl, &elem);
2730 }
2731 else if (xml_elem_cmp(&elem, trustInfoW, asmv1W))
2732 {
2733 parse_trust_info_elem(xmlbuf, assembly, acl, &elem);
2734 }
2736 {
2738
2739 if (!xmlbuf->error && expected_ai)
2740 {
2741 /* FIXME: more tests */
2743 memcmp(&assembly->id.version, &expected_ai->version, sizeof(assembly->id.version)))
2744 {
2745 set_error( xmlbuf );
2746 }
2747 else if (assembly->type == ASSEMBLY_SHARED_MANIFEST &&
2748 (assembly->id.version.major != expected_ai->version.major ||
2749 assembly->id.version.minor != expected_ai->version.minor ||
2750 assembly->id.version.build < expected_ai->version.build ||
2751 (assembly->id.version.build == expected_ai->version.build &&
2752 assembly->id.version.revision < expected_ai->version.revision)))
2753 {
2754 set_error( xmlbuf );
2755 }
2756 }
2757 }
2759 {
2760 parse_compatibility_elem(xmlbuf, assembly, acl, &elem);
2761 }
2762 else if (xml_elem_cmp(&elem, applicationW, asmv3W))
2763 {
2764 parse_application_elem(xmlbuf, assembly, acl, &elem);
2765 }
2766 else
2767 {
2768 parse_unknown_elem(xmlbuf, &elem);
2769 }
2770 }
2771
2774 {
2775 set_error( xmlbuf );
2776 }
2777}
static void parse_noinheritable_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2346
static const WCHAR fileW[]
Definition: actctx.c:696
static const WCHAR trustInfoW[]
Definition: actctx.c:773
static const WCHAR noInheritW[]
Definition: actctx.c:698
static const WCHAR clrSurrogateW[]
Definition: actctx.c:689
static void parse_noinherit_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2338
static const WCHAR applicationW[]
Definition: actctx.c:767
static const WCHAR comInterfaceExternalProxyStubW[]
Definition: actctx.c:691
static const WCHAR assemblyIdentityW[]
Definition: actctx.c:686
static const WCHAR compatibilityW[]
Definition: actctx.c:765
static const WCHAR asmv1W[]
Definition: actctx.c:625
static void parse_file_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2354
static void parse_description_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2103
static void parse_application_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2551
static const WCHAR manifestVersionW[]
Definition: actctx.c:708
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:2121
static const WCHAR dependencyW[]
Definition: actctx.c:693
static BOOL xml_attr_cmp(const struct xml_attr *attr, const WCHAR *str)
Definition: actctx.c:864
static const WCHAR noInheritableW[]
Definition: actctx.c:699
static BOOL xmlstr_cmp(const xmlstr_t *xmlstr, const WCHAR *str)
Definition: actctx.c:854
static const WCHAR clrClassW[]
Definition: actctx.c:688
static void parse_assembly_identity_elem(xmlbuf_t *xmlbuf, ACTIVATION_CONTEXT *actctx, struct assembly_identity *ai, const struct xml_elem *parent)
Definition: actctx.c:1600
static void parse_clr_class_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2170
static void parse_compatibility_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2472
static void parse_clr_surrogate_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2234
static void parse_trust_info_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2651
static void parse_dependency_elem(xmlbuf_t *xmlbuf, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2309
static const WCHAR compatibilityNSW[]
Definition: actctx.c:766
static const WCHAR descriptionW[]
Definition: actctx.c:695
BOOL no_inherit
Definition: actctx.c:530

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

1602{
1603 struct xml_attr attr;
1604 BOOL end = FALSE;
1605
1606 while (next_xml_attr(xmlbuf, &attr, &end))
1607 {
1608 if (xml_attr_cmp(&attr, g_nameW))
1609 {
1610 if (!(ai->name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1611 }
1612 else if (xml_attr_cmp(&attr, typeW))
1613 {
1614 if (!(ai->type = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1615 }
1616 else if (xml_attr_cmp(&attr, versionW))
1617 {
1618 if (!parse_version(&attr.value, &ai->version)) set_error( xmlbuf );
1619 }
1621 {
1622 if (!(ai->arch = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1623 }
1624 else if (xml_attr_cmp(&attr, publicKeyTokenW))
1625 {
1626 if (!(ai->public_key = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1627 }
1628 else if (xml_attr_cmp(&attr, languageW))
1629 {
1630 if (!(ai->language = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1631 }
1632 }
1633
1634 if (!end) parse_expect_end_elem(xmlbuf, parent);
1635}
static const WCHAR versionW[]
Definition: name.c:52
static const WCHAR processorArchitectureW[]
Definition: actctx.c:714
static const WCHAR languageW[]
Definition: actctx.c:707
static void parse_expect_end_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:1576
static const WCHAR typeW[]
Definition: actctx.c:719
static const WCHAR publicKeyTokenW[]
Definition: actctx.c:716
static BOOL parse_version(const xmlstr_t *str, struct assembly_version *version)
Definition: actctx.c:1534
static const WCHAR g_nameW[]
Definition: actctx.c:709

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

2084{
2085 struct xml_attr attr;
2086 BOOL end = FALSE;
2087
2088 while (next_xml_attr(xmlbuf, &attr, &end))
2089 {
2091 {
2092 // FIXME("Not stored yet %s\n", debugstr_xml_attr(&attr));
2093 }
2094 else if (xml_attr_cmp(&attr, newVersionW))
2095 {
2096 // FIXME("Not stored yet %s\n", debugstr_xml_attr(&attr));
2097 }
2098 }
2099
2100 if (!end) parse_expect_end_elem(xmlbuf, parent);
2101}
static const WCHAR newVersionW[]
Definition: actctx.c:711
static const WCHAR oldVersionW[]
Definition: actctx.c:712

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

2173{
2174 struct xml_elem elem;
2175 struct xml_attr attr;
2176 BOOL end = FALSE;
2177 struct entity* entity;
2178
2179 if (!(entity = add_entity(&assembly->entities, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)))
2180 {
2181 set_error( xmlbuf );
2182 return;
2183 }
2184
2185 while (next_xml_attr(xmlbuf, &attr, &end))
2186 {
2187 if (xml_attr_cmp(&attr, g_nameW))
2188 {
2189 if (!(entity->u.comclass.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2190 }
2191 else if (xml_attr_cmp(&attr, clsidW))
2192 {
2193 if (!(entity->u.comclass.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2194 }
2195 else if (xml_attr_cmp(&attr, progidW))
2196 {
2197 if (!(entity->u.comclass.progid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2198 }
2199 else if (xml_attr_cmp(&attr, tlbidW))
2200 {
2201 if (!(entity->u.comclass.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2202 }
2203 else if (xml_attr_cmp(&attr, threadingmodelW))
2204 {
2206 }
2207 else if (xml_attr_cmp(&attr, runtimeVersionW))
2208 {
2209 if (!(entity->u.comclass.version = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2210 }
2211 }
2212
2214 if (entity->u.comclass.progid)
2216 if (end) return;
2217
2218 while (next_xml_elem(xmlbuf, &elem, parent))
2219 {
2221 {
2223 }
2224 else
2225 {
2226 parse_unknown_elem(xmlbuf, &elem);
2227 }
2228 }
2229
2230 if (entity->u.comclass.progids.num)
2232}
static const WCHAR progidW[]
Definition: compobj.c:112
static const WCHAR runtimeVersionW[]
Definition: actctx.c:738
static const WCHAR threadingmodelW[]
Definition: actctx.c:717
static void parse_com_class_progid(xmlbuf_t *xmlbuf, struct entity *entity, const struct xml_elem *parent)
Definition: actctx.c:1731
static const WCHAR tlbidW[]
Definition: actctx.c:718
static enum comclass_threadingmodel parse_com_class_threadingmodel(xmlstr_t *value)
Definition: actctx.c:1637
static const WCHAR clsidW[]
Definition: actctx.c:703

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

2236{
2237 struct xml_attr attr;
2238 BOOL end = FALSE;
2239 struct entity* entity;
2240
2241 if (!(entity = add_entity(&assembly->entities, ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)))
2242 {
2243 set_error( xmlbuf );
2244 return;
2245 }
2246
2247 while (next_xml_attr(xmlbuf, &attr, &end))
2248 {
2249 if (xml_attr_cmp(&attr, g_nameW))
2250 {
2251 if (!(entity->u.clrsurrogate.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2252 }
2253 else if (xml_attr_cmp(&attr, clsidW))
2254 {
2255 if (!(entity->u.clrsurrogate.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2256 }
2257 else if (xml_attr_cmp(&attr, runtimeVersionW))
2258 {
2259 if (!(entity->u.clrsurrogate.version = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2260 }
2261 }
2262
2264 if (!end) parse_expect_end_elem(xmlbuf, parent);
2265}

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

1746{
1747 struct xml_elem elem;
1748 struct xml_attr attr;
1749 BOOL end = FALSE;
1750 struct entity* entity;
1751
1752 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)))
1753 {
1754 set_error( xmlbuf );
1755 return;
1756 }
1757
1758 while (next_xml_attr(xmlbuf, &attr, &end))
1759 {
1760 if (xml_attr_cmp(&attr, clsidW))
1761 {
1762 if (!(entity->u.comclass.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1763 }
1764 else if (xml_attr_cmp(&attr, progidW))
1765 {
1766 if (!(entity->u.comclass.progid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1767 }
1768 else if (xml_attr_cmp(&attr, tlbidW))
1769 {
1770 if (!(entity->u.comclass.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1771 }
1772 else if (xml_attr_cmp(&attr, threadingmodelW))
1773 {
1775 }
1776 else if (xml_attr_cmp(&attr, miscstatusW))
1777 {
1779 }
1781 {
1782 entity->u.comclass.miscstatuscontent = parse_com_class_misc(&attr.value);
1783 }
1785 {
1786 entity->u.comclass.miscstatusthumbnail = parse_com_class_misc(&attr.value);
1787 }
1788 else if (xml_attr_cmp(&attr, miscstatusiconW))
1789 {
1790 entity->u.comclass.miscstatusicon = parse_com_class_misc(&attr.value);
1791 }
1793 {
1794 entity->u.comclass.miscstatusdocprint = parse_com_class_misc(&attr.value);
1795 }
1796 else if (xml_attr_cmp(&attr, descriptionW))
1797 {
1798 /* not stored */
1799 }
1800 }
1801
1803 if (entity->u.comclass.progid)
1805
1806 if (end) return;
1807
1808 while (next_xml_elem(xmlbuf, &elem, parent))
1809 {
1811 {
1813 }
1814 else
1815 {
1816 parse_unknown_elem(xmlbuf, &elem);
1817 }
1818 }
1819
1820 if (entity->u.comclass.progids.num)
1822}
static const WCHAR miscstatusdocprintW[]
Definition: actctx.c:734
static DWORD parse_com_class_misc(const xmlstr_t *value)
Definition: actctx.c:1684
static const WCHAR miscstatusW[]
Definition: actctx.c:730
static const WCHAR miscstatuscontentW[]
Definition: actctx.c:732
static const WCHAR miscstatusiconW[]
Definition: actctx.c:731
static const WCHAR miscstatusthumbnailW[]
Definition: actctx.c:733

Referenced by parse_file_elem().

◆ parse_com_class_misc()

static DWORD parse_com_class_misc ( const xmlstr_t value)
static

Definition at line 1684 of file actctx.c.

1685{
1686 const WCHAR *str = value->ptr, *start;
1687 DWORD flags = 0;
1688 int i = 0;
1689
1690 /* it's comma separated list of flags */
1691 while (i < value->len)
1692 {
1693 start = str;
1694 while (*str != ',' && (i++ < value->len)) str++;
1695
1697
1698 /* skip separator */
1699 str++;
1700 i++;
1701 }
1702
1703 return flags;
1704}
GLuint start
Definition: gl.h:1545
static OLEMISC get_olemisc_value(const WCHAR *str, int len)
Definition: actctx.c:1657

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

1732{
1734 BOOL end = FALSE;
1735
1736 parse_expect_no_attr(xmlbuf, &end);
1737 if (end) set_error( xmlbuf );
1738 if (!parse_text_content(xmlbuf, &content)) return;
1739
1740 if (!com_class_add_progid(&content, entity)) set_error( xmlbuf );
1742}
content
Definition: atl_ax.c:994
static BOOL parse_text_content(xmlbuf_t *xmlbuf, xmlstr_t *content)
Definition: actctx.c:1521
static void parse_expect_no_attr(xmlbuf_t *xmlbuf, BOOL *end)
Definition: actctx.c:1565
static BOOL com_class_add_progid(const xmlstr_t *progid, struct entity *entity)
Definition: actctx.c:1706

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

1638{
1639 static const WCHAR apartW[] = {'A','p','a','r','t','m','e','n','t',0};
1640 static const WCHAR neutralW[] = {'N','e','u','t','r','a','l',0};
1641 static const WCHAR freeW[] = {'F','r','e','e',0};
1642 static const WCHAR bothW[] = {'B','o','t','h',0};
1643
1644 if (value->len == 0) return ThreadingModel_No;
1645 if (xmlstr_cmp(value, apartW))
1647 else if (xmlstr_cmp(value, freeW))
1648 return ThreadingModel_Free;
1649 else if (xmlstr_cmp(value, bothW))
1650 return ThreadingModel_Both;
1651 else if (xmlstr_cmp(value, neutralW))
1653 else
1654 return ThreadingModel_No;
1655};

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

2125{
2126 struct xml_attr attr;
2127 BOOL end = FALSE;
2128 struct entity* entity;
2129
2130 if (!(entity = add_entity(&assembly->entities, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)))
2131 {
2132 set_error( xmlbuf );
2133 return;
2134 }
2135
2136 while (next_xml_attr(xmlbuf, &attr, &end))
2137 {
2138 if (xml_attr_cmp(&attr, iidW))
2139 {
2140 if (!(entity->u.ifaceps.iid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2141 }
2142 else if (xml_attr_cmp(&attr, g_nameW))
2143 {
2144 if (!(entity->u.ifaceps.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2145 }
2146 else if (xml_attr_cmp(&attr, baseInterfaceW))
2147 {
2148 if (!(entity->u.ifaceps.base = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2149 entity->u.ifaceps.mask |= BaseIface;
2150 }
2151 else if (xml_attr_cmp(&attr, nummethodsW))
2152 {
2153 if (!(parse_nummethods(&attr.value, entity))) set_error( xmlbuf );
2154 entity->u.ifaceps.mask |= NumMethods;
2155 }
2157 {
2158 if (!(entity->u.ifaceps.ps32 = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2159 }
2160 else if (xml_attr_cmp(&attr, tlbidW))
2161 {
2162 if (!(entity->u.ifaceps.tlib = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2163 }
2164 }
2165
2167 if (!end) parse_expect_end_elem(xmlbuf, parent);
2168}
static const WCHAR proxyStubClsid32W[]
Definition: actctx.c:737
static const WCHAR iidW[]
Definition: actctx.c:706
static const WCHAR baseInterfaceW[]
Definition: actctx.c:735
static BOOL parse_nummethods(const xmlstr_t *str, struct entity *entity)
Definition: actctx.c:1824
static const WCHAR nummethodsW[]
Definition: actctx.c:736

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

1873{
1874 WCHAR *psclsid = NULL;
1875 struct entity *entity;
1876 struct xml_attr attr;
1877 BOOL end = FALSE;
1878
1879 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)))
1880 {
1881 set_error( xmlbuf );
1882 return;
1883 }
1884
1885 while (next_xml_attr(xmlbuf, &attr, &end))
1886 {
1887 if (xml_attr_cmp(&attr, iidW))
1888 {
1889 if (!(entity->u.ifaceps.iid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1890 }
1891 else if (xml_attr_cmp(&attr, g_nameW))
1892 {
1893 if (!(entity->u.ifaceps.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1894 }
1895 else if (xml_attr_cmp(&attr, baseInterfaceW))
1896 {
1897 if (!(entity->u.ifaceps.base = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1898 entity->u.ifaceps.mask |= BaseIface;
1899 }
1900 else if (xml_attr_cmp(&attr, nummethodsW))
1901 {
1902 if (!(parse_nummethods(&attr.value, entity))) set_error( xmlbuf );
1903 entity->u.ifaceps.mask |= NumMethods;
1904 }
1905 else if (xml_attr_cmp(&attr, tlbidW))
1906 {
1907 if (!(entity->u.ifaceps.tlib = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1908 }
1910 {
1911 if (!(psclsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1912 }
1913 /* not used */
1914 else if (xml_attr_cmp(&attr, threadingmodelW))
1915 {
1916 }
1917 }
1918
1920 if (!end) parse_expect_end_elem(xmlbuf, parent);
1921
1922 parse_add_interface_class(xmlbuf, &dll->entities, acl, psclsid ? psclsid : entity->u.ifaceps.iid);
1923
1924 RtlFreeHeap(GetProcessHeap(), 0, psclsid);
1925}
static void parse_add_interface_class(xmlbuf_t *xmlbuf, struct entity_array *entities, struct actctx_loader *acl, WCHAR *clsid)
Definition: actctx.c:1844

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

2456{
2457 struct xml_elem elem;
2458
2459 while (next_xml_elem(xmlbuf, &elem, parent))
2460 {
2462 {
2463 parse_supportedos_elem(xmlbuf, assembly, acl, &elem);
2464 }
2465 else
2466 {
2467 parse_unknown_elem(xmlbuf, &elem);
2468 }
2469 }
2470}
static const WCHAR supportedOSW[]
Definition: actctx.c:768
static void parse_supportedos_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2422

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

2474{
2475 struct xml_elem elem;
2476
2477 while (next_xml_elem(xmlbuf, &elem, parent))
2478 {
2480 {
2482 }
2483 else
2484 {
2485 parse_unknown_elem(xmlbuf, &elem);
2486 }
2487 }
2488}
static void parse_compatibility_application_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2454

Referenced by parse_assembly_elem().

◆ parse_depend_manifests()

static NTSTATUS parse_depend_manifests ( struct actctx_loader acl)
static

Definition at line 3447 of file actctx.c.

3448{
3450 unsigned int i;
3451
3452 for (i = 0; i < acl->num_dependencies; i++)
3453 {
3454 if (lookup_assembly(acl, &acl->dependencies[i]) != STATUS_SUCCESS)
3455 {
3456 if (!acl->dependencies[i].optional && !acl->dependencies[i].delayed)
3457 {
3458 const struct assembly_version *ver = &acl->dependencies[i].version;
3459 DPRINT1( "Could not find dependent assembly %S (%u.%u.%u.%u)\n",
3460 acl->dependencies[i].name,
3461 ver->major, ver->minor, ver->build, ver->revision );
3463 break;
3464 }
3465 }
3466 }
3467 /* FIXME should now iterate through all refs */
3468 return status;
3469}
#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:3359

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

2312{
2313 struct xml_elem elem;
2314 struct xml_attr attr;
2316
2317 while (next_xml_attr(xmlbuf, &attr, &end))
2318 {
2320 {
2322 }
2323 }
2324
2325 while (next_xml_elem(xmlbuf, &elem, parent))
2326 {
2328 {
2330 }
2331 else
2332 {
2333 parse_unknown_elem(xmlbuf, &elem);
2334 }
2335 }
2336}
@ optional
Definition: SystemMenu.c:34
static const WCHAR yesW[]
Definition: actctx.c:723
static const WCHAR optionalW[]
Definition: actctx.c:713
static BOOL xmlstr_cmpi(const xmlstr_t *xmlstr, const WCHAR *str)
Definition: actctx.c:859
static void parse_dependent_assembly_elem(xmlbuf_t *xmlbuf, struct actctx_loader *acl, const struct xml_elem *parent, BOOL optional)
Definition: actctx.c:2267
static const WCHAR dependentAssemblyW[]
Definition: actctx.c:694

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

2269{
2270 struct xml_elem elem;
2271 struct xml_attr attr;
2272 struct assembly_identity ai;
2273 BOOL end = FALSE;
2274
2275 memset(&ai, 0, sizeof(ai));
2276 ai.optional = optional;
2277
2278 while (next_xml_attr(xmlbuf, &attr, &end))
2279 {
2280 static const WCHAR allowDelayedBindingW[] = {'a','l','l','o','w','D','e','l','a','y','e','d','B','i','n','d','i','n','g',0};
2281 static const WCHAR trueW[] = {'t','r','u','e',0};
2282
2283 if (xml_attr_cmp(&attr, allowDelayedBindingW))
2284 ai.delayed = xmlstr_cmp(&attr.value, trueW);
2285 }
2286
2287 if (end) return;
2288
2289 while (next_xml_elem(xmlbuf, &elem, parent))
2290 {
2292 {
2293 parse_assembly_identity_elem(xmlbuf, acl->actctx, &ai, &elem);
2294 /* store the newly found identity for later loading */
2295 if (ai.arch && !wcscmp(ai.arch, wildcardW)) ai.arch = strdupW( current_archW );
2296 if (!add_dependent_assembly_id(acl, &ai)) set_error( xmlbuf );
2297 }
2299 {
2301 }
2302 else
2303 {
2304 parse_unknown_elem(xmlbuf, &elem);
2305 }
2306 }
2307}
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:2083
static const WCHAR current_archW[]
Definition: actctx.c:622
static const WCHAR bindingRedirectW[]
Definition: actctx.c:687
static BOOL add_dependent_assembly_id(struct actctx_loader *acl, struct assembly_identity *ai)
Definition: actctx.c:1093

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

2104{
2105 struct xml_elem elem;
2106 struct xml_attr attr;
2108 BOOL end = FALSE;
2109
2110 while (next_xml_attr(xmlbuf, &attr, &end));
2111
2112 if (end) return;
2113 if (!parse_text_content(xmlbuf, &content)) return;
2114
2115 while (next_xml_elem(xmlbuf, &elem, parent))
2116 {
2117 parse_unknown_elem(xmlbuf, &elem);
2118 }
2119}

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

1577{
1578 struct xml_elem elem;
1579
1580 if (next_xml_elem(xmlbuf, &elem, parent))
1581 {
1582 // FIXME( "unexpected element %s\n", debugstr_xml_elem(&elem) );
1583 set_error( xmlbuf );
1584 }
1585}

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

1566{
1567 struct xml_attr attr;
1568
1569 while (next_xml_attr(xmlbuf, &attr, end))
1570 {
1571 // TODO: report error
1572 // if (!is_xmlns_attr( &attr )) WARN("unexpected attr %s\n", debugstr_xml_attr(&attr));
1573 }
1574}

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

2356{
2357 struct xml_elem elem;
2358 struct xml_attr attr;
2359 BOOL end = FALSE;
2360 struct dll_redirect* dll;
2361
2362 if (!(dll = add_dll_redirect(assembly)))
2363 {
2364 set_error( xmlbuf );
2365 return;
2366 }
2367
2368 while (next_xml_attr(xmlbuf, &attr, &end))
2369 {
2370 if (xml_attr_cmp(&attr, g_nameW))
2371 {
2372 if (!(dll->name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2373 }
2374 else if (xml_attr_cmp(&attr, hashW))
2375 {
2376 if (!(dll->hash = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2377 }
2378 else if (xml_attr_cmp(&attr, hashalgW))
2379 {
2380 static const WCHAR sha1W[] = {'S','H','A','1',0};
2381 if (!xmlstr_cmpi(&attr.value, sha1W)) {
2382 //FIXME("hashalg should be SHA1, got %s\n", debugstr_xmlstr(&attr.value));
2383 }
2384 }
2385 }
2386
2387 if (!dll->name) set_error( xmlbuf );
2388
2390
2391 if (end) return;
2392
2393 while (next_xml_elem(xmlbuf, &elem, parent))
2394 {
2396 {
2397 parse_com_class_elem(xmlbuf, dll, acl, &elem);
2398 }
2400 {
2402 }
2403 else if (xml_elem_cmp(&elem, hashW, asmv2W))
2404 {
2405 parse_unknown_elem(xmlbuf, &elem);
2406 }
2407 else if (xml_elem_cmp(&elem, typelibW, asmv1W))
2408 {
2409 parse_typelib_elem(xmlbuf, dll, acl, &elem);
2410 }
2411 else if (xml_elem_cmp(&elem, windowClassW, asmv1W))
2412 {
2413 parse_window_class_elem(xmlbuf, dll, acl, &elem);
2414 }
2415 else
2416 {
2417 parse_unknown_elem( xmlbuf, &elem );
2418 }
2419 }
2420}
static const WCHAR asmv2W[]
Definition: actctx.c:626
static const WCHAR comInterfaceProxyStubW[]
Definition: actctx.c:692
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:1744
static void parse_typelib_elem(xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:1992
static const WCHAR typelibW[]
Definition: actctx.c:700
static const WCHAR hashW[]
Definition: actctx.c:697
static const WCHAR comClassW[]
Definition: actctx.c:690
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:1871
static const WCHAR windowClassW[]
Definition: actctx.c:701
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:2044
static struct dll_redirect * add_dll_redirect(struct assembly *assembly)
Definition: actctx.c:941
static const WCHAR hashalgW[]
Definition: actctx.c:704

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

2820{
2821 xmlbuf_t xmlbuf;
2823 struct assembly *assembly;
2824 int unicode_tests;
2825
2826 TRACE( "parsing manifest loaded from %S base dir %S\n", filename, directory );
2827
2830
2832 return STATUS_NO_MEMORY;
2833
2834 if (filename) assembly->manifest.info = strdupW( filename + 4 /* skip \??\ prefix */ );
2835 assembly->manifest.type = assembly->manifest.info ? ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE
2836 : ACTIVATION_CONTEXT_PATH_TYPE_NONE;
2837
2839 if (RtlIsTextUnicode( buffer, size, &unicode_tests ))
2840 {
2841 xmlbuf.ptr = buffer;
2842 xmlbuf.end = xmlbuf.ptr + size / sizeof(WCHAR);
2843 status = parse_manifest_buffer( acl, assembly, ai, &xmlbuf );
2844 }
2845 else if (unicode_tests & IS_TEXT_UNICODE_REVERSE_SIGNATURE)
2846 {
2847 const WCHAR *buf = buffer;
2848 WCHAR *new_buff;
2849 unsigned int i;
2850
2851 if (!(new_buff = RtlAllocateHeap( GetProcessHeap(), 0, size )))
2852 return STATUS_NO_MEMORY;
2853 for (i = 0; i < size / sizeof(WCHAR); i++)
2854 new_buff[i] = RtlUshortByteSwap( buf[i] );
2855 xmlbuf.ptr = new_buff;
2856 xmlbuf.end = xmlbuf.ptr + size / sizeof(WCHAR);
2857 status = parse_manifest_buffer( acl, assembly, ai, &xmlbuf );
2858 RtlFreeHeap( GetProcessHeap(), 0, new_buff );
2859 }
2860 else
2861 {
2862 /* TODO: this doesn't handle arbitrary encodings */
2863 WCHAR *new_buff;
2864 ULONG sizeU;
2865
2867 if (!NT_SUCCESS(status))
2868 {
2869 DPRINT1("RtlMultiByteToUnicodeSize failed with %lx\n", status);
2871 }
2872
2873 new_buff = RtlAllocateHeap(GetProcessHeap(), 0, sizeU);
2874 if (!new_buff)
2875 return STATUS_NO_MEMORY;
2876
2877 status = RtlMultiByteToUnicodeN(new_buff, sizeU, &sizeU, buffer, size);
2878 if (!NT_SUCCESS(status))
2879 {
2880 DPRINT1("RtlMultiByteToUnicodeN failed with %lx\n", status);
2882 }
2883
2884 xmlbuf.ptr = new_buff;
2885 xmlbuf.end = xmlbuf.ptr + sizeU / sizeof(WCHAR);
2886 status = parse_manifest_buffer( acl, assembly, ai, &xmlbuf );
2887 RtlFreeHeap( GetProcessHeap(), 0, new_buff );
2888 }
2889 return status;
2890}
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:910
static NTSTATUS parse_manifest_buffer(struct actctx_loader *acl, struct assembly *assembly, struct assembly_identity *ai, xmlbuf_t *xmlbuf)
Definition: actctx.c:2779
#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(), and get_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 2779 of file actctx.c.

2781{
2782 struct xml_elem elem;
2783 struct xml_elem parent = {0};
2784
2785 xmlbuf->error = FALSE;
2786 xmlbuf->ns_pos = 0;
2787
2788 if (!next_xml_elem(xmlbuf, &elem, &parent)) return STATUS_SXS_CANT_GEN_ACTCTX;
2789
2790 if (xmlstr_cmp(&elem.name, g_xmlW) &&
2791 (!parse_xml_header(xmlbuf) || !next_xml_elem(xmlbuf, &elem, &parent)))
2793
2795 {
2797 }
2798
2799 parse_assembly_elem(xmlbuf, assembly, acl, &elem, ai);
2800 if (xmlbuf->error)
2801 {
2803 }
2804
2805 if (next_xml_elem(xmlbuf, &elem, &parent))
2806 {
2808 }
2809
2810 if (xmlbuf->ptr != xmlbuf->end)
2811 {
2813 }
2814 return STATUS_SUCCESS;
2815}
static const WCHAR assemblyW[]
Definition: actctx.c:685
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:2669
static const WCHAR g_xmlW[]
Definition: actctx.c:823
static BOOL parse_xml_header(xmlbuf_t *xmlbuf)
Definition: actctx.c:1505

Referenced by parse_manifest().

◆ parse_noinherit_elem()

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

Definition at line 2338 of file actctx.c.

2339{
2340 BOOL end = FALSE;
2341
2342 parse_expect_no_attr(xmlbuf, &end);
2343 if (!end) parse_expect_end_elem(xmlbuf, parent);
2344}

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

2347{
2348 BOOL end = FALSE;
2349
2350 parse_expect_no_attr(xmlbuf, &end);
2351 if (!end) parse_expect_end_elem(xmlbuf, parent);
2352}

Referenced by parse_assembly_elem().

◆ parse_nummethods()

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

Definition at line 1824 of file actctx.c.

1825{
1826 const WCHAR *curr;
1827 ULONG num = 0;
1828
1829 for (curr = str->ptr; curr < str->ptr + str->len; curr++)
1830 {
1831 if (*curr >= '0' && *curr <= '9')
1832 num = num * 10 + *curr - '0';
1833 else
1834 {
1835 // ERR("wrong numeric value %wZ\n", &strU);
1836 return FALSE;
1837 }
1838 }
1839 entity->u.ifaceps.nummethods = num;
1840
1841 return TRUE;
1842}
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 2569 of file actctx.c.

2571{
2572 static const WCHAR levelW[] = {'l','e','v','e','l',0};
2573 static const WCHAR asInvokerW[] = {'a','s','I','n','v','o','k','e','r',0};
2574 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};
2575 static const WCHAR highestAvailableW[] = {'h','i','g','h','e','s','t','A','v','a','i','l','a','b','l','e',0};
2576 static const WCHAR uiAccessW[] = {'u','i','A','c','c','e','s','s',0};
2577 static const WCHAR falseW[] = {'f','a','l','s','e',0};
2578 static const WCHAR trueW[] = {'t','r','u','e',0};
2579
2580 struct xml_elem elem;
2581 struct xml_attr attr;
2582 BOOL end = FALSE;
2583
2584 /* Multiple requestedExecutionLevel elements are not supported. */
2585 if (assembly->run_level != ACTCTX_RUN_LEVEL_UNSPECIFIED) set_error( xmlbuf );
2586
2587 while (next_xml_attr(xmlbuf, &attr, &end))
2588 {
2589 if (xml_attr_cmp(&attr, levelW))
2590 {
2591 if (xmlstr_cmpi(&attr.value, asInvokerW))
2592 assembly->run_level = ACTCTX_RUN_LEVEL_AS_INVOKER;
2593 else if (xmlstr_cmpi(&attr.value, highestAvailableW))
2594 assembly->run_level = ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE;
2595 else if (xmlstr_cmpi(&attr.value, requireAdministratorW))
2596 assembly->run_level = ACTCTX_RUN_LEVEL_REQUIRE_ADMIN;
2597 }
2598 else if (xml_attr_cmp(&attr, uiAccessW))
2599 {
2602 else if (xmlstr_cmpi(&attr.value, trueW))
2604 }
2605 }
2606
2607 if (end) return;
2608
2609 while (next_xml_elem(xmlbuf, &elem, parent))
2610 {
2611 parse_unknown_elem(xmlbuf, &elem);
2612 }
2613}
static const WCHAR falseW[]
Definition: json.c:34
ULONG ui_access
Definition: actctx.c:538
ACTCTX_REQUESTED_RUN_LEVEL run_level
Definition: actctx.c:537

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

2617{
2618 struct xml_elem elem;
2619
2620 while (next_xml_elem(xmlbuf, &elem, parent))
2621 {
2623 {
2625 }
2626 else
2627 {
2628 parse_unknown_elem(xmlbuf, &elem);
2629 }
2630 }
2631}
static const WCHAR requestedExecutionLevelW[]
Definition: actctx.c:770
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:2569

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

2635{
2636 struct xml_elem elem;
2637
2638 while (next_xml_elem(xmlbuf, &elem, parent))
2639 {
2641 {
2643 }
2644 else
2645 {
2646 parse_unknown_elem(xmlbuf, &elem);
2647 }
2648 }
2649}
static const WCHAR requestedPrivilegesW[]
Definition: actctx.c:771
static void parse_requested_privileges_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2615

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

2492{
2493 struct xml_elem elem;
2494 struct xml_attr attr;
2496 BOOL end = FALSE;
2497 struct entity *entity;
2498
2499 while (next_xml_attr( xmlbuf, &attr, &end ))
2500 {
2501 }
2502
2503 if (end) return;
2504
2505 if (!parse_text_content( xmlbuf, &content )) return;
2506
2507 entity = add_entity( &assembly->entities, ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS );
2508 if (!entity)
2509 {
2510 set_error( xmlbuf );
2511 return;
2512 }
2513 entity->u.settings.name = xmlstrdupW( &parent->name );
2514 entity->u.settings.value = xmlstrdupW( &content );
2515 entity->u.settings.ns = xmlstrdupW( &parent->ns );
2516
2517 while (next_xml_elem(xmlbuf, &elem, parent))
2518 {
2519 parse_unknown_elem( xmlbuf, &elem );
2520 }
2521}
struct entity::@4976::@4982 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 2422 of file actctx.c.

2424{
2425 struct xml_attr attr;
2426 BOOL end = FALSE;
2427
2428 while (next_xml_attr(xmlbuf, &attr, &end))
2429 {
2430 if (xml_attr_cmp(&attr, IdW))
2431 {
2432 COMPATIBILITY_CONTEXT_ELEMENT *compat;
2434 GUID compat_id;
2435
2436 str.Buffer = (PWSTR)attr.value.ptr;
2437 str.Length = str.MaximumLength = (USHORT)attr.value.len * sizeof(WCHAR);
2438 if (RtlGUIDFromString(&str, &compat_id) == STATUS_SUCCESS)
2439 {
2440 if (!(compat = add_compat_context(assembly)))
2441 {
2442 set_error( xmlbuf );
2443 return;
2444 }
2445 compat->Type = ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS;
2446 compat->Id = compat_id;
2447 }
2448 }
2449 }
2450
2451 if (!end) parse_expect_end_elem(xmlbuf, parent);
2452}
unsigned short USHORT
Definition: pedump.c:61
static const WCHAR IdW[]
Definition: actctx.c:769
static PCOMPATIBILITY_CONTEXT_ELEMENT add_compat_context(struct assembly *assembly)
Definition: actctx.c:967
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 1521 of file actctx.c.

1522{
1523 const WCHAR *ptr = memchrW(xmlbuf->ptr, '<', xmlbuf->end - xmlbuf->ptr);
1524
1525 if (!ptr) return FALSE;
1526
1527 content->ptr = xmlbuf->ptr;
1528 content->len = ptr - xmlbuf->ptr;
1529 xmlbuf->ptr = ptr;
1530
1531 return TRUE;
1532}
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 2651 of file actctx.c.

2653{
2654 struct xml_elem elem;
2655
2656 while (next_xml_elem(xmlbuf, &elem, parent))
2657 {
2659 {
2660 parse_security_elem(xmlbuf, assembly, acl, &elem);
2661 }
2662 else
2663 {
2664 parse_unknown_elem(xmlbuf, &elem);
2665 }
2666 }
2667}
static const WCHAR securityW[]
Definition: actctx.c:772
static void parse_security_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2633

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

1994{
1995 struct xml_attr attr;
1996 BOOL end = FALSE;
1997 struct entity* entity;
1998
1999 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)))
2000 {
2001 set_error( xmlbuf );
2002 return;
2003 }
2004
2005 while (next_xml_attr(xmlbuf, &attr, &end))
2006 {
2007 if (xml_attr_cmp(&attr, tlbidW))
2008 {
2009 if (!(entity->u.typelib.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2010 }
2011 else if (xml_attr_cmp(&attr, versionW))
2012 {
2013 if (!parse_typelib_version(&attr.value, entity)) set_error( xmlbuf );
2014 }
2015 else if (xml_attr_cmp(&attr, helpdirW))
2016 {
2017 if (!(entity->u.typelib.helpdir = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2018 }
2019 else if (xml_attr_cmp(&attr, flagsW))
2020 {
2021 if (!parse_typelib_flags(&attr.value, entity)) set_error( xmlbuf );
2022 }
2023 }
2024
2026 if (!end) parse_expect_end_elem(xmlbuf, parent);
2027}
static BOOL parse_typelib_version(const xmlstr_t *str, struct entity *entity)
Definition: actctx.c:1963
static const WCHAR helpdirW[]
Definition: actctx.c:705
static BOOL parse_typelib_flags(const xmlstr_t *value, struct entity *entity)
Definition: actctx.c:1927
static const WCHAR flagsW[]
Definition: actctx.c:729

Referenced by parse_file_elem().

◆ parse_typelib_flags()

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

Definition at line 1927 of file actctx.c.

1928{
1929 WORD *flags = &entity->u.typelib.flags;
1930 const WCHAR *str = value->ptr, *start;
1931 int i = 0;
1932
1933 *flags = 0;
1934
1935 /* it's comma separated list of flags */
1936 while (i < value->len)
1937 {
1938 start = str;
1939 while (*str != ',' && (i++ < value->len)) str++;
1940
1943 else if (!strncmpiW(start, controlW, str-start))
1945 else if (!strncmpiW(start, hiddenW, str-start))
1947 else if (!strncmpiW(start, hasdiskimageW, str-start))
1949 else
1950 {
1951 // WARN("unknown flags value %wZ\n", &valueU);
1952 return FALSE;
1953 }
1954
1955 /* skip separator */
1956 str++;
1957 i++;
1958 }
1959
1960 return TRUE;
1961}
unsigned short WORD
Definition: ntddk_ex.h:93
#define strncmpiW(s1, s2, n)
Definition: unicode.h:40
static const WCHAR hasdiskimageW[]
Definition: actctx.c:728
static const WCHAR restrictedW[]
Definition: actctx.c:725
static const WCHAR controlW[]
Definition: actctx.c:726
static const WCHAR hiddenW[]
Definition: actctx.c:727

Referenced by parse_typelib_elem().

◆ parse_typelib_version()

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

Definition at line 1963 of file actctx.c.

1964{
1965 unsigned int ver[2];
1966 unsigned int pos;
1967 const WCHAR *curr;
1968
1969 /* major.minor */
1970 ver[0] = ver[1] = pos = 0;
1971 for (curr = str->ptr; curr < str->ptr + str->len; curr++)
1972 {
1973 if (*curr >= '0' && *curr <= '9')
1974 {
1975 ver[pos] = ver[pos] * 10 + *curr - '0';
1976 if (ver[pos] >= 0x10000) goto error;
1977 }
1978 else if (*curr == '.')
1979 {
1980 if (++pos >= 2) goto error;
1981 }
1982 else goto error;
1983 }
1984 entity->u.typelib.major = ver[0];
1985 entity->u.typelib.minor = ver[1];
1986 return TRUE;
1987
1988error:
1989 return FALSE;
1990}
#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 1534 of file actctx.c.

1535{
1536 unsigned int ver[4];
1537 unsigned int pos;
1538 const WCHAR *curr;
1539
1540 /* major.minor.build.revision */
1541 ver[0] = ver[1] = ver[2] = ver[3] = pos = 0;
1542 for (curr = str->ptr; curr < str->ptr + str->len; curr++)
1543 {
1544 if (*curr >= '0' && *curr <= '9')
1545 {
1546 ver[pos] = ver[pos] * 10 + *curr - '0';
1547 if (ver[pos] >= 0x10000) goto error;
1548 }
1549 else if (*curr == '.')
1550 {
1551 if (++pos >= 4) goto error;
1552 }
1553 else goto error;
1554 }
1555 version->major = ver[0];
1556 version->minor = ver[1];
1557 version->build = ver[2];
1558 version->revision = ver[3];
1559 return TRUE;
1560
1561error:
1562 return FALSE;
1563}

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

2046{
2047 struct xml_elem elem;
2048 struct xml_attr attr;
2050 BOOL end = FALSE;
2051 struct entity* entity;
2052
2053 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)))
2054 {
2055 set_error( xmlbuf );
2056 return;
2057 }
2058 entity->u.class.versioned = TRUE;
2059 while (next_xml_attr(xmlbuf, &attr, &end))
2060 {
2062 {
2063 if (xmlstr_cmpi(&attr.value, noW))
2064 entity->u.class.versioned = FALSE;
2065 else if (!xmlstr_cmpi(&attr.value, yesW))
2066 set_error( xmlbuf );
2067 }
2068 }
2069
2070 if (end) return;
2071
2072 if (!parse_text_content(xmlbuf, &content)) return;
2073 if (!(entity->u.class.name = xmlstrdupW(&content))) set_error( xmlbuf );
2074
2076
2077 while (next_xml_elem(xmlbuf, &elem, parent))
2078 {
2079 parse_unknown_elem(xmlbuf, &elem);
2080 }
2081}
static const WCHAR noW[]
Definition: actctx.c:724
static const WCHAR versionedW[]
Definition: actctx.c:722

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

2525{
2526 struct xml_elem elem;
2527
2528 while (next_xml_elem( xmlbuf, &elem, parent ))
2529 {
2541 {
2542 parse_settings_elem( xmlbuf, assembly, acl, &elem );
2543 }
2544 else
2545 {
2546 parse_unknown_elem( xmlbuf, &elem );
2547 }
2548 }
2549}
static const WCHAR autoElevateW[]
Definition: actctx.c:775
static const WCHAR longPathAwareW[]
Definition: actctx.c:786
static const WCHAR gdiScalingW[]
Definition: actctx.c:784
static const WCHAR dpiAwarenessW[]
Definition: actctx.c:783
static const WCHAR windowsSettings2011NSW[]
Definition: actctx.c:779
static const WCHAR printerDriverIsolationW[]
Definition: actctx.c:788
static const WCHAR ultraHighResolutionScrollingAwareW[]
Definition: actctx.c:789
static const WCHAR disableWindowFilteringW[]
Definition: actctx.c:777
static void parse_settings_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, struct xml_elem *parent)
Definition: actctx.c:2490
static const WCHAR highResolutionScrollingAwareW[]
Definition: actctx.c:785
static const WCHAR dpiAwareW[]
Definition: actctx.c:782
static const WCHAR disableThemingW[]
Definition: actctx.c:776
static const WCHAR windowsSettings2017NSW[]
Definition: actctx.c:781
static const WCHAR windowsSettings2016NSW[]
Definition: actctx.c:780
static const WCHAR magicFutureSettingW[]
Definition: actctx.c:787
static const WCHAR windowsSettings2005NSW[]
Definition: actctx.c:778

Referenced by parse_application_elem().

◆ parse_xml_header()

static BOOL parse_xml_header ( xmlbuf_t xmlbuf)
static

Definition at line 1505 of file actctx.c.

1506{
1507 /* FIXME: parse attributes */
1508 const WCHAR *ptr;
1509
1510 for (ptr = xmlbuf->ptr; ptr < xmlbuf->end - 1; ptr++)
1511 {
1512 if (ptr[0] == '?' && ptr[1] == '>')
1513 {
1514 xmlbuf->ptr = ptr + 2;
1515 return TRUE;
1516 }
1517 }
1518 return FALSE;
1519}

Referenced by parse_manifest_buffer().

◆ push_xmlns()

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

Definition at line 1312 of file actctx.c.

1313{
1314 const int len = wcslen( xmlnsW );
1315 struct xml_attr *ns;
1316
1317 if (xmlbuf->ns_pos == MAX_NAMESPACES - 1)
1318 {
1319 // FIXME( "too many namespaces in manifest\n" );
1320 set_error( xmlbuf );
1321 return;
1322 }
1323 ns = &xmlbuf->namespaces[xmlbuf->ns_pos++];
1324 ns->value = attr->value;
1325 if (attr->name.len > len)
1326 {
1327 ns->name.ptr = attr->name.ptr + len + 1;
1328 ns->name.len = attr->name.len - len - 1;
1329 }
1330 else ns->name = empty_xmlstr;
1331}
#define MAX_NAMESPACES
Definition: actctx.c:105
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 1416 of file actctx.c.

1417{
1418 const WCHAR* ptr = xmlbuf->ptr;
1419
1420 elem->ns = empty_xmlstr;
1421 elem->name.ptr = ptr;
1422 while (ptr < xmlbuf->end && !isxmlspace(*ptr) && *ptr != '>' && *ptr != '/')
1423 {
1424 if (*ptr == ':')
1425 {
1426 elem->ns.ptr = elem->name.ptr;
1427 elem->ns.len = ptr - elem->ns.ptr;
1428 elem->name.ptr = ptr + 1;
1429 }
1430 ptr++;
1431 }
1432 elem->name.len = ptr - elem->name.ptr;
1433 xmlbuf->ptr = ptr;
1434}

Referenced by next_xml_elem().

◆ RtlActivateActivationContext()

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

Definition at line 5424 of file actctx.c.

5425{
5427}
NTSTATUS NTAPI RtlActivateActivationContextEx(ULONG flags, PTEB tebAddress, HANDLE handle, PULONG_PTR cookie)
Definition: actctx.c:5398
Definition: cookie.c:34

◆ RtlActivateActivationContextEx()

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

Definition at line 5398 of file actctx.c.

5399{
5401
5402 if (!(frame = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*frame) )))
5403 return STATUS_NO_MEMORY;
5404
5405 frame->Previous = tebAddress->ActivationContextStackPointer->ActiveFrame;
5406 frame->ActivationContext = handle;
5407 frame->Flags = 0;
5408
5409 DPRINT("ActiveSP %p: ACTIVATE (ActiveFrame %p -> NewFrame %p, Context %p)\n",
5410 tebAddress->ActivationContextStackPointer, tebAddress->ActivationContextStackPointer->ActiveFrame,
5411 frame, handle);
5412
5413 tebAddress->ActivationContextStackPointer->ActiveFrame = frame;
5415
5416 *cookie = (ULONG_PTR)frame;
5417 TRACE( "%p cookie=%lx\n", handle, *cookie );
5418 return STATUS_SUCCESS;
5419}
NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE)
Definition: actctx.c:5362
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().

◆ RtlAddRefActivationContext()

void WINAPI RtlAddRefActivationContext ( HANDLE  handle)

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

5168{
5169 const ACTCTXW *pActCtx = (PVOID)ActivationContextData;
5170 const WCHAR *directory = NULL;
5171 PACTIVATION_CONTEXT_WRAPPED ActualActCtx;
5174 ULONG lang = 0;
5176 HANDLE file = 0;
5177 struct actctx_loader acl;
5178
5179 TRACE("%p %08x\n", pActCtx, pActCtx ? pActCtx->dwFlags : 0);
5180
5181 if (!pActCtx || pActCtx->cbSize < sizeof(*pActCtx) ||
5182 (pActCtx->dwFlags & ~ACTCTX_FLAGS_ALL))
5184
5185
5186 if (!(ActualActCtx = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ActualActCtx))))
5187 return STATUS_NO_MEMORY;
5188
5189 ActualActCtx->MagicMarker = ACTCTX_MAGIC_MARKER;
5190
5191 actctx = &ActualActCtx->ActivationContext;
5192 actctx->RefCount = 1;
5193 actctx->config.type = ACTIVATION_CONTEXT_PATH_TYPE_NONE;
5194 actctx->config.info = NULL;
5195 actctx->appdir.type = ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE;
5196 if (pActCtx->dwFlags & ACTCTX_FLAG_APPLICATION_NAME_VALID)
5197 {
5198 if (!(actctx->appdir.info = strdupW( pActCtx->lpApplicationName ))) goto error;
5199 }
5200 else
5201 {
5203 WCHAR *p;
5205
5206 if (pActCtx->dwFlags & ACTCTX_FLAG_HMODULE_VALID) module = pActCtx->hModule;
5207 else module = NtCurrentTeb()->ProcessEnvironmentBlock->ImageBaseAddress;
5208
5210 if (!NT_SUCCESS(status)) goto error;
5211 if ((p = strrchrW( dir.Buffer, '\\' ))) p[1] = 0;
5212 actctx->appdir.info = dir.Buffer;
5213 }
5214
5215 nameW.Buffer = NULL;
5216
5217 /* open file only if it's going to be used */
5218 if (pActCtx->lpSource && !((pActCtx->dwFlags & ACTCTX_FLAG_RESOURCE_NAME_VALID) &&
5219 (pActCtx->dwFlags & ACTCTX_FLAG_HMODULE_VALID)))
5220 {
5221 WCHAR *source = NULL;
5222 BOOLEAN ret;
5223
5224 if (pActCtx->dwFlags & ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID &&
5225 RtlDetermineDosPathNameType_U(pActCtx->lpSource) == RELATIVE_PATH)
5226 {
5227 DWORD dir_len, source_len;
5228
5229 dir_len = strlenW(pActCtx->lpAssemblyDirectory);
5230 source_len = strlenW(pActCtx->lpSource);
5231 if (!(source = RtlAllocateHeap( GetProcessHeap(), 0, (dir_len+source_len+2)*sizeof(WCHAR))))
5232 {
5234 goto error;
5235 }
5236
5237 memcpy(source, pActCtx->lpAssemblyDirectory, dir_len*sizeof(WCHAR));
5238 source[dir_len] = '\\';
5239 memcpy(source+dir_len+1, pActCtx->lpSource, (source_len+1)*sizeof(WCHAR));
5240 }
5241
5242 ret = RtlDosPathNameToNtPathName_U(source ? source : pActCtx->lpSource, &nameW, NULL, NULL);
5244 if (!ret)
5245 {
5247 goto error;
5248 }
5249 status = open_nt_file( &file, &nameW );
5250 if (!NT_SUCCESS(status))
5251 {
5253 goto error;
5254 }
5255 }
5256
5257 acl.actctx = actctx;
5258 acl.dependencies = NULL;
5259 acl.num_dependencies = 0;
5260 acl.allocated_dependencies = 0;
5261
5262 if (pActCtx->dwFlags & ACTCTX_FLAG_LANGID_VALID) lang = pActCtx->wLangId;
5263 if (pActCtx->dwFlags & ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID) directory = pActCtx->lpAssemblyDirectory;
5264
5265 if (pActCtx->dwFlags & ACTCTX_FLAG_RESOURCE_NAME_VALID)
5266 {
5267 /* if we have a resource it's a PE file */
5268 if (pActCtx->dwFlags & ACTCTX_FLAG_HMODULE_VALID)
5269 {
5270 status = get_manifest_in_module( &acl, NULL, NULL, directory, FALSE, pActCtx->hModule,
5271 pActCtx->lpResourceName, lang );
5273 /* FIXME: what to do if pActCtx->lpSource is set */
5275 pActCtx->hModule, pActCtx->lpResourceName );
5276 }
5277 else if (pActCtx->lpSource && pActCtx->lpResourceName)
5278 {
5280 file, pActCtx->lpResourceName, lang );
5283 NULL, pActCtx->lpResourceName );
5284 }
5286 }
5287 else
5288 {
5290 }
5291
5292 if (file) NtClose( file );
5294
5296 free_depend_manifests( &acl );
5297
5298 if (NT_SUCCESS(status))
5299 *ActCtx = actctx;
5300 else actctx_release( actctx );
5301 return status;
5302
5303error:
5304 if (file) NtClose( file );
5306 return status;
5307}
unsigned char BOOLEAN
@ RELATIVE_PATH
Definition: winternl.h:1113
_In_ PCWSTR _Out_ PVOID * ActCtx
Definition: ldrtypes.h:247
NTSYSAPI RTL_PATH_TYPE NTAPI RtlDetermineDosPathNameType_U(_In_ PCWSTR Path)
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:3151
static void free_depend_manifests(struct actctx_loader *acl)
Definition: actctx.c:1142
static NTSTATUS parse_depend_manifests(struct actctx_loader *acl)
Definition: actctx.c:3447
#define ACTCTX_FLAGS_ALL
Definition: actctx.c:45
static void actctx_release(ACTIVATION_CONTEXT *actctx)
Definition: actctx.c:1256
void * PVOID
Definition: typedefs.h:50

◆ RtlDeactivateActivationContext()

NTSTATUS WINAPI RtlDeactivateActivationContext ( ULONG  flags,
ULONG_PTR  cookie 
)

Definition at line 5432 of file actctx.c.

5433{
5435
5436 TRACE( "%x cookie=%lx\n", flags, cookie );
5437
5438 /* find the right frame */
5439 top = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame;
5440 for (frame = top; frame; frame = frame->Previous)
5441 if ((ULONG_PTR)frame == cookie) break;
5442
5443 if (!frame)
5445
5448
5449 DPRINT("ActiveSP %p: DEACTIVATE (ActiveFrame %p -> PreviousFrame %p)\n",
5450 NtCurrentTeb()->ActivationContextStackPointer,
5451 NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame,
5452 frame->Previous);
5453
5454 /* pop everything up to and including frame */
5455 NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame = frame->Previous;
5456
5457 while (top != NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5458 {
5459 frame = top->Previous;
5460 RtlReleaseActivationContext( top->ActivationContext );
5462 top = frame;
5463 }
5464
5465 return STATUS_SUCCESS;
5466}
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE)
Definition: actctx.c:5373
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

◆ RtlFindActivationContextSectionGuid()

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

Definition at line 5914 of file actctx.c.

5916{
5917 ACTCTX_SECTION_KEYED_DATA *data = ptr;
5919
5920 if (extguid)
5921 {
5922 FIXME("expected extguid == NULL\n");
5924 }
5925
5926 if (flags & ~FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX)
5927 {
5928 FIXME("unknown flags %08x\n", flags);
5930 }
5931
5932 if (!data || data->cbSize < FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) || !guid)
5934
5935 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5936 {
5937 ACTIVATION_CONTEXT *actctx = check_actctx(NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext);
5938 if (actctx) status = find_guid( actctx, section_kind, guid, flags, data );
5939 }
5940
5941 if (status != STATUS_SUCCESS)
5942 status = find_guid( process_actctx, section_kind, guid, flags, data );
5943
5944 if (status != STATUS_SUCCESS)
5945 status = find_guid( implicit_actctx, section_kind, guid, flags, data );
5946
5947 return status;
5948}
static NTSTATUS find_guid(ACTIVATION_CONTEXT *actctx, ULONG section_kind, const GUID *guid, DWORD flags, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:5078

Referenced by FindActCtxSectionGuid().

◆ RtlFindActivationContextSectionString()

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

Definition at line 5863 of file actctx.c.

5865{
5868
5869 DPRINT("RtlFindActivationContextSectionString(%x %p %x %wZ %p)\n", flags, guid, section_kind, section_name, ptr);
5870 status = RtlpFindActivationContextSection_CheckParameters(flags, guid, section_kind, section_name, data);
5871 if (!NT_SUCCESS(status))
5872 {
5873 DPRINT1("RtlFindActivationContextSectionString() failed with status %x\n", status);
5874 return status;
5875 }
5876
5878
5879 /* if there is no data, but params are valid,
5880 we return that sxs key is not found to be at least somehow compatible */
5881 if (!data)
5882 {
5883 DPRINT("RtlFindActivationContextSectionString() failed with status %x\n", status);
5884 return status;
5885 }
5886
5888 ASSERT(NtCurrentTeb()->ActivationContextStackPointer);
5889
5890 DPRINT("ActiveFrame: %p\n",NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame);
5891 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5892 {
5893 ACTIVATION_CONTEXT *actctx = check_actctx(NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext);
5894 if (actctx) status = find_string( actctx, section_kind, section_name, flags, data );
5895 }
5896
5897 DPRINT("status %x\n", status);
5898 if (status != STATUS_SUCCESS)
5899 status = find_string( process_actctx, section_kind, section_name, flags, data );
5900
5901 if (status != STATUS_SUCCESS)
5902 status = find_string( implicit_actctx, section_kind, section_name, flags, data );
5903
5904 DPRINT("RtlFindActivationContextSectionString() returns status %x\n", status);
5905 return status;
5906}
#define ASSERT(a)
Definition: mode.c:44
static const GUID PACTCTX_SECTION_KEYED_DATA
Definition: actctx.c:36
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:5038

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

◆ RtlFreeThreadActivationContextStack()

void WINAPI RtlFreeThreadActivationContextStack ( void  )

Definition at line 5504 of file actctx.c.

5505{
5506#ifdef __REACTOS__
5507 RtlFreeActivationContextStack(NtCurrentTeb()->ActivationContextStackPointer);
5508 NtCurrentTeb()->ActivationContextStackPointer = NULL;
5509#else
5511
5512 frame = NtCurrentTeb()->ActivationContextStack.ActiveFrame;
5513 while (frame)
5514 {
5517 RtlFreeHeap( GetProcessHeap(), 0, frame );
5518 frame = prev;
5519 }
5520 NtCurrentTeb()->ActivationContextStack.ActiveFrame = NULL;
5521#endif // __REACTOS__
5522}

Referenced by LdrShutdownThread().

◆ RtlGetActiveActivationContext()

NTSTATUS WINAPI RtlGetActiveActivationContext ( HANDLE handle)

Definition at line 5528 of file actctx.c.

5529{
5530 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5531 {
5532 *handle = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext;
5534 }
5535 else
5536 *handle = 0;
5537
5538 return STATUS_SUCCESS;
5539}

Referenced by GetCurrentActCtx(), and LdrpWalkImportDescriptor().

◆ RtlIsActivationContextActive()

BOOLEAN WINAPI RtlIsActivationContextActive ( HANDLE  handle)

Definition at line 5545 of file actctx.c.

5546{
5548
5549 for (frame = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame; frame; frame = frame->Previous)
5550 if (frame->ActivationContext == handle) return TRUE;
5551 return FALSE;
5552}

◆ RtlQueryInformationActivationContext()

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

Definition at line 5561 of file actctx.c.

5564{
5567
5568 TRACE("%08x %p %p %u %p %ld %p\n", flags, handle,
5569 subinst, class, buffer, bufsize, retlen);
5570
5571 if (retlen) *retlen = 0;
5572 if ((status = find_query_actctx( &handle, flags, class ))) return status;
5573
5574 switch (class)
5575 {
5576 case ActivationContextBasicInformation:
5577 {
5578 ACTIVATION_CONTEXT_BASIC_INFORMATION *info = buffer;
5579
5580 if (retlen) *retlen = sizeof(*info);
5581 if (!info || bufsize < sizeof(*info)) return STATUS_BUFFER_TOO_SMALL;
5582
5583 info->hActCtx = handle;
5584 info->dwFlags = 0; /* FIXME */
5586 }
5587 break;
5588
5589 case ActivationContextDetailedInformation:
5590 {
5591 ACTIVATION_CONTEXT_DETAILED_INFORMATION *acdi = buffer;
5592 struct assembly *assembly = NULL;
5593 SIZE_T len, manifest_len = 0, config_len = 0, appdir_len = 0;
5594 LPWSTR ptr;
5595
5597
5598 if (actctx->num_assemblies) assembly = actctx->assemblies;
5599
5600 if (assembly && assembly->manifest.info)
5601 manifest_len = strlenW(assembly->manifest.info) + 1;
5602 if (actctx->config.info) config_len = strlenW(actctx->config.info) + 1;
5603 if (actctx->appdir.info) appdir_len = strlenW(actctx->appdir.info) + 1;
5604 len = sizeof(*acdi) + (manifest_len + config_len + appdir_len) * sizeof(WCHAR);
5605
5606 if (retlen) *retlen = len;
5607 if (!buffer || bufsize < len) return STATUS_BUFFER_TOO_SMALL;
5608
5609 acdi->dwFlags = 0;
5610 acdi->ulFormatVersion = assembly ? 1 : 0; /* FIXME */
5611 acdi->ulAssemblyCount = actctx->num_assemblies;
5612 acdi->ulRootManifestPathType = assembly ? assembly->manifest.type : 0 /* FIXME */;
5613 acdi->ulRootManifestPathChars = assembly && assembly->manifest.info ? manifest_len - 1 : 0;
5614 acdi->ulRootConfigurationPathType = actctx->config.type;
5615 acdi->ulRootConfigurationPathChars = actctx->config.info ? config_len - 1 : 0;
5616 acdi->ulAppDirPathType = actctx->appdir.type;
5617 acdi->ulAppDirPathChars = actctx->appdir.info ? appdir_len - 1 : 0;
5618 ptr = (LPWSTR)(acdi + 1);
5619 if (manifest_len)
5620 {
5621 acdi->lpRootManifestPath = ptr;
5622 memcpy(ptr, assembly->manifest.info, manifest_len * sizeof(WCHAR));
5623 ptr += manifest_len;
5624 }
5625 else acdi->lpRootManifestPath = NULL;
5626 if (config_len)
5627 {
5628 acdi->lpRootConfigurationPath = ptr;
5629 memcpy(ptr, actctx->config.info, config_len * sizeof(WCHAR));
5630 ptr += config_len;
5631 }
5632 else acdi->lpRootConfigurationPath = NULL;
5633 if (appdir_len)
5634 {
5635 acdi->lpAppDirPath = ptr;
5636 memcpy(ptr, actctx->appdir.info, appdir_len * sizeof(WCHAR));
5637 }
5638 else acdi->lpAppDirPath = NULL;
5639 }
5640 break;
5641
5642 case AssemblyDetailedInformationInActivationContext:
5643 {
5644 ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *afdi = buffer;
5645 struct assembly *assembly;
5646 WCHAR *assembly_id;
5647 DWORD index;
5648 SIZE_T len, id_len = 0, ad_len = 0, path_len = 0;
5649 LPWSTR ptr;
5650
5652 if (!subinst) return STATUS_INVALID_PARAMETER;
5653
5654 index = *(DWORD*)subinst;
5655 if (!index || index > actctx->num_assemblies) return STATUS_INVALID_PARAMETER;
5656
5657 assembly = &actctx->assemblies[index - 1];
5658
5659 if (!(assembly_id = build_assembly_id( &assembly->id ))) return STATUS_NO_MEMORY;
5660 id_len = strlenW(assembly_id) + 1;
5661 if (assembly->directory) ad_len = strlenW(assembly->directory) + 1;
5662
5663 if (assembly->manifest.info &&
5665 path_len = strlenW(assembly->manifest.info) + 1;
5666
5667 len = sizeof(*afdi) + (id_len + ad_len + path_len) * sizeof(WCHAR);
5668
5669 if (retlen) *retlen = len;
5670 if (!buffer || bufsize < len)
5671 {
5672 RtlFreeHeap( GetProcessHeap(), 0, assembly_id );
5674 }
5675
5676 afdi->ulFlags = 0; /* FIXME */
5677 afdi->ulEncodedAssemblyIdentityLength = (id_len - 1) * sizeof(WCHAR);
5678 afdi->ulManifestPathType = assembly->manifest.type;
5679 afdi->ulManifestPathLength = assembly->manifest.info ? (path_len - 1) * sizeof(WCHAR) : 0;
5680 /* FIXME afdi->liManifestLastWriteTime = 0; */
5681 afdi->ulPolicyPathType = ACTIVATION_CONTEXT_PATH_TYPE_NONE; /* FIXME */
5682 afdi->ulPolicyPathLength = 0;
5683 /* FIXME afdi->liPolicyLastWriteTime = 0; */
5684 afdi->ulMetadataSatelliteRosterIndex = 0; /* FIXME */
5685 afdi->ulManifestVersionMajor = 1;
5686 afdi->ulManifestVersionMinor = 0;
5687 afdi->ulPolicyVersionMajor = 0; /* FIXME */
5688 afdi->ulPolicyVersionMinor = 0; /* FIXME */
5689 afdi->ulAssemblyDirectoryNameLength = ad_len ? (ad_len - 1) * sizeof(WCHAR) : 0;
5690 ptr = (LPWSTR)(afdi + 1);
5691 afdi->lpAssemblyEncodedAssemblyIdentity = ptr;
5692 memcpy( ptr, assembly_id, id_len * sizeof(WCHAR) );
5693 ptr += id_len;
5694 if (path_len)
5695 {
5696 afdi->lpAssemblyManifestPath = ptr;
5697 memcpy(ptr, assembly->manifest.info, path_len * sizeof(WCHAR));
5698 ptr += path_len;
5699 } else afdi->lpAssemblyManifestPath = NULL;
5700 afdi->lpAssemblyPolicyPath = NULL; /* FIXME */
5701 if (ad_len)
5702 {
5703 afdi->lpAssemblyDirectoryName = ptr;
5704 memcpy(ptr, assembly->directory, ad_len * sizeof(WCHAR));
5705 }
5706 else afdi->lpAssemblyDirectoryName = NULL;
5707 RtlFreeHeap( GetProcessHeap(), 0, assembly_id );
5708 }
5709 break;
5710
5711 case FileInformationInAssemblyOfAssemblyInActivationContext:
5712 {
5713 const ACTIVATION_CONTEXT_QUERY_INDEX *acqi = subinst;
5714 ASSEMBLY_FILE_DETAILED_INFORMATION *afdi = buffer;
5715 struct assembly *assembly;
5716 struct dll_redirect *dll;
5717 SIZE_T len, dll_len = 0;
5718 LPWSTR ptr;
5719
5721 if (!acqi) return STATUS_INVALID_PARAMETER;
5722
5723 if (acqi->ulAssemblyIndex >= actctx->num_assemblies)
5725 assembly = &actctx->assemblies[acqi->ulAssemblyIndex];
5726
5727 if (acqi->ulFileIndexInAssembly >= assembly->num_dlls)
5729 dll = &assembly->dlls[acqi->ulFileIndexInAssembly];
5730
5731 if (dll->name) dll_len = strlenW(dll->name) + 1;
5732 len = sizeof(*afdi) + dll_len * sizeof(WCHAR);
5733
5734 if (!buffer || bufsize < len)
5735 {
5736 if (retlen) *retlen = len;
5738 }
5739 if (retlen) *retlen = 0; /* yes that's what native does !! */
5740 afdi->ulFlags = ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION;
5741 afdi->ulFilenameLength = dll_len ? (dll_len - 1) * sizeof(WCHAR) : 0;
5742 afdi->ulPathLength = 0; /* FIXME */
5743 ptr = (LPWSTR)(afdi + 1);
5744 if (dll_len)
5745 {
5746 afdi->lpFileName = ptr;
5747 memcpy( ptr, dll->name, dll_len * sizeof(WCHAR) );
5748 } else afdi->lpFileName = NULL;
5749 afdi->lpFilePath = NULL; /* FIXME */
5750 }
5751 break;
5752
5753 case CompatibilityInformationInActivationContext:
5754 {
5755 /*ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION*/DWORD *acci = buffer;
5756 COMPATIBILITY_CONTEXT_ELEMENT *elements;
5757 struct assembly *assembly = NULL;
5759 SIZE_T len;
5760
5762
5763 if (actctx->num_assemblies) assembly = actctx->assemblies;
5764
5765 if (assembly)
5767 len = sizeof(*acci) + num_compat_contexts * sizeof(COMPATIBILITY_CONTEXT_ELEMENT);
5768
5769 if (retlen) *retlen = len;
5770 if (!buffer || bufsize < len) return STATUS_BUFFER_TOO_SMALL;
5771
5772 *acci = num_compat_contexts;
5773 elements = (COMPATIBILITY_CONTEXT_ELEMENT*)(acci + 1);
5774 for (n = 0; n < num_compat_contexts; ++n)
5775 {
5776 elements[n] = assembly->compat_contexts[n];
5777 }
5778 }
5779 break;
5780
5781 case RunlevelInformationInActivationContext:
5782 {
5783 ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION *acrli = buffer;
5784 struct assembly *assembly;
5785 SIZE_T len;
5786
5788
5789 len = sizeof(*acrli);
5790 if (retlen) *retlen = len;
5791 if (!buffer || bufsize < len)
5793
5794 assembly = actctx->assemblies;
5795
5796 acrli->ulFlags = 0;
5797 acrli->RunLevel = assembly ? assembly->run_level : ACTCTX_RUN_LEVEL_UNSPECIFIED;
5798 acrli->UiAccess = assembly ? assembly->ui_access : 0;
5799 }
5800 break;
5801
5802 default:
5803 FIXME( "class %u not implemented\n", class );
5805 }
5806 return STATUS_SUCCESS;
5807}
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 STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
static WCHAR * build_assembly_id(const struct assembly_identity *ai)
Definition: actctx.c:1195
static NTSTATUS find_query_actctx(HANDLE *handle, DWORD flags, ULONG class)
Definition: actctx.c:3472
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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

◆ RtlReleaseActivationContext()

◆ RtlZombifyActivationContext()

NTSTATUS WINAPI RtlZombifyActivationContext ( HANDLE  handle)

Definition at line 5387 of file actctx.c.

5388{
5389 FIXME("%p: stub\n", handle);
5390
5392 return STATUS_SUCCESS;
5393
5395}
#define ACTCTX_FAKE_HANDLE
Definition: actctx.c:61

Referenced by ZombifyActCtx().

◆ set_error()

◆ strdupW()

static WCHAR * strdupW ( const WCHAR str)
static

Definition at line 833 of file actctx.c.

834{
835 WCHAR* ptr;
836
837 if (!(ptr = RtlAllocateHeap(GetProcessHeap(), 0, (strlenW(str) + 1) * sizeof(WCHAR))))
838 return NULL;
839 return strcpyW(ptr, str);
840}

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

4836{
4837 struct progidredirect_data *data;
4839 GUID *guid_ptr;
4840 WCHAR *ptrW;
4841
4842 /* setup new index entry */
4843
4844 /* hash progid name */
4847
4848 (*index)->name_offset = *data_offset;
4849 (*index)->name_len = str.Length;
4850 (*index)->data_offset = (*index)->name_offset + aligned_string_len(str.MaximumLength);
4851 (*index)->data_len = sizeof(*data);
4852 (*index)->rosterindex = rosterindex;
4853
4854 *data_offset += aligned_string_len(str.MaximumLength);
4855
4856 /* setup data structure */
4857 data = (struct progidredirect_data*)((BYTE*)section + *data_offset);
4858 data->size = sizeof(*data);
4859 data->reserved = 0;
4860 data->clsid_offset = *global_offset;
4861
4862 /* write progid string */
4863 ptrW = (WCHAR*)((BYTE*)section + (*index)->name_offset);
4864 memcpy(ptrW, progid, (*index)->name_len);
4865 ptrW[(*index)->name_len/sizeof(WCHAR)] = 0;
4866
4867 /* write guid to global area */
4868 guid_ptr = (GUID*)((BYTE*)section + data->clsid_offset);
4869 *guid_ptr = *alias;
4870
4871 /* to next entry */
4872 *global_offset += sizeof(GUID);
4873 *data_offset += data->size;
4874 (*index) += 1;
4875}
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 877 of file actctx.c.

878{
879 if (!xmlstr_cmp( &elem->name, str )) return FALSE;
880 if (xmlstr_cmp( &elem->ns, namespace )) return TRUE;
881 if (!wcscmp( namespace, asmv1W ))
882 {
883 if (xmlstr_cmp( &elem->ns, asmv2W )) return TRUE;
884 if (xmlstr_cmp( &elem->ns, asmv3W )) return TRUE;
885 }
886 else if (!wcscmp( namespace, asmv2W ))
887 {
888 if (xmlstr_cmp( &elem->ns, asmv3W )) return TRUE;
889 }
890 return FALSE;
891}

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

870{
871 return (elem1->name.len == elem2->name.len &&
872 elem1->ns.len == elem2->ns.len &&
873 !wcsncmp( elem1->name.ptr, elem2->name.ptr, elem1->name.len ) &&
874 !wcsncmp( elem1->ns.ptr, elem2->ns.ptr, elem1->ns.len ));
875}
xmlstr_t name
Definition: actctx.c:115
xmlstr_t ns
Definition: actctx.c:116
const WCHAR * ptr
Definition: actctx.c:109
unsigned int len
Definition: actctx.c:110

Referenced by next_xml_elem().

◆ xmlstr_cmp()

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

Definition at line 854 of file actctx.c.

855{
856 return !strncmpW(xmlstr->ptr, str, xmlstr->len) && !str[xmlstr->len];
857}

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

◆ xmlstr_cmpi()

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

Definition at line 859 of file actctx.c.

860{
861 return !strncmpiW(xmlstr->ptr, str, xmlstr->len) && !str[xmlstr->len];
862}

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

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 742 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 743 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 744 of file actctx.c.

◆ alignableW

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

Definition at line 745 of file actctx.c.

◆ alwaysrunW

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

Definition at line 746 of file actctx.c.

◆ applicationW

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

Definition at line 767 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 626 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 627 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 686 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 685 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 775 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 687 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 747 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 748 of file actctx.c.

◆ clrClassW

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

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

Referenced by parse_assembly_elem().

◆ clsidW

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

Definition at line 703 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 690 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 691 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 692 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 765 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 622 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 693 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 694 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 695 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 776 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 777 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 825 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 783 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 782 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ empty_xmlstr

const xmlstr_t empty_xmlstr
static

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

Referenced by parse_assembly_elem().

◆ flagsW

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

Definition at line 729 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 823 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 784 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 728 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 704 of file actctx.c.

Referenced by parse_file_elem().

◆ hashW

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

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

Referenced by parse_typelib_elem().

◆ hiddenW

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

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

Referenced by parse_windows_settings_elem().

◆ IdW

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

Definition at line 769 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 749 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 750 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 751 of file actctx.c.

◆ insideoutW

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

Definition at line 752 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 753 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 754 of file actctx.c.

◆ languageW

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

Definition at line 707 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 786 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 787 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ manifestVersionW

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

Definition at line 708 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 732 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 734 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 731 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 733 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 730 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 710 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 711 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 699 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 698 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 755 of file actctx.c.

◆ noW

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

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

Referenced by parse_binding_redirect_elem().

◆ olemisc_values

const struct olemisc_entry olemisc_values[]
static
Initial value:
=
{
}
static const WCHAR alignableW[]
Definition: actctx.c:745
static const WCHAR nouiactivateW[]
Definition: actctx.c:755
static const WCHAR supportsmultilevelundoW[]
Definition: actctx.c:762
static const WCHAR activatewhenvisibleW[]
Definition: actctx.c:742
static const WCHAR actslikelabelW[]
Definition: actctx.c:744
static const WCHAR insideoutW[]
Definition: actctx.c:752
static const WCHAR staticW[]
Definition: actctx.c:761
static const WCHAR cantlinkinsideW[]
Definition: actctx.c:748
static const WCHAR canlinkbyole1W[]
Definition: actctx.c:747
static const WCHAR imemodeW[]
Definition: actctx.c:750
static const WCHAR actslikebuttonW[]
Definition: actctx.c:743
static const WCHAR recomposeonresizeW[]
Definition: actctx.c:757
static const WCHAR ignoreactivatewhenvisibleW[]
Definition: actctx.c:749
static const WCHAR islinkobjectW[]
Definition: actctx.c:754
static const WCHAR simpleframeW[]
Definition: actctx.c:760
static const WCHAR wantstomenumergeW[]
Definition: actctx.c:763
static const WCHAR invisibleatruntimeW[]
Definition: actctx.c:753
static const WCHAR onlyiconicW[]
Definition: actctx.c:756
static const WCHAR alwaysrunW[]
Definition: actctx.c:746
static const WCHAR renderingisdeviceindependentW[]
Definition: actctx.c:758
static const WCHAR insertnotreplaceW[]
Definition: actctx.c:751
static const WCHAR setclientsitefirstW[]
Definition: actctx.c:759

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

◆ optionalW

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

Definition at line 713 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 788 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 714 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 715 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 716 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 757 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 758 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 770 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 771 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 725 of file actctx.c.

Referenced by parse_typelib_flags().

◆ runtimeVersionW

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

Definition at line 738 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 772 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 759 of file actctx.c.

◆ simpleframeW

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

Definition at line 760 of file actctx.c.

◆ staticW

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

Definition at line 761 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 768 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 762 of file actctx.c.

◆ system_actctx

ACTIVATION_CONTEXT_WRAPPED system_actctx = { ACTCTX_MAGIC_MARKER, { 1 } }
static

Definition at line 829 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 773 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 719 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 789 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 826 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 722 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 720 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 763 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 701 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 778 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 779 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 780 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 781 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 774 of file actctx.c.

Referenced by parse_application_elem().

◆ xmlnsW

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

Definition at line 721 of file actctx.c.

Referenced by is_xmlns_attr(), and push_xmlns().

◆ yesW

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

Definition at line 723 of file actctx.c.

Referenced by parse_dependency_elem(), and parse_window_class_elem().