ReactOS  0.4.14-dev-384-g5b37caa
metadata.c
Go to the documentation of this file.
1 /*
2  * IMetaDataDispenserEx - dynamic creation/editing of assemblies
3  *
4  * Copyright 2010 Vincent Povirk for CodeWeavers
5  *
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.
10  *
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.
15  *
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
19  */
20 
21 #include "mscoree_private.h"
22 
23 typedef struct MetaDataDispenser
24 {
28 
30 {
31  return CONTAINING_RECORD(iface, MetaDataDispenser, IMetaDataDispenserEx_iface);
32 }
33 
35  REFIID riid, void **ppvObject)
36 {
37  TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
38 
39  if (IsEqualGUID(riid, &IID_IMetaDataDispenserEx) ||
40  IsEqualGUID(riid, &IID_IMetaDataDispenser) ||
42  {
43  *ppvObject = iface;
44  }
45  else
46  {
47  FIXME("Unsupported interface %s\n", debugstr_guid(riid));
48  return E_NOINTERFACE;
49  }
50 
51  IMetaDataDispenserEx_AddRef( iface );
52 
53  return S_OK;
54 }
55 
57 {
60 
61  TRACE("%p ref=%u\n", This, ref);
62 
63  return ref;
64 }
65 
67 {
70 
71  TRACE("%p ref=%u\n", This, ref);
72 
73  if (ref == 0)
74  {
76  }
77 
78  return ref;
79 }
80 
82  REFCLSID rclsid, DWORD dwCreateFlags, REFIID riid, IUnknown **ppIUnk)
83 {
84  FIXME("%p %s %x %s %p\n", iface, debugstr_guid(rclsid), dwCreateFlags,
85  debugstr_guid(riid), ppIUnk);
86  return E_NOTIMPL;
87 }
88 
90  LPCWSTR szScope, DWORD dwOpenFlags, REFIID riid, IUnknown **ppIUnk)
91 {
92  FIXME("%p %s %x %s %p\n", iface, debugstr_w(szScope), dwOpenFlags,
93  debugstr_guid(riid), ppIUnk);
94  return E_NOTIMPL;
95 }
96 
98  const void *pData, ULONG cbData, DWORD dwOpenFlags, REFIID riid, IUnknown **ppIUnk)
99 {
100  FIXME("%p %p %u %x %s %p\n", iface, pData, cbData, dwOpenFlags,
101  debugstr_guid(riid), ppIUnk);
102  return E_NOTIMPL;
103 }
104 
106  REFGUID optionid, const VARIANT *value)
107 {
108  FIXME("%p %s\n", iface, debugstr_guid(optionid));
109  return E_NOTIMPL;
110 }
111 
113  REFGUID optionid, VARIANT *pvalue)
114 {
115  FIXME("%p %s\n", iface, debugstr_guid(optionid));
116  return E_NOTIMPL;
117 }
118 
120  ITypeInfo *pITI, DWORD dwOpenFlags, REFIID riid, IUnknown **ppIUnk)
121 {
122  FIXME("%p %p %u %s %p\n", iface, pITI, dwOpenFlags, debugstr_guid(riid), ppIUnk);
123  return E_NOTIMPL;
124 }
125 
127  LPWSTR szBuffer, DWORD cchBuffer, DWORD *pchBuffer)
128 {
129  FIXME("%p %p %u %p\n", iface, szBuffer, cchBuffer, pchBuffer);
130  return E_NOTIMPL;
131 }
132 
134  LPCWSTR szAppBase, LPCWSTR szPrivateBin, LPCWSTR szGlobalBin, LPCWSTR szAssemblyName,
135  LPWSTR szName, ULONG cchName, ULONG *pcName)
136 {
137  FIXME("%p %s %s %s %s %p %u %p\n", iface, debugstr_w(szAppBase),
138  debugstr_w(szPrivateBin), debugstr_w(szGlobalBin),
140  return E_NOTIMPL;
141 }
142 
144  LPCWSTR szAppBase, LPCWSTR szPrivateBin, LPCWSTR szGlobalBin, LPCWSTR szAssemblyName,
146 {
147  FIXME("%p %s %s %s %s %s %p %u %p\n", iface, debugstr_w(szAppBase),
148  debugstr_w(szPrivateBin), debugstr_w(szGlobalBin), debugstr_w(szAssemblyName),
150  return E_NOTIMPL;
151 }
152 
153 static const struct IMetaDataDispenserExVtbl MetaDataDispenserVtbl =
154 {
167 };
168 
170 {
172 
174 
175  if (!This)
176  return E_OUTOFMEMORY;
177 
178  This->IMetaDataDispenserEx_iface.lpVtbl = &MetaDataDispenserVtbl;
179  This->ref = 1;
180 
181  *ppUnk = (IUnknown*)This;
182 
183  return S_OK;
184 }
#define REFIID
Definition: guiddef.h:118
static HRESULT WINAPI MetaDataDispenser_SetOption(IMetaDataDispenserEx *iface, REFGUID optionid, const VARIANT *value)
Definition: metadata.c:105
#define E_NOINTERFACE
Definition: winerror.h:2364
static HRESULT WINAPI MetaDataDispenser_OpenScopeOnMemory(IMetaDataDispenserEx *iface, const void *pData, ULONG cbData, DWORD dwOpenFlags, REFIID riid, IUnknown **ppIUnk)
Definition: metadata.c:97
Definition: scsiwmi.h:51
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
REFIID riid
Definition: precomp.h:44
#define REFCLSID
Definition: guiddef.h:117
static const struct IMetaDataDispenserExVtbl MetaDataDispenserVtbl
Definition: metadata.c:153
static ULONG WINAPI MetaDataDispenser_Release(IMetaDataDispenserEx *iface)
Definition: metadata.c:66
Definition: send.c:47
static HRESULT WINAPI MetaDataDispenser_DefineScope(IMetaDataDispenserEx *iface, REFCLSID rclsid, DWORD dwCreateFlags, REFIID riid, IUnknown **ppIUnk)
Definition: metadata.c:81
static HRESULT WINAPI MetaDataDispenser_QueryInterface(IMetaDataDispenserEx *iface, REFIID riid, void **ppvObject)
Definition: metadata.c:34
static HRESULT WINAPI MetaDataDispenser_OpenScopeOnITypeInfo(IMetaDataDispenserEx *iface, ITypeInfo *pITI, DWORD dwOpenFlags, REFIID riid, IUnknown **ppIUnk)
Definition: metadata.c:119
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2713
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
static DWORD cchBuffer
Definition: fusion.c:85
GLenum GLint ref
Definition: glext.h:6028
static ULONG WINAPI MetaDataDispenser_AddRef(IMetaDataDispenserEx *iface)
Definition: metadata.c:56
#define FIXME(fmt,...)
Definition: debug.h:110
static HRESULT WINAPI MetaDataDispenser_FindAssemblyModule(IMetaDataDispenserEx *iface, LPCWSTR szAppBase, LPCWSTR szPrivateBin, LPCWSTR szGlobalBin, LPCWSTR szAssemblyName, LPCWSTR szModuleName, LPWSTR szName, ULONG cchName, ULONG *pcName)
Definition: metadata.c:143
static HRESULT WINAPI MetaDataDispenser_GetCORSystemDirectory(IMetaDataDispenserEx *iface, LPWSTR szBuffer, DWORD cchBuffer, DWORD *pchBuffer)
Definition: metadata.c:126
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static HRESULT WINAPI MetaDataDispenser_OpenScope(IMetaDataDispenserEx *iface, LPCWSTR szScope, DWORD dwOpenFlags, REFIID riid, IUnknown **ppIUnk)
Definition: metadata.c:89
static MetaDataDispenser * impl_from_IMetaDataDispenserEx(IMetaDataDispenserEx *iface)
Definition: metadata.c:29
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:8
IMetaDataDispenserEx IMetaDataDispenserEx_iface
Definition: metadata.c:25
unsigned long DWORD
Definition: ntddk_ex.h:95
struct MetaDataDispenser MetaDataDispenser
static LPCWSTR szAssemblyName
Definition: asmenum.c:37
#define InterlockedDecrement
Definition: armddk.h:52
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI MetaDataDispenser_GetOption(IMetaDataDispenserEx *iface, REFGUID optionid, VARIANT *pvalue)
Definition: metadata.c:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static const WCHAR szName[]
Definition: msipriv.h:1194
unsigned int ULONG
Definition: retypes.h:1
LPCWSTR LPCWSTR szModuleName
Definition: env.c:35
static HRESULT WINAPI MetaDataDispenser_FindAssembly(IMetaDataDispenserEx *iface, LPCWSTR szAppBase, LPCWSTR szPrivateBin, LPCWSTR szGlobalBin, LPCWSTR szAssemblyName, LPWSTR szName, ULONG cchName, ULONG *pcName)
Definition: metadata.c:133
WCHAR * LPWSTR
Definition: xmlstorage.h:184
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
HRESULT MetaDataDispenser_CreateInstance(IUnknown **ppUnk)
Definition: metadata.c:169
#define HeapFree(x, y, z)
Definition: compat.h:402