2 * IAssemblyName implementation
4 * Copyright 2012 Hans Leidekker for CodeWeavers
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.
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.
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
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(sxs
);
36 IAssemblyName IAssemblyName_iface
;
40 static inline struct name
*impl_from_IAssemblyName( IAssemblyName
*iface
)
42 return CONTAINING_RECORD( iface
, struct name
, IAssemblyName_iface
);
45 static HRESULT WINAPI
name_QueryInterface(
50 struct name
*name
= impl_from_IAssemblyName( iface
);
52 TRACE("%p, %s, %p\n", name
, debugstr_guid(riid
), obj
);
56 if (IsEqualIID( riid
, &IID_IUnknown
) ||
57 IsEqualIID( riid
, &IID_IAssemblyName
))
59 IUnknown_AddRef( iface
);
67 static ULONG WINAPI
name_AddRef(
68 IAssemblyName
*iface
)
70 struct name
*name
= impl_from_IAssemblyName( iface
);
71 return InterlockedIncrement( &name
->refs
);
74 static ULONG WINAPI
name_Release( IAssemblyName
*iface
)
76 struct name
*name
= impl_from_IAssemblyName( iface
);
77 ULONG refs
= InterlockedDecrement( &name
->refs
);
81 TRACE("destroying %p\n", name
);
82 HeapFree( GetProcessHeap(), 0, name
);
87 static HRESULT WINAPI
name_SetProperty(
93 FIXME("%p, %d, %p, %d\n", iface
, id
, property
, size
);
97 static HRESULT WINAPI
name_GetProperty(
103 FIXME("%p, %d, %p, %p\n", iface
, id
, buffer
, buflen
);
107 static HRESULT WINAPI
name_Finalize(
108 IAssemblyName
*iface
)
110 FIXME("%p\n", iface
);
114 static HRESULT WINAPI
name_GetDisplayName(
115 IAssemblyName
*iface
,
120 FIXME("%p, %p, %p, 0x%08x\n", iface
, buffer
, buflen
, flags
);
124 static HRESULT WINAPI
name_Reserved(
125 IAssemblyName
*iface
,
127 IUnknown
*pUnkReserved1
,
128 IUnknown
*pUnkReserved2
,
129 LPCOLESTR szReserved
,
135 FIXME("%p, %s, %p, %p, %s, %x%08x, %p, %d, %p\n", iface
,
136 debugstr_guid(riid
), pUnkReserved1
, pUnkReserved2
,
137 debugstr_w(szReserved
), (DWORD
)(llReserved
>> 32), (DWORD
)llReserved
,
138 pvReserved
, cbReserved
, ppReserved
);
142 static HRESULT WINAPI
name_GetName(
143 IAssemblyName
*iface
,
147 FIXME("%p, %p, %p\n", iface
, buflen
, buffer
);
151 static HRESULT WINAPI
name_GetVersion(
152 IAssemblyName
*iface
,
156 FIXME("%p, %p, %p\n", iface
, hi
, low
);
160 static HRESULT WINAPI
name_IsEqual(
161 IAssemblyName
*name1
,
162 IAssemblyName
*name2
,
165 FIXME("%p, %p, 0x%08x\n", name1
, name2
, flags
);
169 static HRESULT WINAPI
name_Clone(
170 IAssemblyName
*iface
,
171 IAssemblyName
**name
)
173 FIXME("%p, %p\n", iface
, name
);
177 static const IAssemblyNameVtbl name_vtbl
=
193 /******************************************************************
194 * CreateAssemblyNameObject (SXS.@)
196 HRESULT WINAPI
CreateAssemblyNameObject(
204 TRACE("%p, %s, 0x%08x, %p\n", obj
, debugstr_w(assembly
), flags
, reserved
);
206 if (!obj
) return E_INVALIDARG
;
209 if (!assembly
|| !assembly
[0] || flags
!= CANOF_PARSE_DISPLAY_NAME
)
212 if (!(name
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*name
) )))
213 return E_OUTOFMEMORY
;
215 name
->IAssemblyName_iface
.lpVtbl
= &name_vtbl
;
218 *obj
= &name
->IAssemblyName_iface
;