ReactOS 0.4.16-dev-455-g37b0646
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_FAKE_HANDLE   ((HANDLE) 0xf00baa)
 
#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
 

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_xml_elem (const struct xml_elem *elem)
 
static const chardebugstr_xml_attr (const struct xml_attr *attr)
 
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 (void)
 
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 system_actctx = { ACTCTX_MAGIC, 1 }
 
static ACTIVATION_CONTEXTprocess_actctx = &system_actctx
 
static ACTIVATION_CONTEXTimplicit_actctx = &system_actctx
 

Macro Definition Documentation

◆ ACTCTX_FAKE_HANDLE

#define ACTCTX_FAKE_HANDLE   ((HANDLE) 0xf00baa)

Definition at line 63 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.

◆ CREATEPROCESS_MANIFEST_RESOURCE_ID

#define CREATEPROCESS_MANIFEST_RESOURCE_ID   ((ULONG_PTR)1)

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

◆ RT_MANIFEST

#define RT_MANIFEST   ((ULONG_PTR)24)

Definition at line 66 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

Enumeration Type Documentation

◆ assembly_type

Enumerator
APPLICATION_MANIFEST 
ASSEMBLY_MANIFEST 
ASSEMBLY_SHARED_MANIFEST 

Definition at line 516 of file actctx.c.

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

◆ comclass_miscfields

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

Definition at line 244 of file actctx.c.

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

236{
242};
@ 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 540 of file actctx.c.

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

◆ ifaceps_mask

Enumerator
NumMethods 
BaseIface 
NumMethods 
BaseIface 

Definition at line 275 of file actctx.c.

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

◆ tagLIBFLAGS

Enumerator
LIBFLAG_FRESTRICTED 
LIBFLAG_FCONTROL 
LIBFLAG_FHIDDEN 
LIBFLAG_FHASDISKIMAGE 

Definition at line 71 of file actctx.c.

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

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

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

Function Documentation

◆ actctx_addref()

static void actctx_addref ( ACTIVATION_CONTEXT actctx)
inlinestatic

Definition at line 1224 of file actctx.c.

1225{
1226 InterlockedIncrement( &actctx->ref_count );
1227}
#define InterlockedIncrement
Definition: armddk.h:53
#define actctx
Definition: kernel32.h:8

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

◆ actctx_init()

void actctx_init ( void  )

Definition at line 5194 of file actctx.c.

5195{
5196 ACTCTXW ctx;
5197 HANDLE handle;
5198
5199 ctx.cbSize = sizeof(ctx);
5200 ctx.lpSource = NULL;
5201 ctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
5202 ctx.hModule = NtCurrentTeb()->ProcessEnvironmentBlock->ImageBaseAddress;
5204
5206 {
5208 }
5209
5210#ifdef __REACTOS__
5211 NtCurrentTeb()->ProcessEnvironmentBlock->ActivationContextData = process_actctx->ActivationContextData;
5212#else
5213 NtCurrentTeb()->Peb->ActivationContextData = process_actctx;
5214#endif // __REACTOS__
5215}
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE *, const void *)
#define NtCurrentTeb
static ACTIVATION_CONTEXT * process_actctx
Definition: actctx.c:770
#define CREATEPROCESS_MANIFEST_RESOURCE_ID
Definition: actctx.c:67
static ACTIVATION_CONTEXT * check_actctx(HANDLE h)
Definition: actctx.c:1207
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ actctx_release()

static void actctx_release ( ACTIVATION_CONTEXT actctx)
static

Definition at line 1229 of file actctx.c.

1230{
1231 if (!InterlockedDecrement( &actctx->ref_count ))
1232 {
1233 unsigned int i, j;
1234
1235 for (i = 0; i < actctx->num_assemblies; i++)
1236 {
1237 struct assembly *assembly = &actctx->assemblies[i];
1238 for (j = 0; j < assembly->num_dlls; j++)
1239 {
1240 struct dll_redirect *dll = &assembly->dlls[j];
1241 free_entity_array( &dll->entities );
1242 RtlFreeHeap( GetProcessHeap(), 0, dll->name );
1243 RtlFreeHeap( GetProcessHeap(), 0, dll->hash );
1244 }
1251 }
1252 RtlFreeHeap( GetProcessHeap(), 0, actctx->config.info );
1253 RtlFreeHeap( GetProcessHeap(), 0, actctx->appdir.info );
1254 RtlFreeHeap( GetProcessHeap(), 0, actctx->assemblies );
1255 RtlFreeHeap( GetProcessHeap(), 0, actctx->dllredirect_section );
1256 RtlFreeHeap( GetProcessHeap(), 0, actctx->wndclass_section );
1257 RtlFreeHeap( GetProcessHeap(), 0, actctx->tlib_section );
1258 RtlFreeHeap( GetProcessHeap(), 0, actctx->comserver_section );
1259 RtlFreeHeap( GetProcessHeap(), 0, actctx->ifaceps_section );
1260 RtlFreeHeap( GetProcessHeap(), 0, actctx->clrsurrogate_section );
1261 RtlFreeHeap( GetProcessHeap(), 0, actctx->progid_section );
1262 actctx->magic = 0;
1264 }
1265}
#define InterlockedDecrement
Definition: armddk.h:52
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:996
static void free_assembly_identity(struct assembly_identity *ai)
Definition: actctx.c:959
WCHAR * directory
Definition: actctx.c:528
struct dll_redirect * dlls
Definition: actctx.c:530
struct assembly_identity id
Definition: actctx.c:526
unsigned int num_dlls
Definition: actctx.c:531
struct file_info manifest
Definition: actctx.c:527
struct entity_array entities
Definition: actctx.c:533
COMPATIBILITY_CONTEXT_ELEMENT * compat_contexts
Definition: actctx.c:534

Referenced by RtlCreateActivationContext(), and RtlReleaseActivationContext().

◆ add_assembly()

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

Definition at line 883 of file actctx.c.

884{
885 struct assembly *assembly;
886
887 DPRINT("add_assembly() actctx %p, activeframe ??\n", actctx);
888
889 if (actctx->num_assemblies == actctx->allocated_assemblies)
890 {
891 void *ptr;
892 unsigned int new_count;
893 if (actctx->assemblies)
894 {
895 new_count = actctx->allocated_assemblies * 2;
897 actctx->assemblies, new_count * sizeof(*assembly) );
898 }
899 else
900 {
901 new_count = 4;
902 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*assembly) );
903 }
904 if (!ptr) return NULL;
905 actctx->assemblies = ptr;
906 actctx->allocated_assemblies = new_count;
907 }
908
909 assembly = &actctx->assemblies[actctx->num_assemblies++];
910 assembly->type = at;
911 return assembly;
912}
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 940 of file actctx.c.

941{
942 void *ptr;
944 {
945 unsigned int new_count = assembly->num_compat_contexts + 1;
948 new_count * sizeof(COMPATIBILITY_CONTEXT_ELEMENT) );
949 }
950 else
951 {
952 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(COMPATIBILITY_CONTEXT_ELEMENT) );
953 }
954 if (!ptr) return NULL;
957}
ULONG num_compat_contexts
Definition: actctx.c:535

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

4216{
4217 unsigned int i;
4219
4220 for (i = 0; i < entities->num; i++)
4221 {
4222 struct entity *entity = &entities->base[i];
4223 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4224 {
4225 ULONG module_len, progid_len, str_len = 0, miscmask;
4227 struct guid_index *alias_index;
4228 struct clrclass_data *clrdata;
4230 WCHAR *ptrW;
4231
4232 if (entity->u.comclass.progid)
4233 progid_len = wcslen(entity->u.comclass.progid)*sizeof(WCHAR);
4234 else
4235 progid_len = 0;
4236
4237 module_len = dll ? wcslen(dll->name)*sizeof(WCHAR) : wcslen(mscoreeW)*sizeof(WCHAR);
4238
4239 /* setup new index entry */
4241 Status = RtlGUIDFromString(&str, &(*index)->guid);
4242 if (!NT_SUCCESS(Status))
4243 return Status;
4244
4245 (*index)->data_offset = *data_offset;
4246 (*index)->data_len = sizeof(*data); /* additional length added later */
4247 (*index)->rosterindex = rosterindex;
4248
4249 /* Setup new index entry for alias guid. Alias index records are placed after
4250 normal records, so normal guids are hit first on search. Note that class count
4251 is doubled. */
4252 alias_index = (*index) + section->count/2;
4253 generate_uuid(seed, &alias_index->guid);
4254 alias_index->data_offset = (*index)->data_offset;
4255 alias_index->data_len = 0;
4256 alias_index->rosterindex = (*index)->rosterindex;
4257
4258 /* setup data */
4259 data = (struct comclassredirect_data*)((BYTE*)section + (*index)->data_offset);
4260 data->size = sizeof(*data);
4261 data->model = entity->u.comclass.model;
4262 data->clsid = (*index)->guid;
4263 data->alias = alias_index->guid;
4264 data->clsid2 = data->clsid;
4265 if (entity->u.comclass.tlbid)
4266 {
4268 Status = RtlGUIDFromString(&str, &data->tlbid);
4269 if (!NT_SUCCESS(Status))
4270 return Status;
4271 }
4272 else
4273 memset(&data->tlbid, 0, sizeof(data->tlbid));
4274 data->name_len = module_len;
4275 data->name_offset = *module_offset;
4276 data->progid_len = progid_len;
4277 data->progid_offset = data->progid_len ? data->size : 0; /* in case of clrClass additional offset is added later */
4278 data->clrdata_len = 0; /* will be set later */
4279 data->clrdata_offset = entity->u.comclass.name ? sizeof(*data) : 0;
4280 data->miscstatus = entity->u.comclass.miscstatus;
4281 data->miscstatuscontent = entity->u.comclass.miscstatuscontent;
4282 data->miscstatusthumbnail = entity->u.comclass.miscstatusthumbnail;
4283 data->miscstatusicon = entity->u.comclass.miscstatusicon;
4284 data->miscstatusdocprint = entity->u.comclass.miscstatusdocprint;
4285
4286 /* mask describes which misc* data is available */
4287 miscmask = 0;
4288 if (data->miscstatus)
4290 if (data->miscstatuscontent)
4292 if (data->miscstatusthumbnail)
4294 if (data->miscstatusicon)
4296 if (data->miscstatusdocprint)
4298 data->flags = miscmask << 8;
4299
4300 if (data->clrdata_offset)
4301 {
4302 clrdata = (struct clrclass_data*)((BYTE*)data + data->clrdata_offset);
4303
4304 clrdata->size = sizeof(*clrdata);
4305 clrdata->res[0] = 0;
4306 clrdata->res[1] = 2; /* FIXME: unknown field */
4307 clrdata->module_len = wcslen(mscoreeW)*sizeof(WCHAR);
4308 clrdata->module_offset = *module_offset + data->name_len + sizeof(WCHAR);
4309 clrdata->name_len = wcslen(entity->u.comclass.name)*sizeof(WCHAR);
4310 clrdata->name_offset = clrdata->size;
4311 clrdata->version_len = entity->u.comclass.version ? wcslen(entity->u.comclass.version)*sizeof(WCHAR) : 0;
4312 clrdata->version_offset = clrdata->version_len ? clrdata->name_offset + clrdata->name_len + sizeof(WCHAR) : 0;
4313 clrdata->res2[0] = 0;
4314 clrdata->res2[1] = 0;
4315
4316 data->clrdata_len = clrdata->size + clrdata->name_len + sizeof(WCHAR);
4317
4318 /* module name */
4319 ptrW = (WCHAR*)((BYTE*)section + clrdata->module_offset);
4320 memcpy(ptrW, mscoree2W, clrdata->module_len);
4321 ptrW[clrdata->module_len/sizeof(WCHAR)] = 0;
4322
4323 ptrW = (WCHAR*)((BYTE*)section + data->name_offset);
4324 memcpy(ptrW, mscoreeW, data->name_len);
4325 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4326
4327 /* class name */
4328 ptrW = (WCHAR*)((BYTE*)clrdata + clrdata->name_offset);
4329 memcpy(ptrW, entity->u.comclass.name, clrdata->name_len);
4330 ptrW[clrdata->name_len/sizeof(WCHAR)] = 0;
4331
4332 /* runtime version, optional */
4333 if (clrdata->version_len)
4334 {
4335 data->clrdata_len += clrdata->version_len + sizeof(WCHAR);
4336
4337 ptrW = (WCHAR*)((BYTE*)clrdata + clrdata->version_offset);
4338 memcpy(ptrW, entity->u.comclass.version, clrdata->version_len);
4339 ptrW[clrdata->version_len/sizeof(WCHAR)] = 0;
4340 }
4341
4342 if (data->progid_len)
4343 data->progid_offset += data->clrdata_len;
4344 (*index)->data_len += sizeof(*clrdata);
4345 }
4346 else
4347 {
4348 clrdata = NULL;
4349
4350 /* module name */
4351 ptrW = (WCHAR*)((BYTE*)section + data->name_offset);
4352 memcpy(ptrW, dll->name, data->name_len);
4353 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4354 }
4355
4356 /* progid string */
4357 if (data->progid_len)
4358 {
4359 ptrW = (WCHAR*)((BYTE*)data + data->progid_offset);
4360 memcpy(ptrW, entity->u.comclass.progid, data->progid_len);
4361 ptrW[data->progid_len/sizeof(WCHAR)] = 0;
4362 }
4363
4364 /* string block length */
4365 str_len = 0;
4366 if (clrdata)
4367 {
4368 str_len += clrdata->name_len + sizeof(WCHAR);
4369 if (clrdata->version_len)
4370 str_len += clrdata->version_len + sizeof(WCHAR);
4371 }
4372 if (progid_len)
4373 str_len += progid_len + sizeof(WCHAR);
4374
4375 (*index)->data_len += aligned_string_len(str_len);
4376 alias_index->data_len = (*index)->data_len;
4377
4378 /* move to next data record */
4379 (*data_offset) += sizeof(*data) + aligned_string_len(str_len);
4380 (*module_offset) += module_len + sizeof(WCHAR);
4381
4382 if (clrdata)
4383 {
4384 (*data_offset) += sizeof(*clrdata);
4385 (*module_offset) += clrdata->module_len + sizeof(WCHAR);
4386 }
4387 (*index) += 1;
4388 }
4389 }
4390
4391 return STATUS_SUCCESS;
4392}
LONG NTSTATUS
Definition: precomp.h:26
Status
Definition: gdiplustypes.h:25
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:2022
static const WCHAR mscoree2W[]
Definition: actctx.c:680
static void generate_uuid(ULONG *seed, GUID *guid)
Definition: actctx.c:4150
static const WCHAR mscoreeW[]
Definition: actctx.c:679
#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:505
struct entity * base
Definition: actctx.c:504
Definition: actctx.c:446
union entity::@4977 u
DWORD kind
Definition: actctx.c:447
struct entity::@4977::@4979 comclass
GUID guid
Definition: actctx.c:1083
ULONG rosterindex
Definition: actctx.c:1086
ULONG data_offset
Definition: actctx.c:1084
ULONG data_len
Definition: actctx.c:1085
Definition: parser.c:56
#define str_len
Definition: treelist.c:89
uint32_t ULONG
Definition: typedefs.h:59
__wchar_t WCHAR
Definition: xmlstorage.h:180
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 1071 of file actctx.c.

1073{
1074 unsigned int i;
1075
1076 /* check if we already have that assembly */
1077
1078 for (i = 0; i < acl->actctx->num_assemblies; i++)
1079 if (is_matching_identity( ai, &acl->actctx->assemblies[i].id ))
1080 {
1081 TRACE( "reusing existing assembly for %s arch %s version %u.%u.%u.%u\n",
1082 debugstr_w(ai->name), debugstr_w(ai->arch), ai->version.major, ai->version.minor,
1083 ai->version.build, ai->version.revision );
1084 return TRUE;
1085 }
1086
1087 for (i = 0; i < acl->num_dependencies; i++)
1088 if (is_matching_identity( ai, &acl->dependencies[i] ))
1089 {
1090 TRACE( "reusing existing dependency for %s arch %s version %u.%u.%u.%u\n",
1091 debugstr_w(ai->name), debugstr_w(ai->arch), ai->version.major, ai->version.minor,
1092 ai->version.build, ai->version.revision );
1093 return TRUE;
1094 }
1095
1097 {
1098 void *ptr;
1099 unsigned int new_count;
1100 if (acl->dependencies)
1101 {
1102 new_count = acl->allocated_dependencies * 2;
1104 new_count * sizeof(acl->dependencies[0]));
1105 }
1106 else
1107 {
1108 new_count = 4;
1109 ptr = RtlAllocateHeap(GetProcessHeap(), 0, new_count * sizeof(acl->dependencies[0]));
1110 }
1111 if (!ptr) return FALSE;
1112 acl->dependencies = ptr;
1113 acl->allocated_dependencies = new_count;
1114 }
1115 acl->dependencies[acl->num_dependencies++] = *ai;
1116
1117 return TRUE;
1118}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define debugstr_w
Definition: kernel32.h:32
static BOOL is_matching_identity(const struct assembly_identity *id1, const struct assembly_identity *id2)
Definition: actctx.c:1051
#define TRACE(s)
Definition: solgame.cpp:4
struct assembly * assemblies
Definition: actctx.c:586
unsigned int num_assemblies
Definition: actctx.c:587
unsigned int allocated_dependencies
Definition: actctx.c:605
struct assembly_identity * dependencies
Definition: actctx.c:603
unsigned int num_dependencies
Definition: actctx.c:604
ACTIVATION_CONTEXT * actctx
Definition: actctx.c:602
WCHAR * name
Definition: actctx.c:152
WCHAR * arch
Definition: actctx.c:153
struct assembly_version version
Definition: actctx.c:157

Referenced by parse_dependent_assembly_elem().

◆ add_dll_redirect()

static struct dll_redirect * add_dll_redirect ( struct assembly assembly)
static

Definition at line 914 of file actctx.c.

915{
916 DPRINT("add_dll_redirect() to assembly %p, num_dlls %d\n", assembly, assembly->allocated_dlls);
917
919 {
920 void *ptr;
921 unsigned int new_count;
922 if (assembly->dlls)
923 {
924 new_count = assembly->allocated_dlls * 2;
926 assembly->dlls, new_count * sizeof(*assembly->dlls) );
927 }
928 else
929 {
930 new_count = 4;
931 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*assembly->dlls) );
932 }
933 if (!ptr) return NULL;
934 assembly->dlls = ptr;
935 assembly->allocated_dlls = new_count;
936 }
937 return &assembly->dlls[assembly->num_dlls++];
938}
unsigned int allocated_dlls
Definition: actctx.c:532

Referenced by parse_file_elem().

◆ add_entity()

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

Definition at line 968 of file actctx.c.

969{
970 struct entity* entity;
971
972 if (array->num == array->allocated)
973 {
974 void *ptr;
975 unsigned int new_count;
976 if (array->base)
977 {
978 new_count = array->allocated * 2;
980 array->base, new_count * sizeof(*array->base) );
981 }
982 else
983 {
984 new_count = 4;
985 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*array->base) );
986 }
987 if (!ptr) return NULL;
988 array->base = ptr;
989 array->allocated = new_count;
990 }
991 entity = &array->base[array->num++];
992 entity->kind = kind;
993 return entity;
994}
unsigned num
Definition: undname.c:63

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

4521{
4522 unsigned int i;
4523
4524 for (i = 0; i < entities->num; i++)
4525 {
4526 struct entity *entity = &entities->base[i];
4527 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)
4528 {
4529 struct ifacepsredirect_data *data = (struct ifacepsredirect_data*)((BYTE*)section + *data_offset);
4533
4534 if (entity->u.ifaceps.name)
4535 name_len = wcslen(entity->u.ifaceps.name)*sizeof(WCHAR);
4536 else
4537 name_len = 0;
4538
4539 /* setup index */
4541 Status = RtlGUIDFromString(&str, &(*index)->guid);
4542 if (!NT_SUCCESS(Status))
4543 return Status;
4544 (*index)->data_offset = *data_offset;
4545 (*index)->data_len = sizeof(*data) + name_len ? aligned_string_len(name_len + sizeof(WCHAR)) : 0;
4546 (*index)->rosterindex = rosterindex;
4547
4548 /* setup data record */
4549 data->size = sizeof(*data);
4550 data->mask = entity->u.ifaceps.mask;
4551
4552 /* proxyStubClsid32 value is only stored for external PS,
4553 if set it's used as iid, otherwise 'iid' attribute value is used */
4554 if (entity->u.ifaceps.ps32)
4555 {
4557 Status = RtlGUIDFromString(&str, &data->iid);
4558 if (!NT_SUCCESS(Status))
4559 return Status;
4560 }
4561 else
4562 data->iid = (*index)->guid;
4563
4564 data->nummethods = entity->u.ifaceps.nummethods;
4565
4566 if (entity->u.ifaceps.tlib)
4567 {
4569 Status = RtlGUIDFromString(&str, &data->tlbid);
4570 if (!NT_SUCCESS(Status))
4571 return Status;
4572 }
4573 else
4574 memset(&data->tlbid, 0, sizeof(data->tlbid));
4575
4576 if (entity->u.ifaceps.base)
4577 {
4579 Status = RtlGUIDFromString(&str, &data->base);
4580 if (!NT_SUCCESS(Status))
4581 return Status;
4582 }
4583 else
4584 memset(&data->base, 0, sizeof(data->base));
4585
4586 data->name_len = name_len;
4587 data->name_offset = data->name_len ? sizeof(*data) : 0;
4588
4589 /* name string */
4590 if (data->name_len)
4591 {
4592 WCHAR *ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
4593 memcpy(ptrW, entity->u.ifaceps.name, data->name_len);
4594 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4595 }
4596
4597 /* move to next record */
4598 (*index) += 1;
4599 *data_offset += sizeof(*data);
4600 if (data->name_len)
4601 *data_offset += aligned_string_len(data->name_len + sizeof(WCHAR));
4602 }
4603 }
4604
4605 return STATUS_SUCCESS;
4606}
struct entity::@4977::@4980 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 4939 of file actctx.c.

4941{
4942 unsigned int i, j;
4944
4945 for (i = 0; i < entities->num; i++)
4946 {
4947 struct entity *entity = &entities->base[i];
4948 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4949 {
4950 const struct progids *progids = &entity->u.comclass.progids;
4951 struct comclassredirect_data *comclass;
4952 struct guid_index *guid_index;
4954 GUID clsid;
4955
4958 if (!NT_SUCCESS(Status))
4959 return Status;
4960
4961 guid_index = find_guid_index(actctx->comserver_section, &clsid);
4962 comclass = get_comclass_data(actctx, guid_index);
4963
4964 if (entity->u.comclass.progid)
4965 write_progid_record(section, entity->u.comclass.progid, &comclass->alias,
4966 index, data_offset, global_offset, rosterindex);
4967
4968 for (j = 0; j < progids->num; j++)
4970 index, data_offset, global_offset, rosterindex);
4971 }
4972 }
4973 return Status;
4974}
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:4896
static struct comclassredirect_data * get_comclass_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:4457
static struct guid_index * find_guid_index(const struct guidsection_header *section, const GUID *guid)
Definition: actctx.c:3692
WCHAR ** progids
Definition: actctx.c:440
unsigned int num
Definition: actctx.c:441

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

1160{
1161 WCHAR *p = buffer;
1162
1163 if (!str) return;
1164 wcscat( buffer, prefix );
1165 p += wcslen(p);
1166 *p++ = '"';
1167 wcscpy( p, str );
1168 p += wcslen(p);
1169 *p++ = '"';
1170 *p = 0;
1171}
GLuint buffer
Definition: glext.h:5915
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 1128 of file actctx.c.

1129{
1130 static const WCHAR undW[] = {'_',0};
1131 static const WCHAR noneW[] = {'n','o','n','e',0};
1132 static const WCHAR mskeyW[] = {'d','e','a','d','b','e','e','f',0};
1133
1134 const WCHAR *arch = ai->arch ? ai->arch : noneW;
1135 const WCHAR *key = ai->public_key ? ai->public_key : noneW;
1136 const WCHAR *lang = ai->language ? ai->language : noneW;
1137 const WCHAR *name = ai->name ? ai->name : noneW;
1138 SIZE_T size = (wcslen(arch) + 1 + wcslen(name) + 1 + wcslen(key) + 24 + 1 +
1139 wcslen(lang) + 1) * sizeof(WCHAR) + sizeof(mskeyW);
1140 WCHAR *ret;
1141
1142 if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, size ))) return NULL;
1143
1144 wcscpy( ret, arch );
1145 wcscat( ret, undW );
1146 wcscat( ret, name );
1147 wcscat( ret, undW );
1148 wcscat( ret, key );
1149 wcscat( ret, undW );
1151 ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
1152 wcscat( ret, undW );
1153 wcscat( ret, lang );
1154 wcscat( ret, undW );
1155 wcscat( ret, mskeyW );
1156 return ret;
1157}
#define swprintf
Definition: precomp.h:40
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR version_formatW[]
Definition: actctx.c:766
WCHAR * public_key
Definition: actctx.c:154
WCHAR * language
Definition: actctx.c:155
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 1173 of file actctx.c.

1174{
1175 static const WCHAR archW[] =
1176 {',','p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',0};
1177 static const WCHAR public_keyW[] =
1178 {',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',0};
1179 static const WCHAR typeW2[] =
1180 {',','t','y','p','e','=',0};
1181 static const WCHAR versionW2[] =
1182 {',','v','e','r','s','i','o','n','=',0};
1183
1184 WCHAR version[64], *ret;
1185 SIZE_T size = 0;
1186
1188 ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
1189 if (ai->name) size += wcslen(ai->name) * sizeof(WCHAR);
1190 if (ai->arch) size += wcslen(archW) + wcslen(ai->arch) + 2;
1191 if (ai->public_key) size += wcslen(public_keyW) + wcslen(ai->public_key) + 2;
1192 if (ai->type) size += wcslen(typeW2) + wcslen(ai->type) + 2;
1193 size += wcslen(versionW2) + wcslen(version) + 2;
1194
1195 if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR) )))
1196 return NULL;
1197
1198 if (ai->name) wcscpy( ret, ai->name );
1199 else *ret = 0;
1200 append_string( ret, archW, ai->arch );
1201 append_string( ret, public_keyW, ai->public_key );
1202 append_string( ret, typeW2, ai->type );
1203 append_string( ret, versionW2, version );
1204 return ret;
1205}
#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:1159
WCHAR * type
Definition: actctx.c:156

Referenced by RtlQueryInformationActivationContext().

◆ build_clr_surrogate_section()

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

Definition at line 4713 of file actctx.c.

4714{
4715 unsigned int i, j, total_len = 0, count = 0;
4716 struct guidsection_header *header;
4717 struct clrsurrogate_data *data;
4718 struct guid_index *index;
4720
4721 /* compute section length */
4722 for (i = 0; i < actctx->num_assemblies; i++)
4723 {
4724 struct assembly *assembly = &actctx->assemblies[i];
4725 for (j = 0; j < assembly->entities.num; j++)
4726 {
4727 struct entity *entity = &assembly->entities.base[j];
4728 if (entity->kind == ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)
4729 {
4730 ULONG len;
4731
4732 total_len += sizeof(*index) + sizeof(*data);
4733 len = wcslen(entity->u.clrsurrogate.name) + 1;
4734 if (entity->u.clrsurrogate.version)
4735 len += wcslen(entity->u.clrsurrogate.version) + 1;
4736 total_len += aligned_string_len(len*sizeof(WCHAR));
4737
4738 count++;
4739 }
4740 }
4741 }
4742
4743 total_len += sizeof(*header);
4744
4745 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4746 if (!header) return STATUS_NO_MEMORY;
4747
4748 memset(header, 0, sizeof(*header));
4749 header->magic = GUIDSECTION_MAGIC;
4750 header->size = sizeof(*header);
4751 header->count = count;
4752 header->index_offset = sizeof(*header);
4753 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4754 data_offset = header->index_offset + count*sizeof(*index);
4755
4756 for (i = 0; i < actctx->num_assemblies; i++)
4757 {
4758 struct assembly *assembly = &actctx->assemblies[i];
4759 for (j = 0; j < assembly->entities.num; j++)
4760 {
4761 struct entity *entity = &assembly->entities.base[j];
4762 if (entity->kind == ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)
4763 {
4764 ULONG version_len, name_len;
4766 WCHAR *ptrW;
4768
4769 if (entity->u.clrsurrogate.version)
4770 version_len = wcslen(entity->u.clrsurrogate.version)*sizeof(WCHAR);
4771 else
4772 version_len = 0;
4773 name_len = wcslen(entity->u.clrsurrogate.name)*sizeof(WCHAR);
4774
4775 /* setup new index entry */
4777 Status = RtlGUIDFromString(&str, &index->guid);
4778 if (!NT_SUCCESS(Status))
4779 {
4781 return Status;
4782 }
4783
4784 index->data_offset = data_offset;
4785 index->data_len = sizeof(*data) + aligned_string_len(name_len + sizeof(WCHAR) + (version_len ? version_len + sizeof(WCHAR) : 0));
4786 index->rosterindex = i + 1;
4787
4788 /* setup data */
4789 data = (struct clrsurrogate_data*)((BYTE*)header + index->data_offset);
4790 data->size = sizeof(*data);
4791 data->res = 0;
4792 data->clsid = index->guid;
4793 data->version_offset = version_len ? data->size : 0;
4794 data->version_len = version_len;
4795 data->name_offset = data->size + version_len;
4796 if (version_len)
4797 data->name_offset += sizeof(WCHAR);
4798 data->name_len = name_len;
4799
4800 /* surrogate name */
4801 ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
4802 memcpy(ptrW, entity->u.clrsurrogate.name, data->name_len);
4803 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4804
4805 /* runtime version */
4806 if (data->version_len)
4807 {
4808 ptrW = (WCHAR*)((BYTE*)data + data->version_offset);
4809 memcpy(ptrW, entity->u.clrsurrogate.version, data->version_len);
4810 ptrW[data->version_len/sizeof(WCHAR)] = 0;
4811 }
4812
4813 data_offset += index->data_offset;
4814 index++;
4815 }
4816 }
4817 }
4818
4819 *section = header;
4820
4821 return STATUS_SUCCESS;
4822}
#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::@4977::@4982 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 4394 of file actctx.c.

4395{
4396 unsigned int i, j, total_len = 0, class_count = 0, names_len = 0;
4397 struct guidsection_header *header;
4398 ULONG module_offset, data_offset;
4399 struct guid_index *index;
4400 ULONG seed;
4402
4403 /* compute section length */
4404 for (i = 0; i < actctx->num_assemblies; i++)
4405 {
4406 struct assembly *assembly = &actctx->assemblies[i];
4407 get_comserver_datalen(&assembly->entities, NULL, &class_count, &total_len, &names_len);
4408 for (j = 0; j < assembly->num_dlls; j++)
4409 {
4410 struct dll_redirect *dll = &assembly->dlls[j];
4411 get_comserver_datalen(&dll->entities, dll, &class_count, &total_len, &names_len);
4412 }
4413 }
4414
4415 total_len += aligned_string_len(names_len);
4416 total_len += sizeof(*header);
4417
4418 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4419 if (!header) return STATUS_NO_MEMORY;
4420
4421 memset(header, 0, sizeof(*header));
4422 header->magic = GUIDSECTION_MAGIC;
4423 header->size = sizeof(*header);
4424 header->count = 2*class_count;
4425 header->index_offset = sizeof(*header) + aligned_string_len(names_len);
4426 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4427 module_offset = sizeof(*header);
4428 data_offset = header->index_offset + 2*class_count*sizeof(*index);
4429
4430 seed = NtGetTickCount();
4431 for (i = 0; i < actctx->num_assemblies; i++)
4432 {
4433 struct assembly *assembly = &actctx->assemblies[i];
4434 Status = add_comserver_record(header, &assembly->entities, NULL, &index, &data_offset, &module_offset, &seed, i+1);
4435 if (!NT_SUCCESS(Status))
4436 {
4438 return Status;
4439 }
4440 for (j = 0; j < assembly->num_dlls; j++)
4441 {
4442 struct dll_redirect *dll = &assembly->dlls[j];
4443 Status = add_comserver_record(header, &dll->entities, dll, &index, &data_offset, &module_offset, &seed, i+1);
4444 if (!NT_SUCCESS(Status))
4445 {
4447 return Status;
4448 }
4449 }
4450 }
4451
4452 *section = header;
4453
4454 return STATUS_SUCCESS;
4455}
#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:4213
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:4165

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

3571{
3572 unsigned int i, j, total_len = 0, dll_count = 0;
3573 struct strsection_header *header;
3574 struct dllredirect_data *data;
3575 struct string_index *index;
3577
3578 DPRINT("actctx %p, num_assemblies %d\n", actctx, actctx->num_assemblies);
3579
3580 /* compute section length */
3581 for (i = 0; i < actctx->num_assemblies; i++)
3582 {
3583 struct assembly *assembly = &actctx->assemblies[i];
3584 for (j = 0; j < assembly->num_dlls; j++)
3585 {
3586 struct dll_redirect *dll = &assembly->dlls[j];
3587
3588 /* each entry needs index, data and string data */
3589 total_len += sizeof(*index);
3590 total_len += sizeof(*data);
3591 total_len += aligned_string_len((wcslen(dll->name)+1)*sizeof(WCHAR));
3592
3593 DPRINT("assembly %d (%p), dll %d: dll name %S\n", i, assembly, j, dll->name);
3594 }
3595
3597 }
3598
3599 total_len += sizeof(*header);
3600
3601 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
3602 if (!header) return STATUS_NO_MEMORY;
3603
3604 memset(header, 0, sizeof(*header));
3605 header->magic = STRSECTION_MAGIC;
3606 header->size = sizeof(*header);
3607 header->count = dll_count;
3608 header->index_offset = sizeof(*header);
3609 index = (struct string_index*)((BYTE*)header + header->index_offset);
3610 name_offset = header->index_offset + header->count*sizeof(*index);
3611
3612 for (i = 0; i < actctx->num_assemblies; i++)
3613 {
3614 struct assembly *assembly = &actctx->assemblies[i];
3615
3616 DPRINT("assembly->num_dlls %d\n", assembly->num_dlls);
3617
3618 for (j = 0; j < assembly->num_dlls; j++)
3619 {
3620 struct dll_redirect *dll = &assembly->dlls[j];
3622 WCHAR *ptrW;
3623
3624 DPRINT("%d: dll name %S\n", j, dll->name);
3625 /* setup new index entry */
3626 str.Buffer = dll->name;
3627 str.Length = wcslen(dll->name)*sizeof(WCHAR);
3628 str.MaximumLength = str.Length + sizeof(WCHAR);
3629 /* hash original class name */
3631
3632 index->name_offset = name_offset;
3633 index->name_len = str.Length;
3634 index->data_offset = index->name_offset + aligned_string_len(str.MaximumLength);
3635 index->data_len = sizeof(*data);
3636 index->rosterindex = i + 1;
3637
3638 /* setup data */
3639 data = (struct dllredirect_data*)((BYTE*)header + index->data_offset);
3640 data->size = sizeof(*data);
3641 data->unk = 2; /* FIXME: seems to be constant */
3642 memset(data->res, 0, sizeof(data->res));
3643
3644 /* dll name */
3645 ptrW = (WCHAR*)((BYTE*)header + index->name_offset);
3646 memcpy(ptrW, dll->name, index->name_len);
3647 ptrW[index->name_len/sizeof(WCHAR)] = 0;
3648
3649 name_offset += sizeof(*data) + aligned_string_len(str.MaximumLength);
3650
3651 index++;
3652 }
3653 }
3654
3655 *section = header;
3656
3657 return STATUS_SUCCESS;
3658}
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 4608 of file actctx.c.

4609{
4610 unsigned int i, j, total_len = 0, count = 0;
4611 struct guidsection_header *header;
4612 struct guid_index *index;
4614
4615 /* compute section length */
4616 for (i = 0; i < actctx->num_assemblies; i++)
4617 {
4618 struct assembly *assembly = &actctx->assemblies[i];
4619
4620 get_ifaceps_datalen(&assembly->entities, &count, &total_len);
4621 for (j = 0; j < assembly->num_dlls; j++)
4622 {
4623 struct dll_redirect *dll = &assembly->dlls[j];
4624 get_ifaceps_datalen(&dll->entities, &count, &total_len);
4625 }
4626 }
4627
4628 total_len += sizeof(*header);
4629
4630 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4631 if (!header) return STATUS_NO_MEMORY;
4632
4633 memset(header, 0, sizeof(*header));
4634 header->magic = GUIDSECTION_MAGIC;
4635 header->size = sizeof(*header);
4636 header->count = count;
4637 header->index_offset = sizeof(*header);
4638 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4639 data_offset = header->index_offset + count*sizeof(*index);
4640
4641 for (i = 0; i < actctx->num_assemblies; i++)
4642 {
4643 struct assembly *assembly = &actctx->assemblies[i];
4645
4646 Status = add_ifaceps_record(header, &assembly->entities, &index, &data_offset, i + 1);
4647 if (!NT_SUCCESS(Status))
4648 {
4650 return Status;
4651 }
4652
4653 for (j = 0; j < assembly->num_dlls; j++)
4654 {
4655 struct dll_redirect *dll = &assembly->dlls[j];
4656 Status = add_ifaceps_record(header, &dll->entities, &index, &data_offset, i + 1);
4657 if (!NT_SUCCESS(Status))
4658 {
4660 return Status;
4661 }
4662 }
4663 }
4664
4665 *section = header;
4666
4667 return STATUS_SUCCESS;
4668}
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:4519
static void get_ifaceps_datalen(const struct entity_array *entities, unsigned int *count, unsigned int *len)
Definition: actctx.c:4502

Referenced by find_cominterface_redirection().

◆ build_progid_section()

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

Definition at line 4976 of file actctx.c.

4977{
4978 unsigned int i, j, total_len = 0, count = 0;
4979 struct strsection_header *header;
4980 ULONG data_offset, global_offset;
4981 struct string_index *index;
4983
4984 /* compute section length */
4985 for (i = 0; i < actctx->num_assemblies; i++)
4986 {
4987 struct assembly *assembly = &actctx->assemblies[i];
4988
4989 get_progid_datalen(&assembly->entities, &count, &total_len);
4990 for (j = 0; j < assembly->num_dlls; j++)
4991 {
4992 struct dll_redirect *dll = &assembly->dlls[j];
4993 get_progid_datalen(&dll->entities, &count, &total_len);
4994 }
4995 }
4996
4997 total_len += sizeof(*header);
4998
4999 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
5000 if (!header) return STATUS_NO_MEMORY;
5001
5002 memset(header, 0, sizeof(*header));
5003 header->magic = STRSECTION_MAGIC;
5004 header->size = sizeof(*header);
5005 header->count = count;
5006 header->global_offset = header->size;
5007 header->global_len = count*sizeof(GUID);
5008 header->index_offset = header->size + header->global_len;
5009
5010 index = (struct string_index*)((BYTE*)header + header->index_offset);
5011 data_offset = header->index_offset + count*sizeof(*index);
5012 global_offset = header->global_offset;
5013
5014 for (i = 0; i < actctx->num_assemblies; i++)
5015 {
5016 struct assembly *assembly = &actctx->assemblies[i];
5017
5018 Status = add_progid_record(actctx, header, &assembly->entities, &index, &data_offset, &global_offset, i + 1);
5019 if (!NT_SUCCESS(Status))
5020 {
5022 return Status;
5023 }
5024
5025 for (j = 0; j < assembly->num_dlls; j++)
5026 {
5027 struct dll_redirect *dll = &assembly->dlls[j];
5028 Status = add_progid_record(actctx, header, &dll->entities, &index, &data_offset, &global_offset, i + 1);
5029 if (!NT_SUCCESS(Status))
5030 {
5032 return Status;
5033 }
5034 }
5035 }
5036
5037 *section = header;
5038
5039 return STATUS_SUCCESS;
5040}
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:4939
static void get_progid_datalen(struct entity_array *entities, unsigned int *count, unsigned int *total_len)
Definition: actctx.c:4871
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 3976 of file actctx.c.

3977{
3978 unsigned int i, j, k, total_len = 0, tlib_count = 0, names_len = 0;
3979 struct guidsection_header *header;
3980 ULONG module_offset, data_offset;
3981 struct tlibredirect_data *data;
3982 struct guid_index *index;
3983
3984 /* compute section length */
3985 for (i = 0; i < actctx->num_assemblies; i++)
3986 {
3987 struct assembly *assembly = &actctx->assemblies[i];
3988 for (j = 0; j < assembly->num_dlls; j++)
3989 {
3990 struct dll_redirect *dll = &assembly->dlls[j];
3991 for (k = 0; k < dll->entities.num; k++)
3992 {
3993 struct entity *entity = &dll->entities.base[k];
3994 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)
3995 {
3996 /* each entry needs index, data and string data for module name and help string */
3997 total_len += sizeof(*index);
3998 total_len += sizeof(*data);
3999 /* help string is stored separately */
4000 if (*entity->u.typelib.helpdir)
4001 total_len += aligned_string_len((wcslen(entity->u.typelib.helpdir)+1)*sizeof(WCHAR));
4002
4003 /* module names are packed one after another */
4004 names_len += (wcslen(dll->name)+1)*sizeof(WCHAR);
4005
4006 tlib_count++;
4007 }
4008 }
4009 }
4010 }
4011
4012 total_len += aligned_string_len(names_len);
4013 total_len += sizeof(*header);
4014
4015 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
4016 if (!header) return STATUS_NO_MEMORY;
4017
4018 memset(header, 0, sizeof(*header));
4019 header->magic = GUIDSECTION_MAGIC;
4020 header->size = sizeof(*header);
4021 header->count = tlib_count;
4022 header->index_offset = sizeof(*header) + aligned_string_len(names_len);
4023 index = (struct guid_index*)((BYTE*)header + header->index_offset);
4024 module_offset = sizeof(*header);
4025 data_offset = header->index_offset + tlib_count*sizeof(*index);
4026
4027 for (i = 0; i < actctx->num_assemblies; i++)
4028 {
4029 struct assembly *assembly = &actctx->assemblies[i];
4030 for (j = 0; j < assembly->num_dlls; j++)
4031 {
4032 struct dll_redirect *dll = &assembly->dlls[j];
4033 for (k = 0; k < dll->entities.num; k++)
4034 {
4035 struct entity *entity = &dll->entities.base[k];
4036 if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)
4037 {
4038 ULONG module_len, help_len;
4040 WCHAR *ptrW;
4042
4043 if (*entity->u.typelib.helpdir)
4044 help_len = wcslen(entity->u.typelib.helpdir)*sizeof(WCHAR);
4045 else
4046 help_len = 0;
4047
4048 module_len = wcslen(dll->name)*sizeof(WCHAR);
4049
4050 /* setup new index entry */
4052 Status = RtlGUIDFromString(&str, &index->guid);
4053 if (!NT_SUCCESS(Status))
4054 {
4056 return Status;
4057 }
4058 index->data_offset = data_offset;
4059 index->data_len = sizeof(*data) + aligned_string_len(help_len);
4060 index->rosterindex = i + 1;
4061
4062 /* setup data */
4063 data = (struct tlibredirect_data*)((BYTE*)header + index->data_offset);
4064 data->size = sizeof(*data);
4065 data->res = 0;
4066 data->name_len = module_len;
4067 data->name_offset = module_offset;
4068 /* FIXME: resourceid handling is really weird, and it doesn't seem to be useful */
4069 data->langid = 0;
4070 data->flags = entity->u.typelib.flags;
4071 data->help_len = help_len;
4072 data->help_offset = sizeof(*data);
4073 data->major_version = entity->u.typelib.major;
4074 data->minor_version = entity->u.typelib.minor;
4075
4076 /* module name */
4077 ptrW = (WCHAR*)((BYTE*)header + data->name_offset);
4078 memcpy(ptrW, dll->name, data->name_len);
4079 ptrW[data->name_len/sizeof(WCHAR)] = 0;
4080
4081 /* help string */
4082 if (data->help_len)
4083 {
4084 ptrW = (WCHAR*)((BYTE*)data + data->help_offset);
4085 memcpy(ptrW, entity->u.typelib.helpdir, data->help_len);
4086 ptrW[data->help_len/sizeof(WCHAR)] = 0;
4087 }
4088
4089 data_offset += sizeof(*data);
4090 if (help_len)
4091 data_offset += aligned_string_len(help_len + sizeof(WCHAR));
4092
4093 module_offset += module_len + sizeof(WCHAR);
4094
4095 index++;
4096 }
4097 }
4098 }
4099 }
4100
4101 *section = header;
4102
4103 return STATUS_SUCCESS;
4104}
int k
Definition: mpi.c:3369
struct entity::@4977::@4978 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 3772 of file actctx.c.

3773{
3774 unsigned int i, j, k, total_len = 0, class_count = 0;
3776 struct strsection_header *header;
3777 struct string_index *index;
3779
3780 /* compute section length */
3781 for (i = 0; i < actctx->num_assemblies; i++)
3782 {
3783 struct assembly *assembly = &actctx->assemblies[i];
3784 for (j = 0; j < assembly->num_dlls; j++)
3785 {
3786 struct dll_redirect *dll = &assembly->dlls[j];
3787 for (k = 0; k < dll->entities.num; k++)
3788 {
3789 struct entity *entity = &dll->entities.base[k];
3790 if (entity->kind == ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)
3791 {
3792 int class_len = wcslen(entity->u.class.name) + 1;
3793 int len;
3794
3795 /* each class entry needs index, data and string data */
3796 total_len += sizeof(*index);
3797 total_len += sizeof(*data);
3798 /* original name is stored separately */
3799 total_len += aligned_string_len(class_len*sizeof(WCHAR));
3800 /* versioned name and module name are stored one after another */
3801 if (entity->u.class.versioned)
3802 len = get_assembly_version(assembly, NULL) + class_len + 1 /* '!' separator */;
3803 else
3804 len = class_len;
3805 len += wcslen(dll->name) + 1;
3806 total_len += aligned_string_len(len*sizeof(WCHAR));
3807
3808 class_count++;
3809 }
3810 }
3811 }
3812 }
3813
3814 total_len += sizeof(*header);
3815
3816 header = RtlAllocateHeap(GetProcessHeap(), 0, total_len);
3817 if (!header) return STATUS_NO_MEMORY;
3818
3819 memset(header, 0, sizeof(*header));
3820 header->magic = STRSECTION_MAGIC;
3821 header->size = sizeof(*header);
3822 header->count = class_count;
3823 header->index_offset = sizeof(*header);
3824 index = (struct string_index*)((BYTE*)header + header->index_offset);
3825 name_offset = header->index_offset + header->count*sizeof(*index);
3826
3827 for (i = 0; i < actctx->num_assemblies; i++)
3828 {
3829 struct assembly *assembly = &actctx->assemblies[i];
3830 for (j = 0; j < assembly->num_dlls; j++)
3831 {
3832 struct dll_redirect *dll = &assembly->dlls[j];
3833 for (k = 0; k < dll->entities.num; k++)
3834 {
3835 struct entity *entity = &dll->entities.base[k];
3836 if (entity->kind == ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)
3837 {
3838 static const WCHAR exclW[] = {'!',0};
3839 ULONG versioned_len, module_len;
3841 WCHAR *ptrW;
3842
3843 /* setup new index entry */
3844 str.Buffer = entity->u.class.name;
3845 str.Length = wcslen(entity->u.class.name)*sizeof(WCHAR);
3846 str.MaximumLength = str.Length + sizeof(WCHAR);
3847 /* hash original class name */
3849
3850 /* include '!' separator too */
3851 if (entity->u.class.versioned)
3852 versioned_len = (get_assembly_version(assembly, NULL) + 1)*sizeof(WCHAR) + str.Length;
3853 else
3854 versioned_len = str.Length;
3855 module_len = wcslen(dll->name)*sizeof(WCHAR);
3856
3857 index->name_offset = name_offset;
3858 index->name_len = str.Length;
3859 index->data_offset = index->name_offset + aligned_string_len(str.MaximumLength);
3860 index->data_len = sizeof(*data) + versioned_len + module_len + 2*sizeof(WCHAR) /* two nulls */;
3861 index->rosterindex = i + 1;
3862
3863 /* setup data */
3864 data = (struct wndclass_redirect_data*)((BYTE*)header + index->data_offset);
3865 data->size = sizeof(*data);
3866 data->res = 0;
3867 data->name_len = versioned_len;
3868 data->name_offset = sizeof(*data);
3869 data->module_len = module_len;
3870 data->module_offset = index->data_offset + data->name_offset + data->name_len + sizeof(WCHAR);
3871
3872 /* original class name */
3873 ptrW = (WCHAR*)((BYTE*)header + index->name_offset);
3874 memcpy(ptrW, entity->u.class.name, index->name_len);
3875 ptrW[index->name_len/sizeof(WCHAR)] = 0;
3876
3877 /* module name */
3878 ptrW = (WCHAR*)((BYTE*)header + data->module_offset);
3879 memcpy(ptrW, dll->name, data->module_len);
3880 ptrW[data->module_len/sizeof(WCHAR)] = 0;
3881
3882 /* versioned name */
3883 ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
3884 if (entity->u.class.versioned)
3885 {
3887 wcscat(ptrW, exclW);
3888 wcscat(ptrW, entity->u.class.name);
3889 }
3890 else
3891 {
3892 memcpy(ptrW, entity->u.class.name, index->name_len);
3893 ptrW[index->name_len/sizeof(WCHAR)] = 0;
3894 }
3895
3896 name_offset += sizeof(*data);
3897 name_offset += aligned_string_len(str.MaximumLength) + aligned_string_len(versioned_len + module_len + 2*sizeof(WCHAR));
3898
3899 index++;
3900 }
3901 }
3902 }
3903 }
3904
3905 *section = header;
3906
3907 return STATUS_SUCCESS;
3908}
static int get_assembly_version(struct assembly *assembly, WCHAR *ret)
Definition: actctx.c:2027
struct entity::@4977::@4981 class

Referenced by find_window_class().

◆ check_actctx()

static ACTIVATION_CONTEXT * check_actctx ( HANDLE  h)
static

Definition at line 1207 of file actctx.c.

1208{
1210
1211 if (!h || h == INVALID_HANDLE_VALUE) return NULL;
1212 __TRY
1213 {
1214 if (actctx->magic == ACTCTX_MAGIC) ret = actctx;
1215 }
1217 {
1218 DPRINT1("Invalid activation context handle!\n");
1219 }
1220 __ENDTRY
1221 return ret;
1222}
#define DPRINT1
Definition: precomp.h:8
#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
Definition: actctx.c:59

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

1686{
1687 struct progids *progids = &entity->u.comclass.progids;
1688
1689 if (progids->allocated == 0)
1690 {
1691 progids->allocated = 4;
1692 if (!(progids->progids = RtlAllocateHeap(GetProcessHeap(), 0, progids->allocated * sizeof(WCHAR*)))) return FALSE;
1693 }
1694
1695 if (progids->allocated == progids->num)
1696 {
1697 WCHAR **new_progids = RtlReAllocateHeap(GetProcessHeap(), 0, progids->progids,
1698 2 * progids->allocated * sizeof(WCHAR*));
1699 if (!new_progids) return FALSE;
1700 progids->allocated *= 2;
1701 progids->progids = new_progids;
1702 }
1703
1704 if (!(progids->progids[progids->num] = xmlstrdupW(progid))) return FALSE;
1705 progids->num++;
1706
1707 return TRUE;
1708}
#define progid(str)
Definition: exdisp.idl:31
static WCHAR * xmlstrdupW(const xmlstr_t *str)
Definition: actctx.c:782
unsigned int allocated
Definition: actctx.c:442

Referenced by parse_com_class_progid().

◆ debugstr_version()

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

Definition at line 855 of file actctx.c.

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

Referenced by lookup_assembly(), parse_assembly_identity_elem(), parse_depend_manifests(), and parse_dependent_assembly_elem().

◆ debugstr_xml_attr()

◆ debugstr_xml_elem()

◆ debugstr_xmlstr()

◆ find_app_settings()

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

Definition at line 5174 of file actctx.c.

5175{
5176 unsigned int i, j;
5177
5178 for (i = 0; i < actctx->num_assemblies; i++)
5179 {
5180 struct assembly *assembly = &actctx->assemblies[i];
5181 for (j = 0; j < assembly->entities.num; j++)
5182 {
5183 struct entity *entity = &assembly->entities.base[j];
5184 if (entity->kind == ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS &&
5185 !wcscmp( entity->u.settings.name, settings ) &&
5186 !wcscmp( entity->u.settings.ns, ns ))
5187 return entity->u.settings.value;
5188 }
5189 }
5190 return NULL;
5191}
struct mke2fs_defaults settings[]
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
struct entity::@4977::@4983 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 4829 of file actctx.c.

4830{
4831 struct clrsurrogate_data *surrogate;
4832 struct guid_index *index = NULL;
4833
4834 if (!(actctx->sections & CLRSURROGATES_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4835
4836 if (!actctx->clrsurrogate_section)
4837 {
4839
4841 if (status) return status;
4842
4843 if (InterlockedCompareExchangePointer((void**)&actctx->clrsurrogate_section, section, NULL))
4845 }
4846
4847 index = find_guid_index(actctx->clrsurrogate_section, guid);
4848 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4849
4850 surrogate = get_surrogate_data(actctx, index);
4851
4852 data->ulDataFormatVersion = 1;
4853 data->lpData = surrogate;
4854 /* full length includes string length with nulls */
4855 data->ulLength = surrogate->size + surrogate->name_len + sizeof(WCHAR);
4856 if (surrogate->version_len)
4857 data->ulLength += surrogate->version_len + sizeof(WCHAR);
4858
4859 data->lpSectionGlobalData = NULL;
4860 data->ulSectionGlobalDataLength = 0;
4861 data->lpSectionBase = actctx->clrsurrogate_section;
4862 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->clrsurrogate_section );
4863 data->hActCtx = NULL;
4864
4865 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4866 data->ulAssemblyRosterIndex = index->rosterindex;
4867
4868 return STATUS_SUCCESS;
4869}
#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:4824
static NTSTATUS build_clr_surrogate_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4713
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 4675 of file actctx.c.

4676{
4677 struct ifacepsredirect_data *iface;
4678 struct guid_index *index = NULL;
4679
4680 if (!(actctx->sections & IFACEREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4681
4682 if (!actctx->ifaceps_section)
4683 {
4685
4687 if (status) return status;
4688
4689 if (InterlockedCompareExchangePointer((void**)&actctx->ifaceps_section, section, NULL))
4691 }
4692
4693 index = find_guid_index(actctx->ifaceps_section, guid);
4694 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4695
4696 iface = get_ifaceps_data(actctx, index);
4697
4698 data->ulDataFormatVersion = 1;
4699 data->lpData = iface;
4700 data->ulLength = iface->size + (iface->name_len ? iface->name_len + sizeof(WCHAR) : 0);
4701 data->lpSectionGlobalData = NULL;
4702 data->ulSectionGlobalDataLength = 0;
4703 data->lpSectionBase = actctx->ifaceps_section;
4704 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->ifaceps_section );
4705 data->hActCtx = NULL;
4706
4707 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4708 data->ulAssemblyRosterIndex = index->rosterindex;
4709
4710 return STATUS_SUCCESS;
4711}
static NTSTATUS build_ifaceps_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4608
static struct ifacepsredirect_data * get_ifaceps_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:4670

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

4463{
4464 struct comclassredirect_data *comclass;
4465 struct guid_index *index = NULL;
4466
4467 if (!(actctx->sections & SERVERREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4468
4469 if (!actctx->comserver_section)
4470 {
4472
4474 if (status) return status;
4475
4476 if (InterlockedCompareExchangePointer((void**)&actctx->comserver_section, section, NULL))
4478 }
4479
4480 index = find_guid_index(actctx->comserver_section, guid);
4481 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4482
4483 comclass = get_comclass_data(actctx, index);
4484
4485 data->ulDataFormatVersion = 1;
4486 data->lpData = comclass;
4487 /* full length includes string length with nulls */
4488 data->ulLength = comclass->size + comclass->clrdata_len;
4489 if (comclass->progid_len) data->ulLength += comclass->progid_len + sizeof(WCHAR);
4490 data->lpSectionGlobalData = (BYTE*)actctx->comserver_section + actctx->comserver_section->names_offset;
4491 data->ulSectionGlobalDataLength = actctx->comserver_section->names_len;
4492 data->lpSectionBase = actctx->comserver_section;
4493 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->comserver_section );
4494 data->hActCtx = NULL;
4495
4496 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4497 data->ulAssemblyRosterIndex = index->rosterindex;
4498
4499 return STATUS_SUCCESS;
4500}
static NTSTATUS build_comserver_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4394

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

3719{
3720 struct dllredirect_data *dll;
3721 struct string_index *index;
3722
3723 DPRINT("sections: 0x%08X\n", actctx->sections);
3724 if (!(actctx->sections & DLLREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
3725
3726 DPRINT("actctx->dllredirect_section: %p\n", actctx->dllredirect_section);
3727 if (!actctx->dllredirect_section)
3728 {
3729 struct strsection_header *section;
3730
3732 if (status) return status;
3733
3734 if (InterlockedCompareExchangePointer((void**)&actctx->dllredirect_section, section, NULL))
3736 }
3737
3738 index = find_string_index(actctx->dllredirect_section, name);
3739 DPRINT("index: %d\n", index);
3740 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
3741
3742 if (data)
3743 {
3745
3746 data->ulDataFormatVersion = 1;
3747 data->lpData = dll;
3748 data->ulLength = dll->size;
3749 data->lpSectionGlobalData = NULL;
3750 data->ulSectionGlobalDataLength = 0;
3751 data->lpSectionBase = actctx->dllredirect_section;
3752 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->dllredirect_section );
3753 data->hActCtx = NULL;
3754
3755 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
3756 data->ulAssemblyRosterIndex = index->rosterindex;
3757 }
3758
3759 return STATUS_SUCCESS;
3760}
static NTSTATUS build_dllredirect_section(ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
Definition: actctx.c:3570
static struct dllredirect_data * get_dllredirect_data(ACTIVATION_CONTEXT *ctxt, struct string_index *index)
Definition: actctx.c:3712
static struct string_index * find_string_index(const struct strsection_header *section, const UNICODE_STRING *name)
Definition: actctx.c:3660

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

5142{
5144
5145 switch (section_kind)
5146 {
5147 case ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION:
5149 break;
5150 case ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION:
5152 break;
5153 case ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION:
5155 break;
5156 case ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES:
5158 break;
5159 default:
5160 WARN("Unknown section_kind %x\n", section_kind);
5162 }
5163
5164 if (status != STATUS_SUCCESS) return status;
5165
5166 if (flags & FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX)
5167 {
5169 data->hActCtx = actctx;
5170 }
5171 return STATUS_SUCCESS;
5172}
#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:4675
static void actctx_addref(ACTIVATION_CONTEXT *actctx)
Definition: actctx.c:1224
static NTSTATUS find_comserver_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4462
static NTSTATUS find_clr_surrogate(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4829
static NTSTATUS find_tlib_redirection(ACTIVATION_CONTEXT *actctx, const GUID *guid, ACTCTX_SECTION_KEYED_DATA *data)
Definition: actctx.c:4111

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

3693{
3694 struct guid_index *iter, *index = NULL;
3695 ULONG i;
3696
3697 iter = (struct guid_index*)((BYTE*)section + section->index_offset);
3698
3699 for (i = 0; i < section->count; i++)
3700 {
3701 if (!memcmp(guid, &iter->guid, sizeof(*guid)))
3702 {
3703 index = iter;
3704 break;
3705 }
3706 iter++;
3707 }
3708
3709 return index;
3710}
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 5047 of file actctx.c.

5049{
5051 struct string_index *index;
5052
5053 if (!(actctx->sections & PROGIDREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
5054
5055 if (!actctx->comserver_section)
5056 {
5058
5060 if (status) return status;
5061
5062 if (InterlockedCompareExchangePointer((void**)&actctx->comserver_section, section, NULL))
5064 }
5065
5066 if (!actctx->progid_section)
5067 {
5068 struct strsection_header *section;
5069
5071 if (status) return status;
5072
5073 if (InterlockedCompareExchangePointer((void**)&actctx->progid_section, section, NULL))
5075 }
5076
5077 index = find_string_index(actctx->progid_section, name);
5078 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
5079
5080 if (data)
5081 {
5083
5084 data->ulDataFormatVersion = 1;
5085 data->lpData = progid;
5086 data->ulLength = progid->size;
5087 data->lpSectionGlobalData = (BYTE*)actctx->progid_section + actctx->progid_section->global_offset;
5088 data->ulSectionGlobalDataLength = actctx->progid_section->global_len;
5089 data->lpSectionBase = actctx->progid_section;
5090 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->progid_section );
5091 data->hActCtx = NULL;
5092
5093 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
5094 data->ulAssemblyRosterIndex = index->rosterindex;
5095 }
5096
5097 return STATUS_SUCCESS;
5098}
static struct progidredirect_data * get_progid_data(ACTIVATION_CONTEXT *actctx, const struct string_index *index)
Definition: actctx.c:5042
static NTSTATUS build_progid_section(ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
Definition: actctx.c:4976

Referenced by find_string().

◆ find_query_actctx()

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

Definition at line 3535 of file actctx.c.

3536{
3538
3540 {
3541 if (*handle) return STATUS_INVALID_PARAMETER;
3542
3543 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
3544 *handle = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext;
3545 }
3547 {
3548 ULONG_PTR magic;
3550
3551 if (!*handle) return STATUS_INVALID_PARAMETER;
3552
3553 LdrLockLoaderLock( 0, NULL, &magic );
3554 if (!LdrFindEntryForAddress( *handle, &pldr ))
3555 {
3558 else
3560 }
3562 LdrUnlockLoaderLock( 0, magic );
3563 }
3564 else if (!*handle && (class != ActivationContextBasicInformation))