wined3d: Pass a wined3d_device_context to wined3d_cs_emit_blt_sub_resource().
[wine/zf.git] / dlls / pstorec / pstorec.c
blob65debd3e6f42ae5ddc825c16c852d71e8b4cec13
1 /*
2 * Protected Storage (pstores)
4 * Copyright 2004 Mike McCormack 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
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "initguid.h"
28 #include "ole2.h"
29 #include "pstore.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(pstores);
35 typedef struct
37 IPStore IPStore_iface;
38 LONG ref;
39 } PStore_impl;
41 static inline PStore_impl *impl_from_IPStore(IPStore *iface)
43 return CONTAINING_RECORD(iface, PStore_impl, IPStore_iface);
46 /**************************************************************************
47 * IPStore->QueryInterface
49 static HRESULT WINAPI PStore_fnQueryInterface(
50 IPStore* iface,
51 REFIID riid,
52 LPVOID *ppvObj)
54 PStore_impl *This = impl_from_IPStore(iface);
56 TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObj);
58 *ppvObj = NULL;
60 if (IsEqualIID(riid, &IID_IPStore) || IsEqualIID(riid, &IID_IUnknown))
62 *ppvObj = &This->IPStore_iface;
65 if (*ppvObj)
67 IUnknown_AddRef((IUnknown*)(*ppvObj));
68 return S_OK;
70 TRACE("-- Interface: E_NOINTERFACE\n");
71 return E_NOINTERFACE;
74 /******************************************************************************
75 * IPStore->AddRef
77 static ULONG WINAPI PStore_fnAddRef(IPStore* iface)
79 PStore_impl *This = impl_from_IPStore(iface);
81 TRACE("%p %u\n", This, This->ref);
83 return InterlockedIncrement( &This->ref );
86 /******************************************************************************
87 * IPStore->Release
89 static ULONG WINAPI PStore_fnRelease(IPStore* iface)
91 PStore_impl *This = impl_from_IPStore(iface);
92 LONG ref;
94 TRACE("%p %u\n", This, This->ref);
96 ref = InterlockedDecrement( &This->ref );
97 if( !ref )
98 HeapFree( GetProcessHeap(), 0, This );
100 return ref;
103 /******************************************************************************
104 * IPStore->GetInfo
106 static HRESULT WINAPI PStore_fnGetInfo( IPStore* iface, PPST_PROVIDERINFO* ppProperties)
108 FIXME("\n");
109 return E_NOTIMPL;
112 /******************************************************************************
113 * IPStore->GetProvParam
115 static HRESULT WINAPI PStore_fnGetProvParam( IPStore* iface,
116 DWORD dwParam, DWORD* pcbData, BYTE** ppbData, DWORD dwFlags)
118 FIXME("\n");
119 return E_NOTIMPL;
122 /******************************************************************************
123 * IPStore->SetProvParam
125 static HRESULT WINAPI PStore_fnSetProvParam( IPStore* This,
126 DWORD dwParam, DWORD cbData, BYTE* pbData, DWORD* dwFlags)
128 FIXME("\n");
129 return E_NOTIMPL;
132 /******************************************************************************
133 * IPStore->CreateType
135 static HRESULT WINAPI PStore_fnCreateType( IPStore* This,
136 PST_KEY Key, const GUID* pType, PPST_TYPEINFO pInfo, DWORD dwFlags)
138 FIXME("%p %08x %s %p(%d,%s) %08x\n", This, Key, debugstr_guid(pType),
139 pInfo, pInfo->cbSize, debugstr_w(pInfo->szDisplayName), dwFlags);
141 return E_NOTIMPL;
144 /******************************************************************************
145 * IPStore->GetTypeInfo
147 static HRESULT WINAPI PStore_fnGetTypeInfo( IPStore* This,
148 PST_KEY Key, const GUID* pType, PPST_TYPEINFO** ppInfo, DWORD dwFlags)
150 FIXME("\n");
151 return E_NOTIMPL;
154 /******************************************************************************
155 * IPStore->DeleteType
157 static HRESULT WINAPI PStore_fnDeleteType( IPStore* This,
158 PST_KEY Key, const GUID* pType, DWORD dwFlags)
160 FIXME("%p %d %s %08x\n", This, Key, debugstr_guid(pType), dwFlags);
161 return E_NOTIMPL;
164 /******************************************************************************
165 * IPStore->CreateSubtype
167 static HRESULT WINAPI PStore_fnCreateSubtype( IPStore* This,
168 PST_KEY Key, const GUID* pType, const GUID* pSubtype,
169 PPST_TYPEINFO pInfo, PPST_ACCESSRULESET pRules, DWORD dwFlags)
171 FIXME("%p %08x %s %s %p %p %08x\n", This, Key, debugstr_guid(pType),
172 debugstr_guid(pSubtype), pInfo, pRules, dwFlags);
173 return E_NOTIMPL;
176 /******************************************************************************
177 * IPStore->GetSubtypeInfo
179 static HRESULT WINAPI PStore_fnGetSubtypeInfo( IPStore* This,
180 PST_KEY Key, const GUID* pType, const GUID* pSubtype,
181 PPST_TYPEINFO** ppInfo, DWORD dwFlags)
183 FIXME("\n");
184 return E_NOTIMPL;
187 /******************************************************************************
188 * IPStore->DeleteSubtype
190 static HRESULT WINAPI PStore_fnDeleteSubtype( IPStore* This,
191 PST_KEY Key, const GUID* pType, const GUID* pSubtype, DWORD dwFlags)
193 FIXME("%p %u %s %s %08x\n", This, Key,
194 debugstr_guid(pType), debugstr_guid(pSubtype), dwFlags);
195 return E_NOTIMPL;
198 /******************************************************************************
199 * IPStore->ReadAccessRuleset
201 static HRESULT WINAPI PStore_fnReadAccessRuleset( IPStore* This,
202 PST_KEY Key, const GUID* pType, const GUID* pSubtype, PPST_TYPEINFO pInfo,
203 PPST_ACCESSRULESET** ppRules, DWORD dwFlags)
205 FIXME("\n");
206 return E_NOTIMPL;
209 /******************************************************************************
210 * IPStore->WriteAccessRuleSet
212 static HRESULT WINAPI PStore_fnWriteAccessRuleset( IPStore* This,
213 PST_KEY Key, const GUID* pType, const GUID* pSubtype,
214 PPST_TYPEINFO pInfo, PPST_ACCESSRULESET pRules, DWORD dwFlags)
216 FIXME("\n");
217 return E_NOTIMPL;
220 /******************************************************************************
221 * IPStore->EnumTypes
223 static HRESULT WINAPI PStore_fnEnumTypes( IPStore* This, PST_KEY Key,
224 DWORD dwFlags, IEnumPStoreTypes** ppenum)
226 FIXME("\n");
227 return E_NOTIMPL;
230 /******************************************************************************
231 * IPStore->EnumSubtypes
233 static HRESULT WINAPI PStore_fnEnumSubtypes( IPStore* This, PST_KEY Key,
234 const GUID* pType, DWORD dwFlags, IEnumPStoreTypes** ppenum)
236 FIXME("\n");
237 return E_NOTIMPL;
240 /******************************************************************************
241 * IPStore->DeleteItem
243 static HRESULT WINAPI PStore_fnDeleteItem( IPStore* This, PST_KEY Key,
244 const GUID* pItemType, const GUID* pItemSubType, LPCWSTR szItemName,
245 PPST_PROMPTINFO pPromptInfo, DWORD dwFlags)
247 FIXME("\n");
248 return E_NOTIMPL;
251 /******************************************************************************
252 * IPStore->ReadItem
254 static HRESULT WINAPI PStore_fnReadItem( IPStore* This, PST_KEY Key,
255 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
256 DWORD *cbData, BYTE** pbData, PPST_PROMPTINFO pPromptInfo, DWORD dwFlags)
258 FIXME("%p %08x %s %s %s %p %p %p %08x\n", This, Key,
259 debugstr_guid(pItemType), debugstr_guid(pItemSubtype),
260 debugstr_w(szItemName), cbData, pbData, pPromptInfo, dwFlags);
261 return E_NOTIMPL;
264 /******************************************************************************
265 * IPStore->WriteItem
267 static HRESULT WINAPI PStore_fnWriteItem( IPStore* This, PST_KEY Key,
268 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
269 DWORD cbData, BYTE* ppbData, PPST_PROMPTINFO pPromptInfo,
270 DWORD dwDefaultConfirmationStyle, DWORD dwFlags)
272 FIXME("%p %08x %s %s %s %d %p %p %08x\n", This, Key,
273 debugstr_guid(pItemType), debugstr_guid(pItemSubtype),
274 debugstr_w(szItemName), cbData, ppbData, pPromptInfo, dwFlags);
275 return E_NOTIMPL;
278 /******************************************************************************
279 * IPStore->OpenItem
281 static HRESULT WINAPI PStore_fnOpenItem( IPStore* This, PST_KEY Key,
282 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
283 PST_ACCESSMODE ModeFlags, PPST_PROMPTINFO pPromptInfo, DWORD dwFlags )
285 FIXME("(%p,%08x,%s,%s,%s,%08x,%p,%08x) stub\n", This, Key, debugstr_guid(pItemType),
286 debugstr_guid(pItemSubtype), debugstr_w(szItemName), ModeFlags, pPromptInfo, dwFlags);
287 return E_NOTIMPL;
290 /******************************************************************************
291 * IPStore->CloseItem
293 static HRESULT WINAPI PStore_fnCloseItem( IPStore* This, PST_KEY Key,
294 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR* szItemName,
295 DWORD dwFlags)
297 FIXME("\n");
298 return E_NOTIMPL;
301 /******************************************************************************
302 * IPStore->EnumItems
304 static HRESULT WINAPI PStore_fnEnumItems( IPStore* This, PST_KEY Key,
305 const GUID* pItemType, const GUID* pItemSubtype, DWORD dwFlags,
306 IEnumPStoreItems** ppenum)
308 FIXME("\n");
309 return E_NOTIMPL;
313 static const IPStoreVtbl pstores_vtbl =
315 PStore_fnQueryInterface,
316 PStore_fnAddRef,
317 PStore_fnRelease,
318 PStore_fnGetInfo,
319 PStore_fnGetProvParam,
320 PStore_fnSetProvParam,
321 PStore_fnCreateType,
322 PStore_fnGetTypeInfo,
323 PStore_fnDeleteType,
324 PStore_fnCreateSubtype,
325 PStore_fnGetSubtypeInfo,
326 PStore_fnDeleteSubtype,
327 PStore_fnReadAccessRuleset,
328 PStore_fnWriteAccessRuleset,
329 PStore_fnEnumTypes,
330 PStore_fnEnumSubtypes,
331 PStore_fnDeleteItem,
332 PStore_fnReadItem,
333 PStore_fnWriteItem,
334 PStore_fnOpenItem,
335 PStore_fnCloseItem,
336 PStore_fnEnumItems
339 HRESULT WINAPI PStoreCreateInstance( IPStore** ppProvider,
340 PST_PROVIDERID* pProviderID, void* pReserved, DWORD dwFlags)
342 PStore_impl *ips;
344 TRACE("%p %s %p %08x\n", ppProvider, debugstr_guid(pProviderID), pReserved, dwFlags);
346 ips = HeapAlloc( GetProcessHeap(), 0, sizeof (PStore_impl) );
347 if( !ips )
348 return E_OUTOFMEMORY;
350 ips->IPStore_iface.lpVtbl = &pstores_vtbl;
351 ips->ref = 1;
353 *ppProvider = &ips->IPStore_iface;
355 return S_OK;
358 HRESULT WINAPI DllRegisterServer(void)
360 FIXME("\n");
361 return S_OK;
364 HRESULT WINAPI DllUnregisterServer(void)
366 FIXME("\n");
367 return S_OK;
370 /***********************************************************************
371 * DllGetClassObject (PSTOREC.@)
373 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
375 FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
376 return CLASS_E_CLASSNOTAVAILABLE;
379 HRESULT WINAPI DllCanUnloadNow(void)
381 return S_FALSE;