ReactOS 0.4.16-dev-226-g79f2289
actctx.c File Reference

Go to the source code of this file.

Classes

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

Macros

#define ACTCTX_FLAGS_ALL
 
#define ACTCTX_MAGIC   0xC07E3E11
 
#define STRSECTION_MAGIC   0x64487353 /* dHsS */
 
#define GUIDSECTION_MAGIC   0x64487347 /* dHsG */
 
#define ACTCTX_MAGIC_MARKER   (PVOID)'gMcA'
 
#define ACTCTX_FAKE_HANDLE   ((HANDLE) 0xf00baa)
 
#define ACTCTX_FAKE_COOKIE   ((ULONG_PTR) 0xf00bad)
 
#define RT_MANIFEST   ((ULONG_PTR)24)
 
#define CREATEPROCESS_MANIFEST_RESOURCE_ID   ((ULONG_PTR)1)
 
#define MAX_NAMESPACES   64
 

Typedefs

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

Enumerations

enum  tagLIBFLAGS { LIBFLAG_FRESTRICTED = 0x1 , LIBFLAG_FCONTROL = 0x2 , LIBFLAG_FHIDDEN = 0x4 , LIBFLAG_FHASDISKIMAGE = 0x8 }
 
enum  tagOLEMISC {
  OLEMISC_RECOMPOSEONRESIZE = 0x1 , OLEMISC_ONLYICONIC = 0x2 , OLEMISC_INSERTNOTREPLACE = 0x4 , OLEMISC_STATIC = 0x8 ,
  OLEMISC_CANTLINKINSIDE = 0x10 , OLEMISC_CANLINKBYOLE1 = 0x20 , OLEMISC_ISLINKOBJECT = 0x40 , OLEMISC_INSIDEOUT = 0x80 ,
  OLEMISC_ACTIVATEWHENVISIBLE = 0x100 , OLEMISC_RENDERINGISDEVICEINDEPENDENT = 0x200 , OLEMISC_INVISIBLEATRUNTIME = 0x400 , OLEMISC_ALWAYSRUN = 0x800 ,
  OLEMISC_ACTSLIKEBUTTON = 0x1000 , OLEMISC_ACTSLIKELABEL = 0x2000 , OLEMISC_NOUIACTIVATE = 0x4000 , OLEMISC_ALIGNABLE = 0x8000 ,
  OLEMISC_SIMPLEFRAME = 0x10000 , OLEMISC_SETCLIENTSITEFIRST = 0x20000 , OLEMISC_IMEMODE = 0x40000 , OLEMISC_IGNOREACTIVATEWHENVISIBLE = 0x80000 ,
  OLEMISC_WANTSTOMENUMERGE = 0x100000 , OLEMISC_SUPPORTSMULTILEVELUNDO = 0x200000
}
 
enum  comclass_threadingmodel {
  ThreadingModel_Apartment = 1 , ThreadingModel_Free = 2 , ThreadingModel_No = 3 , ThreadingModel_Both = 4 ,
  ThreadingModel_Neutral = 5 , ThreadingModel_Apartment = 1 , ThreadingModel_Free = 2 , ThreadingModel_No = 3 ,
  ThreadingModel_Both = 4 , ThreadingModel_Neutral = 5 , ThreadingModel_Apartment = 1 , ThreadingModel_Free = 2 ,
  ThreadingModel_No = 3 , ThreadingModel_Both = 4 , ThreadingModel_Neutral = 5
}
 
enum  comclass_miscfields {
  MiscStatus = 1 , MiscStatusIcon = 2 , MiscStatusContent = 4 , MiscStatusThumbnail = 8 ,
  MiscStatusDocPrint = 16 , MiscStatus = 1 , MiscStatusIcon = 2 , MiscStatusContent = 4 ,
  MiscStatusThumbnail = 8 , MiscStatusDocPrint = 16 , MiscStatus = 1 , MiscStatusIcon = 2 ,
  MiscStatusContent = 4 , MiscStatusThumbnail = 8 , MiscStatusDocPrint = 16
}
 
enum  ifaceps_mask { NumMethods = 1 , BaseIface = 2 , NumMethods = 1 , BaseIface = 2 }
 
enum  assembly_type { APPLICATION_MANIFEST , ASSEMBLY_MANIFEST , ASSEMBLY_SHARED_MANIFEST }
 
enum  context_sections {
  WINDOWCLASS_SECTION = 1 , DLLREDIRECT_SECTION = 2 , TLIBREDIRECT_SECTION = 4 , SERVERREDIRECT_SECTION = 8 ,
  IFACEREDIRECT_SECTION = 16 , CLRSURROGATES_SECTION = 32 , PROGIDREDIRECT_SECTION = 64
}
 

Functions

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

Variables

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

Macro Definition Documentation

◆ ACTCTX_FAKE_COOKIE

#define ACTCTX_FAKE_COOKIE   ((ULONG_PTR) 0xf00bad)

Definition at line 66 of file actctx.c.

◆ ACTCTX_FAKE_HANDLE

#define ACTCTX_FAKE_HANDLE   ((HANDLE) 0xf00baa)

Definition at line 65 of file actctx.c.

◆ ACTCTX_FLAGS_ALL

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

Definition at line 49 of file actctx.c.

◆ ACTCTX_MAGIC

#define ACTCTX_MAGIC   0xC07E3E11

Definition at line 59 of file actctx.c.

◆ ACTCTX_MAGIC_MARKER

#define ACTCTX_MAGIC_MARKER   (PVOID)'gMcA'

Definition at line 63 of file actctx.c.

◆ CREATEPROCESS_MANIFEST_RESOURCE_ID

#define CREATEPROCESS_MANIFEST_RESOURCE_ID   ((ULONG_PTR)1)

Definition at line 70 of file actctx.c.

◆ GUIDSECTION_MAGIC

#define GUIDSECTION_MAGIC   0x64487347 /* dHsG */

Definition at line 61 of file actctx.c.

◆ MAX_NAMESPACES

#define MAX_NAMESPACES   64

Definition at line 109 of file actctx.c.

◆ RT_MANIFEST

#define RT_MANIFEST   ((ULONG_PTR)24)

Definition at line 69 of file actctx.c.

◆ STRSECTION_MAGIC

#define STRSECTION_MAGIC   0x64487353 /* dHsS */

Definition at line 60 of file actctx.c.

Typedef Documentation

◆ ACTIVATION_CONTEXT

◆ LIBFLAGS

◆ OLEMISC

◆ PIACTIVATION_CONTEXT

Enumeration Type Documentation

◆ assembly_type

Enumerator
APPLICATION_MANIFEST 
ASSEMBLY_MANIFEST 
ASSEMBLY_SHARED_MANIFEST 

Definition at line 519 of file actctx.c.

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

◆ comclass_miscfields

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

Definition at line 247 of file actctx.c.

248{
249 MiscStatus = 1,
250 MiscStatusIcon = 2,
254};
@ MiscStatusContent
Definition: actctx.c:1374
@ MiscStatusThumbnail
Definition: actctx.c:1375
@ MiscStatus
Definition: actctx.c:1372
@ MiscStatusDocPrint
Definition: actctx.c:1376
@ MiscStatusIcon
Definition: actctx.c:1373

◆ comclass_threadingmodel

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

Definition at line 238 of file actctx.c.

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

◆ context_sections

Enumerator
WINDOWCLASS_SECTION 
DLLREDIRECT_SECTION 
TLIBREDIRECT_SECTION 
SERVERREDIRECT_SECTION 
IFACEREDIRECT_SECTION 
CLRSURROGATES_SECTION 
PROGIDREDIRECT_SECTION 

Definition at line 543 of file actctx.c.

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

◆ ifaceps_mask

Enumerator
NumMethods 
BaseIface 
NumMethods 
BaseIface 

Definition at line 278 of file actctx.c.

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

◆ tagLIBFLAGS

Enumerator
LIBFLAG_FRESTRICTED 
LIBFLAG_FCONTROL 
LIBFLAG_FHIDDEN 
LIBFLAG_FHASDISKIMAGE 

Definition at line 74 of file actctx.c.

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

◆ tagOLEMISC

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

Definition at line 82 of file actctx.c.

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

Function Documentation

◆ actctx_addref()

static void actctx_addref ( ACTIVATION_CONTEXT actctx)
inlinestatic

Definition at line 1281 of file actctx.c.

1282{
1283 InterlockedExchangeAdd( &actctx->RefCount, 1 );
1284}
#define InterlockedExchangeAdd
Definition: interlocked.h:181
#define actctx
Definition: kernel32.h:8

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

◆ actctx_init()

void actctx_init ( PVOID pOldShimData)

Definition at line 5150 of file actctx.c.

5151{
5152 ACTCTXW ctx;
5153 HANDLE handle;
5154 WCHAR buffer[1024];
5156
5157 ctx.cbSize = sizeof(ctx);
5158 ctx.lpSource = NULL;
5159 ctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
5160 ctx.hModule = NtCurrentTeb()->ProcessEnvironmentBlock->ImageBaseAddress;
5162
5164 {
5166 }
5167
5168 /* ReactOS specific:
5169 Now that we have found the process_actctx we can initialize the process compat subsystem */
5171
5172
5173 ctx.dwFlags = 0;
5174 ctx.hModule = NULL;
5175 ctx.lpResourceName = NULL;
5176 ctx.lpSource = buffer;
5178 RtlStringCchCatW(buffer, RTL_NUMBER_OF(buffer), L"\\winsxs\\manifests\\systemcompatible.manifest");
5179
5181 if (NT_SUCCESS(Status))
5182 {
5184 }
5185 else
5186 {
5187 DPRINT1("Failed to create the implicit act ctx. Status: 0x%x!!!\n", Status);
5188 }
5189
5190#ifdef __REACTOS__
5191 NtCurrentTeb()->ProcessEnvironmentBlock->ActivationContextData = process_actctx->ActivationContextData;
5192#else
5193 NtCurrentTeb()->Peb->ActivationContextData = process_actctx;
5194#endif // __REACTOS__
5195}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
GLuint buffer
Definition: glext.h:5915
NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE *, const void *)
#define NtCurrentTeb
VOID NTAPI LdrpInitializeProcessCompat(PVOID pProcessActctx, PVOID *pOldShimData)
Definition: ldrinit.c:1580
NTSTRSAFEAPI RtlStringCchCopyW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
Definition: ntstrsafe.h:127
NTSTRSAFEAPI RtlStringCchCatW(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
Definition: ntstrsafe.h:601
#define L(x)
Definition: ntvdm.h:50
#define SharedUserData
static ACTIVATION_CONTEXT * implicit_actctx
Definition: actctx.c:833
static ACTIVATION_CONTEXT * process_actctx
Definition: actctx.c:832
#define CREATEPROCESS_MANIFEST_RESOURCE_ID
Definition: actctx.c:70
static ACTIVATION_CONTEXT * check_actctx(HANDLE h)
Definition: actctx.c:1259
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by LdrpInitializeProcess().

◆ actctx_release()

static void actctx_release ( ACTIVATION_CONTEXT actctx)
static

Definition at line 1286 of file actctx.c.

1287{
1288 PACTIVATION_CONTEXT_WRAPPED pActual;
1289
1290 if (InterlockedExchangeAdd(&actctx->RefCount, -1) == 1)
1291 {
1292 unsigned int i, j;
1293
1294 for (i = 0; i < actctx->num_assemblies; i++)
1295 {
1296 struct assembly *assembly = &actctx->assemblies[i];
1297 for (j = 0; j < assembly->num_dlls; j++)
1298 {
1299 struct dll_redirect *dll = &assembly->dlls[j];
1300 free_entity_array( &dll->entities );
1301 RtlFreeHeap( GetProcessHeap(), 0, dll->name );
1302 RtlFreeHeap( GetProcessHeap(), 0, dll->hash );
1303 }
1310 }
1311 RtlFreeHeap( GetProcessHeap(), 0, actctx->config.info );
1312 RtlFreeHeap( GetProcessHeap(), 0, actctx->appdir.info );
1313 RtlFreeHeap( GetProcessHeap(), 0, actctx->assemblies );
1314 RtlFreeHeap( GetProcessHeap(), 0, actctx->dllredirect_section );
1315 RtlFreeHeap( GetProcessHeap(), 0, actctx->wndclass_section );
1316 RtlFreeHeap( GetProcessHeap(), 0, actctx->tlib_section );
1317 RtlFreeHeap( GetProcessHeap(), 0, actctx->comserver_section );
1318 RtlFreeHeap( GetProcessHeap(), 0, actctx->ifaceps_section );
1319 RtlFreeHeap( GetProcessHeap(), 0, actctx->clrsurrogate_section );
1320 RtlFreeHeap( GetProcessHeap(), 0, actctx->progid_section );
1321
1322 pActual = CONTAINING_RECORD(actctx, ACTIVATION_CONTEXT_WRAPPED, ActivationContext);
1323 pActual->MagicMarker = 0;
1324 RtlFreeHeap(GetProcessHeap(), 0, pActual);
1325 }
1326}
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
#define GetProcessHeap()
Definition: compat.h:736
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static HMODULE dll
Definition: str.c:188
static void free_entity_array(struct entity_array *array)
Definition: actctx.c:1048
static void free_assembly_identity(struct assembly_identity *ai)
Definition: actctx.c:1011
WCHAR * directory
Definition: actctx.c:531
struct dll_redirect * dlls
Definition: actctx.c:533
struct assembly_identity id
Definition: actctx.c:529
unsigned int num_dlls
Definition: actctx.c:534
struct file_info manifest
Definition: actctx.c:530
struct entity_array entities
Definition: actctx.c:536
COMPATIBILITY_CONTEXT_ELEMENT * compat_contexts
Definition: actctx.c:537
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by RtlCreateActivationContext(), and RtlReleaseActivationContext().

◆ add_assembly()

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

Definition at line 935 of file actctx.c.

936{
937 struct assembly *assembly;
938
939 DPRINT("add_assembly() actctx %p, activeframe ??\n", actctx);
940
941 if (actctx->num_assemblies == actctx->allocated_assemblies)
942 {
943 void *ptr;
944 unsigned int new_count;
945 if (actctx->assemblies)
946 {
947 new_count = actctx->allocated_assemblies * 2;
949 actctx->assemblies, new_count * sizeof(*assembly) );
950 }
951 else
952 {
953 new_count = 4;
954 ptr = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*assembly) );
955 }
956 if (!ptr) return NULL;
957 actctx->assemblies = ptr;
958 actctx->allocated_assemblies = new_count;
959 }
960
961 assembly = &actctx->assemblies[actctx->num_assemblies++];
962 assembly->type = at;
963 return assembly;
964}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE, ULONG, PVOID, SIZE_T)
Definition: heap.c:2686
static PVOID ptr
Definition: dispmode.c:27
#define DPRINT
Definition: sndvol32.h:73
BSTR type
Definition: cache.c:326

Referenced by parse_manifest().

◆ add_compat_context()

static PCOMPATIBILITY_CONTEXT_ELEMENT add_compat_context ( struct assembly assembly)
static

Definition at line 992 of file actctx.c.

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

Referenced by parse_supportedos_elem().

◆ add_comserver_record()

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

Definition at line 4169 of file actctx.c.

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

Referenced by build_comserver_section().

◆ add_dependent_assembly_id()

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

Definition at line 1123 of file actctx.c.

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

Referenced by parse_dependent_assembly_elem().

◆ add_dll_redirect()

static struct dll_redirect * add_dll_redirect ( struct assembly assembly)
static

Definition at line 966 of file actctx.c.

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

Referenced by parse_file_elem().

◆ add_entity()

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

Definition at line 1020 of file actctx.c.

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

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

◆ add_ifaceps_record()

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

Definition at line 4475 of file actctx.c.

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

Referenced by build_ifaceps_section().

◆ add_progid_record()

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

Definition at line 4895 of file actctx.c.

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

Referenced by build_progid_section().

◆ aligned_string_len()

◆ append_string()

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

Definition at line 1211 of file actctx.c.

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

Referenced by build_assembly_id().

◆ build_assembly_dir()

static WCHAR * build_assembly_dir ( struct assembly_identity ai)
static

Definition at line 1180 of file actctx.c.

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

Referenced by lookup_assembly().

◆ build_assembly_id()

static WCHAR * build_assembly_id ( const struct assembly_identity ai)
static

Definition at line 1225 of file actctx.c.

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

Referenced by RtlQueryInformationActivationContext().

◆ build_clr_surrogate_section()

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

Definition at line 4669 of file actctx.c.

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

Referenced by find_clr_surrogate().

◆ build_comserver_section()

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

Definition at line 4350 of file actctx.c.

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

Referenced by find_comserver_redirection(), and find_progid_redirection().

◆ build_dllredirect_section()

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

Definition at line 3526 of file actctx.c.

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

Referenced by find_dll_redirection().

◆ build_ifaceps_section()

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

Definition at line 4564 of file actctx.c.

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

Referenced by find_cominterface_redirection().

◆ build_progid_section()

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

Definition at line 4932 of file actctx.c.

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

Referenced by find_progid_redirection().

◆ build_tlib_section()

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

Definition at line 3932 of file actctx.c.

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

Referenced by find_tlib_redirection().

◆ build_wndclass_section()

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

Definition at line 3728 of file actctx.c.

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

Referenced by find_window_class().

◆ check_actctx()

static ACTIVATION_CONTEXT * check_actctx ( HANDLE  h)
static

Definition at line 1259 of file actctx.c.

1260{
1262 PACTIVATION_CONTEXT_WRAPPED pActual;
1263
1264 if (!h || h == INVALID_HANDLE_VALUE) return NULL;
1265 __TRY
1266 {
1267 if (actctx)
1268 {
1269 pActual = CONTAINING_RECORD(actctx, ACTIVATION_CONTEXT_WRAPPED, ActivationContext);
1270 if (pActual->MagicMarker == ACTCTX_MAGIC_MARKER) ret = &pActual->ActivationContext;
1271 }
1272 }
1274 {
1275 DPRINT1("Invalid activation context handle!\n");
1276 }
1277 __ENDTRY
1278 return ret;
1279}
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define __TRY
Definition: compat.h:80
#define __ENDTRY
Definition: compat.h:82
#define __EXCEPT_PAGE_FAULT
Definition: compat.h:81
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define ACTCTX_MAGIC_MARKER
Definition: actctx.c:63

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

◆ com_class_add_progid()

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

Definition at line 1739 of file actctx.c.

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

Referenced by parse_com_class_progid().

◆ debugstr_version()

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

Definition at line 906 of file actctx.c.

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

◆ debugstr_xmlstr()

static const char * debugstr_xmlstr ( const xmlstr_t str)
inlinestatic

Definition at line 901 of file actctx.c.

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

◆ find_app_settings()

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

Definition at line 5130 of file actctx.c.

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

Referenced by RtlQueryActivationContextApplicationSettings().

◆ find_clr_surrogate()

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

Definition at line 4785 of file actctx.c.

4786{
4787 struct clrsurrogate_data *surrogate;
4788 struct guid_index *index = NULL;
4789
4790 if (!(actctx->sections & CLRSURROGATES_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4791
4792 if (!actctx->clrsurrogate_section)
4793 {
4795
4797 if (status) return status;
4798
4799 if (InterlockedCompareExchangePointer((void**)&actctx->clrsurrogate_section, section, NULL))
4801 }
4802
4803 index = find_guid_index(actctx->clrsurrogate_section, guid);
4804 if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4805
4806 surrogate = get_surrogate_data(actctx, index);
4807
4808 data->ulDataFormatVersion = 1;
4809 data->lpData = surrogate;
4810 /* full length includes string length with nulls */
4811 data->ulLength = surrogate->size + surrogate->name_len + sizeof(WCHAR);
4812 if (surrogate->version_len)
4813 data->ulLength += surrogate->version_len + sizeof(WCHAR);
4814
4815 data->lpSectionGlobalData = NULL;
4816 data->ulSectionGlobalDataLength = 0;
4817 data->lpSectionBase = actctx->clrsurrogate_section;
4818 data->ulSectionTotalLength = RtlSizeHeap( GetProcessHeap(), 0, actctx->clrsurrogate_section );
4819 data->hActCtx = NULL;
4820
4821 if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4822 data->ulAssemblyRosterIndex = index->rosterindex;
4823
4824 return STATUS_SUCCESS;
4825}
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
const GUID * guid
NTSYSAPI SIZE_T NTAPI RtlSizeHeap(_In_ PVOID HeapHandle, _In_ ULONG Flags, _In_ PVOID MemoryPointer)
#define STATUS_SXS_KEY_NOT_FOUND
Definition: ntstatus.h:1389
static struct clrsurrogate_data * get_surrogate_data(ACTIVATION_CONTEXT *actctx, const struct guid_index *index)
Definition: actctx.c:4780
static NTSTATUS build_clr_surrogate_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4669
Definition: ps.c:97
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by find_guid().

◆ find_cominterface_redirection()

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

Definition at line 4631 of file actctx.c.

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

Referenced by find_guid().

◆ find_comserver_redirection()

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

Definition at line 4418 of file actctx.c.

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

Referenced by find_guid().

◆ find_dll_redirection()

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

Definition at line 3673 of file actctx.c.

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

Referenced by find_string().

◆ find_guid()

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

Definition at line 5096 of file actctx.c.

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

Referenced by RtlFindActivationContextSectionGuid().

◆ find_guid_index()

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

Definition at line 3648 of file actctx.c.

3649{
3650 struct guid_index *iter, *index = NULL;
3651 ULONG i;
3652
3653 iter = (struct guid_index*)((BYTE*)section + section->index_offset);
3654
3655 for (i = 0; i < section->count; i++)
3656 {
3657 if (!memcmp(guid, &iter->guid, sizeof(*guid)))
3658 {
3659 index = iter;
3660 break;
3661 }
3662 iter++;
3663 }
3664
3665 return index;
3666}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112

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

◆ find_progid_redirection()

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

Definition at line 5003 of file actctx.c.

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

Referenced by find_string().

◆ find_query_actctx()

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

Definition at line 3491 of file actctx.c.

3492{
3494
3496 {
3497 if (*handle) return STATUS_INVALID_PARAMETER;
3498
3499 if (NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame)
3500 *handle = NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame->ActivationContext;
3501 }
3503 {
3506
3507 if (!*handle) return STATUS_INVALID_PARAMETER;
3508
3510 if (!LdrFindEntryForAddress( *handle, &pldr ))
3511 {
3514 else
3516 }
3519 }
3520 else if (!*handle && (class != ActivationContextBasicInformation))
3522
3523 return status;
3524}
NTSTATUS NTAPI LdrUnlockLoaderLock(_In_ ULONG Flags, _In_opt_ ULONG_PTR Cookie)
Definition: ldrapi.c:101
NTSTATUS NTAPI LdrLockLoaderLock(_In_ ULONG Flags, _Out_opt_ PULONG Disposition, _Out_opt_ PULONG_PTR Cookie)