ReactOS 0.4.16-dev-197-g92996da
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 66 of file actctx.c.

◆ ACTCTX_FAKE_HANDLE

#define ACTCTX_FAKE_HANDLE   ((HANDLE) 0xf00baa)

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

◆ ACTCTX_MAGIC

#define ACTCTX_MAGIC   0xC07E3E11

Definition at line 59 of file actctx.c.

◆ ACTCTX_MAGIC_MARKER

#define ACTCTX_MAGIC_MARKER   (PVOID)'gMcA'

Definition at line 63 of file actctx.c.

◆ CREATEPROCESS_MANIFEST_RESOURCE_ID

#define CREATEPROCESS_MANIFEST_RESOURCE_ID   ((ULONG_PTR)1)

Definition at line 70 of file actctx.c.

◆ GUIDSECTION_MAGIC

#define GUIDSECTION_MAGIC   0x64487347 /* dHsG */

Definition at line 61 of file actctx.c.

◆ MAX_NAMESPACES

#define MAX_NAMESPACES   64

Definition at line 109 of file actctx.c.

◆ RT_MANIFEST

#define RT_MANIFEST   ((ULONG_PTR)24)

Definition at line 69 of file actctx.c.

◆ STRSECTION_MAGIC

#define STRSECTION_MAGIC   0x64487353 /* dHsS */

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

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

◆ comclass_miscfields

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

Definition at line 247 of file actctx.c.

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

239{
245};
@ 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 543 of file actctx.c.

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

◆ ifaceps_mask

Enumerator
NumMethods 
BaseIface 
NumMethods 
BaseIface 

Definition at line 278 of file actctx.c.

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

◆ tagLIBFLAGS

Enumerator
LIBFLAG_FRESTRICTED 
LIBFLAG_FCONTROL 
LIBFLAG_FHIDDEN 
LIBFLAG_FHASDISKIMAGE 

Definition at line 74 of file actctx.c.

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

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

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

Function Documentation

◆ actctx_addref()

static void actctx_addref ( ACTIVATION_CONTEXT actctx)
inlinestatic

Definition at line 1281 of file actctx.c.

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

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

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

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

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

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

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

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

Referenced by parse_dependent_assembly_elem().

◆ add_dll_redirect()

static struct dll_redirect * add_dll_redirect ( struct assembly assembly)
static

Definition at line 966 of file actctx.c.

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

Referenced by parse_file_elem().

◆ add_entity()

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

Definition at line 1020 of file actctx.c.

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

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

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

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

1212{
1213 WCHAR *p = buffer;
1214
1215 if (!str) return;
1216 wcscat( buffer, prefix );
1217 p += wcslen(p);
1218 *p++ = '"';
1219 wcscpy( p, str );
1220 p += wcslen(p);
1221 *p++ = '"';
1222 *p = 0;
1223}
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 1180 of file actctx.c.

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

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

Referenced by RtlQueryInformationActivationContext().

◆ build_clr_surrogate_section()

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

Definition at line 4669 of file actctx.c.

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

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

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

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

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

Referenced by find_cominterface_redirection().

◆ build_progid_section()

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

Definition at line 4932 of file actctx.c.

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

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

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

Referenced by find_window_class().

◆ check_actctx()

static ACTIVATION_CONTEXT * check_actctx ( HANDLE  h)
static

Definition at line 1259 of file actctx.c.

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

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

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

Referenced by parse_com_class_progid().

◆ debugstr_version()

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

Definition at line 906 of file actctx.c.

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

◆ debugstr_xmlstr()

static const char * debugstr_xmlstr ( const xmlstr_t str)
inlinestatic

Definition at line 901 of file actctx.c.

902{
903 return debugstr_wn(str->ptr, str->len);
904}
#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 5130 of file actctx.c.

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

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

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

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

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

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

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

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

5098{
5100
5101 switch (section_kind)
5102 {
5103 case ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION:
5105 break;
5106 case ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION:
5108 break;
5109 case ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION:
5111 break;
5112 case ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES:
5114 break;
5115 default:
5116 WARN("Unknown section_kind %x\n", section_kind);
5118 }
5119
5120 if (status != STATUS_SUCCESS) return status;
5121
5122 if (flags & FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX)
5123 {
5125 data->hActCtx = actctx;
5126 }
5127 return STATUS_SUCCESS;
5128}
#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:4631
static void actctx_addref(ACTIVATION_CONTEXT *actctx)
Definition: actctx.c:1281
static NTSTATUS find_comserver_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4418
static NTSTATUS find_clr_surrogate(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4785
static NTSTATUS find_tlib_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4067

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

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

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

Referenced by find_string().

◆ find_query_actctx()

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

Definition at line 3491 of file actctx.c.

3492{
3494
3496 {
3497 if (*handle) return STATUS_INVALID_PARAMETER;
3498
3499 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
3500 *handle = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext;
3501 }
3503 {
3506
3507 if (!*handle) return STATUS_INVALID_PARAMETER;
3508
3510 if (!LdrFindEntryForAddress( *handle, &pldr ))
3511 {
3514 else
3516 }
3519 }
3520 else if (!*handle && (class != ActivationContextBasicInformation))
3522
3523 return status;
3524}
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 5056 of file actctx.c.

5059{
5061
5062 switch (section_kind)
5063 {
5064#ifdef __REACTOS__
5065 case ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION:
5066 DPRINT1("Unsupported yet section_kind %x\n", section_kind);
5068#endif // __REACTOS__
5069 case ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION:
5070 status = find_dll_redirection(actctx, section_name, data);
5071 break;
5072 case ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION:
5073 status = find_window_class(actctx, section_name, data);
5074 break;
5075 case ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION:
5076 status = find_progid_redirection(actctx, section_name, data);
5077 break;
5078 case ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE:
5079 FIXME("Unsupported yet section_kind %x\n", section_kind);
5081 default:
5082 WARN("Unknown section_kind %x\n", section_kind);
5084 }
5085
5086 if (status != STATUS_SUCCESS) return status;
5087
5088 if (data && (flags & FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX))
5089 {
5091 data->hActCtx = actctx;
5092 }
5093 return STATUS_SUCCESS;
5094}
#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:5003
static NTSTATUS find_window_class(ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:3866
static NTSTATUS find_dll_redirection(ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
Definition: actctx.c:3673

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

3617{
3618 struct string_index *iter, *index = NULL;
3620 ULONG hash = 0, i;
3621
3622 DPRINT("section %p, name %wZ\n", section, name);
3624 iter = (struct string_index*)((BYTE*)section + section->index_offset);
3625
3626 for (i = 0; i < section->count; i++)
3627 {
3628 DPRINT("iter->hash 0x%x ?= 0x%x\n", iter->hash, hash);
3629 DPRINT("iter->name %S\n", (WCHAR*)((BYTE*)section + iter->name_offset));
3630 if (iter->hash == hash)
3631 {
3632 str.Buffer = (WCHAR *)((BYTE *)section + iter->name_offset);
3633 str.Length = iter->name_len;
3635 {
3636 index = iter;
3637 break;
3638 }
3639 else
3640 WARN("hash collision 0x%08x, %wZ, %wZ\n", hash, name, &str);
3641 }
3642 iter++;
3643 }
3644
3645 return index;
3646}
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 4067 of file actctx.c.

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

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

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

Referenced by find_string().

◆ find_xmlns()

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

Definition at line 1363 of file actctx.c.

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

Referenced by next_xml_elem().

◆ free_assembly_identity()

static void free_assembly_identity ( struct assembly_identity ai)
static

Definition at line 1011 of file actctx.c.

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

Referenced by actctx_release(), and free_depend_manifests().

◆ free_depend_manifests()

static void free_depend_manifests ( struct actctx_loader acl)
static

Definition at line 1172 of file actctx.c.

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

Referenced by RtlCreateActivationContext().

◆ free_entity_array()

static void free_entity_array ( struct entity_array array)
static

Definition at line 1048 of file actctx.c.

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

Referenced by actctx_release().

◆ generate_uuid()

static void generate_uuid ( ULONG seed,
GUID guid 
)
static

Definition at line 4106 of file actctx.c.

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

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

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

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

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

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

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

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

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

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

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

3174{
3175 static const WCHAR fmtW[] = { '.','%','l','u',0 };
3176 WCHAR *buffer;
3179 HANDLE file;
3181
3182 if (!((ULONG_PTR)resname >> 16)) resid = (ULONG_PTR)resname & 0xffff;
3183
3184 TRACE( "looking for manifest associated with %S id %lu\n", filename, resid );
3185
3186 if (module) /* use the module filename */
3187 {
3189
3190 if (!(status = get_module_filename( module, &name, sizeof(dotManifestW) + 10*sizeof(WCHAR) )))
3191 {
3192 if (resid != 1) swprintf( name.Buffer + wcslen(name.Buffer), 10, fmtW, resid );
3193 wcscat( name.Buffer, dotManifestW );
3194 if (!RtlDosPathNameToNtPathName_U( name.Buffer, &nameW, NULL, NULL ))
3197 }
3198 if (status) return status;
3199 }
3200 else
3201 {
3203 (wcslen(filename) + 10) * sizeof(WCHAR) + sizeof(dotManifestW) )))
3204 return STATUS_NO_MEMORY;
3206 if (resid != 1) swprintf( buffer + wcslen(buffer), 10, fmtW, resid );
3209 }
3210
3211 if (!open_nt_file( &file, &nameW ))
3212 {
3214 NtClose( file );
3215 }
3218 return status;
3219}
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:2936
static const WCHAR dotManifestW[]
Definition: actctx.c:827
static NTSTATUS get_module_filename(HMODULE module, UNICODE_STRING *str, unsigned int extra_len)
Definition: actctx.c:912
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:3128
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 3128 of file actctx.c.

3130{
3138 SIZE_T count;
3139 void *base;
3140
3141 TRACE( "loading manifest file %S\n", filename );
3142
3143 attr.Length = sizeof(attr);
3144 attr.RootDirectory = 0;
3145 attr.ObjectName = NULL;
3146 attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF;
3147 attr.SecurityDescriptor = NULL;
3148 attr.SecurityQualityOfService = NULL;
3149
3150 size.QuadPart = 0;
3153 if (status != STATUS_SUCCESS) return status;
3154
3155 offset.QuadPart = 0;
3156 count = 0;
3157 base = NULL;
3160 NtClose( mapping );
3161 if (status != STATUS_SUCCESS) return status;
3162
3164 if (status == STATUS_SUCCESS)
3165 status = parse_manifest(acl, ai, filename, NULL, directory, shared, base, info.EndOfFile.QuadPart);
3166
3168 return status;
3169}
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:2857
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 2950 of file actctx.c.

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

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

913{
917
920 if (status == STATUS_SUCCESS)
921 {
922 if ((str->Buffer = RtlAllocateHeap( GetProcessHeap(), 0,
923 pldr->FullDllName.Length + extra_len + sizeof(WCHAR) )))
924 {
925 memcpy( str->Buffer, pldr->FullDllName.Buffer, pldr->FullDllName.Length + sizeof(WCHAR) );
926 str->Length = pldr->FullDllName.Length;
927 str->MaximumLength = pldr->FullDllName.Length + extra_len + sizeof(WCHAR);
928 }
930 }
932 return status;
933}
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 1690 of file actctx.c.

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

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

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

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

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

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

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

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

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

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

Referenced by find_window_class().

◆ get_wndclass_first_index()

static struct string_index * get_wndclass_first_index ( ACTIVATION_CONTEXT actctx)
inlinestatic

Definition at line 3718 of file actctx.c.

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

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

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

Referenced by add_dependent_assembly_id().

◆ is_matching_string()

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

Definition at line 1097 of file actctx.c.

1098{
1099 if (!str1) return !str2;
1100 return str2 && !RtlCompareUnicodeStrings( str1, wcslen(str1), str2, wcslen(str2), TRUE );
1101}
_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 1334 of file actctx.c.

1335{
1336 const int len = wcslen( xmlnsW );
1337 if (attr->name.len < len) return FALSE;
1338 if (wcsncmp( attr->name.ptr, xmlnsW, len )) return FALSE;
1339 return (attr->name.len == len || attr->name.ptr[len] == ':');
1340}
static const WCHAR xmlnsW[]
Definition: actctx.c:723
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 895 of file actctx.c.

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

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

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

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

Referenced by lookup_winsxs().

◆ lookup_winsxs()

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

Definition at line 3303 of file actctx.c.

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

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

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

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

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

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

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

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

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

2593{
2594 struct xml_elem elem;
2595
2596 while (next_xml_elem( xmlbuf, &elem, parent ))
2597 {
2599 {
2600 parse_windows_settings_elem( xmlbuf, assembly, acl, &elem );
2601 }
2602 else
2603 {
2604 parse_unknown_elem( xmlbuf, &elem );
2605 }
2606 }
2607}
static const WCHAR asmv3W[]
Definition: actctx.c:629
static const WCHAR windowsSettingsW[]
Definition: actctx.c:776
static BOOL next_xml_elem(xmlbuf_t *xmlbuf, struct xml_elem *elem, const struct xml_elem *parent)
Definition: actctx.c:1466
static void parse_windows_settings_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2563
static void parse_unknown_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:1620
static BOOL xml_elem_cmp(const struct xml_elem *elem, const WCHAR *str, const WCHAR *namespace)
Definition: actctx.c:879

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

2712{
2713 struct xml_elem elem;
2714 struct xml_attr attr;
2715 BOOL end = FALSE, version = FALSE;
2716
2717 while (next_xml_attr(xmlbuf, &attr, &end))
2718 {
2720 {
2721 static const WCHAR v10W[] = {'1','.','0',0};
2722 if (!xmlstr_cmp(&attr.value, v10W))
2723 {
2724 break;
2725 }
2726 version = TRUE;
2727 }
2728 }
2729
2730 if (end || !version)
2731 {
2732 set_error( xmlbuf );
2733 return;
2734 }
2735
2736 while (next_xml_elem(xmlbuf, &elem, parent))
2737 {
2739 {
2740 parse_noinherit_elem(xmlbuf, &elem);
2742 }
2744 {
2746 }
2747 else if (xml_elem_cmp(&elem, descriptionW, asmv1W))
2748 {
2749 parse_description_elem(xmlbuf, &elem);
2750 }
2752 {
2754 }
2755 else if (xml_elem_cmp(&elem, dependencyW, asmv1W))
2756 {
2757 parse_dependency_elem(xmlbuf, acl, &elem);
2758 }
2759 else if (xml_elem_cmp(&elem, fileW, asmv1W))
2760 {
2761 parse_file_elem(xmlbuf, assembly, acl, &elem);
2762 }
2763 else if (xml_elem_cmp(&elem, clrClassW, asmv1W))
2764 {
2765 parse_clr_class_elem(xmlbuf, assembly, acl, &elem);
2766 }
2768 {
2769 parse_clr_surrogate_elem(xmlbuf, assembly, acl, &elem);
2770 }
2771 else if (xml_elem_cmp(&elem, trustInfoW, asmv1W))
2772 {
2773 parse_trust_info_elem(xmlbuf, assembly, acl, &elem);
2774 }
2776 {
2778
2779 if (!xmlbuf->error && expected_ai)
2780 {
2781 /* FIXME: more tests */
2783 memcmp(&assembly->id.version, &expected_ai->version, sizeof(assembly->id.version)))
2784 {
2785 set_error( xmlbuf );
2786 }
2787 else if (assembly->type == ASSEMBLY_SHARED_MANIFEST &&
2788 (assembly->id.version.major != expected_ai->version.major ||
2789 assembly->id.version.minor != expected_ai->version.minor ||
2790 assembly->id.version.build < expected_ai->version.build ||
2791 (assembly->id.version.build == expected_ai->version.build &&
2792 assembly->id.version.revision < expected_ai->version.revision)))
2793 {
2794 set_error( xmlbuf );
2795 }
2796 }
2797 }
2799 {
2800 parse_compatibility_elem(xmlbuf, assembly, acl, &elem);
2801 }
2802 else if (xml_elem_cmp(&elem, applicationW, asmv3W))
2803 {
2804 parse_application_elem(xmlbuf, assembly, acl, &elem);
2805 }
2806 else
2807 {
2808 parse_unknown_elem(xmlbuf, &elem);
2809 }
2810 }
2811
2814 {
2815 set_error( xmlbuf );
2816 }
2817}
static void parse_noinheritable_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2386
static const WCHAR fileW[]
Definition: actctx.c:698
static const WCHAR trustInfoW[]
Definition: actctx.c:775
static const WCHAR noInheritW[]
Definition: actctx.c:700
static const WCHAR clrSurrogateW[]
Definition: actctx.c:691
static void parse_noinherit_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2378
static const WCHAR applicationW[]
Definition: actctx.c:769
static const WCHAR comInterfaceExternalProxyStubW[]
Definition: actctx.c:693
static const WCHAR assemblyIdentityW[]
Definition: actctx.c:688
static const WCHAR compatibilityW[]
Definition: actctx.c:767
static const WCHAR asmv1W[]
Definition: actctx.c:627
static void parse_file_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2394
static void parse_description_elem(xmlbuf_t *xmlbuf, const struct xml_elem *parent)
Definition: actctx.c:2139
static void parse_application_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2591
static const WCHAR manifestVersionW[]
Definition: actctx.c:710
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:2157
static const WCHAR dependencyW[]
Definition: actctx.c:695
static BOOL xml_attr_cmp(const struct xml_attr *attr, const WCHAR *str)
Definition: actctx.c:866
static const WCHAR noInheritableW[]
Definition: actctx.c:701
static BOOL xmlstr_cmp(const xmlstr_t *xmlstr, const WCHAR *str)
Definition: actctx.c:856
static const WCHAR clrClassW[]
Definition: actctx.c:690
static void parse_assembly_identity_elem(xmlbuf_t *xmlbuf, ACTIVATION_CONTEXT *actctx, struct assembly_identity *ai, const struct xml_elem *parent)
Definition: actctx.c:1633
static void parse_clr_class_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2206
static void parse_compatibility_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2512
static void parse_clr_surrogate_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2270
static void parse_trust_info_elem(xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2691
static void parse_dependency_elem(xmlbuf_t *xmlbuf, struct actctx_loader *acl, const struct xml_elem *parent)
Definition: actctx.c:2349
static const WCHAR compatibilityNSW[]
Definition: actctx.c:768
static const WCHAR descriptionW[]
Definition: actctx.c:697
BOOL no_inherit
Definition: actctx.c:532

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

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

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

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

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

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

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

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

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

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

Referenced by parse_file_elem().

◆ parse_com_class_misc()

static DWORD parse_com_class_misc ( const xmlstr_t value)
static

Definition at line 1717 of file actctx.c.

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

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

1765{
1767 BOOL end = FALSE;
1768
1769 parse_expect_no_attr(xmlbuf, &end);
1770 if (end) set_error( xmlbuf );
1771 if (!parse_text_content(xmlbuf, &content)) return;
1772
1773 if (!com_class_add_progid(&content, entity)) set_error( xmlbuf );
1775}
content
Definition: atl_ax.c:994
static BOOL parse_text_content(xmlbuf_t *xmlbuf, xmlstr_t *content)
Definition: actctx.c:1551
static void parse_expect_no_attr(xmlbuf_t *xmlbuf, BOOL *end)
Definition: actctx.c:1598
static BOOL com_class_add_progid(const xmlstr_t *progid, struct entity *entity)
Definition: actctx.c:1739

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

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

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

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

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

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

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

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

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

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

Referenced by parse_assembly_elem().

◆ parse_depend_manifests()

static NTSTATUS parse_depend_manifests ( struct actctx_loader acl)
static

Definition at line 3466 of file actctx.c.

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

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

2352{
2353 struct xml_elem elem;
2354 struct xml_attr attr;
2356
2357 while (next_xml_attr(xmlbuf, &attr, &end))
2358 {
2360 {
2362 }
2363 }
2364
2365 while (next_xml_elem(xmlbuf, &elem, parent))
2366 {
2368 {
2370 }
2371 else
2372 {
2373 parse_unknown_elem(xmlbuf, &elem);
2374 }
2375 }
2376}
@ optional
Definition: SystemMenu.c:34
static const WCHAR yesW[]
Definition: actctx.c:725
static const WCHAR optionalW[]
Definition: actctx.c:715
static BOOL xmlstr_cmpi(const xmlstr_t *xmlstr, const WCHAR *str)
Definition: actctx.c:861
static void parse_dependent_assembly_elem(xmlbuf_t *xmlbuf, struct actctx_loader *acl, const struct xml_elem *parent, BOOL optional)
Definition: actctx.c:2303
static const WCHAR dependentAssemblyW[]
Definition: actctx.c:696

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

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

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

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

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

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

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

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

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

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

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

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

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

2821{
2822 struct xml_elem elem;
2823 struct xml_elem parent = {0};
2824
2825 xmlbuf->error = FALSE;
2826 xmlbuf->ns_pos = 0;
2827
2828 if (!next_xml_elem(xmlbuf, &elem, &parent)) return STATUS_SXS_CANT_GEN_ACTCTX;
2829
2830 if (xmlstr_cmp(&elem.name, g_xmlW) &&
2831 (!parse_xml_header(xmlbuf) || !next_xml_elem(xmlbuf, &elem, &parent)))
2833
2835 {
2837 }
2838
2839 parse_assembly_elem(xmlbuf, assembly, acl, &elem, ai);
2840 if (xmlbuf->error)
2841 {
2843 }
2844
2845 if (next_xml_elem(xmlbuf, &elem, &parent))
2846 {
2848 }
2849
2850 if (xmlbuf->ptr != xmlbuf->end)
2851 {
2853 }
2854 return STATUS_SUCCESS;
2855}
static const WCHAR assemblyW[]
Definition: actctx.c:687
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:2709
static const WCHAR g_xmlW[]
Definition: actctx.c:825
static BOOL parse_xml_header(xmlbuf_t *xmlbuf)
Definition: actctx.c:1535

Referenced by parse_manifest().

◆ parse_noinherit_elem()

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

Definition at line 2378 of file actctx.c.

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

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

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

Referenced by parse_assembly_elem().

◆ parse_nummethods()

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

Definition at line 1857 of file actctx.c.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Referenced by parse_file_elem().

◆ parse_typelib_flags()

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

Definition at line 1963 of file actctx.c.

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

Referenced by parse_typelib_elem().

◆ parse_typelib_version()

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

Definition at line 1999 of file actctx.c.

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

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

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

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

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

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

Referenced by parse_application_elem().

◆ parse_xml_header()

static BOOL parse_xml_header ( xmlbuf_t xmlbuf)
static

Definition at line 1535 of file actctx.c.

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

Referenced by parse_manifest_buffer().

◆ push_xmlns()

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

Definition at line 1342 of file actctx.c.

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

Referenced by next_xml_elem().

◆ read_xml_elem()

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

Definition at line 1446 of file actctx.c.

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

Referenced by next_xml_elem().

◆ RtlActivateActivationContext()

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

Definition at line 5443 of file actctx.c.

5444{
5446}
NTSTATUS WINAPI RtlActivateActivationContextEx(ULONG flags, TEB *teb, HANDLE handle, ULONG_PTR *cookie)
Definition: actctx.c:5451
Definition: cookie.c:34

◆ RtlActivateActivationContextEx()

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

Definition at line 5451 of file actctx.c.

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

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

◆ RtlDeactivateActivationContext()

NTSTATUS WINAPI RtlDeactivateActivationContext ( ULONG  flags,
ULONG_PTR  cookie 
)

Definition at line 5477 of file actctx.c.

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

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

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

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

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

◆ RtlFreeThreadActivationContextStack()

void WINAPI RtlFreeThreadActivationContextStack ( void  )

Definition at line 5549 of file actctx.c.

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

Referenced by LdrShutdownThread().

◆ RtlGetActiveActivationContext()

NTSTATUS WINAPI RtlGetActiveActivationContext ( HANDLE handle)

Definition at line 5573 of file actctx.c.

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

Referenced by GetCurrentActCtx(), and LdrpWalkImportDescriptor().

◆ RtlIsActivationContextActive()

BOOLEAN WINAPI RtlIsActivationContextActive ( HANDLE  handle)

Definition at line 5590 of file actctx.c.

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

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

6002{
6004 const WCHAR *res;
6005
6006 if (flags)
6007 {
6008 WARN( "unknown flags %08x\n", flags );
6010 }
6011
6012 if (ns)
6013 {
6019 }
6021
6024
6026
6027 if (written) *written = wcslen(res) + 1;
6028 if (size < wcslen(res)) return STATUS_BUFFER_TOO_SMALL;
6029 wcscpy( buffer, res );
6030 return STATUS_SUCCESS;
6031}
GLuint res
Definition: glext.h:9613
static const WCHAR * find_app_settings(ACTIVATION_CONTEXT *actctx, const WCHAR *settings, const WCHAR *ns)
Definition: actctx.c:5130
#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 5606 of file actctx.c.

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

5431{
5432 FIXME("%p: stub\n", handle);
5433
5435 return STATUS_SUCCESS;
5436
5438}
#define ACTCTX_FAKE_HANDLE
Definition: actctx.c:65

Referenced by ZombifyActCtx().

◆ set_error()

◆ strdupW()

static WCHAR * strdupW ( const WCHAR str)
static

Definition at line 835 of file actctx.c.

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

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

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

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

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

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

Referenced by next_xml_elem().

◆ xmlstr_cmp()

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

Definition at line 856 of file actctx.c.

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

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

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

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

◆ alignableW

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

Definition at line 747 of file actctx.c.

◆ alwaysrunW

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

Definition at line 748 of file actctx.c.

◆ applicationW

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

Definition at line 769 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 628 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 629 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 688 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 687 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 777 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 689 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 749 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 750 of file actctx.c.

◆ clrClassW

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

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

Referenced by parse_assembly_elem().

◆ clsidW

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

Definition at line 705 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 692 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 693 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 694 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 767 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 624 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 695 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 696 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 697 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 778 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 779 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 827 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 785 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 784 of file actctx.c.

Referenced by parse_windows_settings_elem().

◆ empty_xmlstr

const xmlstr_t empty_xmlstr
static

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

Referenced by parse_assembly_elem().

◆ flagsW

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

Definition at line 731 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 825 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 786 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 730 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 706 of file actctx.c.

Referenced by parse_file_elem().

◆ hashW

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

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

Referenced by parse_typelib_elem().

◆ hiddenW

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

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

Referenced by parse_windows_settings_elem().

◆ IdW

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

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

◆ insideoutW

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

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

◆ languageW

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

Definition at line 709 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 788 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 789 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 710 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 734 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 736 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 733 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 735 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 732 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 712 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 713 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 701 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 700 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 757 of file actctx.c.

◆ noW

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

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

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

◆ optionalW

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

Definition at line 715 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 790 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 716 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 717 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 718 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 759 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 760 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 772 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 773 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 727 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 740 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 774 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 761 of file actctx.c.

◆ simpleframeW

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

Definition at line 762 of file actctx.c.

◆ staticW

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

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

◆ system_actctx

ACTIVATION_CONTEXT_WRAPPED system_actctx = { ACTCTX_MAGIC_MARKER, { 1 } }
static

Definition at line 831 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 775 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 721 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 791 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 828 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 724 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 722 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 765 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 703 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 776 of file actctx.c.

Referenced by parse_application_elem().

◆ xmlnsW

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

Definition at line 723 of file actctx.c.

Referenced by is_xmlns_attr(), and push_xmlns().

◆ yesW

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

Definition at line 725 of file actctx.c.

Referenced by parse_dependency_elem(), and parse_window_class_elem().