ReactOS 0.4.15-dev-8434-g155a7c7
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 NTSTATUS get_module_filename (HMODULE module, UNICODE_STRING *str, unsigned int extra_len)
 
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, HANDLE module, LPCWSTR directory, BOOL shared, const void *buffer, SIZE_T size)
 
static NTSTATUS open_nt_file (HANDLE *handle, UNICODE_STRING *name)
 
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)
 
static const WCHARfind_app_settings (ACTIVATION_CONTEXT *actctx, const WCHAR *settings, const WCHAR *ns)
 
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 WINAPI RtlActivateActivationContext (ULONG unknown, HANDLE handle, PULONG_PTR cookie)
 
NTSTATUS WINAPI RtlActivateActivationContextEx (ULONG flags, TEB *teb, HANDLE handle, ULONG_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)
 
NTSTATUS WINAPI RtlQueryActivationContextApplicationSettings (DWORD flags, HANDLE handle, const WCHAR *ns, const WCHAR *settings, WCHAR *buffer, SIZE_T size, SIZE_T *written)
 

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

◆ ACTCTX_FAKE_HANDLE

#define ACTCTX_FAKE_HANDLE   ((HANDLE) 0xf00baa)

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

◆ ACTCTX_MAGIC

#define ACTCTX_MAGIC   0xC07E3E11

Definition at line 58 of file actctx.c.

◆ ACTCTX_MAGIC_MARKER

#define ACTCTX_MAGIC_MARKER   (PVOID)'gMcA'

Definition at line 62 of file actctx.c.

◆ CREATEPROCESS_MANIFEST_RESOURCE_ID

#define CREATEPROCESS_MANIFEST_RESOURCE_ID   ((ULONG_PTR)1)

Definition at line 69 of file actctx.c.

◆ GUIDSECTION_MAGIC

#define GUIDSECTION_MAGIC   0x64487347 /* dHsG */

Definition at line 60 of file actctx.c.

◆ MAX_NAMESPACES

#define MAX_NAMESPACES   64

Definition at line 108 of file actctx.c.

◆ RT_MANIFEST

#define RT_MANIFEST   ((ULONG_PTR)24)

Definition at line 68 of file actctx.c.

◆ STRSECTION_MAGIC

#define STRSECTION_MAGIC   0x64487353 /* dHsS */

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

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

◆ comclass_miscfields

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

Definition at line 246 of file actctx.c.

247{
248 MiscStatus = 1,
249 MiscStatusIcon = 2,
253};
@ 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 237 of file actctx.c.

238{
244};
@ 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 542 of file actctx.c.

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

◆ ifaceps_mask

Enumerator
NumMethods 
BaseIface 
NumMethods 
BaseIface 

Definition at line 277 of file actctx.c.

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

◆ tagLIBFLAGS

Enumerator
LIBFLAG_FRESTRICTED 
LIBFLAG_FCONTROL 
LIBFLAG_FHIDDEN 
LIBFLAG_FHASDISKIMAGE 

Definition at line 73 of file actctx.c.

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

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

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

Function Documentation

◆ actctx_addref()

static void actctx_addref ( ACTIVATION_CONTEXT actctx)
inlinestatic

Definition at line 1280 of file actctx.c.

1281{
1282 InterlockedExchangeAdd( &actctx->RefCount, 1 );
1283}
#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 5149 of file actctx.c.

5150{
5151 ACTCTXW ctx;
5152 HANDLE handle;
5153 WCHAR buffer[1024];
5155
5156 ctx.cbSize = sizeof(ctx);
5157 ctx.lpSource = NULL;
5158 ctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
5159 ctx.hModule = NtCurrentTeb()->ProcessEnvironmentBlock->ImageBaseAddress;
5161
5163 {
5165 }
5166
5167 /* ReactOS specific:
5168 Now that we have found the process_actctx we can initialize the process compat subsystem */
5170
5171
5172 ctx.dwFlags = 0;
5173 ctx.hModule = NULL;
5174 ctx.lpResourceName = NULL;
5175 ctx.lpSource = buffer;
5177 RtlStringCchCatW(buffer, RTL_NUMBER_OF(buffer), L"\\winsxs\\manifests\\systemcompatible.manifest");
5178
5180 if (NT_SUCCESS(Status))
5181 {
5183 }
5184 else
5185 {
5186 DPRINT1("Failed to create the implicit act ctx. Status: 0x%x!!!\n", Status);
5187 }
5188
5189#ifdef __REACTOS__
5190 NtCurrentTeb()->ProcessEnvironmentBlock->ActivationContextData = process_actctx->ActivationContextData;
5191#else
5192 NtCurrentTeb()->Peb->ActivationContextData = process_actctx;
5193#endif // __REACTOS__
5194}
#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:33
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:832
static ACTIVATION_CONTEXT * process_actctx
Definition: actctx.c:831
#define CREATEPROCESS_MANIFEST_RESOURCE_ID
Definition: actctx.c:69
static ACTIVATION_CONTEXT * check_actctx(HANDLE h)
Definition: actctx.c:1258
__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 1285 of file actctx.c.

1286{
1287 PACTIVATION_CONTEXT_WRAPPED pActual;
1288
1289 if (InterlockedExchangeAdd(&actctx->RefCount, -1) == 1)
1290 {
1291 unsigned int i, j;
1292
1293 for (i = 0; i < actctx->num_assemblies; i++)
1294 {
1295 struct assembly *assembly = &actctx->assemblies[i];
1296 for (j = 0; j < assembly->num_dlls; j++)
1297 {
1298 struct dll_redirect *dll = &assembly->dlls[j];
1299 free_entity_array( &dll->entities );
1300 RtlFreeHeap( GetProcessHeap(), 0, dll->name );
1301 RtlFreeHeap( GetProcessHeap(), 0, dll->hash );
1302 }
1309 }
1310 RtlFreeHeap( GetProcessHeap(), 0, actctx->config.info );
1311 RtlFreeHeap( GetProcessHeap(), 0, actctx->appdir.info );
1312 RtlFreeHeap( GetProcessHeap(), 0, actctx->assemblies );
1313 RtlFreeHeap( GetProcessHeap(), 0, actctx->dllredirect_section );
1314 RtlFreeHeap( GetProcessHeap(), 0, actctx->wndclass_section );
1315 RtlFreeHeap( GetProcessHeap(), 0, actctx->tlib_section );
1316 RtlFreeHeap( GetProcessHeap(), 0, actctx->comserver_section );
1317 RtlFreeHeap( GetProcessHeap(), 0, actctx->ifaceps_section );
1318 RtlFreeHeap( GetProcessHeap(), 0, actctx->clrsurrogate_section );
1319 RtlFreeHeap( GetProcessHeap(), 0, actctx->progid_section );
1320
1321 pActual = CONTAINING_RECORD(actctx, ACTIVATION_CONTEXT_WRAPPED, ActivationContext);
1322 pActual->MagicMarker = 0;
1323 RtlFreeHeap(GetProcessHeap(), 0, pActual);
1324 }
1325}
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:1047
static void free_assembly_identity(struct assembly_identity *ai)
Definition: actctx.c:1010
WCHAR * directory
Definition: actctx.c:530
struct dll_redirect * dlls
Definition: actctx.c:532
struct assembly_identity id
Definition: actctx.c:528
unsigned int num_dlls
Definition: actctx.c:533
struct file_info manifest
Definition: actctx.c:529
struct entity_array entities
Definition: actctx.c:535
COMPATIBILITY_CONTEXT_ELEMENT * compat_contexts
Definition: actctx.c:536
#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 934 of file actctx.c.

935{
936 struct assembly *assembly;
937
938 DPRINT("add_assembly() actctx %p, activeframe ??\n", actctx);
939
940 if (actctx->num_assemblies == actctx->allocated_assemblies)
941 {
942 void *ptr;
943 unsigned int new_count;
944 if (actctx->assemblies)
945 {
946 new_count = actctx->allocated_assemblies * 2;
948 actctx->assemblies, new_count * sizeof(*assembly) );
949 }
950 else
951 {
952 new_count = 4;
953 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*assembly) );
954 }
955 if (!ptr) return NULL;
956 actctx->assemblies = ptr;
957 actctx->allocated_assemblies = new_count;
958 }
959
960 assembly = &actctx->assemblies[actctx->num_assemblies++];
961 assembly->type = at;
962 return assembly;
963}
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:2686
static PVOID ptr
Definition: dispmode.c:27
#define DPRINT
Definition: sndvol32.h:73
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 991 of file actctx.c.

992{
993 void *ptr;
995 {
996 unsigned int new_count = assembly->num_compat_contexts + 1;
999 new_count * sizeof(COMPATIBILITY_CONTEXT_ELEMENT) );
1000 }
1001 else
1002 {
1003 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(COMPATIBILITY_CONTEXT_ELEMENT) );
1004 }
1005 if (!ptr) return NULL;
1008}
ULONG num_compat_contexts
Definition: actctx.c:537

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

4171{
4172 unsigned int i;
4174
4175 for (i = 0; i < entities->num; i++)
4176 {
4177 struct entity *entity = &entities->base[i];
4178 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4179 {
4180 ULONG module_len, progid_len, str_len = 0, miscmask;
4182 struct guid_index *alias_index;
4183 struct clrclass_data *clrdata;
4185 WCHAR *ptrW;
4186
4187 if (entity->u.comclass.progid)
4188 progid_len = wcslen(entity->u.comclass.progid)*sizeof(WCHAR);
4189 else
4190 progid_len = 0;
4191
4192 module_len = dll ? wcslen(dll->name)*sizeof(WCHAR) : wcslen(mscoreeW)*sizeof(WCHAR);
4193
4194 /* setup new index entry */
4196 Status = RtlGUIDFromString(&str, &(*index)->guid);
4197 if (!NT_SUCCESS(Status))
4198 return Status;
4199
4200 (*index)->data_offset = *data_offset;
4201 (*index)->data_len = sizeof(*data); /* additional length added later */
4202 (*index)->rosterindex = rosterindex;
4203
4204 /* Setup new index entry for alias guid. Alias index records are placed after
4205 normal records, so normal guids are hit first on search. Note that class count
4206 is doubled. */
4207 alias_index = (*index) + section->count/2;
4208 generate_uuid(seed, &alias_index->guid);
4209 alias_index->data_offset = (*index)->data_offset;
4210 alias_index->data_len = 0;
4211 alias_index->rosterindex = (*index)->rosterindex;
4212
4213 /* setup data */
4214 data = (struct comclassredirect_data*)((BYTE*)section + (*index)->data_offset);
4215 data->size = sizeof(*data);
4216 data->model = entity->u.comclass.model;
4217 data->clsid = (*index)->guid;
4218 data->alias = alias_index->guid;
4219 data->clsid2 = data->clsid;
4220 if (entity->u.comclass.tlbid)
4221 {
4223 Status = RtlGUIDFromString(&str, &data->tlbid);
4224 if (!NT_SUCCESS(Status))
4225 return Status;
4226 }
4227 else
4228 memset(&data->tlbid, 0, sizeof(data->tlbid));
4229 data->name_len = module_len;
4230 data->name_offset = *module_offset;
4231 data->progid_len = progid_len;
4232 data->progid_offset = data->progid_len ? data->size : 0; /* in case of clrClass additional offset is added later */
4233 data->clrdata_len = 0; /* will be set later */
4234 data->clrdata_offset = entity->u.comclass.name ? sizeof(*data) : 0;
4235 data->miscstatus = entity->u.comclass.miscstatus;
4236 data->miscstatuscontent = entity->u.comclass.miscstatuscontent;
4237 data->miscstatusthumbnail = entity->u.comclass.miscstatusthumbnail;
4238 data->miscstatusicon = entity->u.comclass.miscstatusicon;
4239 data->miscstatusdocprint = entity->u.comclass.miscstatusdocprint;
4240
4241 /* mask describes which misc* data is available */
4242 miscmask = 0;
4243 if (data->miscstatus)
4245 if (data->miscstatuscontent)
4247 if (data->miscstatusthumbnail)
4249 if (data->miscstatusicon)
4251 if (data->miscstatusdocprint)
4253 data->flags = miscmask << 8;
4254
4255 if (data->clrdata_offset)
4256 {
4257 clrdata = (struct clrclass_data*)((BYTE*)data + data->clrdata_offset);
4258
4259 clrdata->size = sizeof(*clrdata);
4260 clrdata->res[0] = 0;
4261 clrdata->res[1] = 2; /* FIXME: unknown field */
4262 clrdata->module_len = wcslen(mscoreeW)*sizeof(WCHAR);
4263 clrdata->module_offset = *module_offset + data->name_len + sizeof(WCHAR);
4264 clrdata->name_len = wcslen(entity->u.comclass.name)*sizeof(WCHAR);
4265 clrdata->name_offset = clrdata->size;
4266 clrdata->version_len = entity->u.comclass.version ? wcslen(entity->u.comclass.version)*sizeof(WCHAR) : 0;
4267 clrdata->version_offset = clrdata->version_len ? clrdata->name_offset + clrdata->name_len + sizeof(WCHAR) : 0;
4268 clrdata->res2[0] = 0;
4269 clrdata->res2[1] = 0;
4270
4271 data->clrdata_len = clrdata->size + clrdata->name_len + sizeof(WCHAR);
4272
4273 /* module name */
4274 ptrW = (WCHAR*)((BYTE*)section + clrdata->module_offset);
4275 memcpy(ptrW, mscoree2W, clrdata->module_len);
4276 ptrW[clrdata->module_len/sizeof(WCHAR)] = 0;
4277
4278 ptrW = (WCHAR*)((BYTE*)section + data->name_offset);
4279 memcpy(ptrW, mscoreeW, data->name_len);
4280 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4281
4282 /* class name */
4283 ptrW = (WCHAR*)((BYTE*)clrdata + clrdata->name_offset);
4284 memcpy(ptrW, entity->u.comclass.name, clrdata->name_len);
4285 ptrW[clrdata->name_len/sizeof(WCHAR)] = 0;
4286
4287 /* runtime version, optional */
4288 if (clrdata->version_len)
4289 {
4290 data->clrdata_len += clrdata->version_len + sizeof(WCHAR);
4291
4292 ptrW = (WCHAR*)((BYTE*)clrdata + clrdata->version_offset);
4293 memcpy(ptrW, entity->u.comclass.version, clrdata->version_len);
4294 ptrW[clrdata->version_len/sizeof(WCHAR)] = 0;
4295 }
4296
4297 if (data->progid_len)
4298 data->progid_offset += data->clrdata_len;
4299 (*index)->data_len += sizeof(*clrdata);
4300 }
4301 else
4302 {
4303 clrdata = NULL;
4304
4305 /* module name */
4306 ptrW = (WCHAR*)((BYTE*)section + data->name_offset);
4307 memcpy(ptrW, dll->name, data->name_len);
4308 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4309 }
4310
4311 /* progid string */
4312 if (data->progid_len)
4313 {
4314 ptrW = (WCHAR*)((BYTE*)data + data->progid_offset);
4315 memcpy(ptrW, entity->u.comclass.progid, data->progid_len);
4316 ptrW[data->progid_len/sizeof(WCHAR)] = 0;
4317 }
4318
4319 /* string block length */
4320 str_len = 0;
4321 if (clrdata)
4322 {
4323 str_len += clrdata->name_len + sizeof(WCHAR);
4324 if (clrdata->version_len)
4325 str_len += clrdata->version_len + sizeof(WCHAR);
4326 }
4327 if (progid_len)
4328 str_len += progid_len + sizeof(WCHAR);
4329
4330 (*index)->data_len += aligned_string_len(str_len);
4331 alias_index->data_len = (*index)->data_len;
4332
4333 /* move to next data record */
4334 (*data_offset) += sizeof(*data) + aligned_string_len(str_len);
4335 (*module_offset) += module_len + sizeof(WCHAR);
4336
4337 if (clrdata)
4338 {
4339 (*data_offset) += sizeof(*clrdata);
4340 (*module_offset) += clrdata->module_len + sizeof(WCHAR);
4341 }
4342 (*index) += 1;
4343 }
4344 }
4345
4346 return STATUS_SUCCESS;
4347}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
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)
const WCHAR * str
#define memset(x, y, z)
Definition: compat.h:39
static int aligned_string_len(int len)
Definition: actctx.c:2064
static const WCHAR mscoree2W[]
Definition: actctx.c:741
static void generate_uuid(ULONG *seed, GUID *guid)
Definition: actctx.c:4105
static const WCHAR mscoreeW[]
Definition: actctx.c:740
#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:507
struct entity * base
Definition: actctx.c:506
Definition: actctx.c:448
union entity::@4973 u
DWORD kind
Definition: actctx.c:449
struct entity::@4973::@4975 comclass
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 1122 of file actctx.c.

1124{
1125 unsigned int i;
1126
1127 /* check if we already have that assembly */
1128
1129 for (i = 0; i < acl->actctx->num_assemblies; i++)
1130 if (is_matching_identity( ai, &acl->actctx->assemblies[i].id ))
1131 {
1132 TRACE( "reusing existing assembly for %S arch %S version %u.%u.%u.%u\n",
1133 ai->name, ai->arch, ai->version.major, ai->version.minor,
1134 ai->version.build, ai->version.revision );
1135 return TRUE;
1136 }
1137
1138 for (i = 0; i < acl->num_dependencies; i++)
1139 if (is_matching_identity( ai, &acl->dependencies[i] ))
1140 {
1141 TRACE( "reusing existing dependency for %S arch %S version %u.%u.%u.%u\n",
1142 ai->name, ai->arch, ai->version.major, ai->version.minor,
1143 ai->version.build, ai->version.revision );
1144 return TRUE;
1145 }
1146
1148 {
1149 void *ptr;
1150 unsigned int new_count;
1151 if (acl->dependencies)
1152 {
1153 new_count = acl->allocated_dependencies * 2;
1155 new_count * sizeof(acl->dependencies[0]));
1156 }
1157 else
1158 {
1159 new_count = 4;
1160 ptr = RtlAllocateHeap(GetProcessHeap(), 0, new_count * sizeof(acl->dependencies[0]));
1161 }
1162 if (!ptr) return FALSE;
1163 acl->dependencies = ptr;
1164 acl->allocated_dependencies = new_count;
1165 }
1166 acl->dependencies[acl->num_dependencies++] = *ai;
1167
1168 return TRUE;
1169}
#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:1102
#define TRACE(s)
Definition: solgame.cpp:4
struct assembly * assemblies
Definition: actctx.c:590
unsigned int num_assemblies
Definition: actctx.c:591
unsigned int allocated_dependencies
Definition: actctx.c:609
struct assembly_identity * dependencies
Definition: actctx.c:607
unsigned int num_dependencies
Definition: actctx.c:608
ACTIVATION_CONTEXT * actctx
Definition: actctx.c:606
WCHAR * name
Definition: actctx.c:154
WCHAR * arch
Definition: actctx.c:155
struct assembly_version version
Definition: actctx.c:159

Referenced by parse_dependent_assembly_elem().

◆ add_dll_redirect()

static struct dll_redirect * add_dll_redirect ( struct assembly assembly)
static

Definition at line 965 of file actctx.c.

966{
967 DPRINT("add_dll_redirect() to assembly %p, num_dlls %d\n", assembly, assembly->allocated_dlls);
968
970 {
971 void *ptr;
972 unsigned int new_count;
973 if (assembly->dlls)
974 {
975 new_count = assembly->allocated_dlls * 2;
977 assembly->dlls, new_count * sizeof(*assembly->dlls) );
978 }
979 else
980 {
981 new_count = 4;
982 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*assembly->dlls) );
983 }
984 if (!ptr) return NULL;
985 assembly->dlls = ptr;
986 assembly->allocated_dlls = new_count;
987 }
988 return &assembly->dlls[assembly->num_dlls++];
989}
unsigned int allocated_dlls
Definition: actctx.c:534

Referenced by parse_file_elem().

◆ add_entity()

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

Definition at line 1019 of file actctx.c.

1020{
1021 struct entity* entity;
1022
1023 if (array->num == array->allocated)
1024 {
1025 void *ptr;
1026 unsigned int new_count;
1027 if (array->base)
1028 {
1029 new_count = array->allocated * 2;
1031 array->base, new_count * sizeof(*array->base) );
1032 }
1033 else
1034 {
1035 new_count = 4;
1036 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*array->base) );
1037 }
1038 if (!ptr) return NULL;
1039 array->base = ptr;
1040 array->allocated = new_count;
1041 }
1042 entity = &array->base[array->num++];
1043 entity->kind = kind;
1044 return entity;
1045}
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 4474 of file actctx.c.

4476{
4477 unsigned int i;
4478
4479 for (i = 0; i < entities->num; i++)
4480 {
4481 struct entity *entity = &entities->base[i];
4482 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)
4483 {
4484 struct ifacepsredirect_data *data = (struct ifacepsredirect_data*)((BYTE*)section + *data_offset);
4488
4489 if (entity->u.ifaceps.name)
4490 name_len = wcslen(entity->u.ifaceps.name)*sizeof(WCHAR);
4491 else
4492 name_len = 0;
4493
4494 /* setup index */
4496 Status = RtlGUIDFromString(&str, &(*index)->guid);
4497 if (!NT_SUCCESS(Status))
4498 return Status;
4499 (*index)->data_offset = *data_offset;
4500 (*index)->data_len = sizeof(*data) + name_len ? aligned_string_len(name_len + sizeof(WCHAR)) : 0;
4501 (*index)->rosterindex = rosterindex;
4502
4503 /* setup data record */
4504 data->size = sizeof(*data);
4505 data->mask = entity->u.ifaceps.mask;
4506
4507 /* proxyStubClsid32 value is only stored for external PS,
4508 if set it's used as iid, otherwise 'iid' attribute value is used */
4509 if (entity->u.ifaceps.ps32)
4510 {
4512 Status = RtlGUIDFromString(&str, &data->iid);
4513 if (!NT_SUCCESS(Status))
4514 return Status;
4515 }
4516 else
4517 data->iid = (*index)->guid;
4518
4519 data->nummethods = entity->u.ifaceps.nummethods;
4520
4521 if (entity->u.ifaceps.tlib)
4522 {
4524 Status = RtlGUIDFromString(&str, &data->tlbid);
4525 if (!NT_SUCCESS(Status))
4526 return Status;
4527 }
4528 else
4529 memset(&data->tlbid, 0, sizeof(data->tlbid));
4530
4531 if (entity->u.ifaceps.base)
4532 {
4534 Status = RtlGUIDFromString(&str, &data->base);
4535 if (!NT_SUCCESS(Status))
4536 return Status;
4537 }
4538 else
4539 memset(&data->base, 0, sizeof(data->base));
4540
4541 data->name_len = name_len;
4542 data->name_offset = data->name_len ? sizeof(*data) : 0;
4543
4544 /* name string */
4545 if (data->name_len)
4546 {
4547 WCHAR *ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
4548 memcpy(ptrW, entity->u.ifaceps.name, data->name_len);
4549 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4550 }
4551
4552 /* move to next record */
4553 (*index) += 1;
4554 *data_offset += sizeof(*data);
4555 if (data->name_len)
4556 *data_offset += aligned_string_len(data->name_len + sizeof(WCHAR));
4557 }
4558 }
4559
4560 return STATUS_SUCCESS;
4561}
struct entity::@4973::@4976 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 4894 of file actctx.c.

4896{
4897 unsigned int i, j;
4899
4900 for (i = 0; i < entities->num; i++)
4901 {
4902 struct entity *entity = &entities->base[i];
4903 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4904 {
4905 const struct progids *progids = &entity->u.comclass.progids;
4906 struct comclassredirect_data *comclass;
4907 struct guid_index *guid_index;
4909 GUID clsid;
4910
4913 if (!NT_SUCCESS(Status))
4914 return Status;
4915
4916 guid_index = find_guid_index(actctx->comserver_section, &clsid);
4917 comclass = get_comclass_data(actctx, guid_index);
4918
4919 if (entity->u.comclass.progid)
4920 write_progid_record(section, entity->u.comclass.progid, &comclass->alias,
4921 index, data_offset, global_offset, rosterindex);
4922
4923 for (j = 0; j < progids->num; j++)
4925 index, data_offset, global_offset, rosterindex);
4926 }
4927 }
4928 return Status;
4929}
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:4851
static struct comclassredirect_data * get_comclass_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:4412
static struct guid_index * find_guid_index(const struct guidsection_header *section, const GUID *guid)
Definition: actctx.c:3647
WCHAR ** progids
Definition: actctx.c:442
unsigned int num
Definition: actctx.c:443

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

1211{
1212 WCHAR *p = buffer;
1213
1214 if (!str) return;
1215 wcscat( buffer, prefix );
1216 p += wcslen(p);
1217 *p++ = '"';
1218 wcscpy( p, str );
1219 p += wcslen(p);
1220 *p++ = '"';
1221 *p = 0;
1222}
GLfloat GLfloat p
Definition: glext.h:8902
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)

Referenced by build_assembly_id().

◆ build_assembly_dir()

static WCHAR * build_assembly_dir ( struct assembly_identity ai)
static

Definition at line 1179 of file actctx.c.

1180{
1181 static const WCHAR undW[] = {'_',0};
1182 static const WCHAR noneW[] = {'n','o','n','e',0};
1183 static const WCHAR mskeyW[] = {'d','e','a','d','b','e','e','f',0};
1184
1185 const WCHAR *arch = ai->arch ? ai->arch : noneW;
1186 const WCHAR *key = ai->public_key ? ai->public_key : noneW;
1187 const WCHAR *lang = ai->language ? ai->language : noneW;
1188 const WCHAR *name = ai->name ? ai->name : noneW;
1189 SIZE_T size = (wcslen(arch) + 1 + wcslen(name) + 1 + wcslen(key) + 24 + 1 +
1190 wcslen(lang) + 1) * sizeof(WCHAR) + sizeof(mskeyW);
1191 WCHAR *ret;
1192
1193 if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, size ))) return NULL;
1194
1195 wcscpy( ret, arch );
1196 wcscat( ret, undW );
1197 wcscat( ret, name );
1198 wcscat( ret, undW );
1199 wcscat( ret, key );
1200 wcscat( ret, undW );
1202 ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
1203 wcscat( ret, undW );
1204 wcscat( ret, lang );
1205 wcscat( ret, undW );
1206 wcscat( ret, mskeyW );
1207 return ret;
1208}
#define swprintf
Definition: precomp.h:40
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR version_formatW[]
Definition: actctx.c:827
WCHAR * public_key
Definition: actctx.c:156
WCHAR * language
Definition: actctx.c:157
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 1224 of file actctx.c.

1225{
1226 static const WCHAR archW[] =
1227 {',','p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',0};
1228 static const WCHAR public_keyW[] =
1229 {',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',0};
1230 static const WCHAR typeW2[] =
1231 {',','t','y','p','e','=',0};
1232 static const WCHAR versionW2[] =
1233 {',','v','e','r','s','i','o','n','=',0};
1234
1235 WCHAR version[64], *ret;
1236 SIZE_T size = 0;
1237
1239 ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
1240 if (ai->name) size += wcslen(ai->name) * sizeof(WCHAR);
1241 if (ai->arch) size += wcslen(archW) + wcslen(ai->arch) + 2;
1242 if (ai->public_key) size += wcslen(public_keyW) + wcslen(ai->public_key) + 2;
1243 if (ai->type) size += wcslen(typeW2) + wcslen(ai->type) + 2;
1244 size += wcslen(versionW2) + wcslen(version) + 2;
1245
1246 if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR) )))
1247 return NULL;
1248
1249 if (ai->name) wcscpy( ret, ai->name );
1250 else *ret = 0;
1251 append_string( ret, archW, ai->arch );
1252 append_string( ret, public_keyW, ai->public_key );
1253 append_string( ret, typeW2, ai->type );
1254 append_string( ret, versionW2, version );
1255 return ret;
1256}
#define ARRAY_SIZE(A)
Definition: main.h:33
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:1210
WCHAR * type
Definition: actctx.c:158

Referenced by RtlQueryInformationActivationContext().

◆ build_clr_surrogate_section()

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

Definition at line 4668 of file actctx.c.

4669{
4670 unsigned int i, j, total_len = 0, count = 0;
4671 struct guidsection_header *header;
4672 struct clrsurrogate_data *data;
4673 struct guid_index *index;
4675
4676 /* compute section length */
4677 for (i = 0; i < actctx->num_assemblies; i++)
4678 {
4679 struct assembly *assembly = &actctx->assemblies[i];
4680 for (j = 0; j < assembly->entities.num; j++)
4681 {
4682 struct entity *entity = &assembly->entities.base[j];
4683 if (entity->kind == ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)
4684 {
4685 ULONG len;
4686
4687 total_len += sizeof(*index) + sizeof(*data);
4688 len = wcslen(entity->u.clrsurrogate.name) + 1;
4689 if (entity->u.clrsurrogate.version)
4690 len += wcslen(entity->u.clrsurrogate.version) + 1;
4691 total_len += aligned_string_len(len*sizeof(WCHAR));
4692
4693 count++;
4694 }
4695 }
4696 }
4697
4698 total_len += sizeof(*header);
4699
4700 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4701 if (!header) return STATUS_NO_MEMORY;
4702
4703 memset(header, 0, sizeof(*header));
4704 header->magic = GUIDSECTION_MAGIC;
4705 header->size = sizeof(*header);
4706 header->count = count;
4707 header->index_offset = sizeof(*header);
4708 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4709 data_offset = header->index_offset + count*sizeof(*index);
4710
4711 for (i = 0; i < actctx->num_assemblies; i++)
4712 {
4713 struct assembly *assembly = &actctx->assemblies[i];
4714 for (j = 0; j < assembly->entities.num; j++)
4715 {
4716 struct entity *entity = &assembly->entities.base[j];
4717 if (entity->kind == ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)
4718 {
4719 ULONG version_len, name_len;
4721 WCHAR *ptrW;
4723
4724 if (entity->u.clrsurrogate.version)
4725 version_len = wcslen(entity->u.clrsurrogate.version)*sizeof(WCHAR);
4726 else
4727 version_len = 0;
4728 name_len = wcslen(entity->u.clrsurrogate.name)*sizeof(WCHAR);
4729
4730 /* setup new index entry */
4732 Status = RtlGUIDFromString(&str, &index->guid);
4733 if (!NT_SUCCESS(Status))
4734 {
4736 return Status;
4737 }
4738
4739 index->data_offset = data_offset;
4740 index->data_len = sizeof(*data) + aligned_string_len(name_len + sizeof(WCHAR) + (version_len ? version_len + sizeof(WCHAR) : 0));
4741 index->rosterindex = i + 1;
4742
4743 /* setup data */
4744 data = (struct clrsurrogate_data*)((BYTE*)header + index->data_offset);
4745 data->size = sizeof(*data);
4746 data->res = 0;
4747 data->clsid = index->guid;
4748 data->version_offset = version_len ? data->size : 0;
4749 data->version_len = version_len;
4750 data->name_offset = data->size + version_len;
4751 if (version_len)
4752 data->name_offset += sizeof(WCHAR);
4753 data->name_len = name_len;
4754
4755 /* surrogate name */
4756 ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
4757 memcpy(ptrW, entity->u.clrsurrogate.name, data->name_len);
4758 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4759
4760 /* runtime version */
4761 if (data->version_len)
4762 {
4763 ptrW = (WCHAR*)((BYTE*)data + data->version_offset);
4764 memcpy(ptrW, entity->u.clrsurrogate.version, data->version_len);
4765 ptrW[data->version_len/sizeof(WCHAR)] = 0;
4766 }
4767
4768 data_offset += index->data_offset;
4769 index++;
4770 }
4771 }
4772 }
4773
4774 *section = header;
4775
4776 return STATUS_SUCCESS;
4777}
#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:60
ULONG version_len
Definition: actctx.c:1638
struct entity::@4973::@4978 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 4349 of file actctx.c.

4350{
4351 unsigned int i, j, total_len = 0, class_count = 0, names_len = 0;
4352 struct guidsection_header *header;
4353 ULONG module_offset, data_offset;
4354 struct guid_index *index;
4355 ULONG seed;
4357
4358 /* compute section length */
4359 for (i = 0; i < actctx->num_assemblies; i++)
4360 {
4361 struct assembly *assembly = &actctx->assemblies[i];
4362 get_comserver_datalen(&assembly->entities, NULL, &class_count, &total_len, &names_len);
4363 for (j = 0; j < assembly->num_dlls; j++)
4364 {
4365 struct dll_redirect *dll = &assembly->dlls[j];
4366 get_comserver_datalen(&dll->entities, dll, &class_count, &total_len, &names_len);
4367 }
4368 }
4369
4370 total_len += aligned_string_len(names_len);
4371 total_len += sizeof(*header);
4372
4373 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4374 if (!header) return STATUS_NO_MEMORY;
4375
4376 memset(header, 0, sizeof(*header));
4377 header->magic = GUIDSECTION_MAGIC;
4378 header->size = sizeof(*header);
4379 header->count = 2*class_count;
4380 header->index_offset = sizeof(*header) + aligned_string_len(names_len);
4381 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4382 module_offset = sizeof(*header);
4383 data_offset = header->index_offset + 2*class_count*sizeof(*index);
4384
4385 seed = NtGetTickCount();
4386 for (i = 0; i < actctx->num_assemblies; i++)
4387 {
4388 struct assembly *assembly = &actctx->assemblies[i];
4389 Status = add_comserver_record(header, &assembly->entities, NULL, &index, &data_offset, &module_offset, &seed, i+1);
4390 if (!NT_SUCCESS(Status))
4391 {
4393 return Status;
4394 }
4395 for (j = 0; j < assembly->num_dlls; j++)
4396 {
4397 struct dll_redirect *dll = &assembly->dlls[j];
4398 Status = add_comserver_record(header, &dll->entities, dll, &index, &data_offset, &module_offset, &seed, i+1);
4399 if (!NT_SUCCESS(Status))
4400 {
4402 return Status;
4403 }
4404 }
4405 }
4406
4407 *section = header;
4408
4409 return STATUS_SUCCESS;
4410}
#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:4168
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:4120

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

3526{
3527 unsigned int i, j, total_len = 0, dll_count = 0;
3528 struct strsection_header *header;
3529 struct dllredirect_data *data;
3530 struct string_index *index;
3532
3533 DPRINT("actctx %p, num_assemblies %d\n", actctx, actctx->num_assemblies);
3534
3535 /* compute section length */
3536 for (i = 0; i < actctx->num_assemblies; i++)
3537 {
3538 struct assembly *assembly = &actctx->assemblies[i];
3539 for (j = 0; j < assembly->num_dlls; j++)
3540 {
3541 struct dll_redirect *dll = &assembly->dlls[j];
3542
3543 /* each entry needs index, data and string data */
3544 total_len += sizeof(*index);
3545 total_len += sizeof(*data);
3546 total_len += aligned_string_len((wcslen(dll->name)+1)*sizeof(WCHAR));
3547
3548 DPRINT("assembly %d (%p), dll %d: dll name %S\n", i, assembly, j, dll->name);
3549 }
3550
3552 }
3553
3554 total_len += sizeof(*header);
3555
3556 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
3557 if (!header) return STATUS_NO_MEMORY;
3558
3559 memset(header, 0, sizeof(*header));
3560 header->magic = STRSECTION_MAGIC;
3561 header->size = sizeof(*header);
3562 header->count = dll_count;
3563 header->index_offset = sizeof(*header);
3564 index = (struct string_index*)((BYTE*)header + header->index_offset);
3565 name_offset = header->index_offset + header->count*sizeof(*index);
3566
3567 for (i = 0; i < actctx->num_assemblies; i++)
3568 {
3569 struct assembly *assembly = &actctx->assemblies[i];
3570
3571 DPRINT("assembly->num_dlls %d\n", assembly->num_dlls);
3572
3573 for (j = 0; j < assembly->num_dlls; j++)
3574 {
3575 struct dll_redirect *dll = &assembly->dlls[j];
3577 WCHAR *ptrW;
3578
3579 DPRINT("%d: dll name %S\n", j, dll->name);
3580 /* setup new index entry */
3581 str.Buffer = dll->name;
3582 str.Length = wcslen(dll->name)*sizeof(WCHAR);
3583 str.MaximumLength = str.Length + sizeof(WCHAR);
3584 /* hash original class name */
3586
3587 index->name_offset = name_offset;
3588 index->name_len = str.Length;
3589 index->data_offset = index->name_offset + aligned_string_len(str.MaximumLength);
3590 index->data_len = sizeof(*data);
3591 index->rosterindex = i + 1;
3592
3593 /* setup data */
3594 data = (struct dllredirect_data*)((BYTE*)header + index->data_offset);
3595 data->size = sizeof(*data);
3596 data->unk = 2; /* FIXME: seems to be constant */
3597 memset(data->res, 0, sizeof(data->res));
3598
3599 /* dll name */
3600 ptrW = (WCHAR*)((BYTE*)header + index->name_offset);
3601 memcpy(ptrW, dll->name, index->name_len);
3602 ptrW[index->name_len/sizeof(WCHAR)] = 0;
3603
3604 name_offset += sizeof(*data) + aligned_string_len(str.MaximumLength);
3605
3606 index++;
3607 }
3608 }
3609
3610 *section = header;
3611
3612 return STATUS_SUCCESS;
3613}
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:59
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 4563 of file actctx.c.

4564{
4565 unsigned int i, j, total_len = 0, count = 0;
4566 struct guidsection_header *header;
4567 struct guid_index *index;
4569
4570 /* compute section length */
4571 for (i = 0; i < actctx->num_assemblies; i++)
4572 {
4573 struct assembly *assembly = &actctx->assemblies[i];
4574
4575 get_ifaceps_datalen(&assembly->entities, &count, &total_len);
4576 for (j = 0; j < assembly->num_dlls; j++)
4577 {
4578 struct dll_redirect *dll = &assembly->dlls[j];
4579 get_ifaceps_datalen(&dll->entities, &count, &total_len);
4580 }
4581 }
4582
4583 total_len += sizeof(*header);
4584
4585 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4586 if (!header) return STATUS_NO_MEMORY;
4587
4588 memset(header, 0, sizeof(*header));
4589 header->magic = GUIDSECTION_MAGIC;
4590 header->size = sizeof(*header);
4591 header->count = count;
4592 header->index_offset = sizeof(*header);
4593 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4594 data_offset = header->index_offset + count*sizeof(*index);
4595
4596 for (i = 0; i < actctx->num_assemblies; i++)
4597 {
4598 struct assembly *assembly = &actctx->assemblies[i];
4600
4601 Status = add_ifaceps_record(header, &assembly->entities, &index, &data_offset, i + 1);
4602 if (!NT_SUCCESS(Status))
4603 {
4605 return Status;
4606 }
4607
4608 for (j = 0; j < assembly->num_dlls; j++)
4609 {
4610 struct dll_redirect *dll = &assembly->dlls[j];
4611 Status = add_ifaceps_record(header, &dll->entities, &index, &data_offset, i + 1);
4612 if (!NT_SUCCESS(Status))
4613 {
4615 return Status;
4616 }
4617 }
4618 }
4619
4620 *section = header;
4621
4622 return STATUS_SUCCESS;
4623}
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:4474
static void get_ifaceps_datalen(const struct entity_array *entities, unsigned int *count, unsigned int *len)
Definition: actctx.c:4457

Referenced by find_cominterface_redirection().

◆ build_progid_section()

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

Definition at line 4931 of file actctx.c.

4932{
4933 unsigned int i, j, total_len = 0, count = 0;
4934 struct strsection_header *header;
4935 ULONG data_offset, global_offset;
4936 struct string_index *index;
4938
4939 /* compute section length */
4940 for (i = 0; i < actctx->num_assemblies; i++)
4941 {
4942 struct assembly *assembly = &actctx->assemblies[i];
4943
4944 get_progid_datalen(&assembly->entities, &count, &total_len);
4945 for (j = 0; j < assembly->num_dlls; j++)
4946 {
4947 struct dll_redirect *dll = &assembly->dlls[j];
4948 get_progid_datalen(&dll->entities, &count, &total_len);
4949 }
4950 }
4951
4952 total_len += sizeof(*header);
4953
4954 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4955 if (!header) return STATUS_NO_MEMORY;
4956
4957 memset(header, 0, sizeof(*header));
4958 header->magic = STRSECTION_MAGIC;
4959 header->size = sizeof(*header);
4960 header->count = count;
4961 header->global_offset = header->size;
4962 header->global_len = count*sizeof(GUID);
4963 header->index_offset = header->size + header->global_len;
4964
4965 index = (struct string_index*)((BYTE*)header + header->index_offset);
4966 data_offset = header->index_offset + count*sizeof(*index);
4967 global_offset = header->global_offset;
4968
4969 for (i = 0; i < actctx->num_assemblies; i++)
4970 {
4971 struct assembly *assembly = &actctx->assemblies[i];
4972
4973 Status = add_progid_record(actctx, header, &assembly->entities, &index, &data_offset, &global_offset, i + 1);
4974 if (!NT_SUCCESS(Status))
4975 {
4977 return Status;
4978 }
4979
4980 for (j = 0; j < assembly->num_dlls; j++)
4981 {
4982 struct dll_redirect *dll = &assembly->dlls[j];
4983 Status = add_progid_record(actctx, header, &dll->entities, &index, &data_offset, &global_offset, i + 1);
4984 if (!NT_SUCCESS(Status))
4985 {
4987 return Status;
4988 }
4989 }
4990 }
4991
4992 *section = header;
4993
4994 return STATUS_SUCCESS;
4995}
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:4894
static void get_progid_datalen(struct entity_array *entities, unsigned int *count, unsigned int *total_len)
Definition: actctx.c:4826
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 3931 of file actctx.c.

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

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

Referenced by find_window_class().

◆ check_actctx()

static ACTIVATION_CONTEXT * check_actctx ( HANDLE  h)
static

Definition at line 1258 of file actctx.c.

1259{
1261 PACTIVATION_CONTEXT_WRAPPED pActual;
1262
1263 if (!h || h == INVALID_HANDLE_VALUE) return NULL;
1264 __TRY
1265 {
1266 if (actctx)
1267 {
1268 pActual = CONTAINING_RECORD(actctx, ACTIVATION_CONTEXT_WRAPPED, ActivationContext);
1269 if (pActual->MagicMarker == ACTCTX_MAGIC_MARKER) ret = &pActual->ActivationContext;
1270 }
1271 }
1273 {
1274 DPRINT1("Invalid activation context handle!\n");
1275 }
1276 __ENDTRY
1277 return ret;
1278}
#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:62

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

◆ com_class_add_progid()

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

Definition at line 1738 of file actctx.c.

1739{
1740 struct progids *progids = &entity->u.comclass.progids;
1741
1742 if (progids->allocated == 0)
1743 {
1744 progids->allocated = 4;
1745 if (!(progids->progids = RtlAllocateHeap(GetProcessHeap(), 0, progids->allocated * sizeof(WCHAR*)))) return FALSE;
1746 }
1747
1748 if (progids->allocated == progids->num)
1749 {
1750 WCHAR **new_progids = RtlReAllocateHeap(GetProcessHeap(), 0, progids->progids,
1751 2 * progids->allocated * sizeof(WCHAR*));
1752 if (!new_progids) return FALSE;
1753 progids->allocated *= 2;
1754 progids->progids = new_progids;
1755 }
1756
1757 if (!(progids->progids[progids->num] = xmlstrdupW(progid))) return FALSE;
1758 progids->num++;
1759
1760 return TRUE;
1761}
#define progid(str)
Definition: exdisp.idl:31
static WCHAR * xmlstrdupW(const xmlstr_t *str)
Definition: actctx.c:843
unsigned int allocated
Definition: actctx.c:444

Referenced by parse_com_class_progid().

◆ debugstr_version()

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

Definition at line 905 of file actctx.c.

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

◆ debugstr_xmlstr()

static const char * debugstr_xmlstr ( const xmlstr_t str)
inlinestatic

Definition at line 900 of file actctx.c.

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

◆ find_app_settings()

static const WCHAR * find_app_settings ( ACTIVATION_CONTEXT actctx,
const WCHAR settings,
const WCHAR ns 
)
static

Definition at line 5129 of file actctx.c.

5130{
5131 unsigned int i, j;
5132
5133 for (i = 0; i < actctx->num_assemblies; i++)
5134 {
5135 struct assembly *assembly = &actctx->assemblies[i];
5136 for (j = 0; j < assembly->entities.num; j++)
5137 {
5138 struct entity *entity = &assembly->entities.base[j];
5139 if (entity->kind == ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS &&
5140 !wcscmp( entity->u.settings.name, settings ) &&
5141 !wcscmp( entity->u.settings.ns, ns ))
5142 return entity->u.settings.value;
5143 }
5144 }
5145 return NULL;
5146}
struct mke2fs_defaults settings[]
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
struct entity::@4973::@4979 settings
Definition: mxnamespace.c:45

Referenced by RtlQueryActivationContextApplicationSettings().

◆ find_clr_surrogate()

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

Definition at line 4784 of file actctx.c.

4785{
4786 struct clrsurrogate_data *surrogate;
4787 struct guid_index *index = NULL;
4788
4789 if (!(actctx->sections & CLRSURROGATES_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4790
4791 if (!actctx->clrsurrogate_section)
4792 {
4794
4796 if (status) return status;
4797
4798 if (InterlockedCompareExchangePointer((void**)&actctx->clrsurrogate_section, section, NULL))
4800 }
4801
4802 index = find_guid_index(actctx->clrsurrogate_section, guid);
4803 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4804
4805 surrogate = get_surrogate_data(actctx, index);
4806
4807 data->ulDataFormatVersion = 1;
4808 data->lpData = surrogate;
4809 /* full length includes string length with nulls */
4810 data->ulLength = surrogate->size + surrogate->name_len + sizeof(WCHAR);
4811 if (surrogate->version_len)
4812 data->ulLength += surrogate->version_len + sizeof(WCHAR);
4813
4814 data->lpSectionGlobalData = NULL;
4815 data->ulSectionGlobalDataLength = 0;
4816 data->lpSectionBase = actctx->clrsurrogate_section;
4817 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->clrsurrogate_section );
4818 data->hActCtx = NULL;
4819
4820 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4821 data->ulAssemblyRosterIndex = index->rosterindex;
4822
4823 return STATUS_SUCCESS;
4824}
#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:4779
static NTSTATUS build_clr_surrogate_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4668
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 4630 of file actctx.c.

4631{
4632 struct ifacepsredirect_data *iface;
4633 struct guid_index *index = NULL;
4634
4635 if (!(actctx->sections & IFACEREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4636
4637 if (!actctx->ifaceps_section)
4638 {
4640
4642 if (status) return status;
4643
4644 if (InterlockedCompareExchangePointer((void**)&actctx->ifaceps_section, section, NULL))
4646 }
4647
4648 index = find_guid_index(actctx->ifaceps_section, guid);
4649 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4650
4651 iface = get_ifaceps_data(actctx, index);
4652
4653 data->ulDataFormatVersion = 1;
4654 data->lpData = iface;
4655 data->ulLength = iface->size + (iface->name_len ? iface->name_len + sizeof(WCHAR) : 0);
4656 data->lpSectionGlobalData = NULL;
4657 data->ulSectionGlobalDataLength = 0;
4658 data->lpSectionBase = actctx->ifaceps_section;
4659 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->ifaceps_section );
4660 data->hActCtx = NULL;
4661
4662 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4663 data->ulAssemblyRosterIndex = index->rosterindex;
4664
4665 return STATUS_SUCCESS;
4666}
static NTSTATUS build_ifaceps_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4563
static struct ifacepsredirect_data * get_ifaceps_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:4625

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

4418{
4419 struct comclassredirect_data *comclass;
4420 struct guid_index *index = NULL;
4421
4422 if (!(actctx->sections & SERVERREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4423
4424 if (!actctx->comserver_section)
4425 {
4427
4429 if (status) return status;
4430
4431 if (InterlockedCompareExchangePointer((void**)&actctx->comserver_section, section, NULL))
4433 }
4434
4435 index = find_guid_index(actctx->comserver_section, guid);
4436 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4437
4438 comclass = get_comclass_data(actctx, index);
4439
4440 data->ulDataFormatVersion = 1;
4441 data->lpData = comclass;
4442 /* full length includes string length with nulls */
4443 data->ulLength = comclass->size + comclass->clrdata_len;
4444 if (comclass->progid_len) data->ulLength += comclass->progid_len + sizeof(WCHAR);
4445 data->lpSectionGlobalData = (BYTE*)actctx->comserver_section + actctx->comserver_section->names_offset;
4446 data->ulSectionGlobalDataLength = actctx->comserver_section->names_len;
4447 data->lpSectionBase = actctx->comserver_section;
4448 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->comserver_section );
4449 data->hActCtx = NULL;
4450
4451 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4452 data->ulAssemblyRosterIndex = index->rosterindex;
4453
4454 return STATUS_SUCCESS;
4455}
static NTSTATUS build_comserver_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4349

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

3674{
3675 struct dllredirect_data *dll;
3676 struct string_index *index;
3677
3678 DPRINT("sections: 0x%08X\n", actctx->sections);
3679 if (!(actctx->sections & DLLREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
3680
3681 DPRINT("actctx->dllredirect_section: %p\n", actctx->dllredirect_section);
3682 if (!actctx->dllredirect_section)
3683 {
3684 struct strsection_header *section;
3685
3687 if (status) return status;
3688
3689 if (InterlockedCompareExchangePointer((void**)&actctx->dllredirect_section, section, NULL))
3691 }
3692
3693 index = find_string_index(actctx->dllredirect_section, name);
3694 DPRINT("index: %d\n", index);
3695 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
3696
3697 if (data)
3698 {
3700
3701 data->ulDataFormatVersion = 1;
3702 data->lpData = dll;
3703 data->ulLength = dll->size;
3704 data->lpSectionGlobalData = NULL;
3705 data->ulSectionGlobalDataLength = 0;
3706 data->lpSectionBase = actctx->dllredirect_section;
3707 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->dllredirect_section );
3708 data->hActCtx = NULL;
3709
3710 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
3711 data->ulAssemblyRosterIndex = index->rosterindex;
3712 }
3713
3714 return STATUS_SUCCESS;
3715}
static NTSTATUS build_dllredirect_section(ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
Definition: actctx.c:3525
static struct dllredirect_data * get_dllredirect_data(ACTIVATION_CONTEXT *ctxt, struct string_index *index)
Definition: actctx.c:3667
static struct string_index * find_string_index(const struct strsection_header *section, const UNICODE_STRING *name)
Definition: actctx.c:3615

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

5097{
5099
5100 switch (section_kind)
5101 {
5102 case ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION:
5104 break;
5105 case ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION:
5107 break;
5108 case ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION:
5110 break;
5111 case ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES:
5113 break;
5114 default:
5115 WARN("Unknown section_kind %x\n", section_kind);
5117 }
5118
5119 if (status != STATUS_SUCCESS) return status;
5120
5121 if (flags & FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX)
5122 {
5124 data->hActCtx = actctx;
5125 }
5126 return STATUS_SUCCESS;
5127}
#define WARN(fmt,...)
Definition: precomp.h:61
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:4630
static void actctx_addref(ACTIVATION_CONTEXT *actctx)
Definition: actctx.c:1280
static NTSTATUS find_comserver_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4417
static NTSTATUS find_clr_surrogate(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4784
static NTSTATUS find_tlib_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4066

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

3648{
3649 struct guid_index *iter, *index = NULL;
3650 ULONG i;
3651
3652 iter = (struct guid_index*)((BYTE*)section + section->index_offset);
3653
3654 for (i = 0; i < section->count; i++)
3655 {
3656 if (!memcmp(guid, &iter->guid, sizeof(*guid)))
3657 {
3658 index = iter;
3659 break;
3660 }
3661 iter++;
3662 }
3663
3664 return index;
3665}
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 5002 of file actctx.c.

5004{
5006 struct string_index *index;
5007
5008 if (!(actctx->sections & PROGIDREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
5009
5010 if (!actctx->comserver_section)
5011 {
5013
5015 if (status) return status;
5016
5017 if (InterlockedCompareExchangePointer((void**)&actctx->comserver_section, section, NULL))
5019 }
5020
5021 if (!actctx->progid_section)
5022 {
5023 struct strsection_header *section;
5024
5026 if (status) return status;
5027
5028 if (InterlockedCompareExchangePointer((void**)&actctx->progid_section, section, NULL))
5030 }
5031
5032 index = find_string_index(actctx->progid_section, name);
5033 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
5034
5035 if (data)
5036 {
5038
5039 data->ulDataFormatVersion = 1;
5040 data->lpData = progid;
5041 data->ulLength = progid->size;
5042 data->lpSectionGlobalData = (BYTE*)actctx->progid_section + actctx->progid_section->global_offset;
5043 data->ulSectionGlobalDataLength = actctx->progid_section->global_len;
5044 data->lpSectionBase = actctx->progid_section;
5045 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->progid_section );
5046 data->hActCtx = NULL;
5047
5048 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
5049 data->ulAssemblyRosterIndex = index->rosterindex;
5050 }
5051
5052 return STATUS_SUCCESS;
5053}
static struct progidredirect_data * get_progid_data(ACTIVATION_CONTEXT *actctx, const struct string_index *index)
Definition: actctx.c:4997
static NTSTATUS build_progid_section(ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
Definition: actctx.c:4931

Referenced by find_string().

◆ find_query_actctx()

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

Definition at line 3490 of file actctx.c.

3491{
3493
3495 {
3496 if (*handle) return STATUS_INVALID_PARAMETER;
3497
3498 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
3499 *handle = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext;
3500 }
3502 {
3505
3506 if (!*handle) return STATUS_INVALID_PARAMETER;
3507
3509 if (!LdrFindEntryForAddress( *handle, &pldr ))
3510 {
3513 else
3515 }
3518 }
3519 else if (!*handle && (class != ActivationContextBasicInformation))
3521
3522 return status;
3523}
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 5055 of file actctx.c.

5058{
5060
5061 switch (section_kind)
5062 {
5063#ifdef __REACTOS__
5064 case ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION:
5065 DPRINT1("Unsupported yet section_kind %x\n", section_kind);
5067#endif // __REACTOS__
5068 case ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION:
5069 status = find_dll_redirection(actctx, section_name, data);
5070 break;
5071 case ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION:
5072 status = find_window_class(actctx, section_name, data);
5073 break;
5074 case ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION:
5075 status = find_progid_redirection(actctx, section_name, data);
5076 break;
5077 case ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE:
5078 FIXME("Unsupported yet section_kind %x\n", section_kind);
5080 default:
5081 WARN("Unknown section_kind %x\n", section_kind);
5083 }
5084
5085 if (status != STATUS_SUCCESS) return status;
5086
5087 if (data && (flags & FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX))
5088 {
5090 data->hActCtx = actctx;
5091 }
5092 return STATUS_SUCCESS;
5093}
#define FIXME(fmt,...)
Definition: precomp.h:53
static NTSTATUS find_progid_redirection(ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:5002
static NTSTATUS find_window_class(ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:3865
static NTSTATUS find_dll_redirection(ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:3672

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

3616{
3617 struct string_index *iter, *index = NULL;
3619 ULONG hash = 0, i;
3620
3621 DPRINT("section %p, name %wZ\n", section, name);
3623 iter = (struct string_index*)((BYTE*)section + section->index_offset);
3624
3625 for (i = 0; i < section->count; i++)
3626 {
3627 DPRINT("iter->hash 0x%x ?= 0x%x\n", iter->hash, hash);
3628 DPRINT("iter->name %S\n", (WCHAR*)((BYTE*)section + iter->name_offset));
3629 if (iter->hash == hash)
3630 {
3631 str.Buffer = (WCHAR *)((BYTE *)section + iter->name_offset);
3632 str.Length = iter->name_len;
3634 {
3635 index = iter;
3636 break;
3637 }
3638 else
3639 WARN("hash collision 0x%08x, %wZ, %wZ\n", hash, name, &str);
3640 }
3641 iter++;
3642 }
3643
3644 return index;
3645}
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
Definition: _hash_fun.h:40
ULONG name_len
Definition: actctx.c:1063
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 4066 of file actctx.c.

4067{
4068 struct guid_index *index = NULL;
4069 struct tlibredirect_data *tlib;
4070
4071 if (!(actctx->sections & TLIBREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4072
4073 if (!actctx->tlib_section)
4074 {
4076
4078 if (status) return status;
4079
4080 if (InterlockedCompareExchangePointer((void**)&actctx->tlib_section, section, NULL))
4082 }
4083
4084 index = find_guid_index(actctx->tlib_section, guid);
4085 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4086
4087 tlib = get_tlib_data(actctx, index);
4088
4089 data->ulDataFormatVersion = 1;
4090 data->lpData = tlib;
4091 /* full length includes string length with nulls */
4092 data->ulLength = tlib->size + tlib->help_len + sizeof(WCHAR);
4093 data->lpSectionGlobalData = (BYTE*)actctx->tlib_section + actctx->tlib_section->names_offset;
4094 data->ulSectionGlobalDataLength = actctx->tlib_section->names_len;
4095 data->lpSectionBase = actctx->tlib_section;
4096 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->tlib_section );
4097 data->hActCtx = NULL;
4098
4099 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4100 data->ulAssemblyRosterIndex = index->rosterindex;
4101
4102 return STATUS_SUCCESS;
4103}
static struct tlibredirect_data * get_tlib_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:4061
static NTSTATUS build_tlib_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:3931

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

3867{
3868 struct string_index *iter, *index = NULL;
3869 struct wndclass_redirect_data *class;
3871 ULONG hash;
3872 int i;
3873
3874 if (!(actctx->sections & WINDOWCLASS_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
3875
3876 if (!actctx->wndclass_section)
3877 {
3878 struct strsection_header *section;
3879
3881 if (status) return status;
3882
3883 if (InterlockedCompareExchangePointer((void**)&actctx->wndclass_section, section, NULL))
3885 }
3886
3887 hash = 0;
3890
3891 for (i = 0; i < actctx->wndclass_section->count; i++)
3892 {
3893 if (iter->hash == hash)
3894 {
3895 str.Buffer = (WCHAR *)((BYTE *)actctx->wndclass_section + iter->name_offset);
3896 str.Length = iter->name_len;
3898 {
3899 index = iter;
3900 break;
3901 }
3902 else
3903 WARN("hash collision 0x%08x, %wZ, %wZ\n", hash, name, &str);
3904 }
3905 iter++;
3906 }
3907
3908 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
3909
3910 if (data)
3911 {
3912 class = get_wndclass_data(actctx, index);
3913
3914 data->ulDataFormatVersion = 1;
3915 data->lpData = class;
3916 /* full length includes string length with nulls */
3917 data->ulLength = class->size + class->name_len + class->module_len + 2*sizeof(WCHAR);
3918 data->lpSectionGlobalData = NULL;
3919 data->ulSectionGlobalDataLength = 0;
3920 data->lpSectionBase = actctx->wndclass_section;
3921 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->wndclass_section );
3922 data->hActCtx = NULL;
3923
3924 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
3925 data->ulAssemblyRosterIndex = index->rosterindex;
3926 }
3927
3928 return STATUS_SUCCESS;
3929}
static struct wndclass_redirect_data * get_wndclass_data(ACTIVATION_CONTEXT *ctxt, struct string_index *index)
Definition: actctx.c:3722
static NTSTATUS build_wndclass_section(ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
Definition: actctx.c:3727
static struct string_index * get_wndclass_first_index(ACTIVATION_CONTEXT *actctx)
Definition: actctx.c:3717

Referenced by find_string().

◆ find_xmlns()

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

Definition at line 1362 of file actctx.c.

1363{
1364 int i;
1365
1366 for (i = xmlbuf->ns_pos - 1; i >= 0; i--)
1367 {
1368 if (xmlbuf->namespaces[i].name.len == name->len &&
1369 !wcsncmp( xmlbuf->namespaces[i].name.ptr, name->ptr, name->len ))
1370 return xmlbuf->namespaces[i].value;
1371 }
1372
1373 return empty_xmlstr;
1374}
_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:612
int ns_pos
Definition: actctx.c:134
struct xml_attr namespaces[MAX_NAMESPACES]
Definition: actctx.c:133

Referenced by next_xml_elem().

◆ free_assembly_identity()

static void free_assembly_identity ( struct assembly_identity ai)
static

Definition at line 1010 of file actctx.c.

1011{
1012 RtlFreeHeap( GetProcessHeap(), 0, ai->name );
1013 RtlFreeHeap( GetProcessHeap(), 0, ai->arch );
1015 RtlFreeHeap( GetProcessHeap(), 0, ai->language );
1016 RtlFreeHeap( GetProcessHeap(), 0, ai->type );
1017}

Referenced by actctx_release(), and free_depend_manifests().

◆ free_depend_manifests()

static void free_depend_manifests ( struct actctx_loader acl)
static

Definition at line 1171 of file actctx.c.

1172{
1173 unsigned int i;
1174 for (i = 0; i < acl->num_dependencies; i++)
1177}

Referenced by RtlCreateActivationContext().

◆ free_entity_array()

static void free_entity_array ( struct entity_array array)
static

Definition at line 1047 of file actctx.c.

1048{
1049 unsigned int i, j;
1050 for (i = 0; i < array->num; i++)
1051 {
1052 struct entity *entity = &array->base[i];
1053 switch (entity->kind)
1054 {
1055 case ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION:
1060 RtlFreeHeap(GetProcessHeap(), 0, entity->u.comclass.version);
1061 for (j = 0; j < entity->u.comclass.progids.num; j++)
1062 RtlFreeHeap(GetProcessHeap(), 0, entity->u.comclass.progids.progids[j]);
1063 RtlFreeHeap(GetProcessHeap(), 0, entity->u.comclass.progids.progids);
1064 break;
1065 case ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION:
1071 break;
1072 case ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION:
1074 RtlFreeHeap(GetProcessHeap(), 0, entity->u.typelib.helpdir);
1075 break;
1076 case ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION:
1078 break;
1079 case ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES:
1083 break;
1084 case ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS:
1088 break;
1089 default:
1090 FIXME("Unknown entity kind %d\n", entity->kind);
1091 }
1092 }
1093 RtlFreeHeap( GetProcessHeap(), 0, array->base );
1094}

Referenced by actctx_release().

◆ generate_uuid()

static void generate_uuid ( ULONG seed,
GUID guid 
)
static

Definition at line 4105 of file actctx.c.

4106{
4107 ULONG *ptr = (ULONG*)guid;
4108 int i;
4109
4110 /* GUID is 16 bytes long */
4111 for (i = 0; i < sizeof(GUID)/sizeof(ULONG); i++, ptr++)
4112 *ptr = RtlUniform(seed);
4113
4114 guid->Data3 &= 0x0fff;
4115 guid->Data3 |= (4 << 12);
4116 guid->Data4[0] &= 0x3f;
4117 guid->Data4[0] |= 0x80;
4118}
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 2069 of file actctx.c.

2070{
2071 static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
2072 struct assembly_version *ver = &assembly->id.version;
2073 WCHAR buff[25];
2074
2075 if (!ret) ret = buff;
2076 return swprintf(ret, ARRAY_SIZE(buff), fmtW, ver->major, ver->minor, ver->build, ver->revision);
2077}
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 4412 of file actctx.c.

4413{
4414 return (struct comclassredirect_data*)((BYTE*)actctx->comserver_section + index->data_offset);
4415}

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

4122{
4123 unsigned int i;
4124
4125 for (i = 0; i < entities->num; i++)
4126 {
4127 struct entity *entity = &entities->base[i];
4128 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4129 {
4130 /* each entry needs two index entries, extra one goes for alias GUID */
4131 *len += 2*sizeof(struct guid_index);
4132 /* To save some memory we don't allocated two data structures,
4133 instead alias index and normal index point to the same data structure. */
4134 *len += sizeof(struct comclassredirect_data);
4135
4136 /* for clrClass store some more */
4137 if (entity->u.comclass.name)
4138 {
4139 unsigned int str_len;
4140
4141 /* all string data is stored together in aligned block */
4142 str_len = wcslen(entity->u.comclass.name)+1;
4143 if (entity->u.comclass.progid)
4144 str_len += wcslen(entity->u.comclass.progid)+1;
4145 if (entity->u.comclass.version)
4146 str_len += wcslen(entity->u.comclass.version)+1;
4147
4148 *len += sizeof(struct clrclass_data);
4149 *len += aligned_string_len(str_len*sizeof(WCHAR));
4150
4151 /* module name is forced to mscoree.dll, and stored two times with different case */
4152 *module_len += sizeof(mscoreeW) + sizeof(mscoree2W);
4153 }
4154 else
4155 {
4156 /* progid string is stored separately */
4157 if (entity->u.comclass.progid)
4158 *len += aligned_string_len((wcslen(entity->u.comclass.progid)+1)*sizeof(WCHAR));
4159
4160 *module_len += (wcslen(dll->name)+1)*sizeof(WCHAR);
4161 }
4162
4163 *count += 1;
4164 }
4165 }
4166}

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

3668{
3669 return (struct dllredirect_data*)((BYTE*)ctxt->dllredirect_section + index->data_offset);
3670}
struct strsection_header * dllredirect_section
Definition: actctx.c:596

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

4626{
4627 return (struct ifacepsredirect_data*)((BYTE*)actctx->ifaceps_section + index->data_offset);
4628}

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

4458{
4459 unsigned int i;
4460
4461 for (i = 0; i < entities->num; i++)
4462 {
4463 struct entity *entity = &entities->base[i];
4464 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)
4465 {
4466 *len += sizeof(struct guid_index) + sizeof(struct ifacepsredirect_data);
4467 if (entity->u.ifaceps.name)
4468 *len += aligned_string_len((wcslen(entity->u.ifaceps.name)+1)*sizeof(WCHAR));
4469 *count += 1;
4470 }
4471 }
4472}
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 3171 of file actctx.c.

3173{
3174 static const WCHAR fmtW[] = { '.','%','l','u',0 };
3175 WCHAR *buffer;
3178 HANDLE file;
3180
3181 if (!((ULONG_PTR)resname >> 16)) resid = (ULONG_PTR)resname & 0xffff;
3182
3183 TRACE( "looking for manifest associated with %S id %lu\n", filename, resid );
3184
3185 if (module) /* use the module filename */
3186 {
3188
3189 if (!(status = get_module_filename( module, &name, sizeof(dotManifestW) + 10*sizeof(WCHAR) )))
3190 {
3191 if (resid != 1) swprintf( name.Buffer + wcslen(name.Buffer), 10, fmtW, resid );
3192 wcscat( name.Buffer, dotManifestW );
3193 if (!RtlDosPathNameToNtPathName_U( name.Buffer, &nameW, NULL, NULL ))
3196 }
3197 if (status) return status;
3198 }
3199 else
3200 {
3202 (wcslen(filename) + 10) * sizeof(WCHAR) + sizeof(dotManifestW) )))
3203 return STATUS_NO_MEMORY;
3205 if (resid != 1) swprintf( buffer + wcslen(buffer), 10, fmtW, resid );
3208 }
3209
3210 if (!open_nt_file( &file, &nameW ))
3211 {
3213 NtClose( file );
3214 }
3217 return status;
3218}
static const WCHAR nameW[]
Definition: main.c:49
#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:2935
static const WCHAR dotManifestW[]
Definition: actctx.c:826
static NTSTATUS get_module_filename(HMODULE module, UNICODE_STRING *str, unsigned int extra_len)
Definition: actctx.c:911
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:3127
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 3127 of file actctx.c.

3129{
3137 SIZE_T count;
3138 void *base;
3139
3140 TRACE( "loading manifest file %S\n", filename );
3141
3142 attr.Length = sizeof(attr);
3143 attr.RootDirectory = 0;
3144 attr.ObjectName = NULL;
3145 attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF;
3146 attr.SecurityDescriptor = NULL;
3147 attr.SecurityQualityOfService = NULL;
3148
3149 size.QuadPart = 0;
3152 if (status != STATUS_SUCCESS) return status;
3153
3154 offset.QuadPart = 0;
3155 count = 0;
3156 base = NULL;
3159 NtClose( mapping );
3160 if (status != STATUS_SUCCESS) return status;
3161
3163 if (status == STATUS_SUCCESS)
3164 status = parse_manifest(acl, ai, filename, NULL, directory, shared, base, info.EndOfFile.QuadPart);
3165
3167 return status;
3168}
NTSTATUS NTAPI NtUnmapViewOfSection(IN HANDLE ProcessHandle, IN PVOID BaseAddress)
Definition: section.c:3481
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:3074
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:3255
#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, HANDLE module, LPCWSTR directory, BOOL shared, const void *buffer, SIZE_T size)
Definition: actctx.c:2856
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 2949 of file actctx.c.

2952{
2957 void *ptr;
2958
2959 //DPRINT( "looking for res %s in module %p %s\n", resname,
2960 // hModule, filename );
2961 DPRINT("get_manifest_in_module %p\n", hModule);
2962
2963#if 0
2964 if (TRACE_ON(actctx))
2965 {
2966 if (!filename && !get_module_filename( hModule, &nameW, 0 ))
2967 {
2968 TRACE( "looking for res %s in module %p %s\n", debugstr_w(resname),
2969 hModule, debugstr_w(nameW.Buffer) );
2971 }
2972 else TRACE( "looking for res %s in module %p %s\n", debugstr_w(resname),
2974 }
2975#endif
2976
2977 if (!resname) return STATUS_INVALID_PARAMETER;
2978
2979 info.Type = RT_MANIFEST;
2980 info.Language = lang;
2981 if (!((ULONG_PTR)resname >> 16))
2982 {
2983 info.Name = (ULONG_PTR)resname;
2985 }
2986 else if (resname[0] == '#')
2987 {
2988 ULONG value;
2989 RtlInitUnicodeString(&nameW, resname + 1);
2992 info.Name = value;
2994 }
2995 else
2996 {
2997 RtlCreateUnicodeString(&nameW, resname);
2999 info.Name = (ULONG_PTR)nameW.Buffer;
3002 }
3004
3005 if (status == STATUS_SUCCESS)
3006 status = parse_manifest(acl, ai, filename, hModule, directory, shared, ptr, entry->Size);
3007
3008 return status;
3009}
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 3071 of file actctx.c.

3074{
3080 SIZE_T count;
3081 void *base;
3082 WCHAR resnameBuf[20];
3083 LPCWSTR resptr = resname;
3084
3085 if ((!((ULONG_PTR)resname >> 16)))
3086 {
3087 _swprintf(resnameBuf, L"#%u", PtrToUlong(resname));
3088 resptr = resnameBuf;
3089 }
3090
3091 TRACE( "looking for res %S in %S\n", resptr, filename ? filename : L"<NULL>");
3092
3093 attr.Length = sizeof(attr);
3094 attr.RootDirectory = 0;
3095 attr.ObjectName = NULL;
3096 attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF;
3097 attr.SecurityDescriptor = NULL;
3098 attr.SecurityQualityOfService = NULL;
3099
3100 size.QuadPart = 0;
3103 if (status != STATUS_SUCCESS) return status;
3104
3105 offset.QuadPart = 0;
3106 count = 0;
3107 base = NULL;
3110 NtClose( mapping );
3111 if (status != STATUS_SUCCESS) return status;
3112
3113 if (RtlImageNtHeader(base)) /* we got a PE file */
3114 {
3115 HANDLE module = (HMODULE)((ULONG_PTR)base | 1); /* make it a LOAD_LIBRARY_AS_DATAFILE handle */
3116 if (resname)
3117 status = get_manifest_in_module( acl, ai, filename, directory, shared, module, resname, lang );
3118 else
3119 status = search_manifest_in_module(acl, ai, filename, directory, shared, module, lang);
3120 }
3122
3124 return status;
3125}
#define RtlImageNtHeader
Definition: compat.h:806
#define PtrToUlong(u)
Definition: config.h:107
int _swprintf(wchar_t *buffer, const wchar_t *format,...)
#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:2949
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 911 of file actctx.c.

912{
916
919 if (status == STATUS_SUCCESS)
920 {
921 if ((str->Buffer = RtlAllocateHeap( GetProcessHeap(), 0,
922 pldr->FullDllName.Length + extra_len + sizeof(WCHAR) )))
923 {
924 memcpy( str->Buffer, pldr->FullDllName.Buffer, pldr->FullDllName.Length + sizeof(WCHAR) );
925 str->Length = pldr->FullDllName.Length;
926 str->MaximumLength = pldr->FullDllName.Length + extra_len + sizeof(WCHAR);
927 }
929 }
931 return status;
932}
UNICODE_STRING FullDllName
Definition: btrfs_drv.h:1882

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

◆ get_olemisc_value()

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

Definition at line 1689 of file actctx.c.

1690{
1691 int min, max;
1692
1693 min = 0;
1695
1696 while (min <= max)
1697 {
1698 int n, c;
1699
1700 n = (min+max)/2;
1701
1703 if (!c && !olemisc_values[n].name[len])
1704 return olemisc_values[n].value;
1705
1706 if (c >= 0)
1707 max = n-1;
1708 else
1709 min = n+1;
1710 }
1711
1712 WARN("unknown flag %S\n", str);
1713 return 0;
1714}
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
static const struct olemisc_entry olemisc_values[]
Definition: actctx.c:798
#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 4997 of file actctx.c.

4998{
4999 return (struct progidredirect_data*)((BYTE*)actctx->progid_section + index->data_offset);
5000}

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

4827{
4828 unsigned int i, j, single_len;
4829
4830 single_len = sizeof(struct progidredirect_data) + sizeof(struct string_index) + sizeof(GUID);
4831 for (i = 0; i < entities->num; i++)
4832 {
4833 struct entity *entity = &entities->base[i];
4834 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4835 {
4836 if (entity->u.comclass.progid)
4837 {
4838 *total_len += single_len + aligned_string_len((wcslen(entity->u.comclass.progid)+1)*sizeof(WCHAR));
4839 *count += 1;
4840 }
4841
4842 for (j = 0; j < entity->u.comclass.progids.num; j++)
4843 *total_len += aligned_string_len((wcslen(entity->u.comclass.progids.progids[j])+1)*sizeof(WCHAR));
4844
4845 *total_len += single_len*entity->u.comclass.progids.num;
4846 *count += entity->u.comclass.progids.num;
4847 }
4848 }
4849}

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

4780{
4781 return (struct clrsurrogate_data*)((BYTE*)actctx->clrsurrogate_section + index->data_offset);
4782}

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

4062{
4063 return (struct tlibredirect_data*)((BYTE*)actctx->tlib_section + index->data_offset);
4064}

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

3723{
3724 return (struct wndclass_redirect_data*)((BYTE*)ctxt->wndclass_section + index->data_offset);
3725}
struct strsection_header * wndclass_section
Definition: actctx.c:595

Referenced by find_window_class().

◆ get_wndclass_first_index()

static struct string_index * get_wndclass_first_index ( ACTIVATION_CONTEXT actctx)
inlinestatic

Definition at line 3717 of file actctx.c.

3718{
3719 return (struct string_index*)((BYTE*)actctx->wndclass_section + actctx->wndclass_section->index_offset);
3720}

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

1104{
1105 if (!is_matching_string( id1->name, id2->name )) return FALSE;
1106 if (!is_matching_string( id1->arch, id2->arch )) return FALSE;
1107 if (!is_matching_string( id1->public_key, id2->public_key )) return FALSE;
1108
1109 if (id1->language && id2->language && !is_matching_string( id1->language, id2->language ))
1110 {
1111 if (wcscmp( wildcardW, id1->language ) && wcscmp( wildcardW, id2->language ))
1112 return FALSE;
1113 }
1114 if (id1->version.major != id2->version.major) return FALSE;
1115 if (id1->version.minor != id2->version.minor) return FALSE;
1116 if (id1->version.build > id2->version.build) return FALSE;
1117 if (id1->version.build == id2->version.build &&
1118 id1->version.revision > id2->version.revision) return FALSE;
1119 return TRUE;
1120}
static BOOL is_matching_string(const WCHAR *str1, const WCHAR *str2)
Definition: actctx.c:1096
static const WCHAR wildcardW[]
Definition: actctx.c:828

Referenced by add_dependent_assembly_id().

◆ is_matching_string()

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

Definition at line 1096 of file actctx.c.

1097{
1098 if (!str1) return !str2;
1099 return str2 && !RtlCompareUnicodeStrings( str1, wcslen(str1), str2, wcslen(str2), TRUE );
1100}
_Must_inspect_result_ NTSYSAPI LONG NTAPI RtlCompareUnicodeStrings(_In_reads_(String1Length) PCWCH String1, _In_ SIZE_T String1Length, _In_reads_(String2Length) PCWCH String2, _In_ SIZE_T String2Length, _In_ BOOLEAN CaseInSensitive)

Referenced by is_matching_identity().

◆ is_xmlns_attr()

static BOOL is_xmlns_attr ( const struct xml_attr attr)
static

Definition at line 1333 of file actctx.c.

1334{
1335 const int len = wcslen( xmlnsW );
1336 if (attr->name.len < len) return FALSE;
1337 if (wcsncmp( attr->name.ptr, xmlnsW, len )) return FALSE;
1338 return (attr->name.len == len || attr->name.ptr[len] == ':');
1339}
static const WCHAR xmlnsW[]
Definition: actctx.c:722
WCHAR * name
Definition: cookie.c:203

Referenced by next_xml_elem(), and parse_cominterface_proxy_stub_elem().

◆ isxmlspace()

static BOOL isxmlspace ( WCHAR  ch)
inlinestatic

Definition at line 894 of file actctx.c.

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

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

3378{
3379 static const WCHAR dotDllW[] = {'.','d','l','l',0};
3380 unsigned int i;
3381 WCHAR *buffer, *p, *directory;
3384 HANDLE file;
3385 DWORD len;
3386
3387 TRACE( "looking for name=%S version=%u.%u.%u.%u arch=%S\n",
3388 ai->name, ai->version.major, ai->version.minor, ai->version.build, ai->version.revision, ai->arch );
3389
3390 if ((status = lookup_winsxs(acl, ai)) != STATUS_NO_SUCH_FILE) return status;
3391
3392 /* FIXME: add support for language specific lookup */
3393
3394 len = max(RtlGetFullPathName_U(acl->actctx->assemblies->manifest.info, 0, NULL, NULL) / sizeof(WCHAR),
3395 wcslen(acl->actctx->appdir.info));
3396
3397 nameW.Buffer = NULL;
3399 (len + 2 * wcslen(ai->name) + 2) * sizeof(WCHAR) + sizeof(dotManifestW) )))
3400 return STATUS_NO_MEMORY;
3401
3402 if (!(directory = build_assembly_dir( ai )))
3403 {
3405 return STATUS_NO_MEMORY;
3406 }
3407
3408 /* Lookup in <dir>\name.dll
3409 * <dir>\name.manifest
3410 * <dir>\name\name.dll
3411 * <dir>\name\name.manifest
3412 *
3413 * First 'appdir' is used as <dir>, if that failed
3414 * it tries application manifest file path.
3415 */
3416 wcscpy( buffer, acl->actctx->appdir.info );
3417 p = buffer + wcslen(buffer);
3418 for (i = 0; i < 4; i++)
3419 {
3420 if (i == 2)
3421 {
3422 struct assembly *assembly = acl->actctx->assemblies;
3423 if (!RtlGetFullPathName_U(assembly->manifest.info, len * sizeof(WCHAR), buffer, &p)) break;
3424 }
3425 else *p++ = '\\';
3426
3427 wcscpy( p, ai->name );
3428 p += wcslen(p);
3429
3430 wcscpy( p, dotDllW );
3432 {
3433 status = open_nt_file( &file, &nameW );
3434 if (!status)
3435 {
3438 NtClose( file );
3439 if (status == STATUS_SUCCESS)
3440 break;
3441 }
3443 }
3444
3445 wcscpy( p, dotManifestW );
3447 {
3448 status = open_nt_file( &file, &nameW );
3449 if (!status)
3450 {
3452 NtClose( file );
3453 break;
3454 }
3456 }
3458 }
3462 return status;
3463}
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:1179
static NTSTATUS lookup_winsxs(struct actctx_loader *acl, struct assembly_identity *ai)
Definition: actctx.c:3302
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:3071
struct file_info appdir
Definition: actctx.c:589
#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 3220 of file actctx.c.

3221{
3222 static const WCHAR lookup_fmtW[] =
3223 {'%','s','_','%','s','_','%','s','_','%','u','.','%','u','.','*','.','*','_',
3224 '%','s','_','*','.','m','a','n','i','f','e','s','t',0};
3225 static const WCHAR wine_trailerW[] = {'d','e','a','d','b','e','e','f','.','m','a','n','i','f','e','s','t'};
3226
3227 WCHAR *lookup, *ret = NULL;
3228 UNICODE_STRING lookup_us;
3230 const WCHAR *lang = ai->language;
3231 unsigned int data_pos = 0, data_len, len;
3232 char buffer[8192];
3233
3234 if (!lang || !wcsicmp( lang, neutralW )) lang = wildcardW;
3235
3236 len = wcslen(ai->arch) + wcslen(ai->name) + wcslen(ai->public_key) + wcslen(lang) + 20 + ARRAY_SIZE(lookup_fmtW);
3237 if (!(lookup = RtlAllocateHeap( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
3238 swprintf( lookup, len, lookup_fmtW, ai->arch, ai->name, ai->public_key,
3239 ai->version.major, ai->version.minor, lang );
3240 RtlInitUnicodeString( &lookup_us, lookup );
3241
3242 if (!NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer),
3243 FileBothDirectoryInformation, FALSE, &lookup_us, TRUE ))
3244 {
3245 ULONG min_build = ai->version.build, min_revision = ai->version.revision;
3246 FILE_BOTH_DIR_INFORMATION *dir_info;
3247 WCHAR *tmp;
3248 ULONG build, revision;
3249
3250 data_len = io.Information;
3251
3252 for (;;)
3253 {
3254 if (data_pos >= data_len)
3255 {
3256 if (NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer),
3258 break;
3259 data_len = io.Information;
3260 data_pos = 0;
3261 }
3262 dir_info = (FILE_BOTH_DIR_INFORMATION*)(buffer + data_pos);
3263
3264 if (dir_info->NextEntryOffset) data_pos += dir_info->NextEntryOffset;
3265 else data_pos = data_len;
3266
3267 tmp = (WCHAR *)dir_info->FileName + (wcschr(lookup, '*') - lookup);
3268 build = wcstoul( tmp, NULL, 10 );
3269 if (build < min_build) continue;
3270 tmp = wcschr(tmp, '.') + 1;
3271 revision = wcstoul( tmp, NULL, 10 );
3272 if (build == min_build && revision < min_revision) continue;
3273 tmp = wcschr(tmp, '_') + 1;
3274 tmp = wcschr(tmp, '_') + 1;
3275 if (dir_info->FileNameLength - (tmp - dir_info->FileName) * sizeof(WCHAR) == sizeof(wine_trailerW) &&
3276 !wcsnicmp( tmp, wine_trailerW, ARRAY_SIZE( wine_trailerW )))
3277 {
3278 /* prefer a non-Wine manifest if we already have one */
3279 /* we'll still load the builtin dll if specified through DllOverrides */
3280 if (ret) continue;
3281 }
3282 else
3283 {
3284 min_build = build;
3285 min_revision = revision;
3286 }
3287 ai->version.build = build;
3288 ai->version.revision = revision;
3290 if ((ret = RtlAllocateHeap( GetProcessHeap(), 0, dir_info->FileNameLength + sizeof(WCHAR) )))
3291 {
3292 memcpy( ret, dir_info->FileName, dir_info->FileNameLength );
3293 ret[dir_info->FileNameLength/sizeof(WCHAR)] = 0;
3294 }
3295 }
3296 }
3297 else WARN("no matching file for %S\n", lookup);
3299 return ret;
3300}
unsigned int dir
Definition: maze.c:112
#define wcschr
Definition: compat.h:17
#define wcsnicmp
Definition: compat.h:14
#define wcsicmp
Definition: compat.h:15
static ULONG lookup[16]
Definition: vga.c:48
@ FileBothDirectoryInformation
Definition: from_kernel.h:64
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
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
static const WCHAR neutralW[]
Definition: actctx.c:711

Referenced by lookup_winsxs().

◆ lookup_winsxs()

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

Definition at line 3302 of file actctx.c.

3303{
3304 struct assembly_identity sxs_ai;
3305 UNICODE_STRING path_us;
3308 WCHAR *path, *file = NULL;
3309 HANDLE handle;
3310
3311 static const WCHAR manifest_dirW[] =
3312 {'\\','w','i','n','s','x','s','\\','m','a','n','i','f','e','s','t','s',0};
3313
3314 if (!ai->arch || !ai->name || !ai->public_key) return STATUS_NO_SUCH_FILE;
3315
3316 if (!(path = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(manifest_dirW) +
3317 wcslen(windows_dir) * sizeof(WCHAR) )))
3318 return STATUS_NO_MEMORY;
3319
3320 wcscpy( path, windows_dir );
3321 wcscat( path, manifest_dirW );
3322
3323 if (!RtlDosPathNameToNtPathName_U( path, &path_us, NULL, NULL ))
3324 {
3326 return STATUS_NO_SUCH_FILE;
3327 }
3329
3330 attr.Length = sizeof(attr);
3331 attr.RootDirectory = 0;
3332 attr.Attributes = OBJ_CASE_INSENSITIVE;
3333 attr.ObjectName = &path_us;
3334 attr.SecurityDescriptor = NULL;
3335 attr.SecurityQualityOfService = NULL;
3336
3339 {
3340 sxs_ai = *ai;
3341 file = lookup_manifest_file( handle, &sxs_ai );
3342 NtClose( handle );
3343 }
3344 if (!file)
3345 {
3346 RtlFreeUnicodeString( &path_us );
3347 return STATUS_NO_SUCH_FILE;
3348 }
3349
3350 /* append file name to directory path */
3351 if (!(path = RtlReAllocateHeap( GetProcessHeap(), 0, path_us.Buffer,
3352 path_us.Length + (wcslen(file) + 2) * sizeof(WCHAR) )))
3353 {
3355 RtlFreeUnicodeString( &path_us );
3356 return STATUS_NO_MEMORY;
3357 }
3358
3359 path[path_us.Length/sizeof(WCHAR)] = '\\';
3360 wcscpy( path + path_us.Length/sizeof(WCHAR) + 1, file );
3361 RtlInitUnicodeString( &path_us, path );
3362 *wcsrchr(file, '.') = 0; /* remove .manifest extension */
3363
3364 if (!open_nt_file( &handle, &path_us ))
3365 {
3366 io.Status = get_manifest_in_manifest_file(acl, &sxs_ai, path_us.Buffer, file, TRUE, handle);
3367 NtClose( handle );
3368 }
3369 else io.Status = STATUS_NO_SUCH_FILE;
3370
3372 RtlFreeUnicodeString( &path_us );
3373 return io.Status;
3374}
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
#define wcsrchr
Definition: compat.h:16
#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
static WCHAR * lookup_manifest_file(HANDLE dir, struct assembly_identity *ai)
Definition: actctx.c:3220

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

1377{
1378 const WCHAR* ptr;
1379 WCHAR quote;
1380
1381 if (xmlbuf->error) return FALSE;
1382
1383 while (xmlbuf->ptr < xmlbuf->end && isxmlspace(*xmlbuf->ptr))
1384 xmlbuf->ptr++;
1385
1386 if (xmlbuf->ptr == xmlbuf->end) return set_error( xmlbuf );
1387
1388 if (*xmlbuf->ptr == '/')
1389 {
1390 xmlbuf->ptr++;
1391 if (xmlbuf->ptr == xmlbuf->end || *xmlbuf->ptr != '>')
1392 return set_error( xmlbuf );
1393
1394 xmlbuf->ptr++;
1395 *end = TRUE;
1396 return FALSE;
1397 }
1398
1399 if (*xmlbuf->ptr == '>')
1400 {
1401 xmlbuf->ptr++;
1402 return FALSE;
1403 }
1404
1405 ptr = xmlbuf->ptr;
1406 while (ptr < xmlbuf->end && *ptr != '=' && *ptr != '>' && !isxmlspace(*ptr)) ptr++;
1407
1408 if (ptr == xmlbuf->end) return set_error( xmlbuf );
1409
1410 attr->name.ptr = xmlbuf->ptr;
1411 attr->name.len = ptr-xmlbuf->ptr;
1412 xmlbuf->ptr = ptr;
1413
1414 /* skip spaces before '=' */
1415 while (ptr < xmlbuf->end && *ptr != '=' && isxmlspace(*ptr)) ptr++;
1416 if (ptr == xmlbuf->end || *ptr != '=') return set_error( xmlbuf );
1417
1418 /* skip '=' itself */
1419 ptr++;
1420 if (ptr == xmlbuf->end) return set_error( xmlbuf );
1421
1422 /* skip spaces after '=' */
1423 while (ptr < xmlbuf->end && *ptr != '"' && *ptr != '\'' && isxmlspace(*ptr)) ptr++;
1424
1425 if (ptr == xmlbuf->end || (*ptr != '"' && *ptr != '\'')) return set_error( xmlbuf );
1426
1427 quote = *ptr++;
1428 attr->value.ptr = ptr;
1429 if (ptr == xmlbuf->end) return set_error( xmlbuf );
1430
1431 while (ptr < xmlbuf->end && *ptr != quote) ptr++;
1432 if (ptr == xmlbuf->end)
1433 {
1434 xmlbuf->ptr = xmlbuf->end;
1435 return set_error( xmlbuf );
1436 }
1437
1438 attr->value.len = ptr - attr->value.ptr;
1439 xmlbuf->ptr = ptr + 1;
1440 if (xmlbuf->ptr != xmlbuf->end) return TRUE;
1441
1442 return set_error( xmlbuf );
1443}
static const WCHAR quote[]
Definition: reg.c:40
GLuint GLuint end
Definition: gl.h:1545
static BOOL isxmlspace(WCHAR ch)
Definition: actctx.c:894
static BOOL set_error(xmlbuf_t *xmlbuf)
Definition: actctx.c:1327
WCHAR * value
Definition: cookie.c:204
BOOL error
Definition: actctx.c:135
const WCHAR * end
Definition: actctx.c:132
const WCHAR * ptr
Definition: actctx.c:131

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

1466{
1467 const WCHAR* ptr;
1468 struct xml_attr attr;
1469 xmlbuf_t attr_buf;
1470 BOOL end = FALSE;
1471
1472 xmlbuf->ns_pos = parent->ns_pos; /* restore namespace stack to parent state */
1473
1474 if (xmlbuf->error) return FALSE;
1475
1476 for (;;)
1477 {
1478 for (ptr = xmlbuf->ptr; ptr < xmlbuf->end; ptr++) if (*ptr == '<') break;
1479 if (ptr == xmlbuf->end)
1480 {
1481 xmlbuf->ptr = xmlbuf->end;
1482 return set_error( xmlbuf );
1483 }
1484 ptr++;
1485 if (ptr + 3 < xmlbuf->end && ptr[0] == '!' && ptr[1] == '-' && ptr[2] == '-') /* skip comment */
1486 {
1487 for (ptr += 3; ptr + 3 <= xmlbuf->end; ptr++)
1488 if (ptr[0] == '-' && ptr[1] == '-' && ptr[2] == '>') break;
1489
1490 if (ptr + 3 > xmlbuf->end)
1491 {
1492 xmlbuf->ptr = xmlbuf->end;
1493 return set_error( xmlbuf );
1494 }
1495 xmlbuf->ptr = ptr + 3;
1496 }
1497 else break;
1498 }
1499
1500 xmlbuf->ptr = ptr;
1501 /* check for element terminating the parent element */
1502 if (ptr < xmlbuf->end && *ptr == '/')
1503 {
1504 xmlbuf->ptr++;
1505 read_xml_elem( xmlbuf, elem );
1506 elem->ns = find_xmlns( xmlbuf, &elem->ns );
1507 if (!xml_name_cmp( elem, parent ))
1508 {
1509 /*ERR( "wrong closing element %s for %s\n",
1510 debugstr_xmlstr(&elem->name), debugstr_xmlstr(&parent->name ));*/
1511 return set_error( xmlbuf );
1512 }
1513 while (xmlbuf->ptr < xmlbuf->end && isxmlspace(*xmlbuf->ptr)) xmlbuf->ptr++;
1514 if (xmlbuf->ptr == xmlbuf->end || *xmlbuf->ptr++ != '>') return set_error( xmlbuf );
1515 return FALSE;
1516 }
1517
1518 read_xml_elem( xmlbuf, elem );
1519
1520 /* parse namespace attributes */
1521 attr_buf = *xmlbuf;
1522 while (next_xml_attr( &attr_buf, &attr, &end ))
1523 {
1524 if (is_xmlns_attr( &attr )) push_xmlns( xmlbuf, &attr );
1525 }
1526 elem->ns = find_xmlns( xmlbuf, &elem->ns );
1527 elem->ns_pos = xmlbuf->ns_pos;
1528
1529 if (xmlbuf->ptr != xmlbuf->end) return TRUE;
1530
1531 return set_error( xmlbuf );
1532}
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:1445
static BOOL next_xml_attr(xmlbuf_t *xmlbuf, struct xml_attr *attr, BOOL *end)
Definition: actctx.c:1376
static void push_xmlns(xmlbuf_t *xmlbuf, const struct xml_attr *attr)
Definition: actctx.c:1341
static BOOL xml_name_cmp(const struct xml_elem *elem1, const struct xml_elem *elem2)
Definition: actctx.c:870
static BOOL is_xmlns_attr(const struct xml_attr *attr)
Definition: actctx.c:1333
static xmlstr_t find_xmlns(xmlbuf_t *xmlbuf, const xmlstr_t *name)
Definition: actctx.c:1362

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

2936{
2939
2940 attr.Length = sizeof(attr);
2941 attr.RootDirectory = 0;
2942 attr.Attributes = OBJ_CASE_INSENSITIVE;
2943 attr.ObjectName = name;
2944 attr.SecurityDescriptor = NULL;
2945 attr.SecurityQualityOfService = NULL;
2947}
#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 1876 of file actctx.c.

1878{
1879 struct entity *entity;
1880 WCHAR *str;
1881
1882 if (!clsid) return;
1883
1884 if (!(str = strdupW(clsid)))
1885 {
1886 set_error( xmlbuf );
1887 return;
1888 }
1889
1890 if (!(entity = add_entity(entities, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)))
1891 {
1893 set_error( xmlbuf );
1894 return;
1895 }
1896
1897 entity->u.comclass.clsid = str;
1899
1901}
static struct entity * add_entity(struct entity_array *array, DWORD kind)
Definition: actctx.c:1019
static WCHAR * strdupW(const WCHAR *str)
Definition: actctx.c:834

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

2592{
2593 struct xml_elem elem;
2594
2595 while (next_xml_elem( xmlbuf, &elem, parent ))
2596 {
2598 {
2599 parse_windows_settings_elem( xmlbuf, assembly, acl, &elem );
2600 }
2601 else
2602 {
2603 parse_unknown_elem( xmlbuf, &elem );
2604 }
2605 }
2606}
static const WCHAR asmv3W[]
Definition: actctx.c:628
static const WCHAR windowsSettingsW[]
Definition: actctx.c:775
static BOOL next_xml_elem(xmlbuf_t *xmlbuf, struct xml_elem *elem, const struct xml_elem *parent)
Definition: actctx.c:1465
static void parse_windows_settings_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2562
static void parse_unknown_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:1619
static BOOL xml_elem_cmp(const struct xml_elem *elem, const WCHAR *str, const WCHAR *namespace)
Definition: actctx.c:878

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

2711{
2712 struct xml_elem elem;
2713 struct xml_attr attr;
2714 BOOL end = FALSE, version = FALSE;
2715
2716 while (next_xml_attr(xmlbuf, &attr, &end))
2717 {
2719 {
2720 static const WCHAR v10W[] = {'1','.','0',0};
2721 if (!xmlstr_cmp(&attr.value, v10W))
2722 {
2723 break;
2724 }
2725 version = TRUE;
2726 }
2727 }
2728
2729 if (end || !version)
2730 {
2731 set_error( xmlbuf );
2732 return;
2733 }
2734
2735 while (next_xml_elem(xmlbuf, &elem, parent))
2736 {
2738 {
2739 parse_noinherit_elem(xmlbuf, &elem);
2741 }
2743 {
2745 }
2746 else if (xml_elem_cmp(&elem, descriptionW, asmv1W))
2747 {
2748 parse_description_elem(xmlbuf, &elem);
2749 }
2751 {
2753 }
2754 else if (xml_elem_cmp(&elem, dependencyW, asmv1W))
2755 {
2756 parse_dependency_elem(xmlbuf, acl, &elem);
2757 }
2758 else if (xml_elem_cmp(&elem, fileW, asmv1W))
2759 {
2760 parse_file_elem(xmlbuf, assembly, acl, &elem);
2761 }
2762 else if (xml_elem_cmp(&elem, clrClassW, asmv1W))
2763 {
2764 parse_clr_class_elem(xmlbuf, assembly, acl, &elem);
2765 }
2767 {
2768 parse_clr_surrogate_elem(xmlbuf, assembly, acl, &elem);
2769 }
2770 else if (xml_elem_cmp(&elem, trustInfoW, asmv1W))
2771 {
2772 parse_trust_info_elem(xmlbuf, assembly, acl, &elem);
2773 }
2775 {
2777
2778 if (!xmlbuf->error && expected_ai)
2779 {
2780 /* FIXME: more tests */
2782 memcmp(&assembly->id.version, &expected_ai->version, sizeof(assembly->id.version)))
2783 {
2784 set_error( xmlbuf );
2785 }
2786 else if (assembly->type == ASSEMBLY_SHARED_MANIFEST &&
2787 (assembly->id.version.major != expected_ai->version.major ||
2788 assembly->id.version.minor != expected_ai->version.minor ||
2789 assembly->id.version.build < expected_ai->version.build ||
2790 (assembly->id.version.build == expected_ai->version.build &&
2791 assembly->id.version.revision < expected_ai->version.revision)))
2792 {
2793 set_error( xmlbuf );
2794 }
2795 }
2796 }
2798 {
2799 parse_compatibility_elem(xmlbuf, assembly, acl, &elem);
2800 }
2801 else if (xml_elem_cmp(&elem, applicationW, asmv3W))
2802 {
2803 parse_application_elem(xmlbuf, assembly, acl, &elem);
2804 }
2805 else
2806 {
2807 parse_unknown_elem(xmlbuf, &elem);
2808 }
2809 }
2810
2813 {
2814 set_error( xmlbuf );
2815 }
2816}
static void parse_noinheritable_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2385
static const WCHAR fileW[]
Definition: actctx.c:697
static const WCHAR trustInfoW[]
Definition: actctx.c:774
static const WCHAR noInheritW[]
Definition: actctx.c:699
static const WCHAR clrSurrogateW[]
Definition: actctx.c:690
static void parse_noinherit_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2377
static const WCHAR applicationW[]
Definition: actctx.c:768
static const WCHAR comInterfaceExternalProxyStubW[]
Definition: actctx.c:692
static const WCHAR assemblyIdentityW[]
Definition: actctx.c:687
static const WCHAR compatibilityW[]
Definition: actctx.c:766
static const WCHAR asmv1W[]
Definition: actctx.c:626
static void parse_file_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2393
static void parse_description_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2138
static void parse_application_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2590
static const WCHAR manifestVersionW[]
Definition: actctx.c:709
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:2156
static const WCHAR dependencyW[]
Definition: actctx.c:694
static BOOL xml_attr_cmp(const struct xml_attr *attr, const WCHAR *str)
Definition: actctx.c:865
static const WCHAR noInheritableW[]
Definition: actctx.c:700
static BOOL xmlstr_cmp(const xmlstr_t *xmlstr, const WCHAR *str)
Definition: actctx.c:855
static const WCHAR clrClassW[]
Definition: actctx.c:689
static void parse_assembly_identity_elem(xmlbuf_t *xmlbuf, ACTIVATION_CONTEXT *actctx, struct assembly_identity *ai, const struct xml_elem *parent)
Definition: actctx.c:1632
static void parse_clr_class_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2205
static void parse_compatibility_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2511
static void parse_clr_surrogate_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2269
static void parse_trust_info_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2690
static void parse_dependency_elem(xmlbuf_t *xmlbuf, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2348
static const WCHAR compatibilityNSW[]
Definition: actctx.c:767
static const WCHAR descriptionW[]
Definition: actctx.c:696
BOOL no_inherit
Definition: actctx.c:531

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

1634{
1635 struct xml_attr attr;
1636 BOOL end = FALSE;
1637
1638 while (next_xml_attr(xmlbuf, &attr, &end))
1639 {
1640 if (xml_attr_cmp(&attr, g_nameW))
1641 {
1642 if (!(ai->name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1643 }
1644 else if (xml_attr_cmp(&attr, typeW))
1645 {
1646 if (!(ai->type = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1647 }
1648 else if (xml_attr_cmp(&attr, versionW))
1649 {
1650 if (!parse_version(&attr.value, &ai->version)) set_error( xmlbuf );
1651 }
1653 {
1654 if (!(ai->arch = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1655 }
1656 else if (xml_attr_cmp(&attr, publicKeyTokenW))
1657 {
1658 if (!(ai->public_key = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1659 }
1660 else if (xml_attr_cmp(&attr, languageW))
1661 {
1662 if (!(ai->language = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1663 }
1664 }
1665
1666 if (!end) parse_expect_end_elem(xmlbuf, parent);
1667}
static const WCHAR versionW[]
Definition: name.c:52
static const WCHAR processorArchitectureW[]
Definition: actctx.c:715
static const WCHAR languageW[]
Definition: actctx.c:708
static void parse_expect_end_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:1608
static const WCHAR typeW[]
Definition: actctx.c:720
static const WCHAR publicKeyTokenW[]
Definition: actctx.c:717
static BOOL parse_version(const xmlstr_t *str, struct assembly_version *version)
Definition: actctx.c:1566
static const WCHAR g_nameW[]
Definition: actctx.c:710

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

2119{
2120 struct xml_attr attr;
2121 BOOL end = FALSE;
2122
2123 while (next_xml_attr(xmlbuf, &attr, &end))
2124 {
2126 {
2127 // FIXME("Not stored yet %s\n", debugstr_xml_attr(&attr));
2128 }
2129 else if (xml_attr_cmp(&attr, newVersionW))
2130 {
2131 // FIXME("Not stored yet %s\n", debugstr_xml_attr(&attr));
2132 }
2133 }
2134
2135 if (!end) parse_expect_end_elem(xmlbuf, parent);
2136}
static const WCHAR newVersionW[]
Definition: actctx.c:712
static const WCHAR oldVersionW[]
Definition: actctx.c:713

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

2208{
2209 struct xml_elem elem;
2210 struct xml_attr attr;
2211 BOOL end = FALSE;
2212 struct entity* entity;
2213
2214 if (!(entity = add_entity(&assembly->entities, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)))
2215 {
2216 set_error( xmlbuf );
2217 return;
2218 }
2219
2220 while (next_xml_attr(xmlbuf, &attr, &end))
2221 {
2222 if (xml_attr_cmp(&attr, g_nameW))
2223 {
2224 if (!(entity->u.comclass.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2225 }
2226 else if (xml_attr_cmp(&attr, clsidW))
2227 {
2228 if (!(entity->u.comclass.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2229 }
2230 else if (xml_attr_cmp(&attr, progidW))
2231 {
2232 if (!(entity->u.comclass.progid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2233 }
2234 else if (xml_attr_cmp(&attr, tlbidW))
2235 {
2236 if (!(entity->u.comclass.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2237 }
2238 else if (xml_attr_cmp(&attr, threadingmodelW))
2239 {
2241 }
2242 else if (xml_attr_cmp(&attr, runtimeVersionW))
2243 {
2244 if (!(entity->u.comclass.version = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2245 }
2246 }
2247
2249 if (entity->u.comclass.progid)
2251 if (end) return;
2252
2253 while (next_xml_elem(xmlbuf, &elem, parent))
2254 {
2256 {
2258 }
2259 else
2260 {
2261 parse_unknown_elem(xmlbuf, &elem);
2262 }
2263 }
2264
2265 if (entity->u.comclass.progids.num)
2267}
static const WCHAR progidW[]
Definition: compobj.c:112
static const WCHAR runtimeVersionW[]
Definition: actctx.c:739
static const WCHAR threadingmodelW[]
Definition: actctx.c:718
static void parse_com_class_progid(xmlbuf_t *xmlbuf, struct entity *entity, const struct xml_elem *parent)
Definition: actctx.c:1763
static const WCHAR tlbidW[]
Definition: actctx.c:719
static enum comclass_threadingmodel parse_com_class_threadingmodel(xmlstr_t *value)
Definition: actctx.c:1669
static const WCHAR clsidW[]
Definition: actctx.c:704

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

2271{
2272 struct xml_attr attr;
2273 BOOL end = FALSE;
2274 struct entity* entity;
2275
2276 if (!(entity = add_entity(&assembly->entities, ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)))
2277 {
2278 set_error( xmlbuf );
2279 return;
2280 }
2281
2282 while (next_xml_attr(xmlbuf, &attr, &end))
2283 {
2284 if (xml_attr_cmp(&attr, g_nameW))
2285 {
2286 if (!(entity->u.clrsurrogate.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2287 }
2288 else if (xml_attr_cmp(&attr, clsidW))
2289 {
2290 if (!(entity->u.clrsurrogate.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2291 }
2292 else if (xml_attr_cmp(&attr, runtimeVersionW))
2293 {
2294 if (!(entity->u.clrsurrogate.version = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2295 }
2296 }
2297
2299 if (!end) parse_expect_end_elem(xmlbuf, parent);
2300}

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

1778{
1779 struct xml_elem elem;
1780 struct xml_attr attr;
1781 BOOL end = FALSE;
1782 struct entity* entity;
1783
1784 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)))
1785 {
1786 set_error( xmlbuf );
1787 return;
1788 }
1789
1790 while (next_xml_attr(xmlbuf, &attr, &end))
1791 {
1792 if (xml_attr_cmp(&attr, clsidW))
1793 {
1794 if (!(entity->u.comclass.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1795 }
1796 else if (xml_attr_cmp(&attr, progidW))
1797 {
1798 if (!(entity->u.comclass.progid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1799 }
1800 else if (xml_attr_cmp(&attr, tlbidW))
1801 {
1802 if (!(entity->u.comclass.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1803 }
1804 else if (xml_attr_cmp(&attr, threadingmodelW))
1805 {
1807 }
1808 else if (xml_attr_cmp(&attr, miscstatusW))
1809 {
1811 }
1813 {
1814 entity->u.comclass.miscstatuscontent = parse_com_class_misc(&attr.value);
1815 }
1817 {
1818 entity->u.comclass.miscstatusthumbnail = parse_com_class_misc(&attr.value);
1819 }
1820 else if (xml_attr_cmp(&attr, miscstatusiconW))
1821 {
1822 entity->u.comclass.miscstatusicon = parse_com_class_misc(&attr.value);
1823 }
1825 {
1826 entity->u.comclass.miscstatusdocprint = parse_com_class_misc(&attr.value);
1827 }
1828 else if (xml_attr_cmp(&attr, descriptionW))
1829 {
1830 /* not stored */
1831 }
1832 }
1833
1835 if (entity->u.comclass.progid)
1837
1838 if (end) return;
1839
1840 while (next_xml_elem(xmlbuf, &elem, parent))
1841 {
1843 {
1845 }
1846 else
1847 {
1848 parse_unknown_elem(xmlbuf, &elem);
1849 }
1850 }
1851
1852 if (entity->u.comclass.progids.num)
1854}
static const WCHAR miscstatusdocprintW[]
Definition: actctx.c:735
static DWORD parse_com_class_misc(const xmlstr_t *value)
Definition: actctx.c:1716
static const WCHAR miscstatusW[]
Definition: actctx.c:731
static const WCHAR miscstatuscontentW[]
Definition: actctx.c:733
static const WCHAR miscstatusiconW[]
Definition: actctx.c:732
static const WCHAR miscstatusthumbnailW[]
Definition: actctx.c:734

Referenced by parse_file_elem().

◆ parse_com_class_misc()

static DWORD parse_com_class_misc ( const xmlstr_t value)
static

Definition at line 1716 of file actctx.c.

1717{
1718 const WCHAR *str = value->ptr, *start;
1719 DWORD flags = 0;
1720 int i = 0;
1721
1722 /* it's comma separated list of flags */
1723 while (i < value->len)
1724 {
1725 start = str;
1726 while (*str != ',' && (i++ < value->len)) str++;
1727
1729
1730 /* skip separator */
1731 str++;
1732 i++;
1733 }
1734
1735 return flags;
1736}
GLuint start
Definition: gl.h:1545
static OLEMISC get_olemisc_value(const WCHAR *str, int len)
Definition: actctx.c:1689

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

1764{
1766 BOOL end = FALSE;
1767
1768 parse_expect_no_attr(xmlbuf, &end);
1769 if (end) set_error( xmlbuf );
1770 if (!parse_text_content(xmlbuf, &content)) return;
1771
1772 if (!com_class_add_progid(&content, entity)) set_error( xmlbuf );
1774}
content
Definition: atl_ax.c:994
static BOOL parse_text_content(xmlbuf_t *xmlbuf, xmlstr_t *content)
Definition: actctx.c:1550
static void parse_expect_no_attr(xmlbuf_t *xmlbuf, BOOL *end)
Definition: actctx.c:1597
static BOOL com_class_add_progid(const xmlstr_t *progid, struct entity *entity)
Definition: actctx.c:1738

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

1670{
1671 static const WCHAR apartW[] = {'A','p','a','r','t','m','e','n','t',0};
1672 static const WCHAR neutralW[] = {'N','e','u','t','r','a','l',0};
1673 static const WCHAR freeW[] = {'F','r','e','e',0};
1674 static const WCHAR bothW[] = {'B','o','t','h',0};
1675
1676 if (value->len == 0) return ThreadingModel_No;
1677 if (xmlstr_cmp(value, apartW))
1679 else if (xmlstr_cmp(value, freeW))
1680 return ThreadingModel_Free;
1681 else if (xmlstr_cmp(value, bothW))
1682 return ThreadingModel_Both;
1683 else if (xmlstr_cmp(value, neutralW))
1685 else
1686 return ThreadingModel_No;
1687};

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

2160{
2161 struct xml_attr attr;
2162 BOOL end = FALSE;
2163 struct entity* entity;
2164
2165 if (!(entity = add_entity(&assembly->entities, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)))
2166 {
2167 set_error( xmlbuf );
2168 return;
2169 }
2170
2171 while (next_xml_attr(xmlbuf, &attr, &end))
2172 {
2173 if (xml_attr_cmp(&attr, iidW))
2174 {
2175 if (!(entity->u.ifaceps.iid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2176 }
2177 else if (xml_attr_cmp(&attr, g_nameW))
2178 {
2179 if (!(entity->u.ifaceps.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2180 }
2181 else if (xml_attr_cmp(&attr, baseInterfaceW))
2182 {
2183 if (!(entity->u.ifaceps.base = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2184 entity->u.ifaceps.mask |= BaseIface;
2185 }
2186 else if (xml_attr_cmp(&attr, nummethodsW))
2187 {
2188 if (!(parse_nummethods(&attr.value, entity))) set_error( xmlbuf );
2189 entity->u.ifaceps.mask |= NumMethods;
2190 }
2192 {
2193 if (!(entity->u.ifaceps.ps32 = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2194 }
2195 else if (xml_attr_cmp(&attr, tlbidW))
2196 {
2197 if (!(entity->u.ifaceps.tlib = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2198 }
2199 }
2200
2202 if (!end) parse_expect_end_elem(xmlbuf, parent);
2203}
static const WCHAR proxyStubClsid32W[]
Definition: actctx.c:738
static const WCHAR iidW[]
Definition: actctx.c:707
static const WCHAR baseInterfaceW[]
Definition: actctx.c:736
static BOOL parse_nummethods(const xmlstr_t *str, struct entity *entity)
Definition: actctx.c:1856
static const WCHAR nummethodsW[]
Definition: actctx.c:737

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

1905{
1906 WCHAR *psclsid = NULL;
1907 struct entity *entity;
1908 struct xml_attr attr;
1909 BOOL end = FALSE;
1910
1911 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)))
1912 {
1913 set_error( xmlbuf );
1914 return;
1915 }
1916
1917 while (next_xml_attr(xmlbuf, &attr, &end))
1918 {
1919 if (xml_attr_cmp(&attr, iidW))
1920 {
1921 if (!(entity->u.ifaceps.iid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1922 }
1923 else if (xml_attr_cmp(&attr, g_nameW))
1924 {
1925 if (!(entity->u.ifaceps.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1926 }
1927 else if (xml_attr_cmp(&attr, baseInterfaceW))
1928 {
1929 if (!(entity->u.ifaceps.base = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1930 entity->u.ifaceps.mask |= BaseIface;
1931 }
1932 else if (xml_attr_cmp(&attr, nummethodsW))
1933 {
1934 if (!(parse_nummethods(&attr.value, entity))) set_error( xmlbuf );
1935 entity->u.ifaceps.mask |= NumMethods;
1936 }
1937 else if (xml_attr_cmp(&attr, tlbidW))
1938 {
1939 if (!(entity->u.ifaceps.tlib = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1940 }
1942 {
1943 if (!(psclsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
1944 }
1945 /* not used */
1946 else if (xml_attr_cmp(&attr, threadingmodelW))
1947 {
1948 }
1949 else if (!is_xmlns_attr( &attr ))
1950 {
1951 }
1952 }
1953
1955 if (!end) parse_expect_end_elem(xmlbuf, parent);
1956
1957 parse_add_interface_class(xmlbuf, &dll->entities, acl, psclsid ? psclsid : entity->u.ifaceps.iid);
1958
1959 RtlFreeHeap(GetProcessHeap(), 0, psclsid);
1960}
static void parse_add_interface_class(xmlbuf_t *xmlbuf, struct entity_array *entities, struct actctx_loader *acl, WCHAR *clsid)
Definition: actctx.c:1876

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

2495{
2496 struct xml_elem elem;
2497
2498 while (next_xml_elem(xmlbuf, &elem, parent))
2499 {
2501 {
2502 parse_supportedos_elem(xmlbuf, assembly, acl, &elem);
2503 }
2504 else
2505 {
2506 parse_unknown_elem(xmlbuf, &elem);
2507 }
2508 }
2509}
static const WCHAR supportedOSW[]
Definition: actctx.c:769
static void parse_supportedos_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2461

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

2513{
2514 struct xml_elem elem;
2515
2516 while (next_xml_elem(xmlbuf, &elem, parent))
2517 {
2519 {
2521 }
2522 else
2523 {
2524 parse_unknown_elem(xmlbuf, &elem);
2525 }
2526 }
2527}
static void parse_compatibility_application_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2493

Referenced by parse_assembly_elem().

◆ parse_depend_manifests()

static NTSTATUS parse_depend_manifests ( struct actctx_loader acl)
static

Definition at line 3465 of file actctx.c.

3466{
3468 unsigned int i;
3469
3470 for (i = 0; i < acl->num_dependencies; i++)
3471 {
3472 if (lookup_assembly(acl, &acl->dependencies[i]) != STATUS_SUCCESS)
3473 {
3474 if (!acl->dependencies[i].optional && !acl->dependencies[i].delayed)
3475 {
3476 const struct assembly_version *ver = &acl->dependencies[i].version;
3477 DPRINT1( "Could not find dependent assembly %S (%u.%u.%u.%u)\n",
3478 acl->dependencies[i].name,
3479 ver->major, ver->minor, ver->build, ver->revision );
3481 break;
3482 }
3483 }
3484 }
3485 /* FIXME should now iterate through all refs */
3486 return status;
3487}
#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:3376

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

2351{
2352 struct xml_elem elem;
2353 struct xml_attr attr;
2355
2356 while (next_xml_attr(xmlbuf, &attr, &end))
2357 {
2359 {
2361 }
2362 }
2363
2364 while (next_xml_elem(xmlbuf, &elem, parent))
2365 {
2367 {
2369 }
2370 else
2371 {
2372 parse_unknown_elem(xmlbuf, &elem);
2373 }
2374 }
2375}
@ optional
Definition: SystemMenu.c:34
static const WCHAR yesW[]
Definition: actctx.c:724
static const WCHAR optionalW[]
Definition: actctx.c:714
static BOOL xmlstr_cmpi(const xmlstr_t *xmlstr, const WCHAR *str)
Definition: actctx.c:860
static void parse_dependent_assembly_elem(xmlbuf_t *xmlbuf, struct actctx_loader *acl, const struct xml_elem *parent, BOOL optional)
Definition: actctx.c:2302
static const WCHAR dependentAssemblyW[]
Definition: actctx.c:695

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

2304{
2305 struct xml_elem elem;
2306 struct xml_attr attr;
2307 struct assembly_identity ai;
2308 BOOL end = FALSE;
2309
2310 memset(&ai, 0, sizeof(ai));
2311 ai.optional = optional;
2312
2313 while (next_xml_attr(xmlbuf, &attr, &end))
2314 {
2315 static const WCHAR allowDelayedBindingW[] = {'a','l','l','o','w','D','e','l','a','y','e','d','B','i','n','d','i','n','g',0};
2316 static const WCHAR trueW[] = {'t','r','u','e',0};
2317
2318 if (xml_attr_cmp(&attr, allowDelayedBindingW))
2319 ai.delayed = xmlstr_cmp(&attr.value, trueW);
2320 }
2321
2322 if (end) return;
2323
2324 while (next_xml_elem(xmlbuf, &elem, parent))
2325 {
2327 {
2328 parse_assembly_identity_elem(xmlbuf, acl->actctx, &ai, &elem);
2329 /* store the newly found identity for later loading */
2330 if (ai.arch && !wcscmp(ai.arch, wildcardW))
2331 {
2332 RtlFreeHeap( GetProcessHeap(), 0, ai.arch );
2333 ai.arch = strdupW( current_archW );
2334 }
2335 if (!add_dependent_assembly_id(acl, &ai)) set_error( xmlbuf );
2336 }
2338 {
2340 }
2341 else
2342 {
2343 parse_unknown_elem(xmlbuf, &elem);
2344 }
2345 }
2346}
static const WCHAR trueW[]
Definition: json.c:33
static void parse_binding_redirect_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2118
static const WCHAR current_archW[]
Definition: actctx.c:623
static const WCHAR bindingRedirectW[]
Definition: actctx.c:688
static BOOL add_dependent_assembly_id(struct actctx_loader *acl, struct assembly_identity *ai)
Definition: actctx.c:1122

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

2139{
2140 struct xml_elem elem;
2141 struct xml_attr attr;
2143 BOOL end = FALSE;
2144
2145 while (next_xml_attr(xmlbuf, &attr, &end));
2146
2147 if (end) return;
2148 if (!parse_text_content(xmlbuf, &content)) return;
2149
2150 while (next_xml_elem(xmlbuf, &elem, parent))
2151 {
2152 parse_unknown_elem(xmlbuf, &elem);
2153 }
2154}

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

1609{
1610 struct xml_elem elem;
1611
1612 if (next_xml_elem(xmlbuf, &elem, parent))
1613 {
1614 // FIXME( "unexpected element %s\n", debugstr_xml_elem(&elem) );
1615 set_error( xmlbuf );
1616 }
1617}

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

1598{
1599 struct xml_attr attr;
1600
1601 while (next_xml_attr(xmlbuf, &attr, end))
1602 {
1603 // TODO: report error
1604 // if (!is_xmlns_attr( &attr )) WARN("unexpected attr %s\n", debugstr_xml_attr(&attr));
1605 }
1606}

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

2395{
2396 struct xml_elem elem;
2397 struct xml_attr attr;
2398 BOOL end = FALSE;
2399 struct dll_redirect* dll;
2400
2401 if (!(dll = add_dll_redirect(assembly)))
2402 {
2403 set_error( xmlbuf );
2404 return;
2405 }
2406
2407 while (next_xml_attr(xmlbuf, &attr, &end))
2408 {
2409 if (xml_attr_cmp(&attr, g_nameW))
2410 {
2411 if (!(dll->name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2412 }
2413 else if (xml_attr_cmp(&attr, hashW))
2414 {
2415 if (!(dll->hash = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2416 }
2417 else if (xml_attr_cmp(&attr, hashalgW))
2418 {
2419 static const WCHAR sha1W[] = {'S','H','A','1',0};
2420 if (!xmlstr_cmpi(&attr.value, sha1W)) {
2421 //FIXME("hashalg should be SHA1, got %s\n", debugstr_xmlstr(&attr.value));
2422 }
2423 }
2424 }
2425
2426 if (!dll->name) set_error( xmlbuf );
2427
2429
2430 if (end) return;
2431
2432 while (next_xml_elem(xmlbuf, &elem, parent))
2433 {
2435 {
2436 parse_com_class_elem(xmlbuf, dll, acl, &elem);
2437 }
2439 {
2441 }
2442 else if (xml_elem_cmp(&elem, hashW, asmv2W))
2443 {
2444 parse_unknown_elem(xmlbuf, &elem);
2445 }
2446 else if (xml_elem_cmp(&elem, typelibW, asmv1W))
2447 {
2448 parse_typelib_elem(xmlbuf, dll, acl, &elem);
2449 }
2450 else if (xml_elem_cmp(&elem, windowClassW, asmv1W))
2451 {
2452 parse_window_class_elem(xmlbuf, dll, acl, &elem);
2453 }
2454 else
2455 {
2456 parse_unknown_elem( xmlbuf, &elem );
2457 }
2458 }
2459}
static const WCHAR asmv2W[]
Definition: actctx.c:627
static const WCHAR comInterfaceProxyStubW[]
Definition: actctx.c:693
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:1776
static void parse_typelib_elem(xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2027
static const WCHAR typelibW[]
Definition: actctx.c:701
static const WCHAR hashW[]
Definition: actctx.c:698
static const WCHAR comClassW[]
Definition: actctx.c:691
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:1903
static const WCHAR windowClassW[]
Definition: actctx.c:702
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:2079
static struct dll_redirect * add_dll_redirect(struct assembly *assembly)
Definition: actctx.c:965
static const WCHAR hashalgW[]
Definition: actctx.c:705

Referenced by parse_assembly_elem().

◆ parse_manifest()

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

Definition at line 2856 of file actctx.c.

2859{
2860 xmlbuf_t xmlbuf;
2862 struct assembly *assembly;
2863 int unicode_tests;
2864
2865 TRACE( "parsing manifest loaded from %S base dir %S\n", filename, directory );
2866
2869
2871 return STATUS_NO_MEMORY;
2872
2873 if (!filename)
2874 {
2875 UNICODE_STRING module_path;
2876 if ((status = get_module_filename( module, &module_path, 0 ))) return status;
2877 assembly->manifest.info = module_path.Buffer;
2878 }
2879 else if(!(assembly->manifest.info = strdupW( filename + 4 /* skip \??\ prefix */ ))) return STATUS_NO_MEMORY;
2880
2881 assembly->manifest.type = assembly->manifest.info ? ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE
2882 : ACTIVATION_CONTEXT_PATH_TYPE_NONE;
2883
2885 if (RtlIsTextUnicode( buffer, size, &unicode_tests ))
2886 {
2887 xmlbuf.ptr = buffer;
2888 xmlbuf.end = xmlbuf.ptr + size / sizeof(WCHAR);
2889 status = parse_manifest_buffer( acl, assembly, ai, &xmlbuf );
2890 }
2891 else if (unicode_tests & IS_TEXT_UNICODE_REVERSE_SIGNATURE)
2892 {
2893 const WCHAR *buf = buffer;
2894 WCHAR *new_buff;
2895 unsigned int i;
2896
2897 if (!(new_buff = RtlAllocateHeap( GetProcessHeap(), 0, size )))
2898 return STATUS_NO_MEMORY;
2899 for (i = 0; i < size / sizeof(WCHAR); i++)
2900 new_buff[i] = RtlUshortByteSwap( buf[i] );
2901 xmlbuf.ptr = new_buff;
2902 xmlbuf.end = xmlbuf.ptr + size / sizeof(WCHAR);
2903 status = parse_manifest_buffer( acl, assembly, ai, &xmlbuf );
2904 RtlFreeHeap( GetProcessHeap(), 0, new_buff );
2905 }
2906 else
2907 {
2908 DWORD len;
2909 WCHAR *new_buff;
2910
2911 /* let's assume utf-8 for now */
2913 if (!NT_SUCCESS(status))
2914 {
2915 DPRINT1("RtlMultiByteToUnicodeSize failed with %lx\n", status);
2917 }
2918
2919 if (!(new_buff = RtlAllocateHeap( GetProcessHeap(), 0, len ))) return STATUS_NO_MEMORY;
2920 status = RtlUTF8ToUnicodeN( new_buff, len, &len, buffer, size );
2921 if (!NT_SUCCESS(status))
2922 {
2923 DPRINT1("RtlMultiByteToUnicodeN failed with %lx\n", status);
2925 }
2926
2927 xmlbuf.ptr = new_buff;
2928 xmlbuf.end = xmlbuf.ptr + len / sizeof(WCHAR);
2929 status = parse_manifest_buffer( acl, assembly, ai, &xmlbuf );
2930 RtlFreeHeap( GetProcessHeap(), 0, new_buff );
2931 }
2932 return status;
2933}
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)
#define RtlUTF8ToUnicodeN
Definition: reactos.cpp:12
static struct assembly * add_assembly(ACTIVATION_CONTEXT *actctx, enum assembly_type at)
Definition: actctx.c:934
static NTSTATUS parse_manifest_buffer(struct actctx_loader *acl, struct assembly *assembly, struct assembly_identity *ai, xmlbuf_t *xmlbuf)
Definition: actctx.c:2818
#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 2818 of file actctx.c.

2820{
2821 struct xml_elem elem;
2822 struct xml_elem parent = {0};
2823
2824 xmlbuf->error = FALSE;
2825 xmlbuf->ns_pos = 0;
2826
2827 if (!next_xml_elem(xmlbuf, &elem, &parent)) return STATUS_SXS_CANT_GEN_ACTCTX;
2828
2829 if (xmlstr_cmp(&elem.name, g_xmlW) &&
2830 (!parse_xml_header(xmlbuf) || !next_xml_elem(xmlbuf, &elem, &parent)))
2832
2834 {
2836 }
2837
2838 parse_assembly_elem(xmlbuf, assembly, acl, &elem, ai);
2839 if (xmlbuf->error)
2840 {
2842 }
2843
2844 if (next_xml_elem(xmlbuf, &elem, &parent))
2845 {
2847 }
2848
2849 if (xmlbuf->ptr != xmlbuf->end)
2850 {
2852 }
2853 return STATUS_SUCCESS;
2854}
static const WCHAR assemblyW[]
Definition: actctx.c:686
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:2708
static const WCHAR g_xmlW[]
Definition: actctx.c:824
static BOOL parse_xml_header(xmlbuf_t *xmlbuf)
Definition: actctx.c:1534

Referenced by parse_manifest().

◆ parse_noinherit_elem()

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

Definition at line 2377 of file actctx.c.

2378{
2379 BOOL end = FALSE;
2380
2381 parse_expect_no_attr(xmlbuf, &end);
2382 if (!end) parse_expect_end_elem(xmlbuf, parent);
2383}

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

2386{
2387 BOOL end = FALSE;
2388
2389 parse_expect_no_attr(xmlbuf, &end);
2390 if (!end) parse_expect_end_elem(xmlbuf, parent);
2391}

Referenced by parse_assembly_elem().

◆ parse_nummethods()

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

Definition at line 1856 of file actctx.c.

1857{
1858 const WCHAR *curr;
1859 ULONG num = 0;
1860
1861 for (curr = str->ptr; curr < str->ptr + str->len; curr++)
1862 {
1863 if (*curr >= '0' && *curr <= '9')
1864 num = num * 10 + *curr - '0';
1865 else
1866 {
1867 // ERR("wrong numeric value %wZ\n", &strU);
1868 return FALSE;
1869 }
1870 }
1871 entity->u.ifaceps.nummethods = num;
1872
1873 return TRUE;
1874}
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 2608 of file actctx.c.

2610{
2611 static const WCHAR levelW[] = {'l','e','v','e','l',0};
2612 static const WCHAR asInvokerW[] = {'a','s','I','n','v','o','k','e','r',0};
2613 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};
2614 static const WCHAR highestAvailableW[] = {'h','i','g','h','e','s','t','A','v','a','i','l','a','b','l','e',0};
2615 static const WCHAR uiAccessW[] = {'u','i','A','c','c','e','s','s',0};
2616 static const WCHAR falseW[] = {'f','a','l','s','e',0};
2617 static const WCHAR trueW[] = {'t','r','u','e',0};
2618
2619 struct xml_elem elem;
2620 struct xml_attr attr;
2621 BOOL end = FALSE;
2622
2623 /* Multiple requestedExecutionLevel elements are not supported. */
2624 if (assembly->run_level != ACTCTX_RUN_LEVEL_UNSPECIFIED) set_error( xmlbuf );
2625
2626 while (next_xml_attr(xmlbuf, &attr, &end))
2627 {
2628 if (xml_attr_cmp(&attr, levelW))
2629 {
2630 if (xmlstr_cmpi(&attr.value, asInvokerW))
2631 assembly->run_level = ACTCTX_RUN_LEVEL_AS_INVOKER;
2632 else if (xmlstr_cmpi(&attr.value, highestAvailableW))
2633 assembly->run_level = ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE;
2634 else if (xmlstr_cmpi(&attr.value, requireAdministratorW))
2635 assembly->run_level = ACTCTX_RUN_LEVEL_REQUIRE_ADMIN;
2636 }
2637 else if (xml_attr_cmp(&attr, uiAccessW))
2638 {
2641 else if (xmlstr_cmpi(&attr.value, trueW))
2643 }
2644 }
2645
2646 if (end) return;
2647
2648 while (next_xml_elem(xmlbuf, &elem, parent))
2649 {
2650 parse_unknown_elem(xmlbuf, &elem);
2651 }
2652}
static const WCHAR falseW[]
Definition: json.c:34
ULONG ui_access
Definition: actctx.c:539
ACTCTX_REQUESTED_RUN_LEVEL run_level
Definition: actctx.c:538

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

2656{
2657 struct xml_elem elem;
2658
2659 while (next_xml_elem(xmlbuf, &elem, parent))
2660 {
2662 {
2664 }
2665 else
2666 {
2667 parse_unknown_elem(xmlbuf, &elem);
2668 }
2669 }
2670}
static const WCHAR requestedExecutionLevelW[]
Definition: actctx.c:771
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:2608

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

2674{
2675 struct xml_elem elem;
2676
2677 while (next_xml_elem(xmlbuf, &elem, parent))
2678 {
2680 {
2682 }
2683 else
2684 {
2685 parse_unknown_elem(xmlbuf, &elem);
2686 }
2687 }
2688}
static const WCHAR requestedPrivilegesW[]
Definition: actctx.c:772
static void parse_requested_privileges_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2654

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

2531{
2532 struct xml_elem elem;
2533 struct xml_attr attr;
2535 BOOL end = FALSE;
2536 struct entity *entity;
2537
2538 while (next_xml_attr( xmlbuf, &attr, &end ))
2539 {
2540 }
2541
2542 if (end) return;
2543
2544 if (!parse_text_content( xmlbuf, &content )) return;
2545
2546 entity = add_entity( &assembly->entities, ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS );
2547 if (!entity)
2548 {
2549 set_error( xmlbuf );
2550 return;
2551 }
2552 entity->u.settings.name = xmlstrdupW( &parent->name );
2553 entity->u.settings.value = xmlstrdupW( &content );
2554 entity->u.settings.ns = xmlstrdupW( &parent->ns );
2555
2556 while (next_xml_elem(xmlbuf, &elem, parent))
2557 {
2558 parse_unknown_elem( xmlbuf, &elem );
2559 }
2560}

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

2463{
2464 struct xml_attr attr;
2465 BOOL end = FALSE;
2466
2467 while (next_xml_attr(xmlbuf, &attr, &end))
2468 {
2469 if (xml_attr_cmp(&attr, IdW))
2470 {
2471 COMPATIBILITY_CONTEXT_ELEMENT *compat;
2473 GUID compat_id;
2474
2475 str.Buffer = (PWSTR)attr.value.ptr;
2476 str.Length = str.MaximumLength = (USHORT)attr.value.len * sizeof(WCHAR);
2477 if (RtlGUIDFromString(&str, &compat_id) == STATUS_SUCCESS)
2478 {
2479 if (!(compat = add_compat_context(assembly)))
2480 {
2481 set_error( xmlbuf );
2482 return;
2483 }
2484 compat->Type = ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS;
2485 compat->Id = compat_id;
2486 }
2487 }
2488 }
2489
2490 if (!end) parse_expect_end_elem(xmlbuf, parent);
2491}
unsigned short USHORT
Definition: pedump.c:61
static const WCHAR IdW[]
Definition: actctx.c:770
static PCOMPATIBILITY_CONTEXT_ELEMENT add_compat_context(struct assembly *assembly)
Definition: actctx.c:991
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 1550 of file actctx.c.

1551{
1552 const WCHAR *ptr;
1553
1554 if (xmlbuf->error) return FALSE;
1555
1556 for (ptr = xmlbuf->ptr; ptr < xmlbuf->end; ptr++) if (*ptr == '<') break;
1557 if (ptr == xmlbuf->end) return set_error( xmlbuf );
1558
1559 content->ptr = xmlbuf->ptr;
1560 content->len = ptr - xmlbuf->ptr;
1561 xmlbuf->ptr = ptr;
1562
1563 return TRUE;
1564}

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

2692{
2693 struct xml_elem elem;
2694
2695 while (next_xml_elem(xmlbuf, &elem, parent))
2696 {
2698 {
2699 parse_security_elem(xmlbuf, assembly, acl, &elem);
2700 }
2701 else
2702 {
2703 parse_unknown_elem(xmlbuf, &elem);
2704 }
2705 }
2706}
static const WCHAR securityW[]
Definition: actctx.c:773
static void parse_security_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2672

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

2029{
2030 struct xml_attr attr;
2031 BOOL end = FALSE;
2032 struct entity* entity;
2033
2034 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)))
2035 {
2036 set_error( xmlbuf );
2037 return;
2038 }
2039
2040 while (next_xml_attr(xmlbuf, &attr, &end))
2041 {
2042 if (xml_attr_cmp(&attr, tlbidW))
2043 {
2044 if (!(entity->u.typelib.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2045 }
2046 else if (xml_attr_cmp(&attr, versionW))
2047 {
2048 if (!parse_typelib_version(&attr.value, entity)) set_error( xmlbuf );
2049 }
2050 else if (xml_attr_cmp(&attr, helpdirW))
2051 {
2052 if (!(entity->u.typelib.helpdir = xmlstrdupW(&attr.value))) set_error( xmlbuf );
2053 }
2054 else if (xml_attr_cmp(&attr, flagsW))
2055 {
2056 if (!parse_typelib_flags(&attr.value, entity)) set_error( xmlbuf );
2057 }
2058 }
2059
2061 if (!end) parse_expect_end_elem(xmlbuf, parent);
2062}
static BOOL parse_typelib_version(const xmlstr_t *str, struct entity *entity)
Definition: actctx.c:1998
static const WCHAR helpdirW[]
Definition: actctx.c:706
static BOOL parse_typelib_flags(const xmlstr_t *value, struct entity *entity)
Definition: actctx.c:1962
static const WCHAR flagsW[]
Definition: actctx.c:730

Referenced by parse_file_elem().

◆ parse_typelib_flags()

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

Definition at line 1962 of file actctx.c.

1963{
1964 WORD *flags = &entity->u.typelib.flags;
1965 const WCHAR *str = value->ptr, *start;
1966 int i = 0;
1967
1968 *flags = 0;
1969
1970 /* it's comma separated list of flags */
1971 while (i < value->len)
1972 {
1973 start = str;
1974 while (*str != ',' && (i++ < value->len)) str++;
1975
1978 else if (!wcsnicmp(start, controlW, str-start))
1980 else if (!wcsnicmp(start, hiddenW, str-start))
1982 else if (!wcsnicmp(start, hasdiskimageW, str-start))
1984 else
1985 {
1986 // WARN("unknown flags value %wZ\n", &valueU);
1987 return FALSE;
1988 }
1989
1990 /* skip separator */
1991 str++;
1992 i++;
1993 }
1994
1995 return TRUE;
1996}
unsigned short WORD
Definition: ntddk_ex.h:93
static const WCHAR hasdiskimageW[]
Definition: actctx.c:729
static const WCHAR restrictedW[]
Definition: actctx.c:726
static const WCHAR controlW[]
Definition: actctx.c:727
static const WCHAR hiddenW[]
Definition: actctx.c:728

Referenced by parse_typelib_elem().

◆ parse_typelib_version()

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

Definition at line 1998 of file actctx.c.

1999{
2000 unsigned int ver[2];
2001 unsigned int pos;
2002 const WCHAR *curr;
2003
2004 /* major.minor */
2005 ver[0] = ver[1] = pos = 0;
2006 for (curr = str->ptr; curr < str->ptr + str->len; curr++)
2007 {
2008 if (*curr >= '0' && *curr <= '9')
2009 {
2010 ver[pos] = ver[pos] * 10 + *curr - '0';
2011 if (ver[pos] >= 0x10000) goto error;
2012 }
2013 else if (*curr == '.')
2014 {
2015 if (++pos >= 2) goto error;
2016 }
2017 else goto error;
2018 }
2019 entity->u.typelib.major = ver[0];
2020 entity->u.typelib.minor = ver[1];
2021 return TRUE;
2022
2023error:
2024 return FALSE;
2025}
#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 1566 of file actctx.c.

1567{
1568 unsigned int ver[4];
1569 unsigned int pos;
1570 const WCHAR *curr;
1571
1572 /* major.minor.build.revision */
1573 ver[0] = ver[1] = ver[2] = ver[3] = pos = 0;
1574 for (curr = str->ptr; curr < str->ptr + str->len; curr++)
1575 {
1576 if (*curr >= '0' && *curr <= '9')
1577 {
1578 ver[pos] = ver[pos] * 10 + *curr - '0';
1579 if (ver[pos] >= 0x10000) goto error;
1580 }
1581 else if (*curr == '.')
1582 {
1583 if (++pos >= 4) goto error;
1584 }
1585 else goto error;
1586 }
1587 version->major = ver[0];
1588 version->minor = ver[1];
1589 version->build = ver[2];
1590 version->revision = ver[3];
1591 return TRUE;
1592
1593error:
1594 return FALSE;
1595}

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

2081{
2082 struct xml_elem elem;
2083 struct xml_attr attr;
2085 BOOL end = FALSE;
2086 struct entity* entity;
2087
2088 if (!(entity = add_entity(&dll->entities, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)))
2089 {
2090 set_error( xmlbuf );
2091 return;
2092 }
2093 entity->u.class.versioned = TRUE;
2094 while (next_xml_attr(xmlbuf, &attr, &end))
2095 {
2097 {
2098 if (xmlstr_cmpi(&attr.value, noW))
2099 entity->u.class.versioned = FALSE;
2100 else if (!xmlstr_cmpi(&attr.value, yesW))
2101 set_error( xmlbuf );
2102 }
2103 }
2104
2105 if (end) return;
2106
2107 if (!parse_text_content(xmlbuf, &content)) return;
2108 if (!(entity->u.class.name = xmlstrdupW(&content))) set_error( xmlbuf );
2109
2111
2112 while (next_xml_elem(xmlbuf, &elem, parent))
2113 {
2114 parse_unknown_elem(xmlbuf, &elem);
2115 }
2116}
static const WCHAR noW[]
Definition: actctx.c:725
static const WCHAR versionedW[]
Definition: actctx.c:723

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

2564{
2565 struct xml_elem elem;
2566
2567 while (next_xml_elem( xmlbuf, &elem, parent ))
2568 {
2580 {
2581 parse_settings_elem( xmlbuf, assembly, acl, &elem );
2582 }
2583 else
2584 {
2585 parse_unknown_elem( xmlbuf, &elem );
2586 }
2587 }
2588}
static const WCHAR autoElevateW[]
Definition: actctx.c:776
static const WCHAR longPathAwareW[]
Definition: actctx.c:787
static const WCHAR gdiScalingW[]
Definition: actctx.c:785
static const WCHAR dpiAwarenessW[]
Definition: actctx.c:784
static const WCHAR windowsSettings2011NSW[]
Definition: actctx.c:780
static const WCHAR printerDriverIsolationW[]
Definition: actctx.c:789
static const WCHAR ultraHighResolutionScrollingAwareW[]
Definition: actctx.c:790
static const WCHAR disableWindowFilteringW[]
Definition: actctx.c:778
static void parse_settings_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, struct xml_elem *parent)
Definition: actctx.c:2529
static const WCHAR highResolutionScrollingAwareW[]
Definition: actctx.c:786
static const WCHAR dpiAwareW[]
Definition: actctx.c:783
static const WCHAR disableThemingW[]
Definition: actctx.c:777
static const WCHAR windowsSettings2017NSW[]
Definition: actctx.c:782
static const WCHAR windowsSettings2016NSW[]
Definition: actctx.c:781
static const WCHAR magicFutureSettingW[]
Definition: actctx.c:788
static const WCHAR windowsSettings2005NSW[]
Definition: actctx.c:779

Referenced by parse_application_elem().

◆ parse_xml_header()

static BOOL parse_xml_header ( xmlbuf_t xmlbuf)
static

Definition at line 1534 of file actctx.c.

1535{
1536 /* FIXME: parse attributes */
1537 const WCHAR *ptr;
1538
1539 for (ptr = xmlbuf->ptr; ptr < xmlbuf->end - 1; ptr++)
1540 {
1541 if (ptr[0] == '?' && ptr[1] == '>')
1542 {
1543 xmlbuf->ptr = ptr + 2;
1544 return TRUE;
1545 }
1546 }
1547 return FALSE;
1548}

Referenced by parse_manifest_buffer().

◆ push_xmlns()

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

Definition at line 1341 of file actctx.c.

1342{
1343 const int len = wcslen( xmlnsW );
1344 struct xml_attr *ns;
1345
1346 if (xmlbuf->ns_pos == MAX_NAMESPACES - 1)
1347 {
1348 // FIXME( "too many namespaces in manifest\n" );
1349 set_error( xmlbuf );
1350 return;
1351 }
1352 ns = &xmlbuf->namespaces[xmlbuf->ns_pos++];
1353 ns->value = attr->value;
1354 if (attr->name.len > len)
1355 {
1356 ns->name.ptr = attr->name.ptr + len + 1;
1357 ns->name.len = attr->name.len - len - 1;
1358 }
1359 else ns->name = empty_xmlstr;
1360}
#define MAX_NAMESPACES
Definition: actctx.c:108

Referenced by next_xml_elem().

◆ read_xml_elem()

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

Definition at line 1445 of file actctx.c.

1446{
1447 const WCHAR* ptr = xmlbuf->ptr;
1448
1449 elem->ns = empty_xmlstr;
1450 elem->name.ptr = ptr;
1451 while (ptr < xmlbuf->end && !isxmlspace(*ptr) && *ptr != '>' && *ptr != '/')
1452 {
1453 if (*ptr == ':')
1454 {
1455 elem->ns.ptr = elem->name.ptr;
1456 elem->ns.len = ptr - elem->ns.ptr;
1457 elem->name.ptr = ptr + 1;
1458 }
1459 ptr++;
1460 }
1461 elem->name.len = ptr - elem->name.ptr;
1462 xmlbuf->ptr = ptr;
1463}

Referenced by next_xml_elem().

◆ RtlActivateActivationContext()

NTSTATUS WINAPI RtlActivateActivationContext ( ULONG  unknown,
HANDLE  handle,
PULONG_PTR  cookie 
)

Definition at line 5442 of file actctx.c.

5443{
5445}
NTSTATUS WINAPI RtlActivateActivationContextEx(ULONG flags, TEB *teb, HANDLE handle, ULONG_PTR *cookie)
Definition: actctx.c:5450
Definition: cookie.c:34

◆ RtlActivateActivationContextEx()

NTSTATUS WINAPI RtlActivateActivationContextEx ( ULONG  flags,
TEB teb,
HANDLE  handle,
ULONG_PTR cookie 
)

Definition at line 5450 of file actctx.c.

5451{
5453
5454 if (!(frame = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*frame) )))
5455 return STATUS_NO_MEMORY;
5456
5457 frame->Previous = teb->ActivationContextStackPointer->ActiveFrame;
5458 frame->ActivationContext = handle;
5459 frame->Flags = 0;
5460
5461 DPRINT("ActiveSP %p: ACTIVATE (ActiveFrame %p -> NewFrame %p, Context %p)\n",
5463 frame, handle);
5464
5465 teb->ActivationContextStackPointer->ActiveFrame = frame;
5467
5468 *cookie = (ULONG_PTR)frame;
5469 TRACE( "%p cookie=%lx\n", handle, *cookie );
5470 return STATUS_SUCCESS;
5471}
NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE)
Definition: actctx.c:5404
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 5204 of file actctx.c.

5210{
5211 const ACTCTXW *pActCtx = (PVOID)ActivationContextData;
5212 const WCHAR *directory = NULL;
5213 PACTIVATION_CONTEXT_WRAPPED ActualActCtx;
5216 ULONG lang = 0;
5218 HANDLE file = 0;
5219 struct actctx_loader acl;
5220
5221 TRACE("%p %08x\n", pActCtx, pActCtx ? pActCtx->dwFlags : 0);
5222
5223 if (!pActCtx || pActCtx->cbSize < sizeof(*pActCtx) ||
5224 (pActCtx->dwFlags & ~ACTCTX_FLAGS_ALL))
5226
5227
5228 if (!(ActualActCtx = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ActualActCtx))))
5229 return STATUS_NO_MEMORY;
5230
5231 ActualActCtx->MagicMarker = ACTCTX_MAGIC_MARKER;
5232
5233 actctx = &ActualActCtx->ActivationContext;
5234 actctx->RefCount = 1;
5235 actctx->config.type = ACTIVATION_CONTEXT_PATH_TYPE_NONE;
5236 actctx->config.info = NULL;
5237 actctx->appdir.type = ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE;
5238 if (pActCtx->dwFlags & ACTCTX_FLAG_APPLICATION_NAME_VALID)
5239 {
5240 if (!(actctx->appdir.info = strdupW( pActCtx->lpApplicationName ))) goto error;
5241 }
5242 else
5243 {
5245 WCHAR *p;
5247
5248 if (pActCtx->dwFlags & ACTCTX_FLAG_HMODULE_VALID) module = pActCtx->hModule;
5249 else module = NtCurrentTeb()->ProcessEnvironmentBlock->ImageBaseAddress;
5250
5252 if (!NT_SUCCESS(status)) goto error;
5253 if ((p = wcsrchr( dir.Buffer, '\\' ))) p[1] = 0;
5254 actctx->appdir.info = dir.Buffer;
5255 }
5256
5257 nameW.Buffer = NULL;
5258
5259 /* open file only if it's going to be used */
5260 if (pActCtx->lpSource && !((pActCtx->dwFlags & ACTCTX_FLAG_RESOURCE_NAME_VALID) &&
5261 (pActCtx->dwFlags & ACTCTX_FLAG_HMODULE_VALID)))
5262 {
5263 WCHAR *source = NULL;
5264 BOOLEAN ret;
5265
5266 if (pActCtx->dwFlags & ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID &&
5267 RtlDetermineDosPathNameType_U(pActCtx->lpSource) == RELATIVE_PATH)
5268 {
5269 DWORD dir_len, source_len;
5270
5271 dir_len = wcslen(pActCtx->lpAssemblyDirectory);
5272 source_len = wcslen(pActCtx->lpSource);
5273 if (!(source = RtlAllocateHeap( GetProcessHeap(), 0, (dir_len+source_len+2)*sizeof(WCHAR))))
5274 {
5276 goto error;
5277 }
5278
5279 memcpy(source, pActCtx->lpAssemblyDirectory, dir_len*sizeof(WCHAR));
5280 source[dir_len] = '\\';
5281 memcpy(source+dir_len+1, pActCtx->lpSource, (source_len+1)*sizeof(WCHAR));
5282 }
5283
5284 ret = RtlDosPathNameToNtPathName_U(source ? source : pActCtx->lpSource, &nameW, NULL, NULL);
5286 if (!ret)
5287 {
5289 goto error;
5290 }
5291 status = open_nt_file( &file, &nameW );
5292 if (!NT_SUCCESS(status))
5293 {
5295 goto error;
5296 }
5297 }
5298
5299 acl.actctx = actctx;
5300 acl.dependencies = NULL;
5301 acl.num_dependencies = 0;
5302 acl.allocated_dependencies = 0;
5303
5304 if (pActCtx->dwFlags & ACTCTX_FLAG_LANGID_VALID) lang = pActCtx->wLangId;
5305 if (pActCtx->dwFlags & ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID) directory = pActCtx->lpAssemblyDirectory;
5306
5307 if (pActCtx->dwFlags & ACTCTX_FLAG_RESOURCE_NAME_VALID)
5308 {
5309 /* if we have a resource it's a PE file */
5310 if (pActCtx->dwFlags & ACTCTX_FLAG_HMODULE_VALID)
5311 {
5312 status = get_manifest_in_module( &acl, NULL, NULL, directory, FALSE, pActCtx->hModule,
5313 pActCtx->lpResourceName, lang );
5315 /* FIXME: what to do if pActCtx->lpSource is set */
5317 pActCtx->hModule, pActCtx->lpResourceName );
5318 }
5319 else if (pActCtx->lpSource && pActCtx->lpResourceName)
5320 {
5322 file, pActCtx->lpResourceName, lang );
5325 NULL, pActCtx->lpResourceName );
5326 }
5328 }
5329 else
5330 {
5332 }
5333
5334 if (file) NtClose( file );
5336
5338 free_depend_manifests( &acl );
5339
5340 if (NT_SUCCESS(status))
5341 *ActCtx = actctx;
5342 else actctx_release( actctx );
5343 return status;
5344
5345error:
5346 if (file) NtClose( file );
5348 return status;
5349}
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:3171
static void free_depend_manifests(struct actctx_loader *acl)
Definition: actctx.c:1171
static NTSTATUS parse_depend_manifests(struct actctx_loader *acl)
Definition: actctx.c:3465
#define ACTCTX_FLAGS_ALL
Definition: actctx.c:48
static void actctx_release(ACTIVATION_CONTEXT *actctx)
Definition: actctx.c:1285
void * PVOID
Definition: typedefs.h:50

◆ RtlDeactivateActivationContext()

NTSTATUS WINAPI RtlDeactivateActivationContext ( ULONG  flags,
ULONG_PTR  cookie 
)

Definition at line 5476 of file actctx.c.

5477{
5479
5480 TRACE( "%x cookie=%lx\n", flags, cookie );
5481
5482 /* find the right frame */
5483 top = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame;
5484 for (frame = top; frame; frame = frame->Previous)
5485 if ((ULONG_PTR)frame == cookie) break;
5486
5487 if (!frame)
5489
5492
5493 DPRINT("ActiveSP %p: DEACTIVATE (ActiveFrame %p -> PreviousFrame %p)\n",
5494 NtCurrentTeb()->ActivationContextStackPointer,
5495 NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame,
5496 frame->Previous);
5497
5498 /* pop everything up to and including frame */
5499 NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame = frame->Previous;
5500
5501 while (top != NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5502 {
5503 frame = top->Previous;
5504 RtlReleaseActivationContext( top->ActivationContext );
5506 top = frame;
5507 }
5508
5509 return STATUS_SUCCESS;
5510}
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE)
Definition: actctx.c:5415
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 5958 of file actctx.c.

5960{
5961 ACTCTX_SECTION_KEYED_DATA *data = ptr;
5963
5964 if (extguid)
5965 {
5966 FIXME("expected extguid == NULL\n");
5968 }
5969
5970 if (flags & ~FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX)
5971 {
5972 FIXME("unknown flags %08x\n", flags);
5974 }
5975
5976 if (!data || data->cbSize < FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) || !guid)
5978
5979 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5980 {
5981 ACTIVATION_CONTEXT *actctx = check_actctx(NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext);
5982 if (actctx) status = find_guid( actctx, section_kind, guid, flags, data );
5983 }
5984
5985 if (status != STATUS_SUCCESS)
5986 status = find_guid( process_actctx, section_kind, guid, flags, data );
5987
5988 if (status != STATUS_SUCCESS)
5989 status = find_guid( implicit_actctx, section_kind, guid, flags, data );
5990
5991 return status;
5992}
static NTSTATUS find_guid(ACTIVATION_CONTEXT *actctx, ULONG section_kind, const GUID *guid, DWORD flags, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:5095

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

5909{
5912
5913 DPRINT("RtlFindActivationContextSectionString(%x %p %x %wZ %p)\n", flags, guid, section_kind, section_name, ptr);
5914 status = RtlpFindActivationContextSection_CheckParameters(flags, guid, section_kind, section_name, data);
5915 if (!NT_SUCCESS(status))
5916 {
5917 DPRINT1("RtlFindActivationContextSectionString() failed with status %x\n", status);
5918 return status;
5919 }
5920
5922
5923 /* if there is no data, but params are valid,
5924 we return that sxs key is not found to be at least somehow compatible */
5925 if (!data)
5926 {
5927 DPRINT("RtlFindActivationContextSectionString() failed with status %x\n", status);
5928 return status;
5929 }
5930
5932 ASSERT(NtCurrentTeb()->ActivationContextStackPointer);
5933
5934 DPRINT("ActiveFrame: %p\n",NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame);
5935 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5936 {
5937 ACTIVATION_CONTEXT *actctx = check_actctx(NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext);
5938 if (actctx) status = find_string( actctx, section_kind, section_name, flags, data );
5939 }
5940
5941 DPRINT("status %x\n", status);
5942 if (status != STATUS_SUCCESS)
5943 status = find_string( process_actctx, section_kind, section_name, flags, data );
5944
5945 if (status != STATUS_SUCCESS)
5946 status = find_string( implicit_actctx, section_kind, section_name, flags, data );
5947
5948 DPRINT("RtlFindActivationContextSectionString() returns status %x\n", status);
5949 return status;
5950}
#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:5055

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

◆ RtlFreeThreadActivationContextStack()

void WINAPI RtlFreeThreadActivationContextStack ( void  )

Definition at line 5548 of file actctx.c.

5549{
5550#ifdef __REACTOS__
5551 RtlFreeActivationContextStack(NtCurrentTeb()->ActivationContextStackPointer);
5552 NtCurrentTeb()->ActivationContextStackPointer = NULL;
5553#else
5555
5556 frame = NtCurrentTeb()->ActivationContextStack.ActiveFrame;
5557 while (frame)
5558 {
5561 RtlFreeHeap( GetProcessHeap(), 0, frame );
5562 frame = prev;
5563 }
5564 NtCurrentTeb()->ActivationContextStack.ActiveFrame = NULL;
5565#endif // __REACTOS__
5566}

Referenced by LdrShutdownThread().

◆ RtlGetActiveActivationContext()

NTSTATUS WINAPI RtlGetActiveActivationContext ( HANDLE handle)

Definition at line 5572 of file actctx.c.

5573{
5574 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
5575 {
5576 *handle = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext;
5578 }
5579 else
5580 *handle = 0;
5581
5582 return STATUS_SUCCESS;
5583}

Referenced by GetCurrentActCtx(), and LdrpWalkImportDescriptor().

◆ RtlIsActivationContextActive()

BOOLEAN WINAPI RtlIsActivationContextActive ( HANDLE  handle)

Definition at line 5589 of file actctx.c.

5590{
5592
5593 for (frame = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame; frame; frame = frame->Previous)
5594 if (frame->ActivationContext == handle) return TRUE;
5595 return FALSE;
5596}

◆ RtlQueryActivationContextApplicationSettings()

NTSTATUS WINAPI RtlQueryActivationContextApplicationSettings ( DWORD  flags,
HANDLE  handle,
const WCHAR ns,
const WCHAR settings,
WCHAR buffer,
SIZE_T  size,
SIZE_T written 
)

Definition at line 5998 of file actctx.c.

6001{
6003 const WCHAR *res;
6004
6005 if (flags)
6006 {
6007 WARN( "unknown flags %08x\n", flags );
6009 }
6010
6011 if (ns)
6012 {
6018 }
6020
6023
6025
6026 if (written) *written = wcslen(res) + 1;
6027 if (size < wcslen(res)) return STATUS_BUFFER_TOO_SMALL;
6028 wcscpy( buffer, res );
6029 return STATUS_SUCCESS;
6030}
GLuint res
Definition: glext.h:9613
static const WCHAR * find_app_settings(ACTIVATION_CONTEXT *actctx, const WCHAR *settings, const WCHAR *ns)
Definition: actctx.c:5129
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69

◆ RtlQueryInformationActivationContext()

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

Definition at line 5605 of file actctx.c.

5608{
5611
5612 TRACE("%08x %p %p %u %p %ld %p\n", flags, handle,
5613 subinst, class, buffer, bufsize, retlen);
5614
5615 if (retlen) *retlen = 0;
5616 if ((status = find_query_actctx( &handle, flags, class ))) return status;
5617
5618 switch (class)
5619 {
5620 case ActivationContextBasicInformation:
5621 {
5622 ACTIVATION_CONTEXT_BASIC_INFORMATION *info = buffer;
5623
5624 if (retlen) *retlen = sizeof(*info);
5625 if (!info || bufsize < sizeof(*info)) return STATUS_BUFFER_TOO_SMALL;
5626
5627 info->hActCtx = handle;
5628 info->dwFlags = 0; /* FIXME */
5630 }
5631 break;
5632
5633 case ActivationContextDetailedInformation:
5634 {
5635 ACTIVATION_CONTEXT_DETAILED_INFORMATION *acdi = buffer;
5636 struct assembly *assembly = NULL;
5637 SIZE_T len, manifest_len = 0, config_len = 0, appdir_len = 0;
5638 LPWSTR ptr;
5639
5641
5642 if (actctx->num_assemblies) assembly = actctx->assemblies;
5643
5644 if (assembly && assembly->manifest.info)
5645 manifest_len = wcslen(assembly->manifest.info) + 1;
5646 if (actctx->config.info) config_len = wcslen(actctx->config.info) + 1;
5647 if (actctx->appdir.info) appdir_len = wcslen(actctx->appdir.info) + 1;
5648 len = sizeof(*acdi) + (manifest_len + config_len + appdir_len) * sizeof(WCHAR);
5649
5650 if (retlen) *retlen = len;
5651 if (!buffer || bufsize < len) return STATUS_BUFFER_TOO_SMALL;
5652
5653 acdi->dwFlags = 0;
5654 acdi->ulFormatVersion = assembly ? 1 : 0; /* FIXME */
5655 acdi->ulAssemblyCount = actctx->num_assemblies;
5656 acdi->ulRootManifestPathType = assembly ? assembly->manifest.type : 0 /* FIXME */;
5657 acdi->ulRootManifestPathChars = assembly && assembly->manifest.info ? manifest_len - 1 : 0;
5658 acdi->ulRootConfigurationPathType = actctx->config.type;
5659 acdi->ulRootConfigurationPathChars = actctx->config.info ? config_len - 1 : 0;
5660 acdi->ulAppDirPathType = actctx->appdir.type;
5661 acdi->ulAppDirPathChars = actctx->appdir.info ? appdir_len - 1 : 0;
5662 ptr = (LPWSTR)(acdi + 1);
5663 if (manifest_len)
5664 {
5665 acdi->lpRootManifestPath = ptr;
5666 memcpy(ptr, assembly->manifest.info, manifest_len * sizeof(WCHAR));
5667 ptr += manifest_len;
5668 }
5669 else acdi->lpRootManifestPath = NULL;
5670 if (config_len)
5671 {
5672 acdi->lpRootConfigurationPath = ptr;
5673 memcpy(ptr, actctx->config.info, config_len * sizeof(WCHAR));
5674 ptr += config_len;
5675 }
5676 else acdi->lpRootConfigurationPath = NULL;
5677 if (appdir_len)
5678 {
5679 acdi->lpAppDirPath = ptr;
5680 memcpy(ptr, actctx->appdir.info, appdir_len * sizeof(WCHAR));
5681 }
5682 else acdi->lpAppDirPath = NULL;
5683 }
5684 break;
5685
5686 case AssemblyDetailedInformationInActivationContext:
5687 {
5688 ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *afdi = buffer;
5689 struct assembly *assembly;
5690 WCHAR *assembly_id;
5691 DWORD index;
5692 SIZE_T len, id_len = 0, ad_len = 0, path_len = 0;
5693 LPWSTR ptr;
5694
5696 if (!subinst) return STATUS_INVALID_PARAMETER;
5697
5698 index = *(DWORD*)subinst;
5699 if (!index || index > actctx->num_assemblies) return STATUS_INVALID_PARAMETER;
5700
5701 assembly = &actctx->assemblies[index - 1];
5702
5703 if (!(assembly_id = build_assembly_id( &assembly->id ))) return STATUS_NO_MEMORY;
5704 id_len = wcslen(assembly_id) + 1;
5705 if (assembly->directory) ad_len = wcslen(assembly->directory) + 1;
5706
5707 if (assembly->manifest.info &&
5709 path_len = wcslen(assembly->manifest.info) + 1;
5710
5711 len = sizeof(*afdi) + (id_len + ad_len + path_len) * sizeof(WCHAR);
5712
5713 if (retlen) *retlen = len;
5714 if (!buffer || bufsize < len)
5715 {
5716 RtlFreeHeap( GetProcessHeap(), 0, assembly_id );
5718 }
5719
5720 afdi->ulFlags = 0; /* FIXME */
5721 afdi->ulEncodedAssemblyIdentityLength = (id_len - 1) * sizeof(WCHAR);
5722 afdi->ulManifestPathType = assembly->manifest.type;
5723 afdi->ulManifestPathLength = assembly->manifest.info ? (path_len - 1) * sizeof(WCHAR) : 0;
5724 /* FIXME afdi->liManifestLastWriteTime = 0; */
5725 afdi->ulPolicyPathType = ACTIVATION_CONTEXT_PATH_TYPE_NONE; /* FIXME */
5726 afdi->ulPolicyPathLength = 0;
5727 /* FIXME afdi->liPolicyLastWriteTime = 0; */
5728 afdi->ulMetadataSatelliteRosterIndex = 0; /* FIXME */
5729 afdi->ulManifestVersionMajor = 1;
5730 afdi->ulManifestVersionMinor = 0;
5731 afdi->ulPolicyVersionMajor = 0; /* FIXME */
5732 afdi->ulPolicyVersionMinor = 0; /* FIXME */
5733 afdi->ulAssemblyDirectoryNameLength = ad_len ? (ad_len - 1) * sizeof(WCHAR) : 0;
5734 ptr = (LPWSTR)(afdi + 1);
5735 afdi->lpAssemblyEncodedAssemblyIdentity = ptr;
5736 memcpy( ptr, assembly_id, id_len * sizeof(WCHAR) );
5737 ptr += id_len;
5738 if (path_len)
5739 {
5740 afdi->lpAssemblyManifestPath = ptr;
5741 memcpy(ptr, assembly->manifest.info, path_len * sizeof(WCHAR));
5742 ptr += path_len;
5743 } else afdi->lpAssemblyManifestPath = NULL;
5744 afdi->lpAssemblyPolicyPath = NULL; /* FIXME */
5745 if (ad_len)
5746 {
5747 afdi->lpAssemblyDirectoryName = ptr;
5748 memcpy(ptr, assembly->directory, ad_len * sizeof(WCHAR));
5749 }
5750 else afdi->lpAssemblyDirectoryName = NULL;
5751 RtlFreeHeap( GetProcessHeap(), 0, assembly_id );
5752 }
5753 break;
5754
5755 case FileInformationInAssemblyOfAssemblyInActivationContext:
5756 {
5757 const ACTIVATION_CONTEXT_QUERY_INDEX *acqi = subinst;
5758 ASSEMBLY_FILE_DETAILED_INFORMATION *afdi = buffer;
5759 struct assembly *assembly;
5760 struct dll_redirect *dll;
5761 SIZE_T len, dll_len = 0;
5762 LPWSTR ptr;
5763
5765 if (!acqi) return STATUS_INVALID_PARAMETER;
5766
5767 if (acqi->ulAssemblyIndex >= actctx->num_assemblies)
5769 assembly = &actctx->assemblies[acqi->ulAssemblyIndex];
5770
5771 if (acqi->ulFileIndexInAssembly >= assembly->num_dlls)
5773 dll = &assembly->dlls[acqi->ulFileIndexInAssembly];
5774
5775 if (dll->name) dll_len = wcslen(dll->name) + 1;
5776 len = sizeof(*afdi) + dll_len * sizeof(WCHAR);
5777
5778 if (!buffer || bufsize < len)
5779 {
5780 if (retlen) *retlen = len;
5782 }
5783 if (retlen) *retlen = 0; /* yes that's what native does !! */
5784 afdi->ulFlags = ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION;
5785 afdi->ulFilenameLength = dll_len ? (dll_len - 1) * sizeof(WCHAR) : 0;
5786 afdi->ulPathLength = 0; /* FIXME */
5787 ptr = (LPWSTR)(afdi + 1);
5788 if (dll_len)
5789 {
5790 afdi->lpFileName = ptr;
5791 memcpy( ptr, dll->name, dll_len * sizeof(WCHAR) );
5792 } else afdi->lpFileName = NULL;
5793 afdi->lpFilePath = NULL; /* FIXME */
5794 }
5795 break;
5796
5797 case CompatibilityInformationInActivationContext:
5798 {
5799 /*ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION*/DWORD *acci = buffer;
5800 COMPATIBILITY_CONTEXT_ELEMENT *elements;
5801 struct assembly *assembly = NULL;
5803 SIZE_T len;
5804
5806
5807 if (actctx->num_assemblies) assembly = actctx->assemblies;
5808
5809 if (assembly)
5811 len = sizeof(*acci) + num_compat_contexts * sizeof(COMPATIBILITY_CONTEXT_ELEMENT);
5812
5813 if (retlen) *retlen = len;
5814 if (!buffer || bufsize < len) return STATUS_BUFFER_TOO_SMALL;
5815
5816 *acci = num_compat_contexts;
5817 elements = (COMPATIBILITY_CONTEXT_ELEMENT*)(acci + 1);
5818 for (n = 0; n < num_compat_contexts; ++n)
5819 {
5820 elements[n] = assembly->compat_contexts[n];
5821 }
5822 }
5823 break;
5824
5825 case RunlevelInformationInActivationContext:
5826 {
5827 ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION *acrli = buffer;
5828 struct assembly *assembly;
5829 SIZE_T len;
5830
5832
5833 len = sizeof(*acrli);
5834 if (retlen) *retlen = len;
5835 if (!buffer || bufsize < len)
5837
5838 assembly = actctx->assemblies;
5839
5840 acrli->ulFlags = 0;
5841 acrli->RunLevel = assembly ? assembly->run_level : ACTCTX_RUN_LEVEL_UNSPECIFIED;
5842 acrli->UiAccess = assembly ? assembly->ui_access : 0;
5843 }
5844 break;
5845
5846 default:
5847 FIXME( "class %u not implemented\n", class );
5849 }
5850 return STATUS_SUCCESS;
5851}
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:1224
static NTSTATUS find_query_actctx(HANDLE *handle, DWORD flags, ULONG class)
Definition: actctx.c:3490
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 5429 of file actctx.c.

5430{
5431 FIXME("%p: stub\n", handle);
5432
5434 return STATUS_SUCCESS;
5435
5437}
#define ACTCTX_FAKE_HANDLE
Definition: actctx.c:64

Referenced by ZombifyActCtx().

◆ set_error()

◆ strdupW()

static WCHAR * strdupW ( const WCHAR str)
static

Definition at line 834 of file actctx.c.

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

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

4853{
4854 struct progidredirect_data *data;
4856 GUID *guid_ptr;
4857 WCHAR *ptrW;
4858
4859 /* setup new index entry */
4860
4861 /* hash progid name */
4864
4865 (*index)->name_offset = *data_offset;
4866 (*index)->name_len = str.Length;
4867 (*index)->data_offset = (*index)->name_offset + aligned_string_len(str.MaximumLength);
4868 (*index)->data_len = sizeof(*data);
4869 (*index)->rosterindex = rosterindex;
4870
4871 *data_offset += aligned_string_len(str.MaximumLength);
4872
4873 /* setup data structure */
4874 data = (struct progidredirect_data*)((BYTE*)section + *data_offset);
4875 data->size = sizeof(*data);
4876 data->reserved = 0;
4877 data->clsid_offset = *global_offset;
4878
4879 /* write progid string */
4880 ptrW = (WCHAR*)((BYTE*)section + (*index)->name_offset);
4881 memcpy(ptrW, progid, (*index)->name_len);
4882 ptrW[(*index)->name_len/sizeof(WCHAR)] = 0;
4883
4884 /* write guid to global area */
4885 guid_ptr = (GUID*)((BYTE*)section + data->clsid_offset);
4886 *guid_ptr = *alias;
4887
4888 /* to next entry */
4889 *global_offset += sizeof(GUID);
4890 *data_offset += data->size;
4891 (*index) += 1;
4892}
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 878 of file actctx.c.

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

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

871{
872 return (elem1->name.len == elem2->name.len &&
873 elem1->ns.len == elem2->ns.len &&
874 !wcsncmp( elem1->name.ptr, elem2->name.ptr, elem1->name.len ) &&
875 !wcsncmp( elem1->ns.ptr, elem2->ns.ptr, elem1->ns.len ));
876}
xmlstr_t name
Definition: actctx.c:118
xmlstr_t ns
Definition: actctx.c:119
const WCHAR * ptr
Definition: actctx.c:112
unsigned int len
Definition: actctx.c:113

Referenced by next_xml_elem().

◆ xmlstr_cmp()

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

Definition at line 855 of file actctx.c.

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

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

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

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

◆ alignableW

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

Definition at line 746 of file actctx.c.

◆ alwaysrunW

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

Definition at line 747 of file actctx.c.

◆ applicationW

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

Definition at line 768 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 627 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 628 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 687 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 686 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 776 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 688 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 748 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 749 of file actctx.c.

◆ clrClassW

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

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

Referenced by parse_assembly_elem().

◆ clsidW

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

Definition at line 704 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 691 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 692 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 693 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 766 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 623 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 694 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 695 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 696 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 777 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 778 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 826 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 784 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 783 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ empty_xmlstr

const xmlstr_t empty_xmlstr
static

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

Referenced by parse_assembly_elem().

◆ flagsW

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

Definition at line 730 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 824 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 785 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 729 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 705 of file actctx.c.

Referenced by parse_file_elem().

◆ hashW

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

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

Referenced by parse_typelib_elem().

◆ hiddenW

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

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

Referenced by parse_windows_settings_elem().

◆ IdW

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

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

◆ insideoutW

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

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

◆ languageW

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

Definition at line 708 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 787 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 788 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 709 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 733 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 735 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 732 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 734 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 731 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 711 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 712 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 700 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 699 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 756 of file actctx.c.

◆ noW

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

Definition at line 725 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 713 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:746
static const WCHAR nouiactivateW[]
Definition: actctx.c:756
static const WCHAR supportsmultilevelundoW[]
Definition: actctx.c:763
static const WCHAR activatewhenvisibleW[]
Definition: actctx.c:743
static const WCHAR actslikelabelW[]
Definition: actctx.c:745
static const WCHAR insideoutW[]
Definition: actctx.c:753
static const WCHAR staticW[]
Definition: actctx.c:762
static const WCHAR cantlinkinsideW[]
Definition: actctx.c:749
static const WCHAR canlinkbyole1W[]
Definition: actctx.c:748
static const WCHAR imemodeW[]
Definition: actctx.c:751
static const WCHAR actslikebuttonW[]
Definition: actctx.c:744
static const WCHAR recomposeonresizeW[]
Definition: actctx.c:758
static const WCHAR ignoreactivatewhenvisibleW[]
Definition: actctx.c:750
static const WCHAR islinkobjectW[]
Definition: actctx.c:755
static const WCHAR simpleframeW[]
Definition: actctx.c:761
static const WCHAR wantstomenumergeW[]
Definition: actctx.c:764
static const WCHAR invisibleatruntimeW[]
Definition: actctx.c:754
static const WCHAR onlyiconicW[]
Definition: actctx.c:757
static const WCHAR alwaysrunW[]
Definition: actctx.c:747
static const WCHAR renderingisdeviceindependentW[]
Definition: actctx.c:759
static const WCHAR insertnotreplaceW[]
Definition: actctx.c:752
static const WCHAR setclientsitefirstW[]
Definition: actctx.c:760

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

◆ optionalW

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

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

Referenced by parse_windows_settings_elem().

◆ process_actctx

◆ 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 715 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 716 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 717 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 758 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 759 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 771 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 772 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 726 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 739 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 773 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 760 of file actctx.c.

◆ simpleframeW

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

Definition at line 761 of file actctx.c.

◆ staticW

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

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

◆ system_actctx

ACTIVATION_CONTEXT_WRAPPED system_actctx = { ACTCTX_MAGIC_MARKER, { 1 } }
static

Definition at line 830 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 774 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 720 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 790 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 827 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 723 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 721 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 764 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 702 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

◆ 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

◆ 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

◆ 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

◆ windowsSettingsW

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

Definition at line 775 of file actctx.c.

Referenced by parse_application_elem().

◆ xmlnsW

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

Definition at line 722 of file actctx.c.

Referenced by is_xmlns_attr(), and push_xmlns().

◆ yesW

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

Definition at line 724 of file actctx.c.

Referenced by parse_dependency_elem(), and parse_window_class_elem().