ReactOS 0.4.15-dev-7788-g1ad9096
asmname.c File Reference
#include <stdarg.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "guiddef.h"
#include "fusion.h"
#include "corerror.h"
#include "strsafe.h"
#include "wine/debug.h"
#include "fusionpriv.h"
Include dependency graph for asmname.c:

Go to the source code of this file.

Classes

struct  IAssemblyNameImpl
 

Macros

#define COBJMACROS
 
#define INITGUID
 
#define CHARS_PER_PUBKEY   16
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (fusion)
 
static IAssemblyNameImplimpl_from_IAssemblyName (IAssemblyName *iface)
 
static HRESULT WINAPI IAssemblyNameImpl_QueryInterface (IAssemblyName *iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI IAssemblyNameImpl_AddRef (IAssemblyName *iface)
 
static ULONG WINAPI IAssemblyNameImpl_Release (IAssemblyName *iface)
 
static HRESULT WINAPI IAssemblyNameImpl_SetProperty (IAssemblyName *iface, DWORD PropertyId, LPVOID pvProperty, DWORD cbProperty)
 
static HRESULT WINAPI IAssemblyNameImpl_GetProperty (IAssemblyName *iface, DWORD PropertyId, LPVOID pvProperty, LPDWORD pcbProperty)
 
static HRESULT WINAPI IAssemblyNameImpl_Finalize (IAssemblyName *iface)
 
static HRESULT WINAPI IAssemblyNameImpl_GetDisplayName (IAssemblyName *iface, LPOLESTR szDisplayName, LPDWORD pccDisplayName, DWORD dwDisplayFlags)
 
static HRESULT WINAPI IAssemblyNameImpl_Reserved (IAssemblyName *iface, REFIID refIID, IUnknown *pUnkReserved1, IUnknown *pUnkReserved2, LPCOLESTR szReserved, LONGLONG llReserved, LPVOID pvReserved, DWORD cbReserved, LPVOID *ppReserved)
 
static HRESULT WINAPI IAssemblyNameImpl_GetName (IAssemblyName *iface, LPDWORD lpcwBuffer, WCHAR *pwzName)
 
static HRESULT WINAPI IAssemblyNameImpl_GetVersion (IAssemblyName *iface, LPDWORD pdwVersionHi, LPDWORD pdwVersionLow)
 
static HRESULT WINAPI IAssemblyNameImpl_IsEqual (IAssemblyName *iface, IAssemblyName *pName, DWORD flags)
 
static HRESULT WINAPI IAssemblyNameImpl_Clone (IAssemblyName *iface, IAssemblyName **pName)
 
static IAssemblyNameImplunsafe_impl_from_IAssemblyName (IAssemblyName *iface)
 
HRESULT IAssemblyName_SetPath (IAssemblyName *iface, LPCWSTR path)
 
HRESULT IAssemblyName_GetPath (IAssemblyName *iface, LPWSTR buf, ULONG *len)
 
static HRESULT parse_version (IAssemblyNameImpl *name, LPWSTR version)
 
static HRESULT parse_culture (IAssemblyNameImpl *name, LPCWSTR culture)
 
static BOOL is_hex (WCHAR c)
 
static BYTE hextobyte (WCHAR c)
 
static HRESULT parse_pubkey (IAssemblyNameImpl *name, LPCWSTR pubkey)
 
static HRESULT parse_procarch (IAssemblyNameImpl *name, LPCWSTR procarch)
 
static WCHARparse_value (const WCHAR *str, unsigned int len)
 
static HRESULT parse_display_name (IAssemblyNameImpl *name, LPCWSTR szAssemblyName)
 
HRESULT WINAPI CreateAssemblyNameObject (IAssemblyName **ppAssemblyNameObj, LPCWSTR szAssemblyName, DWORD dwFlags, LPVOID pvReserved)
 

Variables

static const WCHAR separator [] = {',',' ',0}
 
static const WCHAR version [] = {'V','e','r','s','i','o','n',0}
 
static const WCHAR culture [] = {'C','u','l','t','u','r','e',0}
 
static const WCHAR pubkey []
 
static const WCHAR procarch []
 
static const IAssemblyNameVtbl AssemblyNameVtbl
 

Macro Definition Documentation

◆ CHARS_PER_PUBKEY

#define CHARS_PER_PUBKEY   16

Definition at line 73 of file asmname.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file asmname.c.

◆ INITGUID

#define INITGUID

Definition at line 25 of file asmname.c.

Function Documentation

◆ CreateAssemblyNameObject()

HRESULT WINAPI CreateAssemblyNameObject ( IAssemblyName **  ppAssemblyNameObj,
LPCWSTR  szAssemblyName,
DWORD  dwFlags,
LPVOID  pvReserved 
)

Definition at line 797 of file asmname.c.

800{
802 HRESULT hr;
803
804 TRACE("(%p, %s, %08x, %p)\n", ppAssemblyNameObj,
806
807 if (!ppAssemblyNameObj)
808 return E_INVALIDARG;
809
812 return E_INVALIDARG;
813
814 if (!(name = heap_alloc_zero(sizeof(*name)))) return E_OUTOFMEMORY;
815
817 name->ref = 1;
818
820 if (FAILED(hr))
821 {
823 return hr;
824 }
825
826 *ppAssemblyNameObj = &name->IAssemblyName_iface;
827
828 return S_OK;
829}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
static const IAssemblyNameVtbl AssemblyNameVtbl
Definition: asmname.c:500
static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyName)
Definition: asmname.c:684
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_w
Definition: kernel32.h:32
static LPCSTR DWORD void * pvReserved
Definition: str.c:196
static LPCWSTR szAssemblyName
Definition: asmenum.c:37
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
Definition: name.c:39
IAssemblyName IAssemblyName_iface
Definition: name.c:40
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
@ CANOF_PARSE_DISPLAY_NAME
Definition: winsxs.idl:193

Referenced by cache_QueryAssemblyInfo(), cache_UninstallAssembly(), enum_gac_assemblies(), IAssemblyCacheImpl_QueryAssemblyInfo(), and IAssemblyCacheImpl_UninstallAssembly().

◆ hextobyte()

static BYTE hextobyte ( WCHAR  c)
static

Definition at line 599 of file asmname.c.

600{
601 if(c >= '0' && c <= '9')
602 return c - '0';
603 if(c >= 'A' && c <= 'F')
604 return c - 'A' + 10;
605 if(c >= 'a' && c <= 'f')
606 return c - 'a' + 10;
607 return 0;
608}
const GLubyte * c
Definition: glext.h:8905

Referenced by parse_pubkey().

◆ IAssemblyName_GetPath()

HRESULT IAssemblyName_GetPath ( IAssemblyName iface,
LPWSTR  buf,
ULONG len 
)

Definition at line 534 of file asmname.c.

535{
538
539 if (!name->path)
540 return S_OK;
541
542 if (!buf)
543 buffer_size = 0;
544
545 *len = lstrlenW(name->path) + 1;
546
547 if (*len <= buffer_size)
548 lstrcpyW(buf, name->path);
549 else
551
552 return S_OK;
553}
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
static IAssemblyNameImpl * unsafe_impl_from_IAssemblyName(IAssemblyName *iface)
Definition: asmname.c:516
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum GLsizei len
Definition: glext.h:6722
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
Definition: swimpl.c:888
uint32_t ULONG
Definition: typedefs.h:59
#define E_NOT_SUFFICIENT_BUFFER
Definition: winerror.h:2345

Referenced by IAssemblyCacheImpl_QueryAssemblyInfo(), and IAssemblyCacheImpl_UninstallAssembly().

◆ IAssemblyName_SetPath()

HRESULT IAssemblyName_SetPath ( IAssemblyName iface,
LPCWSTR  path 
)

Definition at line 523 of file asmname.c.

524{
526
527 name->path = strdupW(path);
528 if (!name->path)
529 return E_OUTOFMEMORY;
530
531 return S_OK;
532}
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92

Referenced by enum_gac_assemblies().

◆ IAssemblyNameImpl_AddRef()

static ULONG WINAPI IAssemblyNameImpl_AddRef ( IAssemblyName iface)
static

Definition at line 101 of file asmname.c.

102{
104 ULONG refCount = InterlockedIncrement(&This->ref);
105
106 TRACE("(%p)->(ref before = %u)\n", This, refCount - 1);
107
108 return refCount;
109}
#define InterlockedIncrement
Definition: armddk.h:53
static IAssemblyNameImpl * impl_from_IAssemblyName(IAssemblyName *iface)
Definition: asmname.c:75

◆ IAssemblyNameImpl_Clone()

static HRESULT WINAPI IAssemblyNameImpl_Clone ( IAssemblyName iface,
IAssemblyName **  pName 
)
static

Definition at line 493 of file asmname.c.

495{
496 FIXME("(%p, %p) stub!\n", iface, pName);
497 return E_NOTIMPL;
498}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static LPSTR pName
Definition: security.c:75

◆ IAssemblyNameImpl_Finalize()

static HRESULT WINAPI IAssemblyNameImpl_Finalize ( IAssemblyName iface)
static

Definition at line 258 of file asmname.c.

259{
260 FIXME("(%p) stub!\n", iface);
261 return E_NOTIMPL;
262}

◆ IAssemblyNameImpl_GetDisplayName()

static HRESULT WINAPI IAssemblyNameImpl_GetDisplayName ( IAssemblyName iface,
LPOLESTR  szDisplayName,
LPDWORD  pccDisplayName,
DWORD  dwDisplayFlags 
)
static

Definition at line 264 of file asmname.c.

268{
269 static const WCHAR equals[] = {'=',0};
271 WCHAR verstr[30], *cultureval = NULL;
272 DWORD size;
273
274 TRACE("(%p, %p, %p, %d)\n", iface, szDisplayName,
275 pccDisplayName, dwDisplayFlags);
276
277 if (dwDisplayFlags == 0)
278 {
279 if (!name->displayname || !*name->displayname)
281
282 size = lstrlenW(name->displayname) + 1;
283
284 if (*pccDisplayName < size)
285 {
286 *pccDisplayName = size;
288 }
289
290 if (szDisplayName) lstrcpyW(szDisplayName, name->displayname);
291 *pccDisplayName = size;
292
293 return S_OK;
294 }
295
296 if (!name->name || !*name->name)
298
299 /* Verify buffer size is sufficient */
300 size = lstrlenW(name->name) + 1;
301
302 if ((dwDisplayFlags & ASM_DISPLAYF_VERSION) && (name->versize > 0))
303 {
304 static const WCHAR spec[] = {'%','d',0};
305 static const WCHAR period[] = {'.',0};
306 DWORD i;
307
308 wsprintfW(verstr, spec, name->version[0]);
309
310 for (i = 1; i < name->versize; i++)
311 {
312 WCHAR value[6];
313 wsprintfW(value, spec, name->version[i]);
314
315 lstrcatW(verstr, period);
316 lstrcatW(verstr, value);
317 }
318
319 size += lstrlenW(separator) + lstrlenW(version) + lstrlenW(equals) + lstrlenW(verstr);
320 }
321
322 if ((dwDisplayFlags & ASM_DISPLAYF_CULTURE) && (name->culture))
323 {
324 static const WCHAR neutral[] = {'n','e','u','t','r','a','l', 0};
325
326 cultureval = (lstrlenW(name->culture) == 2) ? name->culture : (LPWSTR) neutral;
327 size += lstrlenW(separator) + lstrlenW(culture) + lstrlenW(equals) + lstrlenW(cultureval);
328 }
329
330 if ((dwDisplayFlags & ASM_DISPLAYF_PUBLIC_KEY_TOKEN) && (name->haspubkey))
332
333 if ((dwDisplayFlags & ASM_DISPLAYF_PROCESSORARCHITECTURE) && (name->procarch))
334 size += lstrlenW(separator) + lstrlenW(procarch) + lstrlenW(equals) + lstrlenW(name->procarch);
335
336 if (size > *pccDisplayName)
337 {
338 *pccDisplayName = size;
340 }
341
342 /* Construct the string */
343 lstrcpyW(szDisplayName, name->name);
344
345 if ((dwDisplayFlags & ASM_DISPLAYF_VERSION) && (name->versize > 0))
346 {
347 lstrcatW(szDisplayName, separator);
348
349 lstrcatW(szDisplayName, version);
350 lstrcatW(szDisplayName, equals);
351 lstrcatW(szDisplayName, verstr);
352 }
353
354 if ((dwDisplayFlags & ASM_DISPLAYF_CULTURE) && (name->culture))
355 {
356 lstrcatW(szDisplayName, separator);
357
358 lstrcatW(szDisplayName, culture);
359 lstrcatW(szDisplayName, equals);
360 lstrcatW(szDisplayName, cultureval);
361 }
362
363 if ((dwDisplayFlags & ASM_DISPLAYF_PUBLIC_KEY_TOKEN) && (name->haspubkey))
364 {
365 WCHAR pkt[CHARS_PER_PUBKEY + 1];
366 static const WCHAR spec[] = {'%','0','2','x','%','0','2','x','%','0','2','x',
367 '%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x',0};
368
369 lstrcatW(szDisplayName, separator);
370
371 lstrcatW(szDisplayName, pubkey);
372 lstrcatW(szDisplayName, equals);
373
374 wsprintfW(pkt, spec, name->pubkey[0], name->pubkey[1], name->pubkey[2],
375 name->pubkey[3], name->pubkey[4], name->pubkey[5], name->pubkey[6],
376 name->pubkey[7]);
377
378 lstrcatW(szDisplayName, pkt);
379 }
380
381 if ((dwDisplayFlags & ASM_DISPLAYF_PROCESSORARCHITECTURE) && (name->procarch))
382 {
383 lstrcatW(szDisplayName, separator);
384
385 lstrcatW(szDisplayName, procarch);
386 lstrcatW(szDisplayName, equals);
387 lstrcatW(szDisplayName, name->procarch);
388 }
389
390 *pccDisplayName = size;
391 return S_OK;
392}
#define FUSION_E_INVALID_NAME
Definition: corerror.h:123
#define NULL
Definition: types.h:112
static const WCHAR version[]
Definition: asmname.c:66
static const WCHAR procarch[]
Definition: asmname.c:70
#define CHARS_PER_PUBKEY
Definition: asmname.c:73
static const WCHAR separator[]
Definition: asmname.c:65
static const WCHAR pubkey[]
Definition: asmname.c:68
static const WCHAR culture[]
Definition: asmname.c:67
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
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
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
WCHAR * name
Definition: name.c:42
WCHAR * version
Definition: name.c:46
Definition: pdh_main.c:94
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ IAssemblyNameImpl_GetName()

static HRESULT WINAPI IAssemblyNameImpl_GetName ( IAssemblyName iface,
LPDWORD  lpcwBuffer,
WCHAR pwzName 
)
static

Definition at line 412 of file asmname.c.

415{
417 DWORD len;
418
419 TRACE("(%p, %p, %p)\n", iface, lpcwBuffer, pwzName);
420
421 if (name->name)
422 len = lstrlenW(name->name) + 1;
423 else
424 len = 0;
425
426 if (*lpcwBuffer < len)
427 {
428 *lpcwBuffer = len;
430 }
431 if (!name->name) lpcwBuffer[0] = 0;
432 else lstrcpyW(pwzName, name->name);
433
434 *lpcwBuffer = len;
435 return S_OK;
436}

◆ IAssemblyNameImpl_GetProperty()

static HRESULT WINAPI IAssemblyNameImpl_GetProperty ( IAssemblyName iface,
DWORD  PropertyId,
LPVOID  pvProperty,
LPDWORD  pcbProperty 
)
static

Definition at line 140 of file asmname.c.

144{
146 DWORD size;
147
148 TRACE("(%p, %d, %p, %p)\n", iface, PropertyId, pvProperty, pcbProperty);
149
150 size = *pcbProperty;
151 switch (PropertyId)
152 {
153 case ASM_NAME_NULL_PUBLIC_KEY:
154 case ASM_NAME_NULL_PUBLIC_KEY_TOKEN:
155 if (name->haspubkey)
156 return S_OK;
157 return S_FALSE;
158
159 case ASM_NAME_NULL_CUSTOM:
160 return S_OK;
161
162 case ASM_NAME_NAME:
163 *pcbProperty = 0;
164 if (name->name)
165 {
166 *pcbProperty = (lstrlenW(name->name) + 1) * 2;
167 if (size < *pcbProperty)
169 lstrcpyW(pvProperty, name->name);
170 }
171 break;
172
173 case ASM_NAME_MAJOR_VERSION:
174 *pcbProperty = 0;
175 if (name->versize >= 1)
176 {
177 *pcbProperty = sizeof(WORD);
178 if (size < *pcbProperty)
180 *((WORD *)pvProperty) = name->version[0];
181 }
182 break;
183
184 case ASM_NAME_MINOR_VERSION:
185 *pcbProperty = 0;
186 if (name->versize >= 2)
187 {
188 *pcbProperty = sizeof(WORD);
189 if (size < *pcbProperty)
191 *((WORD *)pvProperty) = name->version[1];
192 }
193 break;
194
195 case ASM_NAME_BUILD_NUMBER:
196 *pcbProperty = 0;
197 if (name->versize >= 3)
198 {
199 *pcbProperty = sizeof(WORD);
200 if (size < *pcbProperty)
202 *((WORD *)pvProperty) = name->version[2];
203 }
204 break;
205
206 case ASM_NAME_REVISION_NUMBER:
207 *pcbProperty = 0;
208 if (name->versize >= 4)
209 {
210 *pcbProperty = sizeof(WORD);
211 if (size < *pcbProperty)
213 *((WORD *)pvProperty) = name->version[3];
214 }
215 break;
216
217 case ASM_NAME_CULTURE:
218 *pcbProperty = 0;
219 if (name->culture)
220 {
221 *pcbProperty = (lstrlenW(name->culture) + 1) * 2;
222 if (size < *pcbProperty)
224 lstrcpyW(pvProperty, name->culture);
225 }
226 break;
227
228 case ASM_NAME_PUBLIC_KEY_TOKEN:
229 *pcbProperty = 0;
230 if (name->haspubkey)
231 {
232 *pcbProperty = sizeof(DWORD) * 2;
233 if (size < *pcbProperty)
235 memcpy(pvProperty, name->pubkey, sizeof(DWORD) * 2);
236 }
237 break;
238
239 case ASM_NAME_ARCHITECTURE:
240 *pcbProperty = 0;
241 if (name->pekind != peNone)
242 {
243 *pcbProperty = sizeof(PEKIND);
244 if (size < *pcbProperty)
246 *((PEKIND *)pvProperty) = name->pekind;
247 }
248 break;
249
250 default:
251 *pcbProperty = 0;
252 break;
253 }
254
255 return S_OK;
256}
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: cdrom.h:932
unsigned short WORD
Definition: ntddk_ex.h:93
PEKIND
Definition: fusion.idl:36
@ peNone
Definition: fusion.idl:37
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define DWORD
Definition: nt_native.h:44
#define STRSAFE_E_INSUFFICIENT_BUFFER
Definition: strsafe.h:103
#define S_FALSE
Definition: winerror.h:2357

◆ IAssemblyNameImpl_GetVersion()

static HRESULT WINAPI IAssemblyNameImpl_GetVersion ( IAssemblyName iface,
LPDWORD  pdwVersionHi,
LPDWORD  pdwVersionLow 
)
static

Definition at line 438 of file asmname.c.

441{
443
444 TRACE("(%p, %p, %p)\n", iface, pdwVersionHi, pdwVersionLow);
445
446 *pdwVersionHi = 0;
447 *pdwVersionLow = 0;
448
449 if (name->versize != 4)
451
452 *pdwVersionHi = (name->version[0] << 16) + name->version[1];
453 *pdwVersionLow = (name->version[2] << 16) + name->version[3];
454
455 return S_OK;
456}

◆ IAssemblyNameImpl_IsEqual()

static HRESULT WINAPI IAssemblyNameImpl_IsEqual ( IAssemblyName iface,
IAssemblyName pName,
DWORD  flags 
)
static

Definition at line 458 of file asmname.c.

461{
464
465 TRACE("(%p, %p, 0x%08x)\n", iface, pName, flags);
466
467 if (!pName) return S_FALSE;
468 if (flags & ~ASM_CMPF_IL_ALL) FIXME("unsupported flags\n");
469
470 if ((flags & ASM_CMPF_NAME) && lstrcmpW(name1->name, name2->name)) return S_FALSE;
471 if (name1->versize && name2->versize)
472 {
473 if ((flags & ASM_CMPF_MAJOR_VERSION) &&
474 name1->version[0] != name2->version[0]) return S_FALSE;
475 if ((flags & ASM_CMPF_MINOR_VERSION) &&
476 name1->version[1] != name2->version[1]) return S_FALSE;
477 if ((flags & ASM_CMPF_BUILD_NUMBER) &&
478 name1->version[2] != name2->version[2]) return S_FALSE;
479 if ((flags & ASM_CMPF_REVISION_NUMBER) &&
480 name1->version[3] != name2->version[3]) return S_FALSE;
481 }
482 if ((flags & ASM_CMPF_PUBLIC_KEY_TOKEN) &&
483 name1->haspubkey && name2->haspubkey &&
484 memcmp(name1->pubkey, name2->pubkey, sizeof(name1->pubkey))) return S_FALSE;
485
486 if ((flags & ASM_CMPF_CULTURE) &&
487 name1->culture && name2->culture &&
488 lstrcmpW(name1->culture, name2->culture)) return S_FALSE;
489
490 return S_OK;
491}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLbitfield flags
Definition: glext.h:7161
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static WCHAR name1[]
Definition: record.c:34
static WCHAR name2[]
Definition: record.c:35

◆ IAssemblyNameImpl_QueryInterface()

static HRESULT WINAPI IAssemblyNameImpl_QueryInterface ( IAssemblyName iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 80 of file asmname.c.

82{
84
85 TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj);
86
87 *ppobj = NULL;
88
90 IsEqualIID(riid, &IID_IAssemblyName))
91 {
92 IAssemblyName_AddRef(iface);
93 *ppobj = &This->IAssemblyName_iface;
94 return S_OK;
95 }
96
97 WARN("(%p, %s, %p): not found\n", This, debugstr_guid(riid), ppobj);
98 return E_NOINTERFACE;
99}
const GUID IID_IUnknown
#define WARN(fmt,...)
Definition: debug.h:112
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ IAssemblyNameImpl_Release()

static ULONG WINAPI IAssemblyNameImpl_Release ( IAssemblyName iface)
static

Definition at line 111 of file asmname.c.

112{
114 ULONG refCount = InterlockedDecrement(&This->ref);
115
116 TRACE("(%p)->(ref before = %u)\n", This, refCount + 1);
117
118 if (!refCount)
119 {
120 heap_free(This->path);
121 heap_free(This->displayname);
122 heap_free(This->name);
123 heap_free(This->culture);
124 heap_free(This->procarch);
126 }
127
128 return refCount;
129}
#define InterlockedDecrement
Definition: armddk.h:52

◆ IAssemblyNameImpl_Reserved()

static HRESULT WINAPI IAssemblyNameImpl_Reserved ( IAssemblyName iface,
REFIID  refIID,
IUnknown pUnkReserved1,
IUnknown pUnkReserved2,
LPCOLESTR  szReserved,
LONGLONG  llReserved,
LPVOID  pvReserved,
DWORD  cbReserved,
LPVOID ppReserved 
)
static

Definition at line 394 of file asmname.c.

403{
404 TRACE("(%p, %s, %p, %p, %s, %s, %p, %d, %p)\n", iface,
405 debugstr_guid(refIID), pUnkReserved1, pUnkReserved2,
406 debugstr_w(szReserved), wine_dbgstr_longlong(llReserved),
407 pvReserved, cbReserved, ppReserved);
408
409 return E_NOTIMPL;
410}
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49

◆ IAssemblyNameImpl_SetProperty()

static HRESULT WINAPI IAssemblyNameImpl_SetProperty ( IAssemblyName iface,
DWORD  PropertyId,
LPVOID  pvProperty,
DWORD  cbProperty 
)
static

Definition at line 131 of file asmname.c.

135{
136 FIXME("(%p, %d, %p, %d) stub!\n", iface, PropertyId, pvProperty, cbProperty);
137 return E_NOTIMPL;
138}

◆ impl_from_IAssemblyName()

◆ is_hex()

static BOOL is_hex ( WCHAR  c)
static

Definition at line 592 of file asmname.c.

593{
594 return ((c >= 'a' && c <= 'f') ||
595 (c >= 'A' && c <= 'F') ||
596 (c >= '0' && c <= '9'));
597}

◆ parse_culture()

static HRESULT parse_culture ( IAssemblyNameImpl name,
LPCWSTR  culture 
)
static

Definition at line 580 of file asmname.c.

581{
582 static const WCHAR empty[] = {0};
583
584 if (lstrlenW(culture) == 2)
585 name->culture = strdupW(culture);
586 else
587 name->culture = strdupW(empty);
588
589 return S_OK;
590}
static const WCHAR empty[]
Definition: main.c:47

Referenced by parse_display_name().

◆ parse_display_name()

static HRESULT parse_display_name ( IAssemblyNameImpl name,
LPCWSTR  szAssemblyName 
)
static

Definition at line 684 of file asmname.c.

685{
686 LPWSTR str, save, ptr, ptr2, value;
687 HRESULT hr = S_OK;
688 BOOL done = FALSE;
689
690 if (!szAssemblyName)
691 return S_OK;
692
693 name->displayname = strdupW(szAssemblyName);
694 if (!name->displayname)
695 return E_OUTOFMEMORY;
696
698 save = str;
699 if (!str)
700 {
702 goto done;
703 }
704
705 ptr = wcschr(str, ',');
706 if (ptr) *ptr = '\0';
707
708 /* no ',' but ' ' only */
709 if( !ptr && wcschr(str, ' ') )
710 {
712 goto done;
713 }
714
715 name->name = strdupW(str);
716 if (!name->name)
717 {
719 goto done;
720 }
721
722 if (!ptr)
723 goto done;
724
725 str = ptr + 1;
726 while (!done)
727 {
728 ptr = wcschr(str, '=');
729 if (!ptr)
730 {
732 goto done;
733 }
734
735 *(ptr++) = '\0';
736 if (!*ptr)
737 {
739 goto done;
740 }
741
742 if (!(ptr2 = wcschr(ptr, ',')))
743 {
744 if (!(ptr2 = wcschr(ptr, '\0')))
745 {
747 goto done;
748 }
749
750 done = TRUE;
751 }
752
753 *ptr2 = '\0';
754 if (!(value = parse_value( ptr, ptr2 - ptr )))
755 {
757 goto done;
758 }
759 while (*str == ' ') str++;
760
761 if (!lstrcmpiW(str, version))
763 else if (!lstrcmpiW(str, culture))
765 else if (!lstrcmpiW(str, pubkey))
767 else if (!lstrcmpiW(str, procarch))
768 {
769 name->procarch = value;
770 value = NULL;
771
772 hr = parse_procarch( name, name->procarch );
773 }
774 heap_free( value );
775
776 if (FAILED(hr))
777 goto done;
778
779 str = ptr2 + 1;
780 }
781
782done:
783 heap_free(save);
784 if (FAILED(hr))
785 {
786 heap_free(name->displayname);
788 heap_free(name->culture);
789 heap_free(name->procarch);
790 }
791 return hr;
792}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define wcschr
Definition: compat.h:17
static HRESULT parse_pubkey(IAssemblyNameImpl *name, LPCWSTR pubkey)
Definition: asmname.c:610
static HRESULT parse_version(IAssemblyNameImpl *name, LPWSTR version)
Definition: asmname.c:555
static WCHAR * parse_value(const WCHAR *str, unsigned int len)
Definition: asmname.c:661
static HRESULT parse_procarch(IAssemblyNameImpl *name, LPCWSTR procarch)
Definition: asmname.c:637
static HRESULT parse_culture(IAssemblyNameImpl *name, LPCWSTR culture)
Definition: asmname.c:580
unsigned int BOOL
Definition: ntddk_ex.h:94
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
static PVOID ptr
Definition: dispmode.c:27
const WCHAR * str

Referenced by CreateAssemblyNameObject().

◆ parse_procarch()

static HRESULT parse_procarch ( IAssemblyNameImpl name,
LPCWSTR  procarch 
)
static

Definition at line 637 of file asmname.c.

638{
639 static const WCHAR msilW[] = {'m','s','i','l',0};
640 static const WCHAR x86W[] = {'x','8','6',0};
641 static const WCHAR ia64W[] = {'i','a','6','4',0};
642 static const WCHAR amd64W[] = {'a','m','d','6','4',0};
643
644 if (!lstrcmpiW(procarch, msilW))
645 name->pekind = peMSIL;
646 else if (!lstrcmpiW(procarch, x86W))
647 name->pekind = peI386;
648 else if (!lstrcmpiW(procarch, ia64W))
649 name->pekind = peIA64;
650 else if (!lstrcmpiW(procarch, amd64W))
651 name->pekind = peAMD64;
652 else
653 {
654 ERR("unrecognized architecture: %s\n", wine_dbgstr_w(procarch));
656 }
657
658 return S_OK;
659}
#define ERR(fmt,...)
Definition: debug.h:110
@ peMSIL
Definition: fusion.idl:38
@ peIA64
Definition: fusion.idl:40
@ peI386
Definition: fusion.idl:39
@ peAMD64
Definition: fusion.idl:41
#define wine_dbgstr_w
Definition: kernel32.h:34

Referenced by parse_display_name().

◆ parse_pubkey()

static HRESULT parse_pubkey ( IAssemblyNameImpl name,
LPCWSTR  pubkey 
)
static

Definition at line 610 of file asmname.c.

611{
612 int i;
613 BYTE val;
614 static const WCHAR nullstr[] = {'n','u','l','l',0};
615
616 if(lstrcmpiW(pubkey, nullstr) == 0)
618
621
622 for (i = 0; i < CHARS_PER_PUBKEY; i++)
623 if (!is_hex(pubkey[i]))
625
626 name->haspubkey = TRUE;
627
628 for (i = 0; i < CHARS_PER_PUBKEY; i += 2)
629 {
630 val = (hextobyte(pubkey[i]) << 4) + hextobyte(pubkey[i + 1]);
631 name->pubkey[i / 2] = val;
632 }
633
634 return S_OK;
635}
#define FUSION_E_PRIVATE_ASM_DISALLOWED
Definition: corerror.h:122
static BYTE hextobyte(WCHAR c)
Definition: asmname.c:599
#define is_hex(c)
Definition: registry.c:430
GLuint GLfloat * val
Definition: glext.h:7180
unsigned char BYTE
Definition: xxhash.c:193

Referenced by parse_display_name().

◆ parse_value()

static WCHAR * parse_value ( const WCHAR str,
unsigned int  len 
)
static

Definition at line 661 of file asmname.c.

662{
663 WCHAR *ret;
664 const WCHAR *p = str;
665 BOOL quoted = FALSE;
666 unsigned int i = 0;
667
668 if (!(ret = heap_alloc( (len + 1) * sizeof(WCHAR) ))) return NULL;
669 if (*p == '\"')
670 {
671 quoted = TRUE;
672 p++;
673 }
674 while (*p && *p != '\"') ret[i++] = *p++;
675 if ((quoted && *p != '\"') || (!quoted && *p == '\"'))
676 {
677 heap_free( ret );
678 return NULL;
679 }
680 ret[i] = 0;
681 return ret;
682}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
GLfloat GLfloat p
Definition: glext.h:8902
int ret

Referenced by ITERATE_WriteRegistryValues(), and parse_display_name().

◆ parse_version()

static HRESULT parse_version ( IAssemblyNameImpl name,
LPWSTR  version 
)
static

Definition at line 555 of file asmname.c.

556{
557 LPWSTR beg, end;
558 int i;
559
560 for (i = 0, beg = version; i < 4; i++)
561 {
562 if (!*beg)
563 return S_OK;
564
565 end = wcschr(beg, '.');
566
567 if (end) *end = '\0';
568 name->version[i] = wcstol(beg, NULL, 10);
569 name->versize++;
570
571 if (!end && i < 3)
572 return S_OK;
573
574 beg = end + 1;
575 }
576
577 return S_OK;
578}
GLuint GLuint end
Definition: gl.h:1545
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)

Referenced by parse_display_name().

◆ unsafe_impl_from_IAssemblyName()

static IAssemblyNameImpl * unsafe_impl_from_IAssemblyName ( IAssemblyName iface)
inlinestatic

Definition at line 516 of file asmname.c.

517{
518 assert(iface->lpVtbl == &AssemblyNameVtbl);
519
520 return impl_from_IAssemblyName(iface);
521}
#define assert(x)
Definition: debug.h:53

Referenced by IAssemblyName_GetPath(), and IAssemblyName_SetPath().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( fusion  )

Variable Documentation

◆ AssemblyNameVtbl

const IAssemblyNameVtbl AssemblyNameVtbl
static
Initial value:
= {
}
static ULONG WINAPI IAssemblyNameImpl_Release(IAssemblyName *iface)
Definition: asmname.c:111
static HRESULT WINAPI IAssemblyNameImpl_GetVersion(IAssemblyName *iface, LPDWORD pdwVersionHi, LPDWORD pdwVersionLow)
Definition: asmname.c:438
static HRESULT WINAPI IAssemblyNameImpl_Clone(IAssemblyName *iface, IAssemblyName **pName)
Definition: asmname.c:493
static HRESULT WINAPI IAssemblyNameImpl_GetProperty(IAssemblyName *iface, DWORD PropertyId, LPVOID pvProperty, LPDWORD pcbProperty)
Definition: asmname.c:140
static ULONG WINAPI IAssemblyNameImpl_AddRef(IAssemblyName *iface)
Definition: asmname.c:101
static HRESULT WINAPI IAssemblyNameImpl_IsEqual(IAssemblyName *iface, IAssemblyName *pName, DWORD flags)
Definition: asmname.c:458
static HRESULT WINAPI IAssemblyNameImpl_Reserved(IAssemblyName *iface, REFIID refIID, IUnknown *pUnkReserved1, IUnknown *pUnkReserved2, LPCOLESTR szReserved, LONGLONG llReserved, LPVOID pvReserved, DWORD cbReserved, LPVOID *ppReserved)
Definition: asmname.c:394
static HRESULT WINAPI IAssemblyNameImpl_QueryInterface(IAssemblyName *iface, REFIID riid, LPVOID *ppobj)
Definition: asmname.c:80
static HRESULT WINAPI IAssemblyNameImpl_Finalize(IAssemblyName *iface)
Definition: asmname.c:258
static HRESULT WINAPI IAssemblyNameImpl_GetName(IAssemblyName *iface, LPDWORD lpcwBuffer, WCHAR *pwzName)
Definition: asmname.c:412
static HRESULT WINAPI IAssemblyNameImpl_GetDisplayName(IAssemblyName *iface, LPOLESTR szDisplayName, LPDWORD pccDisplayName, DWORD dwDisplayFlags)
Definition: asmname.c:264
static HRESULT WINAPI IAssemblyNameImpl_SetProperty(IAssemblyName *iface, DWORD PropertyId, LPVOID pvProperty, DWORD cbProperty)
Definition: asmname.c:131

Definition at line 500 of file asmname.c.

Referenced by CreateAssemblyNameObject(), and unsafe_impl_from_IAssemblyName().

◆ culture

◆ procarch

const WCHAR procarch[]
static
Initial value:
= {'p','r','o','c','e','s','s','o','r',
'A','r','c','h','i','t','e','c','t','u','r','e',0}

Definition at line 70 of file asmname.c.

Referenced by IAssemblyNameImpl_GetDisplayName(), parse_display_name(), and parse_procarch().

◆ pubkey

const WCHAR pubkey[]
static
Initial value:
=
{'P','u','b','l','i','c','K','e','y','T','o','k','e','n',0}

Definition at line 68 of file asmname.c.

Referenced by assembly_get_pubkey_token(), CryptImportKey(), IAssemblyNameImpl_GetDisplayName(), parse_display_name(), parse_pubkey(), and test_QueryAssemblyInfo().

◆ separator

◆ version

const WCHAR version[] = {'V','e','r','s','i','o','n',0}
static

Definition at line 66 of file asmname.c.

Referenced by __rpcb_findaddr_timed(), _TestVesion(), acmGetVersion(), add_widl_version_define(), assembly_get_runtime_version(), assembly_get_version(), build_assembly_id(), build_assembly_name(), build_file_mask(), build_manifest_filename(), build_manifest_path(), build_policy_filename(), build_policy_path(), build_request_header(), cache_QueryAssemblyInfo(), cache_UninstallAssembly(), CHashEncodeMsg_GetParam(), check_tiff_format(), check_version(), clnt_dg_create(), CLRMetaHost_GetVersionFromFile(), CLRRuntimeInfo_GetRuntimeDirectory(), CLRRuntimeInfo_GetVersionString(), CLRRuntimeInfo_LoadLibrary(), CompareStringEx(), component_GetVersion(), component_IsThisVersionInstalled(), create_database_wordcount(), create_msft_typelib(), create_webbrowser(), create_writer(), CreateDebuggingInterfaceFromVersion(), CRYPT_AsnDecodeCMSSignedInfo(), CRYPT_AsnDecodePKCSDigestedData(), CRYPT_AsnDecodePKCSEnvelopedData(), CRYPT_AsnDecodeRsaPrivKey(), d3d_device_create(), d3d_device_init(), d3drm_device_init(), D3DXDisassembleShader(), D3DXFindShaderComment(), ddraw_surface_create(), ddraw_surface_init(), debugstr_dmversion(), deflateInit2_(), deflateInit_(), DetectPlatform(), DirectInput8Create(), DllMain(), DwmIsCompositionEnabled(), enum_gac_assemblies(), examine_app14(), file_version_matches(), filesys_GetFileVersion(), fill_keyboard_dideviceinstanceA(), fill_keyboard_dideviceinstanceW(), fill_mouse_dideviceinstanceA(), fill_mouse_dideviceinstanceW(), fill_processor(), find_builtin_prop(), get_app_version(), get_assembly_directory(), get_clr_version(), get_clr_version_str(), get_corversion(), get_device_type(), get_file_version(), get_mono_path_from_registry(), get_msxml_version(), get_processor_version(), get_runtime_info(), get_version_info(), get_versionstring(), GetCachePath(), GetUIVersion(), gl_GetString(), glsl_is_shadow_sampler(), gxv_bsln_validate(), gxv_just_validate(), gxv_kern_subtable_validate(), gxv_kern_validate_generic(), gxv_lcar_validate(), gxv_mort_validate(), gxv_morx_validate(), gxv_opbd_validate(), gxv_prop_property_validate(), gxv_prop_validate(), gxv_trak_validate(), hash_basename(), HTMLDOMImplementation_hasFeature(), IAssemblyCacheImpl_InstallAssembly(), IAssemblyNameImpl_GetDisplayName(), IDirectInput8AImpl_Initialize(), IDirectInput8WImpl_Initialize(), IDirectInputAImpl_Initialize(), SEALED_::IMsTscAx::get_Version(), inflateBackInit_(), inflateInit2_(), inflateInit_(), InstallerImpl_Version(), is_vertex_shader(), iso_recv_msg(), ITERATE_UnregisterTypeLibraries(), joystick_tests(), jpeg_CreateCompress(), jpeg_CreateDecompress(), JSPROXY_InternetInitializeAutoProxyDll(), keyboard_tests(), keyboarddev_enum_deviceA(), keyboarddev_enum_deviceW(), LCMapStringEx(), ldap_startup(), lineGetCountryW(), load_wine_gecko_v(), LoadLibraryShim(), LoadMenuIndirectW(), main(), match_languages(), MetadataReaderInfo_GetSpecVersion(), MetadataReaderInfo_GetVersion(), mousedev_enum_deviceA(), mousedev_enum_deviceW(), msi_compare_file_versions(), msi_get_disk_file_version(), msi_get_font_file_version(), MSI_GetComponentPath(), msi_version_str_to_dword(), MsiGetFileVersionW(), MSSTYLES_OpenThemeFile(), MXWriter_create(), mxwriter_get_version(), mxwriter_put_version(), name_GetDisplayName(), name_GetVersion(), nfs41_mount(), nfs41_send_compound(), nfs41_shutdown_daemon(), nfs41_unmount(), nfs41_UpcallCreate(), OLEFontImpl_Load(), OLEFontImpl_Save(), OpenBookmarkFile(), otv_BASE_validate(), otv_GDEF_validate(), otv_GPOS_validate(), otv_GSUB_validate(), output_typelib_regscript(), XMLStorage::XMLReaderBase::parse(), parse_assembly_elem(), parse_cie_details(), parse_display_name(), parse_runtime_version(), parse_supported_runtime(), parse_version(), ParseFile(), PdhGetDllVersion(), per_user_install_callback(), plugin_init(), pmap_getport(), pmap_set(), pmap_unset(), pointer_default(), PRINTF_ATTR(), process_pdu_logon(), profile3_GetVersion(), CCMIAdapter::queryChip(), read_version_entry(), register_avicap_devices(), rpc_should_retry(), rpcb_getaddr(), rpcb_set(), rpcb_unset(), SAXAttributes_create(), SdbpReadFileVersion(), SECUR32_initNTLMSP(), set_msi_assembly_prop(), SetPerUserSecValuesW(), sfnt_init_face(), sfnt_open_font(), shader_generate_glsl_declarations(), shader_glsl_atomic(), shader_glsl_gen_sample_c_lz(), shader_glsl_generate_pshader(), shader_glsl_generate_vshader(), shader_glsl_get_register_name(), shader_glsl_ld_uav(), shader_glsl_load_constants_f(), shader_glsl_resinfo(), shader_glsl_ret(), shader_glsl_store_uav(), START_TEST(), Status(), TcRegisterClient(), test_appsearch_drlocator(), test_appsearch_inilocator(), test_appsearch_reglocator(), test_assoc_perceived(), test_find_surrogate(), test_GetCachePath(), test_GetFileVersion(), test_GetTempPathW(), test_height_selection_vdmx(), test_ldap_get_optionW(), test_MsiGetFileVersion(), test_OleDoAutoConvert(), test_pack_SHELLSTATE(), test_PdhGetDllVersion(), test_request_parameter_defaults(), test_service_flags(), test_text_metrics(), test_UuidCreate(), test_UuidCreateSequential(), test_version(), test_versioninfo(), test_WithWSAStartup(), TestV5VersionMessage(), TestVersionMessage(), tt_face_get_kerning(), tt_face_load_maxp(), tt_face_load_os2(), UniataAhciDetect(), UniAtaAhciValidateVersion(), upcall_parse(), update_heap_entry(), VfdOpenDevice(), walk_constant_heap(), walk_constant_heap_clamped(), warning(), WinHttpOpenRequest(), WMProfileManager2_GetSystemProfileVersion(), WMProfileManager2_SetSystemProfileVersion(), WMProfileManager_CreateEmptyProfile(), write_coclass(), write_msi_summary_info(), write_typelib_interface(), xmlCheckVersion(), XMLStorage::XMLReaderBase::XmlDeclHandler(), xmlParseTextDecl(), xmlParseVersionInfo(), xmlParseXMLDecl(), xmlSAXVersion(), xsltApplyStylesheetInternal(), xsltDocumentElem(), and xsltGetHTMLIDs().