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
36 #include "wine/list.h"
37 #include "mscoree_private.h"
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL( mscoree
);
43 typedef struct MetaDataDispenser
45 IMetaDataDispenserEx IMetaDataDispenserEx_iface
;
49 static inline MetaDataDispenser
*impl_from_IMetaDataDispenserEx(IMetaDataDispenserEx
*iface
)
51 return CONTAINING_RECORD(iface
, MetaDataDispenser
, IMetaDataDispenserEx_iface
);
54 static HRESULT WINAPI
MetaDataDispenser_QueryInterface(IMetaDataDispenserEx
* iface
,
55 REFIID riid
, void **ppvObject
)
57 TRACE("%p %s %p\n", iface
, debugstr_guid(riid
), ppvObject
);
59 if (IsEqualGUID(riid
, &IID_IMetaDataDispenserEx
) ||
60 IsEqualGUID(riid
, &IID_IMetaDataDispenser
) ||
61 IsEqualGUID(riid
, &IID_IUnknown
))
67 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
71 IMetaDataDispenserEx_AddRef( iface
);
76 static ULONG WINAPI
MetaDataDispenser_AddRef(IMetaDataDispenserEx
* iface
)
78 MetaDataDispenser
*This
= impl_from_IMetaDataDispenserEx(iface
);
79 ULONG ref
= InterlockedIncrement(&This
->ref
);
81 TRACE("%p ref=%lu\n", This
, ref
);
86 static ULONG WINAPI
MetaDataDispenser_Release(IMetaDataDispenserEx
* iface
)
88 MetaDataDispenser
*This
= impl_from_IMetaDataDispenserEx(iface
);
89 ULONG ref
= InterlockedDecrement(&This
->ref
);
91 TRACE("%p ref=%lu\n", This
, ref
);
95 HeapFree(GetProcessHeap(), 0, This
);
101 static HRESULT WINAPI
MetaDataDispenser_DefineScope(IMetaDataDispenserEx
* iface
,
102 REFCLSID rclsid
, DWORD dwCreateFlags
, REFIID riid
, IUnknown
**ppIUnk
)
104 FIXME("%p %s %lx %s %p\n", iface
, debugstr_guid(rclsid
), dwCreateFlags
,
105 debugstr_guid(riid
), ppIUnk
);
109 static HRESULT WINAPI
MetaDataDispenser_OpenScope(IMetaDataDispenserEx
* iface
,
110 LPCWSTR szScope
, DWORD dwOpenFlags
, REFIID riid
, IUnknown
**ppIUnk
)
112 FIXME("%p %s %lx %s %p\n", iface
, debugstr_w(szScope
), dwOpenFlags
,
113 debugstr_guid(riid
), ppIUnk
);
117 static HRESULT WINAPI
MetaDataDispenser_OpenScopeOnMemory(IMetaDataDispenserEx
* iface
,
118 const void *pData
, ULONG cbData
, DWORD dwOpenFlags
, REFIID riid
, IUnknown
**ppIUnk
)
120 FIXME("%p %p %lu %lx %s %p\n", iface
, pData
, cbData
, dwOpenFlags
,
121 debugstr_guid(riid
), ppIUnk
);
125 static HRESULT WINAPI
MetaDataDispenser_SetOption(IMetaDataDispenserEx
* iface
,
126 REFGUID optionid
, const VARIANT
*value
)
128 FIXME("%p %s\n", iface
, debugstr_guid(optionid
));
132 static HRESULT WINAPI
MetaDataDispenser_GetOption(IMetaDataDispenserEx
* iface
,
133 REFGUID optionid
, VARIANT
*pvalue
)
135 FIXME("%p %s\n", iface
, debugstr_guid(optionid
));
139 static HRESULT WINAPI
MetaDataDispenser_OpenScopeOnITypeInfo(IMetaDataDispenserEx
* iface
,
140 ITypeInfo
*pITI
, DWORD dwOpenFlags
, REFIID riid
, IUnknown
**ppIUnk
)
142 FIXME("%p %p %lu %s %p\n", iface
, pITI
, dwOpenFlags
, debugstr_guid(riid
), ppIUnk
);
146 static HRESULT WINAPI
MetaDataDispenser_GetCORSystemDirectory(IMetaDataDispenserEx
* iface
,
147 LPWSTR szBuffer
, DWORD cchBuffer
, DWORD
*pchBuffer
)
149 FIXME("%p %p %lu %p\n", iface
, szBuffer
, cchBuffer
, pchBuffer
);
153 static HRESULT WINAPI
MetaDataDispenser_FindAssembly(IMetaDataDispenserEx
* iface
,
154 LPCWSTR szAppBase
, LPCWSTR szPrivateBin
, LPCWSTR szGlobalBin
, LPCWSTR szAssemblyName
,
155 LPWSTR szName
, ULONG cchName
, ULONG
*pcName
)
157 FIXME("%p %s %s %s %s %p %lu %p\n", iface
, debugstr_w(szAppBase
),
158 debugstr_w(szPrivateBin
), debugstr_w(szGlobalBin
),
159 debugstr_w(szAssemblyName
), szName
, cchName
, pcName
);
163 static HRESULT WINAPI
MetaDataDispenser_FindAssemblyModule(IMetaDataDispenserEx
* iface
,
164 LPCWSTR szAppBase
, LPCWSTR szPrivateBin
, LPCWSTR szGlobalBin
, LPCWSTR szAssemblyName
,
165 LPCWSTR szModuleName
, LPWSTR szName
, ULONG cchName
, ULONG
*pcName
)
167 FIXME("%p %s %s %s %s %s %p %lu %p\n", iface
, debugstr_w(szAppBase
),
168 debugstr_w(szPrivateBin
), debugstr_w(szGlobalBin
), debugstr_w(szAssemblyName
),
169 debugstr_w(szModuleName
), szName
, cchName
, pcName
);
173 static const struct IMetaDataDispenserExVtbl MetaDataDispenserVtbl
=
175 MetaDataDispenser_QueryInterface
,
176 MetaDataDispenser_AddRef
,
177 MetaDataDispenser_Release
,
178 MetaDataDispenser_DefineScope
,
179 MetaDataDispenser_OpenScope
,
180 MetaDataDispenser_OpenScopeOnMemory
,
181 MetaDataDispenser_SetOption
,
182 MetaDataDispenser_GetOption
,
183 MetaDataDispenser_OpenScopeOnITypeInfo
,
184 MetaDataDispenser_GetCORSystemDirectory
,
185 MetaDataDispenser_FindAssembly
,
186 MetaDataDispenser_FindAssemblyModule
189 HRESULT
MetaDataDispenser_CreateInstance(IUnknown
**ppUnk
)
191 MetaDataDispenser
*This
;
193 This
= HeapAlloc(GetProcessHeap(), 0, sizeof(MetaDataDispenser
));
196 return E_OUTOFMEMORY
;
198 This
->IMetaDataDispenserEx_iface
.lpVtbl
= &MetaDataDispenserVtbl
;
201 *ppUnk
= (IUnknown
*)&This
->IMetaDataDispenserEx_iface
;