2 * IMetaDataDispenserEx - dynamic creation/editing of assemblies
4 * Copyright 2010 Vincent Povirk 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
27 #include "wine/library.h"
35 #include "wine/list.h"
36 #include "mscoree_private.h"
38 #include "wine/debug.h"
40 WINE_DEFAULT_DEBUG_CHANNEL( mscoree
);
42 typedef struct MetaDataDispenser
44 IMetaDataDispenserEx IMetaDataDispenserEx_iface
;
48 static inline MetaDataDispenser
*impl_from_IMetaDataDispenserEx(IMetaDataDispenserEx
*iface
)
50 return CONTAINING_RECORD(iface
, MetaDataDispenser
, IMetaDataDispenserEx_iface
);
53 static HRESULT WINAPI
MetaDataDispenser_QueryInterface(IMetaDataDispenserEx
* iface
,
54 REFIID riid
, void **ppvObject
)
56 TRACE("%p %s %p\n", iface
, debugstr_guid(riid
), ppvObject
);
58 if (IsEqualGUID(riid
, &IID_IMetaDataDispenserEx
) ||
59 IsEqualGUID(riid
, &IID_IMetaDataDispenser
) ||
60 IsEqualGUID(riid
, &IID_IUnknown
))
66 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
70 IMetaDataDispenserEx_AddRef( iface
);
75 static ULONG WINAPI
MetaDataDispenser_AddRef(IMetaDataDispenserEx
* iface
)
77 MetaDataDispenser
*This
= impl_from_IMetaDataDispenserEx(iface
);
78 ULONG ref
= InterlockedIncrement(&This
->ref
);
80 TRACE("%p ref=%u\n", This
, ref
);
85 static ULONG WINAPI
MetaDataDispenser_Release(IMetaDataDispenserEx
* iface
)
87 MetaDataDispenser
*This
= impl_from_IMetaDataDispenserEx(iface
);
88 ULONG ref
= InterlockedDecrement(&This
->ref
);
90 TRACE("%p ref=%u\n", This
, ref
);
94 HeapFree(GetProcessHeap(), 0, This
);
100 static HRESULT WINAPI
MetaDataDispenser_DefineScope(IMetaDataDispenserEx
* iface
,
101 REFCLSID rclsid
, DWORD dwCreateFlags
, REFIID riid
, IUnknown
**ppIUnk
)
103 FIXME("%p %s %x %s %p\n", iface
, debugstr_guid(rclsid
), dwCreateFlags
,
104 debugstr_guid(riid
), ppIUnk
);
108 static HRESULT WINAPI
MetaDataDispenser_OpenScope(IMetaDataDispenserEx
* iface
,
109 LPCWSTR szScope
, DWORD dwOpenFlags
, REFIID riid
, IUnknown
**ppIUnk
)
111 FIXME("%p %s %x %s %p\n", iface
, debugstr_w(szScope
), dwOpenFlags
,
112 debugstr_guid(riid
), ppIUnk
);
116 static HRESULT WINAPI
MetaDataDispenser_OpenScopeOnMemory(IMetaDataDispenserEx
* iface
,
117 const void *pData
, ULONG cbData
, DWORD dwOpenFlags
, REFIID riid
, IUnknown
**ppIUnk
)
119 FIXME("%p %p %u %x %s %p\n", iface
, pData
, cbData
, dwOpenFlags
,
120 debugstr_guid(riid
), ppIUnk
);
124 static HRESULT WINAPI
MetaDataDispenser_SetOption(IMetaDataDispenserEx
* iface
,
125 REFGUID optionid
, const VARIANT
*value
)
127 FIXME("%p %s\n", iface
, debugstr_guid(optionid
));
131 static HRESULT WINAPI
MetaDataDispenser_GetOption(IMetaDataDispenserEx
* iface
,
132 REFGUID optionid
, VARIANT
*pvalue
)
134 FIXME("%p %s\n", iface
, debugstr_guid(optionid
));
138 static HRESULT WINAPI
MetaDataDispenser_OpenScopeOnITypeInfo(IMetaDataDispenserEx
* iface
,
139 ITypeInfo
*pITI
, DWORD dwOpenFlags
, REFIID riid
, IUnknown
**ppIUnk
)
141 FIXME("%p %p %u %s %p\n", iface
, pITI
, dwOpenFlags
, debugstr_guid(riid
), ppIUnk
);
145 static HRESULT WINAPI
MetaDataDispenser_GetCORSystemDirectory(IMetaDataDispenserEx
* iface
,
146 LPWSTR szBuffer
, DWORD cchBuffer
, DWORD
*pchBuffer
)
148 FIXME("%p %p %u %p\n", iface
, szBuffer
, cchBuffer
, pchBuffer
);
152 static HRESULT WINAPI
MetaDataDispenser_FindAssembly(IMetaDataDispenserEx
* iface
,
153 LPCWSTR szAppBase
, LPCWSTR szPrivateBin
, LPCWSTR szGlobalBin
, LPCWSTR szAssemblyName
,
154 LPWSTR szName
, ULONG cchName
, ULONG
*pcName
)
156 FIXME("%p %s %s %s %s %p %u %p\n", iface
, debugstr_w(szAppBase
),
157 debugstr_w(szPrivateBin
), debugstr_w(szGlobalBin
),
158 debugstr_w(szAssemblyName
), szName
, cchName
, pcName
);
162 static HRESULT WINAPI
MetaDataDispenser_FindAssemblyModule(IMetaDataDispenserEx
* iface
,
163 LPCWSTR szAppBase
, LPCWSTR szPrivateBin
, LPCWSTR szGlobalBin
, LPCWSTR szAssemblyName
,
164 LPCWSTR szModuleName
, LPWSTR szName
, ULONG cchName
, ULONG
*pcName
)
166 FIXME("%p %s %s %s %s %s %p %u %p\n", iface
, debugstr_w(szAppBase
),
167 debugstr_w(szPrivateBin
), debugstr_w(szGlobalBin
), debugstr_w(szAssemblyName
),
168 debugstr_w(szModuleName
), szName
, cchName
, pcName
);
172 const struct IMetaDataDispenserExVtbl MetaDataDispenserVtbl
=
174 MetaDataDispenser_QueryInterface
,
175 MetaDataDispenser_AddRef
,
176 MetaDataDispenser_Release
,
177 MetaDataDispenser_DefineScope
,
178 MetaDataDispenser_OpenScope
,
179 MetaDataDispenser_OpenScopeOnMemory
,
180 MetaDataDispenser_SetOption
,
181 MetaDataDispenser_GetOption
,
182 MetaDataDispenser_OpenScopeOnITypeInfo
,
183 MetaDataDispenser_GetCORSystemDirectory
,
184 MetaDataDispenser_FindAssembly
,
185 MetaDataDispenser_FindAssemblyModule
188 HRESULT
MetaDataDispenser_CreateInstance(IUnknown
**ppUnk
)
190 MetaDataDispenser
*This
;
192 This
= HeapAlloc(GetProcessHeap(), 0, sizeof(MetaDataDispenser
));
195 return E_OUTOFMEMORY
;
197 This
->IMetaDataDispenserEx_iface
.lpVtbl
= &MetaDataDispenserVtbl
;
200 *ppUnk
= (IUnknown
*)This
;