36 #include "wine/list.h" 42 {
'_',
'_',
'W',
'I',
'N',
'E',
'_',
'S',
'X',
'S',
'_',
'C',
'A',
'C',
'H',
'E',
'_',
'M',
'U',
'T',
'E',
'X',
'_',
'_',0};
45 static const WCHAR win32_policyW[] = {
'w',
'i',
'n',
'3',
'2',
'-',
'p',
'o',
'l',
'i',
'c',
'y',0};
74 IAssemblyCache_AddRef( iface );
104 static const WCHAR winsxsW[] = {
'\\',
'w',
'i',
'n',
's',
'x',
's',
'\\',0};
114 static const WCHAR fmtW[] =
115 {
'%',
's',
'_',
'%',
's',
'_',
'%',
's',
'_',
'%',
's',
'_',
'n',
'o',
'n',
'e',
'_',
'd',
'e',
'a',
'd',
'b',
'e',
'e',
'f',0};
131 static const WCHAR fmtW[] =
132 {
'%',
's',
'm',
'a',
'n',
'i',
'f',
'e',
's',
't',
's',
'\\',
'%',
's',
'.',
'm',
'a',
'n',
'i',
'f',
'e',
's',
't',0};
152 static const WCHAR fmtW[] =
153 {
'%',
's',
'_',
'%',
's',
'_',
'%',
's',
'_',
'n',
'o',
'n',
'e',
'_',
'd',
'e',
'a',
'd',
'b',
'e',
'e',
'f',0};
168 static const WCHAR fmtW[] =
169 {
'%',
's',
'p',
'o',
'l',
'i',
'c',
'i',
'e',
's',
'\\',
'%',
's',
'\\',
'%',
's',
'.',
'p',
'o',
'l',
'i',
'c',
'y',0};
197 #define ASSEMBLYINFO_FLAG_INSTALLED 1 228 IAssemblyName_Release( name_obj );
233 IAssemblyName_Release( name_obj );
254 TRACE(
"assembly is installed\n");
258 if (
info->pszCurrentAssemblyPathBuf)
270 IAssemblyName_Release( name_obj );
302 hr = IXMLDOMNamedNodeMap_getNamedItem(
map,
str, &
attr );
306 hr = IXMLDOMNode_get_nodeValue(
attr, &
var );
307 IXMLDOMNode_Release(
attr );
356 static const WCHAR fileW[] = {
'f',
'i',
'l',
'e',0};
357 static const WCHAR nameW[] = {
'n',
'a',
'm',
'e',0};
367 hr = IXMLDOMDocument_getElementsByTagName( doc,
str, &
list );
371 hr = IXMLDOMNodeList_get_length(
list, &
len );
372 if (
hr !=
S_OK)
goto done;
391 hr = IXMLDOMNode_get_attributes(
node, &attrs );
392 IXMLDOMNode_Release(
node );
398 IXMLDOMNamedNodeMap_Release( attrs );
404 IXMLDOMNamedNodeMap_Release( attrs );
416 WARN(
"no files found\n");
421 IXMLDOMNodeList_Release(
list );
427 static const WCHAR identityW[] = {
'a',
's',
's',
'e',
'm',
'b',
'l',
'y',
'I',
'd',
'e',
'n',
't',
'i',
't',
'y',0};
428 static const WCHAR typeW[] = {
't',
'y',
'p',
'e',0};
429 static const WCHAR nameW[] = {
'n',
'a',
'm',
'e',0};
430 static const WCHAR versionW[] = {
'v',
'e',
'r',
's',
'i',
'o',
'n',0};
431 static const WCHAR architectureW[] = {
'p',
'r',
'o',
'c',
'e',
's',
's',
'o',
'r',
'A',
'r',
'c',
'h',
'i',
't',
'e',
'c',
't',
'u',
'r',
'e',0};
432 static const WCHAR tokenW[] = {
'p',
'u',
'b',
'l',
'i',
'c',
'K',
'e',
'y',
'T',
'o',
'k',
'e',
'n',0};
442 hr = IXMLDOMDocument_getElementsByTagName( doc,
str, &
list );
444 if (
hr !=
S_OK)
goto done;
446 hr = IXMLDOMNodeList_get_length(
list, &
len );
447 if (
hr !=
S_OK)
goto done;
454 if (
hr !=
S_OK)
goto done;
467 hr = IXMLDOMNode_get_attributes(
node, &attrs );
468 if (
hr !=
S_OK)
goto done;
477 !
a->name || !
a->version || !
a->arch || !
a->token)
479 WARN(
"invalid win32 assembly\n");
486 if (attrs) IXMLDOMNamedNodeMap_Release( attrs );
487 if (
node) IXMLDOMNode_Release(
node );
488 if (
list) IXMLDOMNodeList_Release(
list );
497 static const WCHAR policiesW[] = {
'p',
'o',
'l',
'i',
'c',
'i',
'e',
's',
'\\',0};
498 static const WCHAR suffixW[] = {
'.',
'p',
'o',
'l',
'i',
'c',
'y',0};
540 WARN(
"failed to copy policy manifest file 0x%08x\n",
hr);
568 static const WCHAR manifestsW[] = {
'm',
'a',
'n',
'i',
'f',
'e',
's',
't',
's',
'\\',0};
569 static const WCHAR suffixW[] = {
'.',
'm',
'a',
'n',
'i',
'f',
'e',
's',
't',0};
602 hr = IXMLDOMDocument_load( doc,
var, &
b );
607 WARN(
"failed to load manifest\n");
629 WARN(
"failed to copy manifest file 0x%08x\n",
hr);
662 WARN(
"failed to copy file 0x%08x\n",
hr);
705 if (doc) IXMLDOMDocument_Release( doc );
765 FIXME(
"application reference not supported\n");
809 if (name_obj) IAssemblyName_Release( name_obj );
812 if (doc) IXMLDOMDocument_Release( doc );
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
#define HRESULT_FROM_WIN32(x)
const WCHAR * get_name_attribute(IAssemblyName *iface, enum name_attr_id id)
#define ASSEMBLYINFO_FLAG_INSTALLED
static WCHAR * build_assembly_name(const WCHAR *arch, const WCHAR *name, const WCHAR *token, const WCHAR *version, unsigned int *len)
static WCHAR * strdupW(const WCHAR *src)
static unsigned int build_sxs_path(WCHAR *path)
static const WCHAR win32_policyW[]
static void cache_unlock(struct cache *cache)
__cdecl __MINGW_NOTHROW char * dirname(char *)
static const WCHAR typeW[]
DWORD WINAPI GetLastError(VOID)
static HRESULT WINAPI cache_CreateAssemblyCacheItem(IAssemblyCache *iface, DWORD flags, PVOID reserved, IAssemblyCacheItem **item, LPCWSTR name)
static WCHAR * build_source_filename(const WCHAR *manifest, struct file *file)
static HRESULT WINAPI cache_Reserved(IAssemblyCache *iface, IUnknown **reserved)
static const IAssemblyCacheVtbl cache_vtbl
void WINAPI VariantInit(VARIANTARG *pVarg)
static struct cache * impl_from_IAssemblyCache(IAssemblyCache *iface)
static const WCHAR backslashW[]
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
static BSTR get_attribute_value(IXMLDOMNamedNodeMap *map, const WCHAR *value_name)
static WCHAR * build_policy_path(const WCHAR *arch, const WCHAR *name, const WCHAR *token, const WCHAR *version)
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
static WCHAR * build_manifest_path(const WCHAR *arch, const WCHAR *name, const WCHAR *token, const WCHAR *version)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
HRESULT WINAPI CreateAssemblyCache(IAssemblyCache **obj, DWORD reserved)
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 token
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
static const WCHAR version[]
BSTR WINAPI SysAllocString(LPCOLESTR str)
static HRESULT uninstall_assembly(struct assembly *assembly)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
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)
static HRESULT WINAPI cache_QueryAssemblyInfo(IAssemblyCache *iface, DWORD flags, LPCWSTR assembly_name, ASSEMBLY_INFO *info)
static HRESULT parse_files(IXMLDOMDocument *doc, struct assembly *assembly)
static const WCHAR nameW[]
static const WCHAR cache_mutex_nameW[]
#define ERROR_SXS_MANIFEST_FORMAT_ERROR
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
GLboolean GLboolean GLboolean b
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
WINE_DEFAULT_DEBUG_CHANNEL(sxs)
static HRESULT WINAPI cache_QueryInterface(IAssemblyCache *iface, REFIID riid, void **obj)
static const WCHAR win32W[]
HRESULT WINAPI CreateAssemblyNameObject(IAssemblyName **ppAssemblyNameObj, LPCWSTR szAssemblyName, DWORD dwFlags, LPVOID pvReserved)
#define INVALID_FILE_ATTRIBUTES
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
#define InterlockedDecrement
#define memcpy(s1, s2, n)
IAssemblyCache IAssemblyCache_iface
int _cdecl swprintf(const WCHAR *,...)
static void cache_lock(struct cache *cache)
static HRESULT parse_assembly(IXMLDOMDocument *doc, struct assembly **assembly)
static HRESULT install_assembly(const WCHAR *manifest, struct assembly *assembly)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
_CRTIMP wchar_t *__cdecl _wcslwr(_Inout_z_ wchar_t *_String)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
#define ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE
static HRESULT install_policy(const WCHAR *manifest, struct assembly *assembly)
#define InterlockedIncrement
#define ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
static HRESULT WINAPI cache_UninstallAssembly(IAssemblyCache *iface, DWORD flags, LPCWSTR assembly_name, LPCFUSION_INSTALL_REFERENCE ref, ULONG *disp)
static HRESULT load_manifest(IXMLDOMDocument *doc, const WCHAR *filename)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
static WCHAR * build_policy_name(const WCHAR *arch, const WCHAR *name, const WCHAR *token, unsigned int *len)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
static WCHAR * build_policy_filename(const WCHAR *arch, const WCHAR *name, const WCHAR *token, const WCHAR *version)
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
static HRESULT WINAPI cache_InstallAssembly(IAssemblyCache *iface, DWORD flags, LPCWSTR path, LPCFUSION_INSTALL_REFERENCE ref)
static const CHAR manifest[]
static const WCHAR tokenW[]
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
GLuint GLuint GLsizei GLenum type
GLboolean GLboolean GLboolean GLboolean a
static const WCHAR fileW[]
static const WCHAR versionW[]
static void free_assembly(struct assembly *assembly)
#define HeapFree(x, y, z)
static ULONG WINAPI cache_Release(IAssemblyCache *iface)
#define IsEqualIID(riid1, riid2)
static ULONG WINAPI cache_AddRef(IAssemblyCache *iface)
static WCHAR * build_manifest_filename(const WCHAR *arch, const WCHAR *name, const WCHAR *token, const WCHAR *version)
const struct _GUID CLSID_DOMDocument
#define ERROR_INSUFFICIENT_BUFFER
GLuint const GLchar * name