ReactOS  0.4.14-dev-98-gb0d4763
actctx.c File Reference
#include <rtl.h>
#include <ntstrsafe.h>
#include <compat_undoc.h>
#include <debug.h>
#include <wine/unicode.h>
Include dependency graph for actctx.c:

Go to the source code of this file.

Classes

struct  xmlstr_t
 
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  _ASSEMBLY_STORAGE_MAP_ENTRY
 
struct  _ASSEMBLY_STORAGE_MAP
 
struct  _ACTIVATION_CONTEXT
 
struct  actctx_loader
 
struct  _ACTIVATION_CONTEXT_WRAPPED
 
struct  olemisc_entry
 

Macros

#define NDEBUG
 
#define ACTCTX_FLAGS_ALL
 
#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 FIND_ACTCTX_RETURN_FLAGS   0x00000002
 
#define FIND_ACTCTX_RETURN_ASSEMBLY_METADATA   0x00000004
 
#define FIND_ACTCTX_VALID_MASK   (FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX | FIND_ACTCTX_RETURN_FLAGS | FIND_ACTCTX_RETURN_ASSEMBLY_METADATA)
 

Typedefs

typedef struct _ASSEMBLY_STORAGE_MAP_ENTRY ASSEMBLY_STORAGE_MAP_ENTRY
 
typedef struct _ASSEMBLY_STORAGE_MAP_ENTRYPASSEMBLY_STORAGE_MAP_ENTRY
 
typedef struct _ASSEMBLY_STORAGE_MAP ASSEMBLY_STORAGE_MAP
 
typedef struct _ASSEMBLY_STORAGE_MAPPASSEMBLY_STORAGE_MAP
 
typedef struct _ACTIVATION_CONTEXT ACTIVATION_CONTEXT
 
typedef struct _ACTIVATION_CONTEXTPIACTIVATION_CONTEXT
 
typedef struct _ACTIVATION_CONTEXT_WRAPPED ACTIVATION_CONTEXT_WRAPPED
 
typedef struct _ACTIVATION_CONTEXT_WRAPPEDPACTIVATION_CONTEXT_WRAPPED
 

Enumerations

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

VOID NTAPI RtlpSxsBreakOnInvalidMarker (IN PACTIVATION_CONTEXT ActCtx, IN ULONG FailureCode)
 
FORCEINLINE VOID RtlpValidateActCtx (IN PACTIVATION_CONTEXT ActCtx)
 
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 xmlstr_cmp_end (const xmlstr_t *xmlstr, const WCHAR *str)
 
static BOOL xml_elem_cmp (const xmlstr_t *elem, const WCHAR *str, const WCHAR *namespace)
 
static BOOL xml_elem_cmp_end (const xmlstr_t *elem, const WCHAR *str, const WCHAR *namespace)
 
static BOOL isxmlspace (WCHAR ch)
 
static UNICODE_STRING xmlstr2unicode (const xmlstr_t *xmlstr)
 
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 next_xml_attr (xmlbuf_t *xmlbuf, xmlstr_t *name, xmlstr_t *value, BOOL *error, BOOL *end)
 
static BOOL next_xml_elem (xmlbuf_t *xmlbuf, xmlstr_t *elem)
 
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 BOOL parse_expect_elem (xmlbuf_t *xmlbuf, const WCHAR *name, const WCHAR *namespace)
 
static BOOL parse_expect_no_attr (xmlbuf_t *xmlbuf, BOOL *end)
 
static BOOL parse_end_element (xmlbuf_t *xmlbuf)
 
static BOOL parse_expect_end_elem (xmlbuf_t *xmlbuf, const WCHAR *name, const WCHAR *namespace)
 
static BOOL parse_unknown_elem (xmlbuf_t *xmlbuf, const xmlstr_t *unknown_elem)
 
static BOOL parse_assembly_identity_elem (xmlbuf_t *xmlbuf, ACTIVATION_CONTEXT *actctx, struct assembly_identity *ai)
 
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 BOOL parse_com_class_progid (xmlbuf_t *xmlbuf, struct entity *entity)
 
static BOOL parse_com_class_elem (xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl)
 
static BOOL parse_nummethods (const xmlstr_t *str, struct entity *entity)
 
static BOOL parse_cominterface_proxy_stub_elem (xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl)
 
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 BOOL parse_typelib_elem (xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl)
 
static int aligned_string_len (int len)
 
static int get_assembly_version (struct assembly *assembly, WCHAR *ret)
 
static BOOL parse_window_class_elem (xmlbuf_t *xmlbuf, struct dll_redirect *dll, struct actctx_loader *acl)
 
static BOOL parse_binding_redirect_elem (xmlbuf_t *xmlbuf)
 
static BOOL parse_description_elem (xmlbuf_t *xmlbuf)
 
static BOOL parse_com_interface_external_proxy_stub_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
 
static BOOL parse_clr_class_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
 
static BOOL parse_clr_surrogate_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
 
static BOOL parse_dependent_assembly_elem (xmlbuf_t *xmlbuf, struct actctx_loader *acl, BOOL optional)
 
static BOOL parse_dependency_elem (xmlbuf_t *xmlbuf, struct actctx_loader *acl)
 
static BOOL parse_noinherit_elem (xmlbuf_t *xmlbuf)
 
static BOOL parse_noinheritable_elem (xmlbuf_t *xmlbuf)
 
static BOOL parse_file_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
 
static BOOL parse_supportedos_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
 
static BOOL parse_compatibility_application_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
 
static BOOL parse_compatibility_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
 
static BOOL parse_requested_execution_level_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
 
static BOOL parse_requested_privileges_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
 
static BOOL parse_security_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
 
static BOOL parse_trust_info_elem (xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl)
 
static BOOL parse_assembly_elem (xmlbuf_t *xmlbuf, struct actctx_loader *acl, struct assembly *assembly, struct assembly_identity *expected_ai)
 
static NTSTATUS parse_manifest_buffer (struct actctx_loader *acl, struct assembly *assembly, struct assembly_identity *ai, xmlbuf_t *xmlbuf)
 
static NTSTATUS parse_manifest (struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, const void *buffer, SIZE_T size)
 
static NTSTATUS open_nt_file (HANDLE *handle, UNICODE_STRING *name)
 
static NTSTATUS get_module_filename (HMODULE module, UNICODE_STRING *str, USHORT extra_len)
 
static NTSTATUS get_manifest_in_module (struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, HANDLE hModule, LPCWSTR resname, ULONG lang)
 
IMAGE_RESOURCE_DIRECTORYfind_entry_by_name (IMAGE_RESOURCE_DIRECTORY *dir, LPCWSTR name, void *root, int want_dir)
 
IMAGE_RESOURCE_DIRECTORYfind_first_entry (IMAGE_RESOURCE_DIRECTORY *dir, void *root, int want_dir)
 
static IMAGE_RESOURCE_DIRECTORYfind_first_id_entry (IMAGE_RESOURCE_DIRECTORY *dir, void *root, int want_dir)
 
static NTSTATUS search_manifest_in_module (struct actctx_loader *acl, struct assembly_identity *ai, LPCWSTR filename, LPCWSTR directory, BOOL shared, HANDLE hModule, 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 void 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 void 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 void add_progid_record (ACTIVATION_CONTEXT *actctx, struct strsection_header *section, const struct entity_array *entities, struct string_index **index, ULONG *data_offset, ULONG *global_offset, ULONG rosterindex)
 
static NTSTATUS build_progid_section (ACTIVATION_CONTEXT *actctx, struct strsection_header **section)
 
static struct progidredirect_dataget_progid_data (ACTIVATION_CONTEXT *actctx, const struct string_index *index)
 
static NTSTATUS find_progid_redirection (ACTIVATION_CONTEXT *actctx, const UNICODE_STRING *name, PACTCTX_SECTION_KEYED_DATA data)
 
static NTSTATUS find_string (ACTIVATION_CONTEXT *actctx, ULONG section_kind, const UNICODE_STRING *section_name, DWORD flags, PACTCTX_SECTION_KEYED_DATA data)
 
static NTSTATUS find_guid (ACTIVATION_CONTEXT *actctx, ULONG section_kind, const GUID *guid, DWORD flags, PACTCTX_SECTION_KEYED_DATA data)
 
void actctx_init (PVOID *pOldShimData)
 
NTSTATUS NTAPI RtlCreateActivationContext (IN ULONG Flags, IN PACTIVATION_CONTEXT_DATA ActivationContextData, IN ULONG ExtraBytes, IN PVOID NotificationRoutine, IN PVOID NotificationContext, OUT PACTIVATION_CONTEXT *ActCtx)
 
VOID NTAPI RtlAddRefActivationContext (HANDLE handle)
 
VOID NTAPI RtlReleaseActivationContext (HANDLE handle)
 
NTSTATUS NTAPI RtlZombifyActivationContext (PVOID Context)
 
NTSTATUS NTAPI RtlActivateActivationContextEx (ULONG flags, PTEB tebAddress, HANDLE handle, PULONG_PTR cookie)
 
NTSTATUS NTAPI RtlActivateActivationContext (ULONG flags, HANDLE handle, PULONG_PTR cookie)
 
NTSTATUS NTAPI RtlDeactivateActivationContext (ULONG flags, ULONG_PTR cookie)
 
VOID NTAPI RtlFreeActivationContextStack (IN PACTIVATION_CONTEXT_STACK Stack)
 
VOID NTAPI RtlFreeThreadActivationContextStack (VOID)
 
NTSTATUS NTAPI RtlGetActiveActivationContext (HANDLE *handle)
 
BOOLEAN NTAPI RtlIsActivationContextActive (HANDLE handle)
 
NTSTATUS NTAPI RtlQueryInformationActivationContext (ULONG flags, HANDLE handle, PVOID subinst, ULONG class, PVOID buffer, SIZE_T bufsize, SIZE_T *retlen)
 
NTSTATUS NTAPI RtlQueryInformationActiveActivationContext (ULONG ulInfoClass, PVOID pvBuffer, SIZE_T cbBuffer OPTIONAL, SIZE_T *pcbWrittenOrRequired OPTIONAL)
 
NTSTATUS NTAPI RtlpFindActivationContextSection_CheckParameters (ULONG flags, const GUID *guid, ULONG section_kind, const UNICODE_STRING *section_name, PACTCTX_SECTION_KEYED_DATA data)
 
NTSTATUS NTAPI 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 NTAPI RtlAllocateActivationContextStack (IN PACTIVATION_CONTEXT_STACK *Stack)
 
PRTL_ACTIVATION_CONTEXT_STACK_FRAME FASTCALL RtlActivateActivationContextUnsafeFast (IN PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame, IN PVOID Context)
 
PRTL_ACTIVATION_CONTEXT_STACK_FRAME FASTCALL RtlDeactivateActivationContextUnsafeFast (IN PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame)
 

Variables

BOOLEAN RtlpNotAllowingMultipleActivation
 
static const WCHAR asmv1W [] = {'a','s','m','v','1',':',0}
 
static const WCHAR asmv2W [] = {'a','s','m','v','2',':',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 struct olemisc_entry olemisc_values []
 
static const WCHAR g_xmlW [] = {'?','x','m','l',0}
 
static const WCHAR manifestv1W [] = {'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 manifestv2W [] = {'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 manifestv3W [] = {'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 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 44 of file actctx.c.

◆ ACTCTX_FAKE_HANDLE

#define ACTCTX_FAKE_HANDLE   ((HANDLE) 0xf00baa)

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

◆ ACTCTX_MAGIC_MARKER

#define ACTCTX_MAGIC_MARKER   (PVOID)'gMcA'

Definition at line 41 of file actctx.c.

◆ FIND_ACTCTX_RETURN_ASSEMBLY_METADATA

#define FIND_ACTCTX_RETURN_ASSEMBLY_METADATA   0x00000004

Definition at line 5708 of file actctx.c.

◆ FIND_ACTCTX_RETURN_FLAGS

#define FIND_ACTCTX_RETURN_FLAGS   0x00000002

Definition at line 5707 of file actctx.c.

◆ FIND_ACTCTX_VALID_MASK

#define FIND_ACTCTX_VALID_MASK   (FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX | FIND_ACTCTX_RETURN_FLAGS | FIND_ACTCTX_RETURN_ASSEMBLY_METADATA)

Definition at line 5709 of file actctx.c.

◆ GUIDSECTION_MAGIC

#define GUIDSECTION_MAGIC   0x64487347 /* dHsG */

Definition at line 39 of file actctx.c.

◆ NDEBUG

#define NDEBUG

Definition at line 21 of file actctx.c.

◆ STRSECTION_MAGIC

#define STRSECTION_MAGIC   0x64487353 /* dHsS */

Definition at line 38 of file actctx.c.

Typedef Documentation

◆ ACTIVATION_CONTEXT

◆ ACTIVATION_CONTEXT_WRAPPED

◆ ASSEMBLY_STORAGE_MAP

◆ ASSEMBLY_STORAGE_MAP_ENTRY

◆ PACTIVATION_CONTEXT_WRAPPED

◆ PASSEMBLY_STORAGE_MAP

◆ PASSEMBLY_STORAGE_MAP_ENTRY

◆ PIACTIVATION_CONTEXT

Enumeration Type Documentation

◆ assembly_type

Enumerator
APPLICATION_MANIFEST 
ASSEMBLY_MANIFEST 
ASSEMBLY_SHARED_MANIFEST 

Definition at line 436 of file actctx.c.

◆ comclass_miscfields

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

Definition at line 168 of file actctx.c.

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

◆ context_sections

Enumerator
WINDOWCLASS_SECTION 
DLLREDIRECT_SECTION 
TLIBREDIRECT_SECTION 
SERVERREDIRECT_SECTION 
IFACEREDIRECT_SECTION 
CLRSURROGATES_SECTION 
PROGIDREDIRECT_SECTION 

Definition at line 460 of file actctx.c.

◆ ifaceps_mask

Enumerator
NumMethods 
BaseIface 
NumMethods 
BaseIface 

Definition at line 201 of file actctx.c.

202 {
203  NumMethods = 1,
204  BaseIface = 2
205 };

Function Documentation

◆ actctx_addref()

static void actctx_addref ( ACTIVATION_CONTEXT actctx)
inlinestatic

Definition at line 1129 of file actctx.c.

1130 {
1131  InterlockedExchangeAdd( &actctx->RefCount, 1 );
1132 }
#define actctx
Definition: kernel32.h:8
#define InterlockedExchangeAdd
Definition: interlocked.h:181

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

◆ actctx_init()

void actctx_init ( PVOID pOldShimData)

Definition at line 5003 of file actctx.c.

5004 {
5005  ACTCTXW ctx;
5006  HANDLE handle;
5007  WCHAR buffer[1024];
5008  NTSTATUS Status;
5009 
5010  ctx.cbSize = sizeof(ctx);
5011  ctx.lpSource = NULL;
5012  ctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
5013  ctx.hModule = NtCurrentTeb()->ProcessEnvironmentBlock->ImageBaseAddress;
5014  ctx.lpResourceName = (LPCWSTR)CREATEPROCESS_MANIFEST_RESOURCE_ID;
5015 
5017  {
5019  }
5020 
5021  /* ReactOS specific:
5022  Now that we have found the process_actctx we can initialize the process compat subsystem */
5024 
5025 
5026  ctx.dwFlags = 0;
5027  ctx.hModule = NULL;
5028  ctx.lpResourceName = NULL;
5029  ctx.lpSource = buffer;
5031 
5033  {
5034  RtlStringCchCatW(buffer, RTL_NUMBER_OF(buffer), L"\\winsxs\\manifests\\forwardcompatible.manifest");
5035  }
5036  else
5037  {
5038  RtlStringCchCatW(buffer, RTL_NUMBER_OF(buffer), L"\\winsxs\\manifests\\systemcompatible.manifest");
5039  }
5040 
5042  if (NT_SUCCESS(Status))
5043  {
5045  }
5046  else
5047  {
5048  DPRINT1("Failed to create the implicit act ctx. Status: 0x%x!!!\n", Status);
5049  }
5050 }
NTSTATUS NTAPI RtlCreateActivationContext(IN ULONG Flags, IN PACTIVATION_CONTEXT_DATA ActivationContextData, IN ULONG ExtraBytes, IN PVOID NotificationRoutine, IN PVOID NotificationContext, OUT PACTIVATION_CONTEXT *ActCtx)
Definition: actctx.c:5061
VOID NTAPI LdrpInitializeProcessCompat(PVOID pProcessActctx, PVOID *pOldShimData)
Definition: ldrinit.c:1542
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
LONG NTSTATUS
Definition: precomp.h:26
GLuint buffer
Definition: glext.h:5915
static ACTIVATION_CONTEXT * check_actctx(HANDLE h)
Definition: actctx.c:1107
smooth NULL
Definition: ftsmooth.c:416
static DWORD RosGetProcessCompatVersion(VOID)
Definition: compat_undoc.h:22
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTRSAFEAPI RtlStringCchCatW(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
Definition: ntstrsafe.h:601
#define SharedUserData
static const WCHAR L[]
Definition: oid.c:1250
static ACTIVATION_CONTEXT * process_actctx
Definition: actctx.c:712
Status
Definition: gdiplustypes.h:24
NTSTRSAFEAPI RtlStringCchCopyW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
Definition: ntstrsafe.h:127
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define DPRINT1
Definition: precomp.h:8
static const GUID LPCWSTR
Definition: actctx.c:37
#define CREATEPROCESS_MANIFEST_RESOURCE_ID
Definition: winuser.h:621
static ACTIVATION_CONTEXT * implicit_actctx
Definition: actctx.c:713

Referenced by LdrpInitializeProcess().

◆ actctx_release()

static void actctx_release ( ACTIVATION_CONTEXT actctx)
static

Definition at line 1134 of file actctx.c.

1135 {
1137 
1138  if (InterlockedExchangeAdd(&actctx->RefCount, -1) == 1)
1139  {
1140  unsigned int i, j;
1141 
1142  for (i = 0; i < actctx->num_assemblies; i++)
1143  {
1144  struct assembly *assembly = &actctx->assemblies[i];
1145  for (j = 0; j < assembly->num_dlls; j++)
1146  {
1147  struct dll_redirect *dll = &assembly->dlls[j];
1148  free_entity_array( &dll->entities );
1149  RtlFreeHeap( RtlGetProcessHeap(), 0, dll->name );
1150  RtlFreeHeap( RtlGetProcessHeap(), 0, dll->hash );
1151  }
1152  RtlFreeHeap( RtlGetProcessHeap(), 0, assembly->dlls );
1153  RtlFreeHeap( RtlGetProcessHeap(), 0, assembly->manifest.info );
1154  RtlFreeHeap( RtlGetProcessHeap(), 0, assembly->directory );
1155  RtlFreeHeap( RtlGetProcessHeap(), 0, assembly->compat_contexts );
1158  }
1159  RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->config.info );
1160  RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->appdir.info );
1161  RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->assemblies );
1162  RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->dllredirect_section );
1163  RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->wndclass_section );
1164  RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->tlib_section );
1165  RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->comserver_section );
1166  RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->ifaceps_section );
1167  RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->clrsurrogate_section );
1168  RtlFreeHeap( RtlGetProcessHeap(), 0, actctx->progid_section );
1169 
1170  pActual = CONTAINING_RECORD(actctx, ACTIVATION_CONTEXT_WRAPPED, ActivationContext);
1171  pActual->MagicMarker = 0;
1172  RtlFreeHeap(RtlGetProcessHeap(), 0, pActual);
1173  }
1174 }
static void free_entity_array(struct entity_array *array)
Definition: actctx.c:901
struct file_info manifest
Definition: actctx.c:447
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
static HMODULE dll
Definition: str.c:188
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
WCHAR * directory
Definition: actctx.c:448
#define actctx
Definition: kernel32.h:8
COMPATIBILITY_CONTEXT_ELEMENT * compat_contexts
Definition: actctx.c:454
#define InterlockedExchangeAdd
Definition: interlocked.h:181
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
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 void free_assembly_identity(struct assembly_identity *ai)
Definition: actctx.c:864
unsigned int num_dlls
Definition: actctx.c:451
struct dll_redirect * dlls
Definition: actctx.c:450
struct entity_array entities
Definition: actctx.c:453
struct assembly_identity id
Definition: actctx.c:446

Referenced by RtlCreateActivationContext(), and RtlReleaseActivationContext().

◆ add_assembly()

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

Definition at line 788 of file actctx.c.

789 {
790  struct assembly *assembly;
791 
792  DPRINT("add_assembly() actctx %p, activeframe ??\n", actctx);
793 
794  if (actctx->num_assemblies == actctx->allocated_assemblies)
795  {
796  void *ptr;
797  unsigned int new_count;
798  if (actctx->assemblies)
799  {
800  new_count = actctx->allocated_assemblies * 2;
801  ptr = RtlReAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY,
802  actctx->assemblies, new_count * sizeof(*assembly) );
803  }
804  else
805  {
806  new_count = 4;
807  ptr = RtlAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*assembly) );
808  }
809  if (!ptr) return NULL;
810  actctx->assemblies = ptr;
811  actctx->allocated_assemblies = new_count;
812  }
813 
814  assembly = &actctx->assemblies[actctx->num_assemblies++];
815  assembly->type = at;
816  return assembly;
817 }
NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE, ULONG, PVOID, SIZE_T)
Definition: heap.c:2561
static struct _tagASSEMBLY assembly
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
#define actctx
Definition: kernel32.h:8
void DPRINT(...)
Definition: polytest.cpp:61
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
BSTR type
Definition: cache.c:326
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by parse_manifest().

◆ add_compat_context()

static PCOMPATIBILITY_CONTEXT_ELEMENT add_compat_context ( struct assembly assembly)
static

Definition at line 845 of file actctx.c.

846 {
847  void *ptr;
849  {
850  unsigned int new_count = assembly->num_compat_contexts + 1;
851  ptr = RtlReAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY,
853  new_count * sizeof(COMPATIBILITY_CONTEXT_ELEMENT) );
854  }
855  else
856  {
857  ptr = RtlAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(COMPATIBILITY_CONTEXT_ELEMENT) );
858  }
859  if (!ptr) return NULL;
862 }
NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE, ULONG, PVOID, SIZE_T)
Definition: heap.c:2561
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
COMPATIBILITY_CONTEXT_ELEMENT * compat_contexts
Definition: actctx.c:454
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
ULONG num_compat_contexts
Definition: actctx.c:455
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by parse_supportedos_elem().

◆ add_comserver_record()

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

4107 {
4108  unsigned int i;
4109 
4110  for (i = 0; i < entities->num; i++)
4111  {
4112  struct entity *entity = &entities->base[i];
4113  if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4114  {
4115  ULONG module_len, progid_len, str_len = 0;
4116  struct comclassredirect_data *data;
4117  struct guid_index *alias_index;
4118  struct clrclass_data *clrdata;
4120  WCHAR *ptrW;
4121 
4122  if (entity->u.comclass.progid)
4123  progid_len = strlenW(entity->u.comclass.progid)*sizeof(WCHAR);
4124  else
4125  progid_len = 0;
4126 
4127  module_len = dll ? strlenW(dll->name)*sizeof(WCHAR) : strlenW(mscoreeW)*sizeof(WCHAR);
4128 
4129  /* setup new index entry */
4131  RtlGUIDFromString(&str, &(*index)->guid);
4132 
4133  (*index)->data_offset = *data_offset;
4134  (*index)->data_len = sizeof(*data); /* additional length added later */
4135  (*index)->rosterindex = rosterindex;
4136 
4137  /* Setup new index entry for alias guid. Alias index records are placed after
4138  normal records, so normal guids are hit first on search. Note that class count
4139  is doubled. */
4140  alias_index = (*index) + section->count/2;
4141  generate_uuid(seed, &alias_index->guid);
4142  alias_index->data_offset = (*index)->data_offset;
4143  alias_index->data_len = 0;
4144  alias_index->rosterindex = (*index)->rosterindex;
4145 
4146  /* setup data */
4147  data = (struct comclassredirect_data*)((BYTE*)section + (*index)->data_offset);
4148  data->size = sizeof(*data);
4149  data->res = 0;
4150  data->res1[0] = 0;
4151  data->res1[1] = 0;
4152  data->model = entity->u.comclass.model;
4153  data->clsid = (*index)->guid;
4154  data->alias = alias_index->guid;
4155  data->clsid2 = data->clsid;
4156  if (entity->u.comclass.tlbid)
4157  {
4159  RtlGUIDFromString(&str, &data->tlbid);
4160  }
4161  else
4162  memset(&data->tlbid, 0, sizeof(data->tlbid));
4163  data->name_len = module_len;
4164  data->name_offset = *module_offset;
4165  data->progid_len = progid_len;
4166  data->progid_offset = data->progid_len ? data->size : 0; /* in case of clrClass additional offset is added later */
4167  data->clrdata_len = 0; /* will be set later */
4168  data->clrdata_offset = entity->u.comclass.name ? sizeof(*data) : 0;
4169  data->miscstatus = entity->u.comclass.miscstatus;
4170  data->miscstatuscontent = entity->u.comclass.miscstatuscontent;
4171  data->miscstatusthumbnail = entity->u.comclass.miscstatusthumbnail;
4172  data->miscstatusicon = entity->u.comclass.miscstatusicon;
4173  data->miscstatusdocprint = entity->u.comclass.miscstatusdocprint;
4174 
4175  /* mask describes which misc* data is available */
4176  data->miscmask = 0;
4177  if (data->miscstatus)
4178  data->miscmask |= MiscStatus;
4179  if (data->miscstatuscontent)
4180  data->miscmask |= MiscStatusContent;
4181  if (data->miscstatusthumbnail)
4182  data->miscmask |= MiscStatusThumbnail;
4183  if (data->miscstatusicon)
4184  data->miscmask |= MiscStatusIcon;
4185  if (data->miscstatusdocprint)
4186  data->miscmask |= MiscStatusDocPrint;
4187 
4188  if (data->clrdata_offset)
4189  {
4190  clrdata = (struct clrclass_data*)((BYTE*)data + data->clrdata_offset);
4191 
4192  clrdata->size = sizeof(*clrdata);
4193  clrdata->res[0] = 0;
4194  clrdata->res[1] = 2; /* FIXME: unknown field */
4195  clrdata->module_len = strlenW(mscoreeW)*sizeof(WCHAR);
4196  clrdata->module_offset = *module_offset + data->name_len + sizeof(WCHAR);
4197  clrdata->name_len = strlenW(entity->u.comclass.name)*sizeof(WCHAR);
4198  clrdata->name_offset = clrdata->size;
4199  clrdata->version_len = entity->u.comclass.version ? strlenW(entity->u.comclass.version)*sizeof(WCHAR) : 0;
4200  clrdata->version_offset = clrdata->version_len ? clrdata->name_offset + clrdata->name_len + sizeof(WCHAR) : 0;
4201  clrdata->res2[0] = 0;
4202  clrdata->res2[1] = 0;
4203 
4204  data->clrdata_len = clrdata->size + clrdata->name_len + sizeof(WCHAR);
4205 
4206  /* module name */
4207  ptrW = (WCHAR*)((BYTE*)section + clrdata->module_offset);
4208  memcpy(ptrW, mscoree2W, clrdata->module_len);
4209  ptrW[clrdata->module_len/sizeof(WCHAR)] = 0;
4210 
4211  ptrW = (WCHAR*)((BYTE*)section + data->name_offset);
4212  memcpy(ptrW, mscoreeW, data->name_len);
4213  ptrW[data->name_len/sizeof(WCHAR)] = 0;
4214 
4215  /* class name */
4216  ptrW = (WCHAR*)((BYTE*)clrdata + clrdata->name_offset);
4217  memcpy(ptrW, entity->u.comclass.name, clrdata->name_len);
4218  ptrW[clrdata->name_len/sizeof(WCHAR)] = 0;
4219 
4220  /* runtime version, optional */
4221  if (clrdata->version_len)
4222  {
4223  data->clrdata_len += clrdata->version_len + sizeof(WCHAR);
4224 
4225  ptrW = (WCHAR*)((BYTE*)clrdata + clrdata->version_offset);
4226  memcpy(ptrW, entity->u.comclass.version, clrdata->version_len);
4227  ptrW[clrdata->version_len/sizeof(WCHAR)] = 0;
4228  }
4229 
4230  if (data->progid_len)
4231  data->progid_offset += data->clrdata_len;
4232  (*index)->data_len += sizeof(*clrdata);
4233  }
4234  else
4235  {
4236  clrdata = NULL;
4237 
4238  /* module name */
4239  ptrW = (WCHAR*)((BYTE*)section + data->name_offset);
4240  memcpy(ptrW, dll->name, data->name_len);
4241  ptrW[data->name_len/sizeof(WCHAR)] = 0;
4242  }
4243 
4244  /* progid string */
4245  if (data->progid_len)
4246  {
4247  ptrW = (WCHAR*)((BYTE*)data + data->progid_offset);
4248  memcpy(ptrW, entity->u.comclass.progid, data->progid_len);
4249  ptrW[data->progid_len/sizeof(WCHAR)] = 0;
4250  }
4251 
4252  /* string block length */
4253  str_len = 0;
4254  if (clrdata)
4255  {
4256  str_len += clrdata->name_len + sizeof(WCHAR);
4257  if (clrdata->version_len)
4258  str_len += clrdata->version_len + sizeof(WCHAR);
4259  }
4260  if (progid_len)
4261  str_len += progid_len + sizeof(WCHAR);
4262 
4263  (*index)->data_len += aligned_string_len(str_len);
4264  alias_index->data_len = (*index)->data_len;
4265 
4266  /* move to next data record */
4267  (*data_offset) += sizeof(*data) + aligned_string_len(str_len);
4268  (*module_offset) += module_len + sizeof(WCHAR);
4269 
4270  if (clrdata)
4271  {
4272  (*data_offset) += sizeof(*clrdata);
4273  (*module_offset) += clrdata->module_len + sizeof(WCHAR);
4274  }
4275  (*index) += 1;
4276  }
4277  }
4278 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
DWORD res2[2]
Definition: actctx.c:1411
static const Entity entities[NUM_ENTITIES]
Definition: tinyxml2.cpp:129
union entity::@3982 u
#define str_len
Definition: treelist.c:89
Definition: parser.c:55
static const WCHAR mscoree2W[]
Definition: actctx.c:635
ULONG data_offset
Definition: actctx.c:1084
static HMODULE dll
Definition: str.c:188
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
Definition: actctx.c:371
struct entity::@3982::@3984 comclass
ULONG version_len
Definition: actctx.c:1409
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
ULONG version_offset
Definition: actctx.c:1410
ULONG rosterindex
Definition: actctx.c:1086
ULONG name_offset
Definition: actctx.c:1408
ULONG name_len
Definition: actctx.c:1407
ULONG size
Definition: actctx.c:1403
__wchar_t WCHAR
Definition: xmlstorage.h:180
static int aligned_string_len(int len)
Definition: actctx.c:1850
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
ULONG data_len
Definition: actctx.c:1085
GUID guid
Definition: actctx.c:1083
ULONG module_offset
Definition: actctx.c:1406
static const WCHAR mscoreeW[]
Definition: actctx.c:634
ULONG module_len
Definition: actctx.c:1405
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define memset(x, y, z)
Definition: compat.h:39
DWORD res[2]
Definition: actctx.c:1404
static void generate_uuid(ULONG *seed, GUID *guid)
Definition: actctx.c:4041
DWORD kind
Definition: actctx.c:373

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

973 {
974  unsigned int i;
975 
976  /* check if we already have that assembly */
977 
978  for (i = 0; i < acl->actctx->num_assemblies; i++)
979  if (is_matching_identity( ai, &acl->actctx->assemblies[i].id ))
980  {
981  DPRINT( "reusing existing assembly for %S arch %S version %u.%u.%u.%u\n",
982  ai->name, ai->arch, ai->version.major, ai->version.minor,
983  ai->version.build, ai->version.revision );
984  return TRUE;
985  }
986 
987  for (i = 0; i < acl->num_dependencies; i++)
988  if (is_matching_identity( ai, &acl->dependencies[i] ))
989  {
990  DPRINT( "reusing existing dependency for %S arch %S version %u.%u.%u.%u\n",
991  ai->name, ai->arch, ai->version.major, ai->version.minor,
992  ai->version.build, ai->version.revision );
993  return TRUE;
994  }
995 
996  if (acl->num_dependencies == acl->allocated_dependencies)
997  {
998  void *ptr;
999  unsigned int new_count;
1000  if (acl->dependencies)
1001  {
1002  new_count = acl->allocated_dependencies * 2;
1003  ptr = RtlReAllocateHeap(RtlGetProcessHeap(), 0, acl->dependencies,
1004  new_count * sizeof(acl->dependencies[0]));
1005  }
1006  else
1007  {
1008  new_count = 4;
1009  ptr = RtlAllocateHeap(RtlGetProcessHeap(), 0, new_count * sizeof(acl->dependencies[0]));
1010  }
1011  if (!ptr) return FALSE;
1012  acl->dependencies = ptr;
1013  acl->allocated_dependencies = new_count;
1014  }
1015  acl->dependencies[acl->num_dependencies++] = *ai;
1016 
1017  return TRUE;
1018 }
unsigned int allocated_dependencies
Definition: actctx.c:520
struct assembly_identity * dependencies
Definition: actctx.c:518
#define TRUE
Definition: types.h:120
WCHAR * arch
Definition: actctx.c:77
NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE, ULONG, PVOID, SIZE_T)
Definition: heap.c:2561
struct assembly_version version
Definition: actctx.c:81
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
static PVOID ptr
Definition: dispmode.c:27
void DPRINT(...)
Definition: polytest.cpp:61
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
unsigned int num_assemblies
Definition: actctx.c:502
ACTIVATION_CONTEXT * actctx
Definition: actctx.c:517
struct assembly * assemblies
Definition: actctx.c:501
WCHAR * name
Definition: actctx.c:76
unsigned int num_dependencies
Definition: actctx.c:519
static BOOL is_matching_identity(const struct assembly_identity *id1, const struct assembly_identity *id2)
Definition: actctx.c:951

Referenced by parse_dependent_assembly_elem().

◆ add_dll_redirect()

static struct dll_redirect* add_dll_redirect ( struct assembly assembly)
static

Definition at line 819 of file actctx.c.

820 {
821  DPRINT("add_dll_redirect() to assembly %p, num_dlls %d\n", assembly, assembly->allocated_dlls);
822 
824  {
825  void *ptr;
826  unsigned int new_count;
827  if (assembly->dlls)
828  {
829  new_count = assembly->allocated_dlls * 2;
830  ptr = RtlReAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY,
831  assembly->dlls, new_count * sizeof(*assembly->dlls) );
832  }
833  else
834  {
835  new_count = 4;
836  ptr = RtlAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*assembly->dlls) );
837  }
838  if (!ptr) return NULL;
839  assembly->dlls = ptr;
840  assembly->allocated_dlls = new_count;
841  }
842  return &assembly->dlls[assembly->num_dlls++];
843 }
NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE, ULONG, PVOID, SIZE_T)
Definition: heap.c:2561
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
unsigned int num_dlls
Definition: actctx.c:451
struct dll_redirect * dlls
Definition: actctx.c:450
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
unsigned int allocated_dlls
Definition: actctx.c:452

Referenced by parse_file_elem().

◆ add_entity()

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

Definition at line 873 of file actctx.c.

874 {
875  struct entity* entity;
876 
877  if (array->num == array->allocated)
878  {
879  void *ptr;
880  unsigned int new_count;
881  if (array->base)
882  {
883  new_count = array->allocated * 2;
884  ptr = RtlReAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY,
885  array->base, new_count * sizeof(*array->base) );
886  }
887  else
888  {
889  new_count = 4;
890  ptr = RtlAllocateHeap( RtlGetProcessHeap(), HEAP_ZERO_MEMORY, new_count * sizeof(*array->base) );
891  }
892  if (!ptr) return NULL;
893  array->base = ptr;
894  array->allocated = new_count;
895  }
896  entity = &array->base[array->num++];
897  entity->kind = kind;
898  return entity;
899 }
NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE, ULONG, PVOID, SIZE_T)
Definition: heap.c:2561
Definition: actctx.c:371
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
unsigned num
Definition: undname.c:57
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
DWORD kind
Definition: actctx.c:373

Referenced by 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_typelib_elem(), and parse_window_class_elem().

◆ add_ifaceps_record()

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

Definition at line 4394 of file actctx.c.

4396 {
4397  unsigned int i;
4398 
4399  for (i = 0; i < entities->num; i++)
4400  {
4401  struct entity *entity = &entities->base[i];
4402  if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)
4403  {
4404  struct ifacepsredirect_data *data = (struct ifacepsredirect_data*)((BYTE*)section + *data_offset);
4406  ULONG name_len;
4407 
4408  if (entity->u.ifaceps.name)
4409  name_len = strlenW(entity->u.ifaceps.name)*sizeof(WCHAR);
4410  else
4411  name_len = 0;
4412 
4413  /* setup index */
4415  RtlGUIDFromString(&str, &(*index)->guid);
4416  (*index)->data_offset = *data_offset;
4417  (*index)->data_len = sizeof(*data) + name_len ? aligned_string_len(name_len + sizeof(WCHAR)) : 0;
4418  (*index)->rosterindex = rosterindex;
4419 
4420  /* setup data record */
4421  data->size = sizeof(*data);
4422  data->mask = entity->u.ifaceps.mask;
4423 
4424  /* proxyStubClsid32 value is only stored for external PS,
4425  if set it's used as iid, otherwise 'iid' attribute value is used */
4426  if (entity->u.ifaceps.ps32)
4427  {
4429  RtlGUIDFromString(&str, &data->iid);
4430  }
4431  else
4432  data->iid = (*index)->guid;
4433 
4434  data->nummethods = entity->u.ifaceps.nummethods;
4435 
4436  if (entity->u.ifaceps.tlib)
4437  {
4439  RtlGUIDFromString(&str, &data->tlbid);
4440  }
4441  else
4442  memset(&data->tlbid, 0, sizeof(data->tlbid));
4443 
4444  if (entity->u.ifaceps.base)
4445  {
4447  RtlGUIDFromString(&str, &data->base);
4448  }
4449  else
4450  memset(&data->base, 0, sizeof(data->base));
4451 
4452  data->name_len = name_len;
4453  data->name_offset = data->name_len ? sizeof(*data) : 0;
4454 
4455  /* name string */
4456  if (data->name_len)
4457  {
4458  WCHAR *ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
4459  memcpy(ptrW, entity->u.ifaceps.name, data->name_len);
4460  ptrW[data->name_len/sizeof(WCHAR)] = 0;
4461  }
4462 
4463  /* move to next record */
4464  (*index) += 1;
4465  *data_offset += sizeof(*data);
4466  if (data->name_len)
4467  *data_offset += aligned_string_len(data->name_len + sizeof(WCHAR));
4468  }
4469  }
4470 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static const Entity entities[NUM_ENTITIES]
Definition: tinyxml2.cpp:129
union entity::@3982 u
Definition: parser.c:55
struct entity::@3982::@3985 ifaceps
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
Definition: actctx.c:371
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
static int aligned_string_len(int len)
Definition: actctx.c:1850
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define memset(x, y, z)
Definition: compat.h:39
DWORD kind
Definition: actctx.c:373

Referenced by build_ifaceps_section().

◆ add_progid_record()

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

4787 {
4788  unsigned int i, j;
4789 
4790  for (i = 0; i < entities->num; i++)
4791  {
4792  struct entity *entity = &entities->base[i];
4793  if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
4794  {
4795  const struct progids *progids = &entity->u.comclass.progids;
4796  struct comclassredirect_data *comclass;
4797  struct guid_index *guid_index;
4799  GUID clsid;
4800 
4803 
4804  guid_index = find_guid_index(actctx->comserver_section, &clsid);
4805  comclass = get_comclass_data(actctx, guid_index);
4806 
4807  if (entity->u.comclass.progid)
4808  write_progid_record(section, entity->u.comclass.progid, &comclass->alias,
4809  index, data_offset, global_offset, rosterindex);
4810 
4811  for (j = 0; j < progids->num; j++)
4813  index, data_offset, global_offset, rosterindex);
4814  }
4815  }
4816 }
static const Entity entities[NUM_ENTITIES]
Definition: tinyxml2.cpp:129
static struct guid_index * find_guid_index(const struct guidsection_header *section, const GUID *guid)
Definition: actctx.c:3590
union entity::@3982 u
Definition: parser.c:55
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:4742
unsigned int num
Definition: actctx.c:367
ULONG data_offset
Definition: actctx.c:1084
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
Definition: actctx.c:371
struct entity::@3982::@3984 comclass
const WCHAR * str
#define actctx
Definition: kernel32.h:8
GLuint index
Definition: glext.h:6031
ULONG rosterindex
Definition: actctx.c:1086
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
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
REFCLSID clsid
Definition: msctf.c:84
WCHAR ** progids
Definition: actctx.c:366
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
static struct comclassredirect_data * get_comclass_data(ACTIVATION_CONTEXT *actctx, struct guid_index *index)
Definition: actctx.c:4332
DWORD kind
Definition: actctx.c:373

Referenced by build_progid_section().

◆ aligned_string_len()

static int aligned_string_len ( int  len)
inlinestatic

◆ append_string()

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

Definition at line 1059 of file actctx.c.

1060 {
1061  WCHAR *p = buffer;
1062 
1063  if (!str) return;
1064  strcatW( buffer, prefix );
1065  p += strlenW(p);
1066  *p++ = '"';
1067  strcpyW( p, str );
1068  p += strlenW(p);
1069  *p++ = '"';
1070  *p = 0;
1071 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
GLuint buffer
Definition: glext.h:5915
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by build_assembly_id().

◆ build_assembly_dir()

static WCHAR* build_assembly_dir ( struct assembly_identity ai)
static

Definition at line 1028 of file actctx.c.

1029 {
1030  static const WCHAR undW[] = {'_',0};
1031  static const WCHAR noneW[] = {'n','o','n','e',0};
1032  static const WCHAR mskeyW[] = {'d','e','a','d','b','e','e','f',0};
1033 
1034  const WCHAR *arch = ai->arch ? ai->arch : noneW;
1035  const WCHAR *key = ai->public_key ? ai->public_key : noneW;
1036  const WCHAR *lang = ai->language ? ai->language : noneW;
1037  const WCHAR *name = ai->name ? ai->name : noneW;
1038  SIZE_T size = (strlenW(arch) + 1 + strlenW(name) + 1 + strlenW(key) + 24 + 1 +
1039  strlenW(lang) + 1) * sizeof(WCHAR) + sizeof(mskeyW);
1040  WCHAR *ret;
1041 
1042  if (!(ret = RtlAllocateHeap( RtlGetProcessHeap(), 0, size ))) return NULL;
1043 
1044  strcpyW( ret, arch );
1045  strcatW( ret, undW );
1046  strcatW( ret, name );
1047  strcatW( ret, undW );
1048  strcatW( ret, key );
1049  strcatW( ret, undW );
1051  ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
1052  strcatW( ret, undW );
1053  strcatW( ret, lang );
1054  strcatW( ret, undW );
1055  strcatW( ret, mskeyW );
1056  return ret;
1057 }
static const WCHAR version_formatW[]
Definition: actctx.c:708
WCHAR * arch
Definition: actctx.c:77
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
struct assembly_version version
Definition: actctx.c:81
WCHAR * public_key
Definition: actctx.c:78
smooth NULL
Definition: ftsmooth.c:416
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
static const WCHAR lang[]
Definition: wbemdisp.c:287
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
ULONG_PTR SIZE_T
Definition: typedefs.h:78
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define sprintfW
Definition: unicode.h:58
WCHAR * name
Definition: actctx.c:76
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
Definition: name.c:36
WCHAR * language
Definition: actctx.c:79
Definition: path.c:42

Referenced by lookup_assembly().

◆ build_assembly_id()

static WCHAR* build_assembly_id ( const struct assembly_identity ai)
static

Definition at line 1073 of file actctx.c.

1074 {
1075  static const WCHAR archW[] =
1076  {',','p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',0};
1077  static const WCHAR public_keyW[] =
1078  {',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',0};
1079  static const WCHAR typeW2[] =
1080  {',','t','y','p','e','=',0};
1081  static const WCHAR versionW2[] =
1082  {',','v','e','r','s','i','o','n','=',0};
1083 
1084  WCHAR version[64], *ret;
1085  SIZE_T size = 0;
1086 
1088  ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
1089  if (ai->name) size += strlenW(ai->name) * sizeof(WCHAR);
1090  if (ai->arch) size += strlenW(archW) + strlenW(ai->arch) + 2;
1091  if (ai->public_key) size += strlenW(public_keyW) + strlenW(ai->public_key) + 2;
1092  if (ai->type) size += strlenW(typeW2) + strlenW(ai->type) + 2;
1093  size += strlenW(versionW2) + strlenW(version) + 2;
1094 
1095  if (!(ret = RtlAllocateHeap( RtlGetProcessHeap(), 0, (size + 1) * sizeof(WCHAR) )))
1096  return NULL;
1097 
1098  if (ai->name) strcpyW( ret, ai->name );
1099  else *ret = 0;
1100  append_string( ret, archW, ai->arch );
1101  append_string( ret, public_keyW, ai->public_key );
1102  append_string( ret, typeW2, ai->type );
1103  append_string( ret, versionW2, version );
1104  return ret;
1105 }
static const WCHAR version_formatW[]
Definition: actctx.c:708
WCHAR * arch
Definition: actctx.c:77
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
struct assembly_version version
Definition: actctx.c:81
static const WCHAR archW[]
Definition: name.c:47
WCHAR * public_key
Definition: actctx.c:78
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
static void append_string(WCHAR *buffer, const WCHAR *prefix, const WCHAR *str)
Definition: actctx.c:1059
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * type
Definition: actctx.c:80
int ret
ULONG_PTR SIZE_T
Definition: typedefs.h:78
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define sprintfW
Definition: unicode.h:58
WCHAR * name
Definition: actctx.c:76

Referenced by RtlQueryInformationActivationContext().

◆ build_clr_surrogate_section()

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

Definition at line 4565 of file actctx.c.

4566 {
4567  unsigned int i, j, total_len = 0, count = 0;
4568  struct guidsection_header *header;
4569  struct clrsurrogate_data *data;
4570  struct guid_index *index;
4572 
4573  /* compute section length */
4574  for (i = 0; i < actctx->num_assemblies; i++)
4575  {
4576  struct assembly *assembly = &actctx->assemblies[i];
4577  for (j = 0; j < assembly->entities.num; j++)
4578  {
4579  struct entity *entity = &assembly->entities.base[j];
4580  if (entity->kind == ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)
4581  {
4582  ULONG len;
4583 
4584  total_len += sizeof(*index) + sizeof(*data);
4585  len = strlenW(entity->u.clrsurrogate.name) + 1;
4586  if (entity->u.clrsurrogate.version)
4587  len += strlenW(entity->u.clrsurrogate.version) + 1;
4588  total_len += aligned_string_len(len*sizeof(WCHAR));
4589 
4590  count++;
4591  }
4592  }
4593  }
4594 
4595  total_len += sizeof(*header);
4596 
4597  header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
4598  if (!header) return STATUS_NO_MEMORY;
4599 
4600  memset(header, 0, sizeof(*header));
4601  header->magic = GUIDSECTION_MAGIC;
4602  header->size = sizeof(*header);
4603  header->count = count;
4604  header->index_offset = sizeof(*header);
4605  index = (struct guid_index*)((BYTE*)header + header->index_offset);
4606  data_offset = header->index_offset + count*sizeof(*index);
4607 
4608  for (i = 0; i < actctx->num_assemblies; i++)
4609  {
4610  struct assembly *assembly = &actctx->assemblies[i];
4611  for (j = 0; j < assembly->entities.num; j++)
4612  {
4613  struct entity *entity = &assembly->entities.base[j];
4614  if (entity->kind == ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES)
4615  {
4616  ULONG version_len, name_len;
4618  WCHAR *ptrW;
4619 
4620  if (entity->u.clrsurrogate.version)
4621  version_len = strlenW(entity->u.clrsurrogate.version)*sizeof(WCHAR);
4622  else
4623  version_len = 0;
4624  name_len = strlenW(entity->u.clrsurrogate.name)*sizeof(WCHAR);
4625 
4626  /* setup new index entry */
4628  RtlGUIDFromString(&str, &index->guid);
4629 
4630  index->data_offset = data_offset;
4631  index->data_len = sizeof(*data) + aligned_string_len(name_len + sizeof(WCHAR) + (version_len ? version_len + sizeof(WCHAR) : 0));
4632  index->rosterindex = i + 1;
4633 
4634  /* setup data */
4635  data = (struct clrsurrogate_data*)((BYTE*)header + index->data_offset);
4636  data->size = sizeof(*data);
4637  data->res = 0;
4638  data->clsid = index->guid;
4639  data->version_offset = version_len ? data->size : 0;
4640  data->version_len = version_len;
4641  data->name_offset = data->size + version_len;
4642  if (version_len)
4643  data->name_offset += sizeof(WCHAR);
4644  data->name_len = name_len;
4645 
4646  /* surrogate name */
4647  ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
4648  memcpy(ptrW, entity->u.clrsurrogate.name, data->name_len);
4649  ptrW[data->name_len/sizeof(WCHAR)] = 0;
4650 
4651  /* runtime version */
4652  if (data->version_len)
4653  {
4654  ptrW = (WCHAR*)((BYTE*)data + data->version_offset);
4655  memcpy(ptrW, entity->u.clrsurrogate.version, data->version_len);
4656  ptrW[data->version_len/sizeof(WCHAR)] = 0;
4657  }
4658 
4659  data_offset += index->data_offset;
4660  index++;
4661  }
4662  }
4663  }
4664 
4665  *section = header;
4666 
4667  return STATUS_SUCCESS;
4668 }
#define GUIDSECTION_MAGIC
Definition: actctx.c:39
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
union entity::@3982 u
GLuint GLuint GLsizei count
Definition: gl.h:1545
Definition: parser.c:55
ULONG data_offset
Definition: actctx.c:1084
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
Definition: actctx.c:371
const WCHAR * str
#define actctx
Definition: kernel32.h:8
GLuint index
Definition: glext.h:6031
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
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
__wchar_t WCHAR
Definition: xmlstorage.h:180
static int aligned_string_len(int len)
Definition: actctx.c:1850
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define index(s, c)
Definition: various.h:29
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
struct entity_array entities
Definition: actctx.c:453
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
struct entity::@3982::@3987 clrsurrogate
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define memset(x, y, z)
Definition: compat.h:39
ULONG version_len
Definition: actctx.c:1638
struct CFHEADER header
Definition: fdi.c:109
DWORD kind
Definition: actctx.c:373

Referenced by find_clr_surrogate().

◆ build_comserver_section()

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

Definition at line 4280 of file actctx.c.

4281 {
4282  unsigned int i, j, total_len = 0, class_count = 0, names_len = 0;
4283  struct guidsection_header *header;
4284  ULONG module_offset, data_offset;
4285  struct guid_index *index;
4286  ULONG seed;
4287 
4288  /* compute section length */
4289  for (i = 0; i < actctx->num_assemblies; i++)
4290  {
4291  struct assembly *assembly = &actctx->assemblies[i];
4292  get_comserver_datalen(&assembly->entities, NULL, &class_count, &total_len, &names_len);
4293  for (j = 0; j < assembly->num_dlls; j++)
4294  {
4295  struct dll_redirect *dll = &assembly->dlls[j];
4296  get_comserver_datalen(&dll->entities, dll, &class_count, &total_len, &names_len);
4297  }
4298  }
4299 
4300  total_len += aligned_string_len(names_len);
4301  total_len += sizeof(*header);
4302 
4303  header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
4304  if (!header) return STATUS_NO_MEMORY;
4305 
4306  memset(header, 0, sizeof(*header));
4307  header->magic = GUIDSECTION_MAGIC;
4308  header->size = sizeof(*header);
4309  header->count = 2*class_count;
4310  header->index_offset = sizeof(*header) + aligned_string_len(names_len);
4311  index = (struct guid_index*)((BYTE*)header + header->index_offset);
4312  module_offset = sizeof(*header);
4313  data_offset = header->index_offset + 2*class_count*sizeof(*index);
4314 
4315  seed = NtGetTickCount();
4316  for (i = 0; i < actctx->num_assemblies; i++)
4317  {
4318  struct assembly *assembly = &actctx->assemblies[i];
4319  add_comserver_record(header, &assembly->entities, NULL, &index, &data_offset, &module_offset, &seed, i+1);
4320  for (j = 0; j < assembly->num_dlls; j++)
4321  {
4322  struct dll_redirect *dll = &assembly->dlls[j];
4323  add_comserver_record(header, &dll->entities, dll, &index, &data_offset, &module_offset, &seed, i+1);
4324  }
4325  }
4326 
4327  *section = header;
4328 
4329  return STATUS_SUCCESS;
4330 }
#define GUIDSECTION_MAGIC
Definition: actctx.c:39
Definition: parser.c:55
#define NtGetTickCount
Definition: rtlp.h:146
ULONG data_offset
Definition: actctx.c:1084
static HMODULE dll
Definition: str.c:188
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
smooth NULL
Definition: ftsmooth.c:416
#define actctx
Definition: kernel32.h:8
GLuint index
Definition: glext.h:6031
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
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
static int aligned_string_len(int len)
Definition: actctx.c:1850
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:4056
#define index(s, c)
Definition: various.h:29
unsigned char BYTE
Definition: mem.h:68
unsigned int num_dlls
Definition: actctx.c:451
struct dll_redirect * dlls
Definition: actctx.c:450
static void 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:4104
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
struct entity_array entities
Definition: actctx.c:453
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define memset(x, y, z)
Definition: compat.h:39
struct CFHEADER header
Definition: fdi.c:109

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

3469 {
3470  unsigned int i, j, total_len = 0, dll_count = 0;
3471  struct strsection_header *header;
3472  struct dllredirect_data *data;
3473  struct string_index *index;
3475 
3476  DPRINT("actctx %p, num_assemblies %d\n", actctx, actctx->num_assemblies);
3477 
3478  /* compute section length */
3479  for (i = 0; i < actctx->num_assemblies; i++)
3480  {
3481  struct assembly *assembly = &actctx->assemblies[i];
3482  for (j = 0; j < assembly->num_dlls; j++)
3483  {
3484  struct dll_redirect *dll = &assembly->dlls[j];
3485 
3486  /* each entry needs index, data and string data */
3487  total_len += sizeof(*index);
3488  total_len += sizeof(*data);
3489  total_len += aligned_string_len((strlenW(dll->name)+1)*sizeof(WCHAR));
3490 
3491  DPRINT("assembly %d (%p), dll %d: dll name %S\n", i, assembly, j, dll->name);
3492  }
3493 
3495  }
3496 
3497  total_len += sizeof(*header);
3498 
3499  header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
3500  if (!header) return STATUS_NO_MEMORY;
3501 
3502  memset(header, 0, sizeof(*header));
3503  header->magic = STRSECTION_MAGIC;
3504  header->size = sizeof(*header);
3505  header->count = dll_count;
3506  header->index_offset = sizeof(*header);
3507  index = (struct string_index*)((BYTE*)header + header->index_offset);
3508  name_offset = header->index_offset + header->count*sizeof(*index);
3509 
3510  for (i = 0; i < actctx->num_assemblies; i++)
3511  {
3512  struct assembly *assembly = &actctx->assemblies[i];
3513 
3514  DPRINT("assembly->num_dlls %d\n", assembly->num_dlls);
3515 
3516  for (j = 0; j < assembly->num_dlls; j++)
3517  {
3518  struct dll_redirect *dll = &assembly->dlls[j];
3520  WCHAR *ptrW;
3521 
3522  DPRINT("%d: dll name %S\n", j, dll->name);
3523  /* setup new index entry */
3524  str.Buffer = dll->name;
3525  str.Length = (USHORT)strlenW(dll->name)*sizeof(WCHAR);
3526  str.MaximumLength = str.Length + sizeof(WCHAR);
3527  /* hash original class name */
3529 
3530  index->name_offset = name_offset;
3531  index->name_len = str.Length;
3532  index->data_offset = index->name_offset + aligned_string_len(str.MaximumLength);
3533  index->data_len = sizeof(*data);
3534  index->rosterindex = i + 1;
3535 
3536  /* setup data */
3537  data = (struct dllredirect_data*)((BYTE*)header + index->data_offset);
3538  data->size = sizeof(*data);
3539  data->unk = 2; /* FIXME: seems to be constant */
3540  memset(data->res, 0, sizeof(data->res));
3541 
3542  /* dll name */
3543  ptrW = (WCHAR*)((BYTE*)header + index->name_offset);
3544  memcpy(ptrW, dll->name, index->name_len);
3545  ptrW[index->name_len/sizeof(WCHAR)] = 0;
3546 
3547  name_offset += sizeof(*data) + aligned_string_len(str.MaximumLength);
3548 
3549  index++;
3550  }
3551  }
3552 
3553  *section = header;
3554 
3555  return STATUS_SUCCESS;
3556 }
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
Definition: parser.c:55
static HMODULE dll
Definition: str.c:188
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
const WCHAR * str
#define actctx
Definition: kernel32.h:8
void DPRINT(...)
Definition: polytest.cpp:61
GLuint index
Definition: glext.h:6031
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
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
__wchar_t WCHAR
Definition: xmlstorage.h:180
static int aligned_string_len(int len)
Definition: actctx.c:1850
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define index(s, c)
Definition: various.h:29
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
unsigned int num_dlls
Definition: actctx.c:451
struct dll_redirect * dlls
Definition: actctx.c:450
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
ULONG name_offset
Definition: actctx.c:1062
LONG dll_count
Definition: itss.c:51
NTSYSAPI NTSTATUS NTAPI RtlHashUnicodeString(_In_ CONST UNICODE_STRING *String, _In_ BOOLEAN CaseInSensitive, _In_ ULONG HashAlgorithm, _Out_ PULONG HashValue)
unsigned int ULONG
Definition: retypes.h:1
#define STRSECTION_MAGIC
Definition: actctx.c:38
#define HASH_STRING_ALGORITHM_X65599
Definition: rtlstr.c:33
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define memset(x, y, z)
Definition: compat.h:39
struct CFHEADER header
Definition: fdi.c:109

Referenced by find_dll_redirection().

◆ build_ifaceps_section()

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

Definition at line 4472 of file actctx.c.

4473 {
4474  unsigned int i, j, total_len = 0, count = 0;
4475  struct guidsection_header *header;
4476  struct guid_index *index;
4478 
4479  /* compute section length */
4480  for (i = 0; i < actctx->num_assemblies; i++)
4481  {
4482  struct assembly *assembly = &actctx->assemblies[i];
4483 
4484  get_ifaceps_datalen(&assembly->entities, &count, &total_len);
4485  for (j = 0; j < assembly->num_dlls; j++)
4486  {
4487  struct dll_redirect *dll = &assembly->dlls[j];
4488  get_ifaceps_datalen(&dll->entities, &count, &total_len);
4489  }
4490  }
4491 
4492  total_len += sizeof(*header);
4493 
4494  header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
4495  if (!header) return STATUS_NO_MEMORY;
4496 
4497  memset(header, 0, sizeof(*header));
4498  header->magic = GUIDSECTION_MAGIC;
4499  header->size = sizeof(*header);
4500  header->count = count;
4501  header->index_offset = sizeof(*header);
4502  index = (struct guid_index*)((BYTE*)header + header->index_offset);
4503  data_offset = header->index_offset + count*sizeof(*index);
4504 
4505  for (i = 0; i < actctx->num_assemblies; i++)
4506  {
4507  struct assembly *assembly = &actctx->assemblies[i];
4508 
4509  add_ifaceps_record(header, &assembly->entities, &index, &data_offset, i + 1);
4510  for (j = 0; j < assembly->num_dlls; j++)
4511  {
4512  struct dll_redirect *dll = &assembly->dlls[j];
4513  add_ifaceps_record(header, &dll->entities, &index, &data_offset, i + 1);
4514  }
4515  }
4516 
4517  *section = header;
4518 
4519  return STATUS_SUCCESS;
4520 }
#define GUIDSECTION_MAGIC
Definition: actctx.c:39
GLuint GLuint GLsizei count
Definition: gl.h:1545
Definition: parser.c:55
ULONG data_offset
Definition: actctx.c:1084
static HMODULE dll
Definition: str.c:188
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
#define actctx
Definition: kernel32.h:8
GLuint index
Definition: glext.h:6031
static void get_ifaceps_datalen(const struct entity_array *entities, unsigned int *count, unsigned int *len)
Definition: actctx.c:4377
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
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
#define index(s, c)
Definition: various.h:29
unsigned char BYTE
Definition: mem.h:68
unsigned int num_dlls
Definition: actctx.c:451
struct dll_redirect * dlls
Definition: actctx.c:450
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
struct entity_array entities
Definition: actctx.c:453
unsigned int ULONG
Definition: retypes.h:1
static void add_ifaceps_record(struct guidsection_header *section, struct entity_array *entities, struct guid_index **index, ULONG *data_offset, ULONG rosterindex)
Definition: actctx.c:4394
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define memset(x, y, z)
Definition: compat.h:39
struct CFHEADER header
Definition: fdi.c:109

Referenced by find_cominterface_redirection().

◆ build_progid_section()

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

Definition at line 4818 of file actctx.c.

4819 {
4820  unsigned int i, j, total_len = 0, count = 0;
4821  struct strsection_header *header;
4822  ULONG data_offset, global_offset;
4823  struct string_index *index;
4824 
4825  /* compute section length */
4826  for (i = 0; i < actctx->num_assemblies; i++)
4827  {
4828  struct assembly *assembly = &actctx->assemblies[i];
4829 
4830  get_progid_datalen(&assembly->entities, &count, &total_len);
4831  for (j = 0; j < assembly->num_dlls; j++)
4832  {
4833  struct dll_redirect *dll = &assembly->dlls[j];
4834  get_progid_datalen(&dll->entities, &count, &total_len);
4835  }
4836  }
4837 
4838  total_len += sizeof(*header);
4839 
4840  header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
4841  if (!header) return STATUS_NO_MEMORY;
4842 
4843  memset(header, 0, sizeof(*header));
4844  header->magic = STRSECTION_MAGIC;
4845  header->size = sizeof(*header);
4846  header->count = count;
4847  header->global_offset = header->size;
4848  header->global_len = count*sizeof(GUID);
4849  header->index_offset = header->size + header->global_len;
4850 
4851  index = (struct string_index*)((BYTE*)header + header->index_offset);
4852  data_offset = header->index_offset + count*sizeof(*index);
4853  global_offset = header->global_offset;
4854 
4855  for (i = 0; i < actctx->num_assemblies; i++)
4856  {
4857  struct assembly *assembly = &actctx->assemblies[i];
4858 
4859  add_progid_record(actctx, header, &assembly->entities, &index, &data_offset, &global_offset, i + 1);
4860  for (j = 0; j < assembly->num_dlls; j++)
4861  {
4862  struct dll_redirect *dll = &assembly->dlls[j];
4863  add_progid_record(actctx, header, &dll->entities, &index, &data_offset, &global_offset, i + 1);
4864  }
4865  }
4866 
4867  *section = header;
4868 
4869  return STATUS_SUCCESS;
4870 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
Definition: parser.c:55
static HMODULE dll
Definition: str.c:188
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
#define actctx
Definition: kernel32.h:8
GLuint index
Definition: glext.h:6031
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
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
#define index(s, c)
Definition: various.h:29
unsigned char BYTE
Definition: mem.h:68
unsigned int num_dlls
Definition: actctx.c:451
struct dll_redirect * dlls
Definition: actctx.c:450
struct _GUID GUID
ULONG data_offset
Definition: actctx.c:1064
static void 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:4785
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
struct entity_array entities
Definition: actctx.c:453
unsigned int ULONG
Definition: retypes.h:1
#define STRSECTION_MAGIC
Definition: actctx.c:38
static void get_progid_datalen(struct entity_array *entities, unsigned int *count, unsigned int *total_len)
Definition: actctx.c:4717
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define memset(x, y, z)
Definition: compat.h:39
struct CFHEADER header
Definition: fdi.c:109

Referenced by find_progid_redirection().

◆ build_tlib_section()

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

Definition at line 3873 of file actctx.c.

3874 {
3875  unsigned int i, j, k, total_len = 0, tlib_count = 0, names_len = 0;
3876  struct guidsection_header *header;
3877  ULONG module_offset, data_offset;
3878  struct tlibredirect_data *data;
3879  struct guid_index *index;
3880 
3881  /* compute section length */
3882  for (i = 0; i < actctx->num_assemblies; i++)
3883  {
3884  struct assembly *assembly = &actctx->assemblies[i];
3885  for (j = 0; j < assembly->num_dlls; j++)
3886  {
3887  struct dll_redirect *dll = &assembly->dlls[j];
3888  for (k = 0; k < dll->entities.num; k++)
3889  {
3890  struct entity *entity = &dll->entities.base[k];
3891  if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)
3892  {
3893  /* each entry needs index, data and string data for module name and help string */
3894  total_len += sizeof(*index);
3895  total_len += sizeof(*data);
3896  /* help string is stored separately */
3897  if (*entity->u.typelib.helpdir)
3898  total_len += aligned_string_len((strlenW(entity->u.typelib.helpdir)+1)*sizeof(WCHAR));
3899 
3900  /* module names are packed one after another */
3901  names_len += (strlenW(dll->name)+1)*sizeof(WCHAR);
3902 
3903  tlib_count++;
3904  }
3905  }
3906  }
3907  }
3908 
3909  total_len += aligned_string_len(names_len);
3910  total_len += sizeof(*header);
3911 
3912  header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
3913  if (!header) return STATUS_NO_MEMORY;
3914 
3915  memset(header, 0, sizeof(*header));
3916  header->magic = GUIDSECTION_MAGIC;
3917  header->size = sizeof(*header);
3918  header->count = tlib_count;
3919  header->index_offset = sizeof(*header) + aligned_string_len(names_len);
3920  index = (struct guid_index*)((BYTE*)header + header->index_offset);
3921  module_offset = sizeof(*header);
3922  data_offset = header->index_offset + tlib_count*sizeof(*index);
3923 
3924  for (i = 0; i < actctx->num_assemblies; i++)
3925  {
3926  struct assembly *assembly = &actctx->assemblies[i];
3927  for (j = 0; j < assembly->num_dlls; j++)
3928  {
3929  struct dll_redirect *dll = &assembly->dlls[j];
3930  for (k = 0; k < dll->entities.num; k++)
3931  {
3932  struct entity *entity = &dll->entities.base[k];
3933  if (entity->kind == ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)
3934  {
3935  ULONG module_len, help_len;
3937  WCHAR *ptrW;
3938 
3939  if (*entity->u.typelib.helpdir)
3940  help_len = strlenW(entity->u.typelib.helpdir)*sizeof(WCHAR);
3941  else
3942  help_len = 0;
3943 
3944  module_len = strlenW(dll->name)*sizeof(WCHAR);
3945 
3946  /* setup new index entry */
3948  RtlGUIDFromString(&str, &index->guid);
3949  index->data_offset = data_offset;
3950  index->data_len = sizeof(*data) + aligned_string_len(help_len);
3951  index->rosterindex = i + 1;
3952 
3953  /* setup data */
3954  data = (struct tlibredirect_data*)((BYTE*)header + index->data_offset);
3955  data->size = sizeof(*data);
3956  data->res = 0;
3957  data->name_len = module_len;
3958  data->name_offset = module_offset;
3959  /* FIXME: resourceid handling is really weird, and it doesn't seem to be useful */
3960  data->langid = 0;
3961  data->flags = entity->u.typelib.flags;
3962  data->help_len = help_len;
3963  data->help_offset = sizeof(*data);
3964  data->major_version = entity->u.typelib.major;
3965  data->minor_version = entity->u.typelib.minor;
3966 
3967  /* module name */
3968  ptrW = (WCHAR*)((BYTE*)header + data->name_offset);
3969  memcpy(ptrW, dll->name, data->name_len);
3970  ptrW[data->name_len/sizeof(WCHAR)] = 0;
3971 
3972  /* help string */
3973  if (data->help_len)
3974  {
3975  ptrW = (WCHAR*)((BYTE*)data + data->help_offset);
3976  memcpy(ptrW, entity->u.typelib.helpdir, data->help_len);
3977  ptrW[data->help_len/sizeof(WCHAR)] = 0;
3978  }
3979 
3980  data_offset += sizeof(*data);
3981  if (help_len)
3982  data_offset += aligned_string_len(help_len + sizeof(WCHAR));
3983 
3984  module_offset += module_len + sizeof(WCHAR);
3985 
3986  index++;
3987  }
3988  }
3989  }
3990  }
3991 
3992  *section = header;
3993 
3994  return STATUS_SUCCESS;
3995 }
#define GUIDSECTION_MAGIC
Definition: actctx.c:39
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
union entity::@3982 u
Definition: parser.c:55
ULONG data_offset
Definition: actctx.c:1084
static HMODULE dll
Definition: str.c:188
ULONG help_len
Definition: oleaut.c:795
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
Definition: actctx.c:371
const WCHAR * str
#define actctx
Definition: kernel32.h:8
struct entity::@3982::@3983 typelib
GLuint index
Definition: glext.h:6031
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
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
__wchar_t WCHAR
Definition: xmlstorage.h:180
static int aligned_string_len(int len)
Definition: actctx.c:1850
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define index(s, c)
Definition: various.h:29
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
unsigned int num_dlls
Definition: actctx.c:451
struct dll_redirect * dlls
Definition: actctx.c:450
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define memset(x, y, z)
Definition: compat.h:39
int k
Definition: mpi.c:3369
struct CFHEADER header
Definition: fdi.c:109
DWORD kind
Definition: actctx.c:373

Referenced by find_tlib_redirection().

◆ build_wndclass_section()

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

Definition at line 3670 of file actctx.c.

3671 {
3672  unsigned int i, j, k, total_len = 0, class_count = 0;
3673  struct wndclass_redirect_data *data;
3674  struct strsection_header *header;
3675  struct string_index *index;
3677 
3678  /* compute section length */
3679  for (i = 0; i < actctx->num_assemblies; i++)
3680  {
3681  struct assembly *assembly = &actctx->assemblies[i];
3682  for (j = 0; j < assembly->num_dlls; j++)
3683  {
3684  struct dll_redirect *dll = &assembly->dlls[j];
3685  for (k = 0; k < dll->entities.num; k++)
3686  {
3687  struct entity *entity = &dll->entities.base[k];
3688  if (entity->kind == ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)
3689  {
3690  int class_len = strlenW(entity->u.class.name) + 1;
3691  int len;
3692 
3693  /* each class entry needs index, data and string data */
3694  total_len += sizeof(*index);
3695  total_len += sizeof(*data);
3696  /* original name is stored separately */
3697  total_len += aligned_string_len(class_len*sizeof(WCHAR));
3698  /* versioned name and module name are stored one after another */
3699  if (entity->u.class.versioned)
3700  len = get_assembly_version(assembly, NULL) + class_len + 1 /* '!' separator */;
3701  else
3702  len = class_len;
3703  len += strlenW(dll->name) + 1;
3704  total_len += aligned_string_len(len*sizeof(WCHAR));
3705 
3706  class_count++;
3707  }
3708  }
3709  }
3710  }
3711 
3712  total_len += sizeof(*header);
3713 
3714  header = RtlAllocateHeap(RtlGetProcessHeap(), 0, total_len);
3715  if (!header) return STATUS_NO_MEMORY;
3716 
3717  memset(header, 0, sizeof(*header));
3718  header->magic = STRSECTION_MAGIC;
3719  header->size = sizeof(*header);
3720  header->count = class_count;
3721  header->index_offset = sizeof(*header);
3722  index = (struct string_index*)((BYTE*)header + header->index_offset);
3723  name_offset = header->index_offset + header->count*sizeof(*index);
3724 
3725  for (i = 0; i < actctx->num_assemblies; i++)
3726  {
3727  struct assembly *assembly = &actctx->assemblies[i];
3728  for (j = 0; j < assembly->num_dlls; j++)
3729  {
3730  struct dll_redirect *dll = &assembly->dlls[j];
3731  for (k = 0; k < dll->entities.num; k++)
3732  {
3733  struct entity *entity = &dll->entities.base[k];
3734  if (entity->kind == ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)
3735  {
3736  static const WCHAR exclW[] = {'!',0};
3737  ULONG versioned_len, module_len;
3739  WCHAR *ptrW;
3740 
3741  /* setup new index entry */
3742  str.Buffer = entity->u.class.name;
3743  str.Length = (USHORT)strlenW(entity->u.class.name)*sizeof(WCHAR);
3744  str.MaximumLength = str.Length + sizeof(WCHAR);
3745  /* hash original class name */
3747 
3748  /* include '!' separator too */
3749  if (entity->u.class.versioned)
3750  versioned_len = (get_assembly_version(assembly, NULL) + 1)*sizeof(WCHAR) + str.Length;
3751  else
3752  versioned_len = str.Length;
3753  module_len = strlenW(dll->name)*sizeof(WCHAR);
3754 
3755  index->name_offset = name_offset;
3756  index->name_len = str.Length;
3757  index->data_offset = index->name_offset + aligned_string_len(str.MaximumLength);
3758  index->data_len = sizeof(*data) + versioned_len + module_len + 2*sizeof(WCHAR) /* two nulls */;
3759  index->rosterindex = i + 1;
3760 
3761  /* setup data */
3762  data = (struct wndclass_redirect_data*)((BYTE*)header + index->data_offset);
3763  data->size = sizeof(*data);
3764  data->res = 0;
3765  data->name_len = versioned_len;
3766  data->name_offset = sizeof(*data);
3767  data->module_len = module_len;
3768  data->module_offset = index->data_offset + data->name_offset + data->name_len + sizeof(WCHAR);
3769 
3770  /* original class name */
3771  ptrW = (WCHAR*)((BYTE*)header + index->name_offset);
3772  memcpy(ptrW, entity->u.class.name, index->name_len);
3773  ptrW[index->name_len/sizeof(WCHAR)] = 0;
3774 
3775  /* module name */
3776  ptrW = (WCHAR*)((BYTE*)header + data->module_offset);
3777  memcpy(ptrW, dll->name, data->module_len);
3778  ptrW[data->module_len/sizeof(WCHAR)] = 0;
3779 
3780  /* versioned name */
3781  ptrW = (WCHAR*)((BYTE*)data + data->name_offset);
3782  if (entity->u.class.versioned)
3783  {
3785  strcatW(ptrW, exclW);
3786  strcatW(ptrW, entity->u.class.name);
3787  }
3788  else
3789  {
3790  memcpy(ptrW, entity->u.class.name, index->name_len);
3791  ptrW[index->name_len/sizeof(WCHAR)] = 0;
3792  }
3793 
3794  name_offset += sizeof(*data);
3795  name_offset += aligned_string_len(str.MaximumLength) + aligned_string_len(versioned_len + module_len + 2*sizeof(WCHAR));
3796 
3797  index++;
3798  }
3799  }
3800  }
3801  }
3802 
3803  *section = header;
3804 
3805  return STATUS_SUCCESS;
3806 }
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
struct entity::@3982::@3986 class
union entity::@3982 u
Definition: parser.c:55
static HMODULE dll
Definition: str.c:188
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
Definition: actctx.c:371
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define actctx
Definition: kernel32.h:8
GLuint index
Definition: glext.h:6031
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
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
__wchar_t WCHAR
Definition: xmlstorage.h:180
static int aligned_string_len(int len)
Definition: actctx.c:1850
static int get_assembly_version(struct assembly *assembly, WCHAR *ret)
Definition: actctx.c:1855
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define index(s, c)
Definition: various.h:29
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
unsigned int num_dlls
Definition: actctx.c:451
struct dll_redirect * dlls
Definition: actctx.c:450
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
ULONG name_offset
Definition: actctx.c:1062
NTSYSAPI NTSTATUS NTAPI RtlHashUnicodeString(_In_ CONST UNICODE_STRING *String, _In_ BOOLEAN CaseInSensitive, _In_ ULONG HashAlgorithm, _Out_ PULONG HashValue)
unsigned int ULONG
Definition: retypes.h:1
#define STRSECTION_MAGIC
Definition: actctx.c:38
#define HASH_STRING_ALGORITHM_X65599
Definition: rtlstr.c:33
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define memset(x, y, z)
Definition: compat.h:39
int k
Definition: mpi.c:3369
struct CFHEADER header
Definition: fdi.c:109
DWORD kind
Definition: actctx.c:373

Referenced by find_window_class().

◆ check_actctx()

static ACTIVATION_CONTEXT* check_actctx ( HANDLE  h)
static

Definition at line 1107 of file actctx.c.

1108 {
1111 
1112  if (!h || h == INVALID_HANDLE_VALUE) return NULL;
1113  _SEH2_TRY
1114  {
1115  if (actctx)
1116  {
1117  pActual = CONTAINING_RECORD(actctx, ACTIVATION_CONTEXT_WRAPPED, ActivationContext);
1118  if (pActual->MagicMarker == ACTCTX_MAGIC_MARKER) ret = &pActual->ActivationContext;
1119  }
1120  }
1122  {
1123  DPRINT1("Invalid activation context handle!\n");
1124  }
1125  _SEH2_END;
1126  return ret;
1127 }
ACTIVATION_CONTEXT ActivationContext
Definition: actctx.c:529
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define ACTCTX_MAGIC_MARKER
Definition: actctx.c:41
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
_SEH2_TRY
Definition: create.c:4250
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define actctx
Definition: kernel32.h:8
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
int ret
_SEH2_END
Definition: create.c:4424
#define DPRINT1
Definition: precomp.h:8
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6

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

◆ com_class_add_progid()

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

Definition at line 1532 of file actctx.c.

1533 {
1534  struct progids *progids = &entity->u.comclass.progids;
1535 
1536  if (progids->allocated == 0)
1537  {
1538  progids->allocated = 4;
1539  if (!(progids->progids = RtlAllocateHeap(RtlGetProcessHeap(), 0, progids->allocated * sizeof(WCHAR*)))) return FALSE;
1540  }
1541 
1542  if (progids->allocated == progids->num)
1543  {
1544  WCHAR **new_progids = RtlReAllocateHeap(RtlGetProcessHeap(), 0, progids->progids,
1545  2 * progids->allocated * sizeof(WCHAR*));
1546  if (!new_progids) return FALSE;
1547  progids->allocated *= 2;
1548  progids->progids = new_progids;
1549  }
1550 
1551  if (!(progids->progids[progids->num] = xmlstrdupW(progid))) return FALSE;
1552  progids->num++;
1553 
1554  return TRUE;
1555 }
#define TRUE
Definition: types.h:120
unsigned int allocated
Definition: actctx.c:368
union entity::@3982 u
NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE, ULONG, PVOID, SIZE_T)
Definition: heap.c:2561
unsigned int num
Definition: actctx.c:367
Definition: actctx.c:371
struct entity::@3982::@3984 comclass
static WCHAR * xmlstrdupW(const xmlstr_t *str)
Definition: actctx.c:724
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR ** progids
Definition: actctx.c:366
#define progid(str)
Definition: exdisp.idl:31

Referenced by parse_com_class_progid().

◆ find_clr_surrogate()

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

Definition at line 4675 of file actctx.c.

4676 {
4677  struct clrsurrogate_data *surrogate;
4678  struct guid_index *index = NULL;
4679 
4680  if (!(actctx->sections & CLRSURROGATES_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4681 
4682  if (!actctx->clrsurrogate_section)
4683  {
4684  struct guidsection_header *section;
4685 
4687  if (status) return status;
4688 
4689  if (InterlockedCompareExchangePointer((void**)&actctx->clrsurrogate_section, section, NULL))
4690  RtlFreeHeap(RtlGetProcessHeap(), 0, section);
4691  }
4692 
4693  index = find_guid_index(actctx->clrsurrogate_section, guid);
4694  if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4695 
4696  surrogate = get_surrogate_data(actctx, index);
4697 
4698  data->ulDataFormatVersion = 1;
4699  data->lpData = surrogate;
4700  /* full length includes string length with nulls */
4701  data->ulLength = surrogate->size + surrogate->name_len + sizeof(WCHAR);
4702  if (surrogate->version_len)
4703  data->ulLength += surrogate->version_len + sizeof(WCHAR);
4704 
4705  data->lpSectionGlobalData = NULL;
4706  data->ulSectionGlobalDataLength = 0;
4707  data->lpSectionBase = actctx->clrsurrogate_section;
4708  data->ulSectionTotalLength = RtlSizeHeap( RtlGetProcessHeap(), 0, actctx->clrsurrogate_section );
4709  data->hActCtx = NULL;
4710 
4711  if (data->cbSize >= FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex) + sizeof(ULONG))
4712  data->ulAssemblyRosterIndex = index->rosterindex;
4713 
4714  return STATUS_SUCCESS;
4715 }
static struct guid_index * find_guid_index(const struct guidsection_header *section, const GUID *guid)
Definition: actctx.c:3590
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define STATUS_SXS_KEY_NOT_FOUND
Definition: ntstatus.h:1170
Definition: parser.c:55
static IMAGE_SECTION_HEADER section
Definition: loader.c:152
const GUID * guid
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
smooth NULL
Definition: ftsmooth.c:416
#define actctx
Definition: kernel32.h:8
GLuint index
Definition: glext.h:6031
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
NTSYSAPI SIZE_T NTAPI RtlSizeHeap(_In_ PVOID HeapHandle, _In_ ULONG Flags, _In_ PVOID MemoryPointer)
static struct clrsurrogate_data * get_surrogate_data(ACTIVATION_CONTEXT *actctx, const struct guid_index *index)
Definition: actctx.c:4670
static NTSTATUS build_clr_surrogate_section(ACTIVATION_CONTEXT *actctx, struct guidsection_header **section)
Definition: actctx.c:4565
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2966
static SERVICE_STATUS status
Definition: service.c:31
ULONG version_len
Definition: actctx.c:1638
Definition: ps.c:97

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

4528 {
4529  struct ifacepsredirect_data *iface;
4530  struct guid_index *index = NULL;
4531 
4532  if (!(actctx->sections & IFACEREDIRECT_SECTION)) return STATUS_SXS_KEY_NOT_FOUND;
4533 
4534  if (!actctx->ifaceps_section)
4535  {
4536  struct guidsection_header *section;
4537 
4539  if (status) return status;
4540 
4541  if (InterlockedCompareExchangePointer((void**)&actctx->ifaceps_section, section, NULL))
4542  RtlFreeHeap(RtlGetProcessHeap(), 0, section);
4543  }
4544 
4545  index = find_guid_index(actctx->ifaceps_section, guid);
4546  if (!index) return STATUS_SXS_KEY_NOT_FOUND;
4547 
4548  iface = get_ifaceps_data(actctx, index);
4549 
4550  data->ulDataFormatVersion = 1;
4551  data->lpData = iface;
4552  data->ulLength = iface->size + (iface->name_len ? iface->name_len + sizeof(WCHAR) : 0);
4553  data->lpSectionGlobalData = NULL;
4554  data->ulSectionGlobalDataLength = 0;
4555  data->lpSectionBase = actctx->ifaceps_section;
4556