ReactOS 0.4.17-dev-966-gf06eace
cache.c
Go to the documentation of this file.
1/*
2 * IAssemblyCache implementation
3 *
4 * Copyright 2010 Hans Leidekker for CodeWeavers
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include <stdarg.h>
22
23#define COBJMACROS
24#define INITGUID
25
26#include "windef.h"
27#include "winbase.h"
28#include "ole2.h"
29#include "winsxs.h"
30#include "msxml2.h"
31
32#include "wine/debug.h"
33#include "wine/list.h"
34#include "sxs_private.h"
35
37
38static const WCHAR cache_mutex_nameW[] = L"__WINE_SXS_CACHE_MUTEX__";
39
40struct cache
41{
45};
46
47static inline struct cache *impl_from_IAssemblyCache(IAssemblyCache *iface)
48{
49 return CONTAINING_RECORD(iface, struct cache, IAssemblyCache_iface);
50}
51
53 IAssemblyCache *iface,
55 void **ret_iface )
56{
57 TRACE("%p, %s, %p\n", iface, debugstr_guid(riid), ret_iface);
58
59 *ret_iface = NULL;
60
62 IsEqualIID(riid, &IID_IAssemblyCache))
63 {
64 IAssemblyCache_AddRef( iface );
65 *ret_iface = iface;
66 return S_OK;
67 }
68
69 return E_NOINTERFACE;
70}
71
73{
74 struct cache *cache = impl_from_IAssemblyCache(iface);
76}
77
79{
80 struct cache *cache = impl_from_IAssemblyCache(iface);
82
83 if (!refs)
84 {
85 TRACE("destroying %p\n", cache);
87 free( cache );
88 }
89 return refs;
90}
91
92static unsigned int build_sxs_path( WCHAR *path )
93{
94 static const WCHAR winsxsW[] = L"\\winsxs\\";
95 unsigned int len = GetWindowsDirectoryW( path, MAX_PATH );
96
97 memcpy( path + len, winsxsW, sizeof(winsxsW) );
98 return len + ARRAY_SIZE(winsxsW) - 1;
99}
100
101static WCHAR *build_assembly_name( const WCHAR *arch, const WCHAR *name, const WCHAR *token,
102 const WCHAR *version, unsigned int *len )
103{
104 static const WCHAR fmtW[] = L"%s_%s_%s_%s_none_deadbeef";
105 unsigned int buflen = ARRAY_SIZE(fmtW);
106 WCHAR *ret;
107
108 buflen += lstrlenW( arch );
109 buflen += lstrlenW( name );
110 buflen += lstrlenW( token );
111 buflen += lstrlenW( version );
112 if (!(ret = malloc( buflen * sizeof(WCHAR) ))) return NULL;
113 *len = swprintf( ret, buflen, fmtW, arch, name, token, version );
114 return wcslwr( ret );
115}
116
117static WCHAR *build_dll_path( const WCHAR *arch, const WCHAR *name, const WCHAR *token,
118 const WCHAR *version )
119{
120 WCHAR *path = NULL, *ret, sxsdir[MAX_PATH];
121 unsigned int len;
122
123 if (!(path = build_assembly_name( arch, name, token, version, &len ))) return NULL;
124 len += build_sxs_path( sxsdir ) + 2;
125 if (!(ret = malloc( len * sizeof(WCHAR) )))
126 {
127 free( path );
128 return NULL;
129 }
130 lstrcpyW( ret, sxsdir );
131 lstrcatW( ret, path );
132 lstrcatW( ret, L"\\" );
133 free( path );
134 return ret;
135}
136
137static WCHAR *build_policy_name( const WCHAR *arch, const WCHAR *name, const WCHAR *token,
138 unsigned int *len )
139{
140 static const WCHAR fmtW[] = L"%s_%s_%s_none_deadbeef";
141 unsigned int buflen = ARRAY_SIZE(fmtW);
142 WCHAR *ret;
143
144 buflen += lstrlenW( arch );
145 buflen += lstrlenW( name );
146 buflen += lstrlenW( token );
147 if (!(ret = malloc( buflen * sizeof(WCHAR) ))) return NULL;
148 *len = swprintf( ret, buflen, fmtW, arch, name, token );
149 return wcslwr( ret );
150}
151
152static WCHAR *build_policy_path( const WCHAR *arch, const WCHAR *name, const WCHAR *token,
153 const WCHAR *version )
154{
155 static const WCHAR fmtW[] = L"%spolicies\\%s\\%s.policy";
156 WCHAR *path = NULL, *ret, sxsdir[MAX_PATH];
157 unsigned int len;
158
159 if (!(path = build_policy_name( arch, name, token, &len ))) return NULL;
160 len += ARRAY_SIZE(fmtW);
161 len += build_sxs_path( sxsdir );
162 len += lstrlenW( version );
163 if (!(ret = malloc( len * sizeof(WCHAR) )))
164 {
165 free( path );
166 return NULL;
167 }
168 swprintf( ret, len, fmtW, sxsdir, path, version );
169 free( path );
170 return ret;
171}
172
173static void cache_lock( struct cache *cache )
174{
176}
177
178static void cache_unlock( struct cache *cache )
179{
181}
182
183#define ASSEMBLYINFO_FLAG_INSTALLED 1
184
186 IAssemblyCache *iface,
187 DWORD flags,
190{
191 struct cache *cache = impl_from_IAssemblyCache( iface );
192 IAssemblyName *name_obj;
193 const WCHAR *arch, *name, *token, *type, *version;
194 WCHAR *path = NULL;
195 unsigned int len;
196 HRESULT hr;
197
198 TRACE("%p, 0x%08lx, %s, %p\n", iface, flags, debugstr_w(assembly_name), info);
199
200 if (flags || (info && info->cbAssemblyInfo != sizeof(*info)))
201 return E_INVALIDARG;
202
204 if (FAILED( hr ))
205 return hr;
206
207 arch = get_name_attribute( name_obj, NAME_ATTR_ID_ARCH );
212 if (!arch || !name || !token || !type || !version)
213 {
214 IAssemblyName_Release( name_obj );
216 }
217 if (!info)
218 {
219 IAssemblyName_Release( name_obj );
220 return S_OK;
221 }
222 cache_lock( cache );
223
224 if (!wcscmp( type, L"win32" )) path = build_dll_path( arch, name, token, version );
225 else if (!wcscmp( type, L"win32-policy" )) path = build_policy_path( arch, name, token, version );
226 else
227 {
229 goto done;
230 }
231 if (!path)
232 {
234 goto done;
235 }
236 hr = S_OK;
237 if (GetFileAttributesW( path ) != INVALID_FILE_ATTRIBUTES) /* FIXME: better check */
238 {
239 info->dwAssemblyFlags = ASSEMBLYINFO_FLAG_INSTALLED;
240 TRACE("assembly is installed\n");
241 }
242 len = lstrlenW( path ) + 1;
243 if (info->pszCurrentAssemblyPathBuf)
244 {
245 if (info->cchBuf < len)
246 {
247 info->cchBuf = len;
249 }
250 else lstrcpyW( info->pszCurrentAssemblyPathBuf, path );
251 }
252
253done:
254 free( path );
255 IAssemblyName_Release( name_obj );
257 return hr;
258}
259
261 IAssemblyCache *iface,
262 DWORD flags,
265 LPCWSTR name )
266{
267 FIXME("%p, 0x%08lx, %p, %p, %s\n", iface, flags, reserved, item, debugstr_w(name));
268 return E_NOTIMPL;
269}
270
272 IAssemblyCache *iface,
274{
275 FIXME("%p\n", reserved);
276 return E_NOTIMPL;
277}
278
280{
281 HRESULT hr;
283 VARIANT var;
284 BSTR str;
285
286 str = SysAllocString( value_name );
287 hr = IXMLDOMNamedNodeMap_getNamedItem( map, str, &attr );
289 if (hr != S_OK) return NULL;
290
291 hr = IXMLDOMNode_get_nodeValue( attr, &var );
292 IXMLDOMNode_Release( attr );
293 if (hr != S_OK) return NULL;
294 if (V_VT(&var) != VT_BSTR)
295 {
296 VariantClear( &var );
297 return NULL;
298 }
299 TRACE("%s=%s\n", debugstr_w(value_name), debugstr_w(V_BSTR( &var )));
300 return V_BSTR( &var );
301}
302
303struct file
304{
305 struct list entry;
307};
308
310{
316 struct list files;
317};
318
319static void free_assembly( struct assembly *assembly )
320{
321 struct list *item, *cursor;
322
323 if (!assembly) return;
330 {
331 struct file *file = LIST_ENTRY( item, struct file, entry );
334 free( file );
335 }
336 free( assembly );
337}
338
340{
341 IXMLDOMNamedNodeMap *attrs;
344 struct file *f;
345 BSTR str;
346 HRESULT hr;
347 LONG len;
348
349 str = SysAllocString( L"file" );
350 hr = IXMLDOMDocument_getElementsByTagName( doc, str, &list );
352 if (hr != S_OK) return hr;
353
354 hr = IXMLDOMNodeList_get_length( list, &len );
355 if (hr != S_OK) goto done;
356 TRACE("found %ld files\n", len);
357 if (!len)
358 {
360 goto done;
361 }
362
363 for (;;)
364 {
365 hr = IXMLDOMNodeList_nextNode( list, &node );
366 if (hr != S_OK || !node)
367 {
368 hr = S_OK;
369 break;
370 }
371
372 /* FIXME: validate node type */
373
374 hr = IXMLDOMNode_get_attributes( node, &attrs );
375 IXMLDOMNode_Release( node );
376 if (hr != S_OK)
377 goto done;
378
379 if (!(f = malloc( sizeof(*f) )))
380 {
381 IXMLDOMNamedNodeMap_Release( attrs );
383 goto done;
384 }
385
386 f->name = get_attribute_value( attrs, L"name" );
387 IXMLDOMNamedNodeMap_Release( attrs );
388 if (!f->name)
389 {
390 free( f );
392 goto done;
393 }
394 list_add_tail( &assembly->files, &f->entry );
395 }
396
397 if (list_empty( &assembly->files ))
398 {
399 WARN("no files found\n");
401 }
402
403done:
404 IXMLDOMNodeList_Release( list );
405 return hr;
406}
407
409{
412 IXMLDOMNamedNodeMap *attrs = NULL;
413 struct assembly *a = NULL;
414 BSTR str;
415 HRESULT hr;
416 LONG len;
417
418 str = SysAllocString( L"assemblyIdentity" );
419 hr = IXMLDOMDocument_getElementsByTagName( doc, str, &list );
421 if (hr != S_OK) goto done;
422
423 hr = IXMLDOMNodeList_get_length( list, &len );
424 if (hr != S_OK) goto done;
425 if (!len)
426 {
428 goto done;
429 }
430 hr = IXMLDOMNodeList_nextNode( list, &node );
431 if (hr != S_OK) goto done;
432 if (!node)
433 {
435 goto done;
436 }
437 if (!(a = calloc(1, sizeof(*a) )))
438 {
440 goto done;
441 }
442 list_init( &a->files );
443
444 hr = IXMLDOMNode_get_attributes( node, &attrs );
445 if (hr != S_OK) goto done;
446
447 a->type = get_attribute_value( attrs, L"type" );
448 a->name = get_attribute_value( attrs, L"name" );
449 a->version = get_attribute_value( attrs, L"version" );
450 a->arch = get_attribute_value( attrs, L"processorArchitecture" );
451 a->token = get_attribute_value( attrs, L"publicKeyToken" );
452
453 if (!a->type || (wcscmp( a->type, L"win32" ) && wcscmp( a->type, L"win32-policy" )) ||
454 !a->name || !a->version || !a->arch || !a->token)
455 {
456 WARN("invalid win32 assembly\n");
458 goto done;
459 }
460 if (!wcscmp( a->type, L"win32" )) hr = parse_files( doc, a );
461
462done:
463 if (attrs) IXMLDOMNamedNodeMap_Release( attrs );
464 if (node) IXMLDOMNode_Release( node );
465 if (list) IXMLDOMNodeList_Release( list );
466 if (hr == S_OK) *assembly = a;
467 else free_assembly( a );
468 return hr;
469}
470
471static WCHAR *build_policy_filename( const WCHAR *arch, const WCHAR *name, const WCHAR *token,
472 const WCHAR *version )
473{
474 static const WCHAR policiesW[] = L"policies\\";
475 static const WCHAR suffixW[] = L".policy";
476 WCHAR sxsdir[MAX_PATH], *ret, *fullname;
477 unsigned int len;
478
479 if (!(fullname = build_policy_name( arch, name, token, &len ))) return NULL;
480 len += build_sxs_path( sxsdir );
481 len += ARRAY_SIZE(policiesW) - 1;
482 len += lstrlenW( version );
483 len += ARRAY_SIZE(suffixW) - 1;
484 if (!(ret = malloc( (len + 1) * sizeof(WCHAR) )))
485 {
486 free( fullname );
487 return NULL;
488 }
489 lstrcpyW( ret, sxsdir );
490 lstrcatW( ret, policiesW );
492 lstrcatW( ret, name );
494 lstrcatW( ret, L"\\" );
495 lstrcatW( ret, version );
496 lstrcatW( ret, suffixW );
497
498 free( fullname );
499 return ret;
500}
501
503{
504 WCHAR *dst;
505 BOOL ret;
506
507 /* FIXME: handle catalog file */
508
510 if (!dst) return E_OUTOFMEMORY;
511
513 free( dst );
514 if (!ret)
515 {
517 WARN("failed to copy policy manifest file 0x%08lx\n", hr);
518 return hr;
519 }
520 return S_OK;
521}
522
524{
525 WCHAR *src;
526 const WCHAR *p;
527 int len;
528
529 p = wcsrchr( manifest, '\\' );
530 if (!p) p = wcsrchr( manifest, '/' );
531 if (!p) return wcsdup( manifest );
532
533 len = p - manifest + 1;
534 if (!(src = malloc( (len + lstrlenW( file->name ) + 1) * sizeof(WCHAR) )))
535 return NULL;
536
537 memcpy( src, manifest, len * sizeof(WCHAR) );
538 lstrcpyW( src + len, file->name );
539 return src;
540}
541
542static WCHAR *build_manifest_filename( const WCHAR *arch, const WCHAR *name, const WCHAR *token,
543 const WCHAR *version )
544{
545 static const WCHAR manifestsW[] = L"manifests\\";
546 static const WCHAR suffixW[] = L".manifest";
547 WCHAR sxsdir[MAX_PATH], *ret, *fullname;
548 unsigned int len;
549
550 if (!(fullname = build_assembly_name( arch, name, token, version, &len ))) return NULL;
551 len += build_sxs_path( sxsdir );
552 len += ARRAY_SIZE(manifestsW) - 1;
553 len += ARRAY_SIZE(suffixW) - 1;
554 if (!(ret = malloc( (len + 1) * sizeof(WCHAR) )))
555 {
556 free( fullname );
557 return NULL;
558 }
559 lstrcpyW( ret, sxsdir );
560 lstrcatW( ret, manifestsW );
562 lstrcatW( ret, suffixW );
563
564 free( fullname );
565 return ret;
566}
567
569{
570 HRESULT hr;
571 VARIANT var;
573 BSTR str;
574
576 VariantInit( &var );
577 V_VT( &var ) = VT_BSTR;
578 V_BSTR( &var ) = str;
579 hr = IXMLDOMDocument_load( doc, var, &b );
581 if (hr != S_OK) return hr;
582 if (!b)
583 {
584 WARN("failed to load manifest\n");
585 return S_FALSE;
586 }
587 return S_OK;
588}
589
591{
592 WCHAR sxsdir[MAX_PATH], *p, *name, *dst, *src;
593 unsigned int len, len_name, len_sxsdir = build_sxs_path( sxsdir );
594 struct file *file;
596 BOOL ret;
597
599 if (!dst) return E_OUTOFMEMORY;
600
602 {
603 free( dst );
604 TRACE("manifest exists, skipping install\n");
605 return S_OK;
606 }
607
609 free( dst );
610 if (!ret)
611 {
613 WARN("failed to copy manifest file 0x%08lx\n", hr);
614 return hr;
615 }
616
618 &len_name );
619 if (!name) return E_OUTOFMEMORY;
620
621 /* FIXME: this should be a transaction */
623 {
624 if (!(src = build_source_filename( manifest, file ))) goto done;
625
626 len = len_sxsdir + len_name + lstrlenW( file->name );
627 if (!(dst = malloc( (len + 2) * sizeof(WCHAR) )))
628 {
629 free( src );
630 goto done;
631 }
632 lstrcpyW( dst, sxsdir );
633 lstrcatW( dst, name );
635
636 lstrcatW( dst, L"\\" );
637 lstrcatW( dst, file->name );
638 for (p = dst; *p; p++) *p = towlower( *p );
639
640 ret = CopyFileW( src, dst, FALSE );
641 free( src );
642 free( dst );
643 if (!ret)
644 {
646 WARN("failed to copy file 0x%08lx\n", hr);
647 goto done;
648 }
649 }
650 hr = S_OK;
651
652done:
653 free( name );
654 return hr;
655}
656
658 IAssemblyCache *iface,
659 DWORD flags,
662{
663 struct cache *cache = impl_from_IAssemblyCache( iface );
664 HRESULT hr, init;
665 IXMLDOMDocument *doc = NULL;
666 struct assembly *assembly = NULL;
667
668 TRACE("%p, 0x%08lx, %s, %p\n", iface, flags, debugstr_w(path), ref);
669
670 cache_lock( cache );
672
673 hr = CoCreateInstance( &CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (void **)&doc );
674 if (hr != S_OK)
675 goto done;
676
677 if ((hr = load_manifest( doc, path )) != S_OK) goto done;
678 if ((hr = parse_assembly( doc, &assembly )) != S_OK) goto done;
679
680 /* FIXME: verify name attributes */
681
682 if (!wcscmp( assembly->type, L"win32-policy" ))
684 else
686
687done:
689 if (doc) IXMLDOMDocument_Release( doc );
692 return hr;
693}
694
696{
697 WCHAR sxsdir[MAX_PATH], *name, *dirname, *filename;
698 unsigned int len, len_name, len_sxsdir = build_sxs_path( sxsdir );
700 struct file *file;
701
703 &len_name );
704 if (!name) return E_OUTOFMEMORY;
705 if (!(dirname = malloc( (len_sxsdir + len_name + 1) * sizeof(WCHAR) )))
706 goto done;
707 lstrcpyW( dirname, sxsdir );
708 lstrcpyW( dirname + len_sxsdir, name );
709
711 {
712 len = len_sxsdir + len_name + 1 + lstrlenW( file->name );
713 if (!(filename = malloc( (len + 1) * sizeof(WCHAR) ))) goto done;
715 lstrcatW( filename, L"\\" );
717
718 if (!DeleteFileW( filename )) WARN( "failed to delete file %lu\n", GetLastError() );
719 free( filename );
720 }
722 hr = S_OK;
723
724done:
725 free( dirname );
726 free( name );
727 return hr;
728}
729
731 IAssemblyCache *iface,
732 DWORD flags,
735 ULONG *disp )
736{
737 struct cache *cache = impl_from_IAssemblyCache( iface );
738 HRESULT hr, init;
739 IXMLDOMDocument *doc = NULL;
740 struct assembly *assembly = NULL;
741 IAssemblyName *name_obj = NULL;
742 const WCHAR *arch, *name, *token, *type, *version;
743 WCHAR *p, *path = NULL;
744
745 TRACE("%p, 0x%08lx, %s, %p, %p\n", iface, flags, debugstr_w(assembly_name), ref, disp);
746
747 if (ref)
748 {
749 FIXME("application reference not supported\n");
750 return E_NOTIMPL;
751 }
752 cache_lock( cache );
754
756 if (FAILED( hr ))
757 goto done;
758
764 if (!arch || !name || !token || !type || !version)
765 {
767 goto done;
768 }
769 if (!wcscmp( type, L"win32" )) path = build_manifest_filename( arch, name, token, version );
770 else if (!wcscmp( type, L"win32-policy" )) path = build_policy_filename( arch, name, token, version );
771 else
772 {
774 goto done;
775 }
776
777 hr = CoCreateInstance( &CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (void **)&doc );
778 if (hr != S_OK)
779 goto done;
780
781 if ((hr = load_manifest( doc, path )) != S_OK) goto done;
782 if ((hr = parse_assembly( doc, &assembly )) != S_OK) goto done;
783
784 if (!DeleteFileW( path )) WARN( "unable to remove manifest file %lu\n", GetLastError() );
785 else if ((p = wcsrchr( path, '\\' )))
786 {
787 *p = 0;
789 }
790 if (!wcscmp( assembly->type, L"win32" )) hr = uninstall_assembly( assembly );
791
792done:
793 if (name_obj) IAssemblyName_Release( name_obj );
794 free( path );
796 if (doc) IXMLDOMDocument_Release( doc );
799 return hr;
800}
801
802static const IAssemblyCacheVtbl cache_vtbl =
803{
812};
813
814/******************************************************************
815 * CreateAssemblyCache (SXS.@)
816 */
818{
819 struct cache *cache;
820
821 TRACE("%p, %lu\n", obj, reserved);
822
823 if (!obj)
824 return E_INVALIDARG;
825
826 *obj = NULL;
827
828 cache = malloc( sizeof(*cache) );
829 if (!cache)
830 return E_OUTOFMEMORY;
831
833 cache->refs = 1;
835 if (!cache->lock)
836 {
837 free( cache );
839 }
841 return S_OK;
842}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
Definition: list.h:39
Definition: _map.h:48
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
#define CloseHandle
Definition: compat.h:739
#define wcsrchr
Definition: compat.h:16
OLECHAR * BSTR
Definition: compat.h:2293
#define MAX_PATH
Definition: compat.h:34
#define lstrcpyW
Definition: compat.h:749
short VARIANT_BOOL
Definition: compat.h:2290
@ VT_BSTR
Definition: compat.h:2303
#define lstrlenW
Definition: compat.h:750
static const WCHAR version[]
Definition: asmname.c:66
HRESULT WINAPI CreateAssemblyNameObject(IAssemblyName **ppAssemblyNameObj, LPCWSTR szAssemblyName, DWORD dwFlags, LPVOID pvReserved)
Definition: asmname.c:795
LONG refs
Definition: port.c:62
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:367
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:58
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:700
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2370
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
static wchar_t * wcslwr(wchar_t *str)
Definition: string.h:96
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
static HRESULT load_manifest(IXMLDOMDocument *doc, const WCHAR *filename)
Definition: cache.c:568
static HRESULT WINAPI cache_UninstallAssembly(IAssemblyCache *iface, DWORD flags, LPCWSTR assembly_name, LPCFUSION_INSTALL_REFERENCE ref, ULONG *disp)
Definition: cache.c:730
static void cache_unlock(struct cache *cache)
Definition: cache.c:178
static const IAssemblyCacheVtbl cache_vtbl
Definition: cache.c:802
static ULONG WINAPI cache_AddRef(IAssemblyCache *iface)
Definition: cache.c:72
static HRESULT uninstall_assembly(struct assembly *assembly)
Definition: cache.c:695
static HRESULT install_assembly(const WCHAR *manifest, struct assembly *assembly)
Definition: cache.c:590
static const WCHAR cache_mutex_nameW[]
Definition: cache.c:38
HRESULT WINAPI CreateAssemblyCache(IAssemblyCache **obj, DWORD reserved)
Definition: cache.c:817
static WCHAR * build_policy_path(const WCHAR *arch, const WCHAR *name, const WCHAR *token, const WCHAR *version)
Definition: cache.c:152
static WCHAR * build_policy_name(const WCHAR *arch, const WCHAR *name, const WCHAR *token, unsigned int *len)
Definition: cache.c:137
static HRESULT WINAPI cache_QueryInterface(IAssemblyCache *iface, REFIID riid, void **ret_iface)
Definition: cache.c:52
static WCHAR * build_manifest_filename(const WCHAR *arch, const WCHAR *name, const WCHAR *token, const WCHAR *version)
Definition: cache.c:542
#define ASSEMBLYINFO_FLAG_INSTALLED
Definition: fusion.idl:103
static BSTR get_attribute_value(IXMLDOMNamedNodeMap *map, const WCHAR *value_name)
Definition: cache.c:279
static HRESULT WINAPI cache_Reserved(IAssemblyCache *iface, IUnknown **reserved)
Definition: cache.c:271
static HRESULT parse_files(IXMLDOMDocument *doc, struct assembly *assembly)
Definition: cache.c:339
static struct cache * impl_from_IAssemblyCache(IAssemblyCache *iface)
Definition: cache.c:47
static unsigned int build_sxs_path(WCHAR *path)
Definition: cache.c:92
static WCHAR * build_policy_filename(const WCHAR *arch, const WCHAR *name, const WCHAR *token, const WCHAR *version)
Definition: cache.c:471
static void free_assembly(struct assembly *assembly)
Definition: cache.c:319
static HRESULT WINAPI cache_CreateAssemblyCacheItem(IAssemblyCache *iface, DWORD flags, PVOID reserved, IAssemblyCacheItem **item, LPCWSTR name)
Definition: cache.c:260
static HRESULT WINAPI cache_InstallAssembly(IAssemblyCache *iface, DWORD flags, LPCWSTR path, LPCFUSION_INSTALL_REFERENCE ref)
Definition: cache.c:657
static HRESULT install_policy(const WCHAR *manifest, struct assembly *assembly)
Definition: cache.c:502
static HRESULT parse_assembly(IXMLDOMDocument *doc, struct assembly **assembly)
Definition: cache.c:408
static WCHAR * build_source_filename(const WCHAR *manifest, struct file *file)
Definition: cache.c:523
static HRESULT WINAPI cache_QueryAssemblyInfo(IAssemblyCache *iface, DWORD flags, LPCWSTR assembly_name, ASSEMBLY_INFO *info)
Definition: cache.c:185
static WCHAR * build_assembly_name(const WCHAR *arch, const WCHAR *name, const WCHAR *token, const WCHAR *version, unsigned int *len)
Definition: cache.c:101
static ULONG WINAPI cache_Release(IAssemblyCache *iface)
Definition: cache.c:78
static WCHAR * build_dll_path(const WCHAR *arch, const WCHAR *name, const WCHAR *token, const WCHAR *version)
Definition: cache.c:117
const WCHAR * get_name_attribute(IAssemblyName *iface, enum name_attr_id id)
Definition: name.c:177
static SRWLOCK cache_lock
Definition: session.c:1973
#define swprintf
Definition: precomp.h:40
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
r reserved
Definition: btrfs.c:3006
#define INFINITE
Definition: serial.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum src
Definition: glext.h:6340
GLfloat f
Definition: glext.h:7540
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum GLenum dst
Definition: glext.h:6340
GLbitfield flags
Definition: glext.h:7161
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
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
Definition: glfuncs.h:210
const char cursor[]
Definition: icontest.c:13
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
const char * filename
Definition: ioapi.h:137
uint32_t entry
Definition: isohybrid.c:63
#define f
Definition: ke_i.h:83
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
__cdecl __MINGW_NOTHROW char * dirname(char *)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
const char * var
Definition: shader.c:5879
const char * fullname
Definition: shader.c:1979
const struct _GUID CLSID_DOMDocument
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:240
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:273
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define calloc
Definition: rosglue.h:14
#define list
Definition: rosglue.h:35
const WCHAR * str
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:236
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:230
#define towlower(c)
Definition: wctype.h:97
#define TRACE(s)
Definition: solgame.cpp:4
BSTR version
Definition: cache.c:313
BSTR type
Definition: cache.c:311
BSTR token
Definition: cache.c:315
struct list files
Definition: cache.c:316
BSTR name
Definition: cache.c:312
BSTR arch
Definition: cache.c:314
Definition: cookie.c:202
Definition: cache.c:41
IAssemblyCache IAssemblyCache_iface
Definition: cache.c:42
HANDLE lock
Definition: cache.c:44
LONG refs
Definition: cache.c:43
char * name
Definition: wpp.c:52
Definition: fci.c:123
struct list entry
Definition: fci.c:124
char name[1]
Definition: fci.c:131
BSTR name
Definition: cache.c:306
Definition: name.c:39
Definition: send.c:48
@ NAME_ATTR_ID_VERSION
Definition: sxs_private.h:27
@ NAME_ATTR_ID_NAME
Definition: sxs_private.h:23
@ NAME_ATTR_ID_TYPE
Definition: sxs_private.h:26
@ NAME_ATTR_ID_ARCH
Definition: sxs_private.h:24
@ NAME_ATTR_ID_TOKEN
Definition: sxs_private.h:25
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:525
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:554
#define LIST_ENTRY(type)
Definition: queue.h:175
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
Definition: dlist.c:348
static const CHAR manifest[]
Definition: v6util.h:41
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:626
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:547
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define ERROR_SXS_MANIFEST_FORMAT_ERROR
Definition: winerror.h:3098
#define ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE
Definition: winerror.h:3173
#define E_NOINTERFACE
Definition: winerror.h:3479
#define ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE
Definition: winerror.h:3184
@ CANOF_PARSE_DISPLAY_NAME
Definition: winsxs.idl:193
static int init
Definition: wintirpc.c:33