mshtml: Don't overwrite type of result if property type is VT_VARIANT.
[wine/multimedia.git] / dlls / sxs / name.c
blob1adeebd72e2a3cb517266b35364714ae90290ee4
1 /*
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
21 #include <stdarg.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "ole2.h"
28 #include "winsxs.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(sxs);
34 struct name
36 IAssemblyName IAssemblyName_iface;
37 LONG refs;
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(
46 IAssemblyName *iface,
47 REFIID riid,
48 void **obj )
50 struct name *name = impl_from_IAssemblyName( iface );
52 TRACE("%p, %s, %p\n", name, debugstr_guid(riid), obj);
54 *obj = NULL;
56 if (IsEqualIID( riid, &IID_IUnknown ) ||
57 IsEqualIID( riid, &IID_IAssemblyName ))
59 IUnknown_AddRef( iface );
60 *obj = name;
61 return S_OK;
64 return E_NOINTERFACE;
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 );
79 if (!refs)
81 TRACE("destroying %p\n", name);
82 HeapFree( GetProcessHeap(), 0, name );
84 return refs;
87 static HRESULT WINAPI name_SetProperty(
88 IAssemblyName *iface,
89 DWORD id,
90 LPVOID property,
91 DWORD size )
93 FIXME("%p, %d, %p, %d\n", iface, id, property, size);
94 return E_NOTIMPL;
97 static HRESULT WINAPI name_GetProperty(
98 IAssemblyName *iface,
99 DWORD id,
100 LPVOID buffer,
101 LPDWORD buflen )
103 FIXME("%p, %d, %p, %p\n", iface, id, buffer, buflen);
104 return E_NOTIMPL;
107 static HRESULT WINAPI name_Finalize(
108 IAssemblyName *iface )
110 FIXME("%p\n", iface);
111 return E_NOTIMPL;
114 static HRESULT WINAPI name_GetDisplayName(
115 IAssemblyName *iface,
116 LPOLESTR buffer,
117 LPDWORD buflen,
118 DWORD flags )
120 FIXME("%p, %p, %p, 0x%08x\n", iface, buffer, buflen, flags);
121 return E_NOTIMPL;
124 static HRESULT WINAPI name_Reserved(
125 IAssemblyName *iface,
126 REFIID riid,
127 IUnknown *pUnkReserved1,
128 IUnknown *pUnkReserved2,
129 LPCOLESTR szReserved,
130 LONGLONG llReserved,
131 LPVOID pvReserved,
132 DWORD cbReserved,
133 LPVOID *ppReserved )
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);
139 return E_NOTIMPL;
142 static HRESULT WINAPI name_GetName(
143 IAssemblyName *iface,
144 LPDWORD buflen,
145 WCHAR *buffer )
147 FIXME("%p, %p, %p\n", iface, buflen, buffer);
148 return E_NOTIMPL;
151 static HRESULT WINAPI name_GetVersion(
152 IAssemblyName *iface,
153 LPDWORD hi,
154 LPDWORD low )
156 FIXME("%p, %p, %p\n", iface, hi, low);
157 return E_NOTIMPL;
160 static HRESULT WINAPI name_IsEqual(
161 IAssemblyName *name1,
162 IAssemblyName *name2,
163 DWORD flags )
165 FIXME("%p, %p, 0x%08x\n", name1, name2, flags);
166 return E_NOTIMPL;
169 static HRESULT WINAPI name_Clone(
170 IAssemblyName *iface,
171 IAssemblyName **name )
173 FIXME("%p, %p\n", iface, name);
174 return E_NOTIMPL;
177 static const IAssemblyNameVtbl name_vtbl =
179 name_QueryInterface,
180 name_AddRef,
181 name_Release,
182 name_SetProperty,
183 name_GetProperty,
184 name_Finalize,
185 name_GetDisplayName,
186 name_Reserved,
187 name_GetName,
188 name_GetVersion,
189 name_IsEqual,
190 name_Clone
193 /******************************************************************
194 * CreateAssemblyNameObject (SXS.@)
196 HRESULT WINAPI CreateAssemblyNameObject(
197 LPASSEMBLYNAME *obj,
198 LPCWSTR assembly,
199 DWORD flags,
200 LPVOID reserved )
202 struct name *name;
204 TRACE("%p, %s, 0x%08x, %p\n", obj, debugstr_w(assembly), flags, reserved);
206 if (!obj) return E_INVALIDARG;
208 *obj = NULL;
209 if (!assembly || !assembly[0] || flags != CANOF_PARSE_DISPLAY_NAME)
210 return E_INVALIDARG;
212 if (!(name = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*name) )))
213 return E_OUTOFMEMORY;
215 name->IAssemblyName_iface.lpVtbl = &name_vtbl;
216 name->refs = 1;
218 *obj = &name->IAssemblyName_iface;
219 return S_OK;