ReactOS  0.4.14-dev-49-gfb4591c
asmcache.c
Go to the documentation of this file.
1 /*
2  * IAssemblyCache implementation
3  *
4  * Copyright 2008 James Hawkins
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 #include <stdio.h>
23 
24 #define COBJMACROS
25 
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "winver.h"
30 #include "wincrypt.h"
31 #include "winreg.h"
32 #include "shlwapi.h"
33 #include "dbghelp.h"
34 #include "ole2.h"
35 #include "fusion.h"
36 #include "corerror.h"
37 
38 #include "fusionpriv.h"
39 #include "wine/debug.h"
40 #include "wine/unicode.h"
41 
43 
44 typedef struct {
46 
50 
51 typedef struct {
53 
56 
57 static const WCHAR cache_mutex_nameW[] =
58  {'_','_','W','I','N','E','_','F','U','S','I','O','N','_','C','A','C','H','E','_','M','U','T','E','X','_','_',0};
59 
61 {
62  LPWSTR new_path;
63  BOOL ret = TRUE;
64  int len;
65 
66  if (!(new_path = heap_alloc((strlenW(path) + 1) * sizeof(WCHAR)))) return FALSE;
67 
68  strcpyW(new_path, path);
69 
70  while ((len = strlenW(new_path)) && new_path[len - 1] == '\\')
71  new_path[len - 1] = 0;
72 
73  while (!CreateDirectoryW(new_path, NULL))
74  {
75  LPWSTR slash;
77 
79  break;
80 
82  {
83  ret = FALSE;
84  break;
85  }
86 
87  if(!(slash = strrchrW(new_path, '\\')))
88  {
89  ret = FALSE;
90  break;
91  }
92 
93  len = slash - new_path;
94  new_path[len] = 0;
95  if(!create_full_path(new_path))
96  {
97  ret = FALSE;
98  break;
99  }
100 
101  new_path[len] = '\\';
102  }
103 
104  heap_free(new_path);
105  return ret;
106 }
107 
108 static BOOL get_assembly_directory(LPWSTR dir, DWORD size, const char *version, PEKIND architecture)
109 {
110  static const WCHAR dotnet[] = {'\\','M','i','c','r','o','s','o','f','t','.','N','E','T','\\',0};
111  static const WCHAR gac[] = {'\\','a','s','s','e','m','b','l','y','\\','G','A','C',0};
112  static const WCHAR msil[] = {'_','M','S','I','L',0};
113  static const WCHAR x86[] = {'_','3','2',0};
114  static const WCHAR amd64[] = {'_','6','4',0};
116 
117  if (!strcmp(version, "v4.0.30319"))
118  {
119  strcpyW(dir + len, dotnet);
120  len += ARRAY_SIZE(dotnet) - 1;
121  strcpyW(dir + len, gac + 1);
122  len += ARRAY_SIZE(gac) - 2;
123  }
124  else
125  {
126  strcpyW(dir + len, gac);
127  len += ARRAY_SIZE(gac) - 1;
128  }
129  switch (architecture)
130  {
131  case peNone:
132  break;
133 
134  case peMSIL:
135  strcpyW(dir + len, msil);
136  break;
137 
138  case peI386:
139  strcpyW(dir + len, x86);
140  break;
141 
142  case peAMD64:
143  strcpyW(dir + len, amd64);
144  break;
145 
146  default:
147  WARN("unhandled architecture %u\n", architecture);
148  return FALSE;
149  }
150  return TRUE;
151 }
152 
153 /* IAssemblyCache */
154 
156 {
157  return CONTAINING_RECORD(iface, IAssemblyCacheImpl, IAssemblyCache_iface);
158 }
159 
161  REFIID riid, LPVOID *ppobj)
162 {
164 
165  TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj);
166 
167  *ppobj = NULL;
168 
169  if (IsEqualIID(riid, &IID_IUnknown) ||
170  IsEqualIID(riid, &IID_IAssemblyCache))
171  {
172  IAssemblyCache_AddRef(iface);
173  *ppobj = &This->IAssemblyCache_iface;
174  return S_OK;
175  }
176 
177  WARN("(%p, %s, %p): not found\n", This, debugstr_guid(riid), ppobj);
178  return E_NOINTERFACE;
179 }
180 
182 {
184  ULONG refCount = InterlockedIncrement(&This->ref);
185 
186  TRACE("(%p)->(ref before = %u)\n", This, refCount - 1);
187 
188  return refCount;
189 }
190 
192 {
194  ULONG refCount = InterlockedDecrement( &cache->ref );
195 
196  TRACE("(%p)->(ref before = %u)\n", cache, refCount + 1);
197 
198  if (!refCount)
199  {
200  CloseHandle( cache->lock );
201  heap_free( cache );
202  }
203  return refCount;
204 }
205 
207 {
209 }
210 
212 {
213  ReleaseMutex( cache->lock );
214 }
215 
217  DWORD dwFlags,
218  LPCWSTR pszAssemblyName,
220  ULONG *pulDisposition)
221 {
222  HRESULT hr;
224  IAssemblyName *asmname, *next = NULL;
225  IAssemblyEnum *asmenum = NULL;
226  WCHAR *p, *path = NULL;
227  ULONG disp;
228  DWORD len;
229 
230  TRACE("(%p, 0%08x, %s, %p, %p)\n", iface, dwFlags,
231  debugstr_w(pszAssemblyName), pRefData, pulDisposition);
232 
233  if (pRefData)
234  {
235  FIXME("application reference not supported\n");
236  return E_NOTIMPL;
237  }
238  hr = CreateAssemblyNameObject( &asmname, pszAssemblyName, CANOF_PARSE_DISPLAY_NAME, NULL );
239  if (FAILED( hr ))
240  return hr;
241 
242  cache_lock( cache );
243 
244  hr = CreateAssemblyEnum( &asmenum, NULL, asmname, ASM_CACHE_GAC, NULL );
245  if (FAILED( hr ))
246  goto done;
247 
248  hr = IAssemblyEnum_GetNextAssembly( asmenum, NULL, &next, 0 );
249  if (hr == S_FALSE)
250  {
251  if (pulDisposition)
252  *pulDisposition = IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED;
253  goto done;
254  }
257  goto done;
258 
259  if (!(path = heap_alloc( len * sizeof(WCHAR) )))
260  {
261  hr = E_OUTOFMEMORY;
262  goto done;
263  }
265  if (FAILED( hr ))
266  goto done;
267 
268  if (DeleteFileW( path ))
269  {
270  if ((p = strrchrW( path, '\\' )))
271  {
272  *p = 0;
274  if ((p = strrchrW( path, '\\' )))
275  {
276  *p = 0;
278  }
279  }
280  disp = IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED;
281  hr = S_OK;
282  }
283  else
284  {
285  disp = IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED;
286  hr = S_FALSE;
287  }
288  if (pulDisposition) *pulDisposition = disp;
289 
290 done:
291  IAssemblyName_Release( asmname );
292  if (next) IAssemblyName_Release( next );
293  if (asmenum) IAssemblyEnum_Release( asmenum );
294  heap_free( path );
295  cache_unlock( cache );
296  return hr;
297 }
298 
300  DWORD dwFlags,
301  LPCWSTR pszAssemblyName,
302  ASSEMBLY_INFO *pAsmInfo)
303 {
305  IAssemblyName *asmname, *next = NULL;
306  IAssemblyEnum *asmenum = NULL;
307  HRESULT hr;
308 
309  TRACE("(%p, %d, %s, %p)\n", iface, dwFlags,
310  debugstr_w(pszAssemblyName), pAsmInfo);
311 
312  if (pAsmInfo)
313  {
314  if (pAsmInfo->cbAssemblyInfo == 0)
315  pAsmInfo->cbAssemblyInfo = sizeof(ASSEMBLY_INFO);
316  else if (pAsmInfo->cbAssemblyInfo != sizeof(ASSEMBLY_INFO))
317  return E_INVALIDARG;
318  }
319 
320  hr = CreateAssemblyNameObject(&asmname, pszAssemblyName,
322  if (FAILED(hr))
323  return hr;
324 
325  cache_lock( cache );
326 
327  hr = CreateAssemblyEnum(&asmenum, NULL, asmname, ASM_CACHE_GAC, NULL);
328  if (FAILED(hr))
329  goto done;
330 
331  for (;;)
332  {
333  hr = IAssemblyEnum_GetNextAssembly(asmenum, NULL, &next, 0);
334  if (hr != S_OK)
335  {
337  goto done;
338  }
339  hr = IAssemblyName_IsEqual(asmname, next, ASM_CMPF_IL_ALL);
340  if (hr == S_OK) break;
341  }
342 
343  if (!pAsmInfo)
344  goto done;
345 
347 
349 
350 done:
351  IAssemblyName_Release(asmname);
352  if (next) IAssemblyName_Release(next);
353  if (asmenum) IAssemblyEnum_Release(asmenum);
354  cache_unlock( cache );
355  return hr;
356 }
357 
358 static const IAssemblyCacheItemVtbl AssemblyCacheItemVtbl;
359 
361  DWORD dwFlags,
363  IAssemblyCacheItem **ppAsmItem,
364  LPCWSTR pszAssemblyName)
365 {
367 
368  FIXME("(%p, %d, %p, %p, %s) semi-stub!\n", iface, dwFlags, pvReserved,
369  ppAsmItem, debugstr_w(pszAssemblyName));
370 
371  if (!ppAsmItem)
372  return E_INVALIDARG;
373 
374  *ppAsmItem = NULL;
375 
376  if (!(item = heap_alloc(sizeof(*item)))) return E_OUTOFMEMORY;
377 
378  item->IAssemblyCacheItem_iface.lpVtbl = &AssemblyCacheItemVtbl;
379  item->ref = 1;
380 
381  *ppAsmItem = &item->IAssemblyCacheItem_iface;
382  return S_OK;
383 }
384 
386  IUnknown **ppUnkReserved)
387 {
388  FIXME("(%p, %p) stub!\n", iface, ppUnkReserved);
389  return E_NOTIMPL;
390 }
391 
392 static HRESULT copy_file( const WCHAR *src_dir, DWORD src_len, const WCHAR *dst_dir, DWORD dst_len,
393  const WCHAR *filename )
394 {
395  WCHAR *src_file, *dst_file;
396  DWORD len = strlenW( filename );
397  HRESULT hr = S_OK;
398 
399  if (!(src_file = heap_alloc( (src_len + len + 1) * sizeof(WCHAR) )))
400  return E_OUTOFMEMORY;
401  memcpy( src_file, src_dir, src_len * sizeof(WCHAR) );
402  strcpyW( src_file + src_len, filename );
403 
404  if (!(dst_file = heap_alloc( (dst_len + len + 1) * sizeof(WCHAR) )))
405  {
406  heap_free( src_file );
407  return E_OUTOFMEMORY;
408  }
409  memcpy( dst_file, dst_dir, dst_len * sizeof(WCHAR) );
410  strcpyW( dst_file + dst_len, filename );
411 
412  if (!CopyFileW( src_file, dst_file, FALSE )) hr = HRESULT_FROM_WIN32( GetLastError() );
413  heap_free( src_file );
414  heap_free( dst_file );
415  return hr;
416 }
417 
419  DWORD dwFlags,
420  LPCWSTR pszManifestFilePath,
422 {
423  static const WCHAR format[] =
424  {'%','s','\\','%','s','\\','%','s','_','_','%','s','\\',0};
425  static const WCHAR format_v40[] =
426  {'%','s','\\','%','s','\\','v','4','.','0','_','%','s','_','_','%','s','\\',0};
427  static const WCHAR ext_exe[] = {'.','e','x','e',0};
428  static const WCHAR ext_dll[] = {'.','d','l','l',0};
431  const WCHAR *extension, *filename, *src_dir;
432  WCHAR *name = NULL, *token = NULL, *version = NULL, *asmpath = NULL;
433  WCHAR asmdir[MAX_PATH], *p, **external_files = NULL, *dst_dir = NULL;
434  PEKIND architecture;
435  char *clr_version;
436  DWORD i, count = 0, src_len, dst_len = ARRAY_SIZE(format_v40);
437  HRESULT hr;
438 
439  TRACE("(%p, %d, %s, %p)\n", iface, dwFlags,
440  debugstr_w(pszManifestFilePath), pRefData);
441 
442  if (!pszManifestFilePath || !*pszManifestFilePath)
443  return E_INVALIDARG;
444 
445  if (!(extension = strrchrW(pszManifestFilePath, '.')))
447 
448  if (lstrcmpiW(extension, ext_exe) && lstrcmpiW(extension, ext_dll))
450 
451  if (GetFileAttributesW(pszManifestFilePath) == INVALID_FILE_ATTRIBUTES)
453 
454  hr = assembly_create(&assembly, pszManifestFilePath);
455  if (FAILED(hr))
456  {
458  goto done;
459  }
460 
462  if (FAILED(hr))
463  goto done;
464 
466  if (FAILED(hr))
467  goto done;
468 
470  if (FAILED(hr))
471  goto done;
472 
474  if (FAILED(hr))
475  goto done;
476 
477  hr = assembly_get_external_files(assembly, &external_files, &count);
478  if (FAILED(hr))
479  goto done;
480 
481  cache_lock( cache );
482 
483  architecture = assembly_get_architecture(assembly);
484  get_assembly_directory(asmdir, MAX_PATH, clr_version, architecture);
485 
486  dst_len += strlenW(asmdir) + strlenW(name) + strlenW(version) + strlenW(token);
487  if (!(dst_dir = heap_alloc(dst_len * sizeof(WCHAR))))
488  {
489  hr = E_OUTOFMEMORY;
490  goto done;
491  }
492  if (!strcmp(clr_version, "v4.0.30319"))
493  dst_len = sprintfW(dst_dir, format_v40, asmdir, name, version, token);
494  else
495  dst_len = sprintfW(dst_dir, format, asmdir, name, version, token);
496 
497  create_full_path(dst_dir);
498 
499  hr = assembly_get_path(assembly, &asmpath);
500  if (FAILED(hr))
501  goto done;
502 
503  if ((p = strrchrW(asmpath, '\\')))
504  {
505  filename = p + 1;
506  src_dir = asmpath;
507  src_len = filename - asmpath;
508  }
509  else
510  {
511  filename = asmpath;
512  src_dir = NULL;
513  src_len = 0;
514  }
515  hr = copy_file(src_dir, src_len, dst_dir, dst_len, filename);
516  if (FAILED(hr))
517  goto done;
518 
519  for (i = 0; i < count; i++)
520  {
521  hr = copy_file(src_dir, src_len, dst_dir, dst_len, external_files[i]);
522  if (FAILED(hr))
523  break;
524  }
525 
526 done:
527  heap_free(name);
528  heap_free(token);
530  heap_free(asmpath);
531  heap_free(dst_dir);
532  for (i = 0; i < count; i++) heap_free(external_files[i]);
533  heap_free(external_files);
535  cache_unlock( cache );
536  return hr;
537 }
538 
539 static const IAssemblyCacheVtbl AssemblyCacheVtbl = {
548 };
549 
550 /******************************************************************
551  * CreateAssemblyCache (FUSION.@)
552  */
554 {
556 
557  TRACE("(%p, %d)\n", ppAsmCache, dwReserved);
558 
559  if (!ppAsmCache)
560  return E_INVALIDARG;
561 
562  *ppAsmCache = NULL;
563 
564  if (!(cache = heap_alloc(sizeof(*cache)))) return E_OUTOFMEMORY;
565 
567  cache->ref = 1;
569  if (!cache->lock)
570  {
571  heap_free( cache );
572  return HRESULT_FROM_WIN32( GetLastError() );
573  }
574  *ppAsmCache = &cache->IAssemblyCache_iface;
575  return S_OK;
576 }
577 
578 /* IAssemblyCacheItem */
579 
581 {
582  return CONTAINING_RECORD(iface, IAssemblyCacheItemImpl, IAssemblyCacheItem_iface);
583 }
584 
586  REFIID riid, LPVOID *ppobj)
587 {
589 
590  TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj);
591 
592  *ppobj = NULL;
593 
594  if (IsEqualIID(riid, &IID_IUnknown) ||
595  IsEqualIID(riid, &IID_IAssemblyCacheItem))
596  {
597  IAssemblyCacheItem_AddRef(iface);
598  *ppobj = &This->IAssemblyCacheItem_iface;
599  return S_OK;
600  }
601 
602  WARN("(%p, %s, %p): not found\n", This, debugstr_guid(riid), ppobj);
603  return E_NOINTERFACE;
604 }
605 
607 {
609  ULONG refCount = InterlockedIncrement(&This->ref);
610 
611  TRACE("(%p)->(ref before = %u)\n", This, refCount - 1);
612 
613  return refCount;
614 }
615 
617 {
619  ULONG refCount = InterlockedDecrement(&This->ref);
620 
621  TRACE("(%p)->(ref before = %u)\n", This, refCount + 1);
622 
623  if (!refCount)
624  heap_free(This);
625 
626  return refCount;
627 }
628 
630  DWORD dwFlags,
631  LPCWSTR pszStreamName,
632  DWORD dwFormat,
634  IStream **ppIStream,
635  ULARGE_INTEGER *puliMaxSize)
636 {
637  FIXME("(%p, %d, %s, %d, %d, %p, %p) stub!\n", iface, dwFlags,
638  debugstr_w(pszStreamName), dwFormat, dwFormatFlags, ppIStream, puliMaxSize);
639 
640  return E_NOTIMPL;
641 }
642 
644  DWORD dwFlags,
645  ULONG *pulDisposition)
646 {
647  FIXME("(%p, %d, %p) stub!\n", iface, dwFlags, pulDisposition);
648  return E_NOTIMPL;
649 }
650 
652 {
653  FIXME("(%p) stub!\n", iface);
654  return E_NOTIMPL;
655 }
656 
657 static const IAssemblyCacheItemVtbl AssemblyCacheItemVtbl = {
664 };
WINE_DEFAULT_DEBUG_CHANNEL(fusion)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
Definition: cache.c:46
disp
Definition: i386-dis.c:3181
HRESULT assembly_get_pubkey_token(ASSEMBLY *assembly, LPWSTR *token)
Definition: assembly.c:806
DWORD dwFormatFlags
Definition: trayclock.cpp:31
HRESULT assembly_get_path(const ASSEMBLY *assembly, LPWSTR *path)
Definition: assembly.c:749
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define E_NOINTERFACE
Definition: winerror.h:2364
static ULONG WINAPI IAssemblyCacheItemImpl_Release(IAssemblyCacheItem *iface)
Definition: asmcache.c:616
clr_version
Definition: msipriv.h:365
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static HRESULT WINAPI IAssemblyCacheImpl_UninstallAssembly(IAssemblyCache *iface, DWORD dwFlags, LPCWSTR pszAssemblyName, LPCFUSION_INSTALL_REFERENCE pRefData, ULONG *pulDisposition)
Definition: asmcache.c:216
#define ASSEMBLYINFO_FLAG_INSTALLED
Definition: cache.c:197
static HRESULT WINAPI IAssemblyCacheImpl_CreateAssemblyCacheItem(IAssemblyCache *iface, DWORD dwFlags, PVOID pvReserved, IAssemblyCacheItem **ppAsmItem, LPCWSTR pszAssemblyName)
Definition: asmcache.c:360
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static ULONG WINAPI IAssemblyCacheImpl_Release(IAssemblyCache *iface)
Definition: asmcache.c:191
REFIID riid
Definition: precomp.h:44
static const IAssemblyCacheItemVtbl AssemblyCacheItemVtbl
Definition: asmcache.c:358
HRESULT assembly_get_runtime_version(ASSEMBLY *assembly, LPSTR *version)
Definition: assembly.c:881
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:111
static void cache_unlock(IAssemblyCacheImpl *cache)
Definition: asmcache.c:211
HRESULT assembly_get_name(ASSEMBLY *assembly, LPWSTR *name)
Definition: assembly.c:722
static BOOL create_full_path(LPCWSTR path)
Definition: asmcache.c:60
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
ULONG cchBuf
Definition: winsxs.idl:41
PEKIND assembly_get_architecture(ASSEMBLY *assembly)
Definition: assembly.c:787
const char * filename
Definition: ioapi.h:135
static struct _tagASSEMBLY assembly
static HRESULT WINAPI IAssemblyCacheImpl_QueryAssemblyInfo(IAssemblyCache *iface, DWORD dwFlags, LPCWSTR pszAssemblyName, ASSEMBLY_INFO *pAsmInfo)
Definition: asmcache.c:299
DWORD dwAssemblyFlags
Definition: winsxs.idl:38
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
IAssemblyCache IAssemblyCache_iface
Definition: asmcache.c:45
static ULONG WINAPI IAssemblyCacheItemImpl_AddRef(IAssemblyCacheItem *iface)
Definition: asmcache.c:606
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
static HRESULT WINAPI IAssemblyCacheItemImpl_AbortItem(IAssemblyCacheItem *iface)
Definition: asmcache.c:651
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
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 E_OUTOFMEMORY
Definition: ddrawi.h:100
static HRESULT WINAPI IAssemblyCacheItemImpl_QueryInterface(IAssemblyCacheItem *iface, REFIID riid, LPVOID *ppobj)
Definition: asmcache.c:585
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
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
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
static void cache_lock(IAssemblyCacheImpl *cache)
Definition: asmcache.c:206
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
#define S_FALSE
Definition: winerror.h:2357
struct _ASSEMBLY_INFO ASSEMBLY_INFO
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
HANDLE lock
Definition: cache.c:50
unsigned int dir
Definition: maze.c:112
static IAssemblyCacheImpl * impl_from_IAssemblyCache(IAssemblyCache *iface)
Definition: asmcache.c:155
#define debugstr_guid
Definition: kernel32.h:35
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732
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
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
static HRESULT WINAPI IAssemblyCacheItemImpl_CreateStream(IAssemblyCacheItem *iface, DWORD dwFlags, LPCWSTR pszStreamName, DWORD dwFormat, DWORD dwFormatFlags, IStream **ppIStream, ULARGE_INTEGER *puliMaxSize)
Definition: asmcache.c:629
static BOOL get_assembly_directory(LPWSTR dir, DWORD size, const char *version, PEKIND architecture)
Definition: asmcache.c:108
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
const GUID IID_IUnknown
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT WINAPI CreateAssemblyNameObject(IAssemblyName **ppAssemblyNameObj, LPCWSTR szAssemblyName, DWORD dwFlags, LPVOID pvReserved)
Definition: asmname.c:795
static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface, DWORD dwFlags, LPCWSTR pszManifestFilePath, LPCFUSION_INSTALL_REFERENCE pRefData)
Definition: asmcache.c:418
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618
HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file)
Definition: assembly.c:640
#define COR_E_ASSEMBLYEXPECTED
Definition: corerror.h:52
int ret
PEKIND
Definition: fusion.idl:35
#define InterlockedDecrement
Definition: armddk.h:52
static const IAssemblyCacheVtbl AssemblyCacheVtbl
Definition: asmcache.c:539
IAssemblyCacheItem IAssemblyCacheItem_iface
Definition: asmcache.c:52
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static IOleCache * cache
Definition: ole2.c:75
ULONG cbAssemblyInfo
Definition: winsxs.idl:37
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
IAssemblyCache IAssemblyCache_iface
Definition: cache.c:48
static HRESULT WINAPI IAssemblyCacheImpl_QueryInterface(IAssemblyCache *iface, REFIID riid, LPVOID *ppobj)
Definition: asmcache.c:160
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
HRESULT WINAPI CreateAssemblyEnum(IAssemblyEnum **pEnum, IUnknown *pUnkReserved, IAssemblyName *pName, DWORD dwFlags, LPVOID pvReserved)
Definition: asmenum.c:464
HRESULT assembly_release(ASSEMBLY *assembly)
Definition: assembly.c:693
HRESULT assembly_get_version(ASSEMBLY *assembly, LPWSTR *version)
Definition: assembly.c:761
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
static unsigned __int64 next
Definition: rand_nt.c:6
#define InterlockedIncrement
Definition: armddk.h:53
static ATOM item
Definition: dde.c:856
#define ARRAY_SIZE(a)
Definition: main.h:24
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: services.c:325
#define sprintfW
Definition: unicode.h:58
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:576
HRESULT IAssemblyName_GetPath(IAssemblyName *iface, LPWSTR buf, ULONG *len)
Definition: asmname.c:532
static IAssemblyCacheItemImpl * impl_from_IAssemblyCacheItem(IAssemblyCacheItem *iface)
Definition: asmcache.c:580
static LPCWSTR LPVOID pvReserved
Definition: asmcache.c:748
static HRESULT copy_file(const WCHAR *src_dir, DWORD src_len, const WCHAR *dst_dir, DWORD dst_len, const WCHAR *filename)
Definition: asmcache.c:392
Definition: name.c:36
static ULONG WINAPI IAssemblyCacheImpl_AddRef(IAssemblyCache *iface)
Definition: asmcache.c:181
unsigned int ULONG
Definition: retypes.h:1
HRESULT WINAPI CreateAssemblyCache(IAssemblyCache **ppAsmCache, DWORD dwReserved)
Definition: asmcache.c:553
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static HRESULT WINAPI IAssemblyCacheImpl_CreateAssemblyScavenger(IAssemblyCache *iface, IUnknown **ppUnkReserved)
Definition: asmcache.c:385
#define ERROR_INVALID_NAME
Definition: compat.h:93
LPWSTR pszCurrentAssemblyPathBuf
Definition: winsxs.idl:40
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define INFINITE
Definition: serial.h:102
static HRESULT WINAPI IAssemblyCacheItemImpl_Commit(IAssemblyCacheItem *iface, DWORD dwFlags, ULONG *pulDisposition)
Definition: asmcache.c:643
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
static const WCHAR cache_mutex_nameW[]
Definition: asmcache.c:57
HRESULT assembly_get_external_files(ASSEMBLY *assembly, LPWSTR **files, DWORD *count)
Definition: assembly.c:887
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10