Release 1.5.6.
[wine/multimedia.git] / dlls / pstorec / pstorec.c
blob0a6a6c117de35fed677dac09c224ee068c09678c
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 "ole2.h"
28 #include "pstore.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(pstores);
34 typedef struct
36 IPStore IPStore_iface;
37 LONG ref;
38 } PStore_impl;
40 static inline PStore_impl *impl_from_IPStore(IPStore *iface)
42 return CONTAINING_RECORD(iface, PStore_impl, IPStore_iface);
45 BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad)
47 TRACE("%p %x %p\n", hinst, fdwReason, fImpLoad);
49 switch (fdwReason)
51 case DLL_WINE_PREATTACH:
52 return FALSE; /* prefer native version */
53 case DLL_PROCESS_ATTACH:
54 DisableThreadLibraryCalls(hinst);
55 break;
56 case DLL_PROCESS_DETACH:
57 break;
59 return TRUE;
62 /**************************************************************************
63 * IPStore->QueryInterface
65 static HRESULT WINAPI PStore_fnQueryInterface(
66 IPStore* iface,
67 REFIID riid,
68 LPVOID *ppvObj)
70 PStore_impl *This = impl_from_IPStore(iface);
72 TRACE("%p %s\n",This,debugstr_guid(riid));
74 *ppvObj = NULL;
76 if (IsEqualIID(riid, &IID_IUnknown))
78 *ppvObj = This;
81 if (*ppvObj)
83 IUnknown_AddRef((IUnknown*)(*ppvObj));
84 return S_OK;
86 TRACE("-- Interface: E_NOINTERFACE\n");
87 return E_NOINTERFACE;
90 /******************************************************************************
91 * IPStore->AddRef
93 static ULONG WINAPI PStore_fnAddRef(IPStore* iface)
95 PStore_impl *This = impl_from_IPStore(iface);
97 TRACE("%p %u\n", This, This->ref);
99 return InterlockedIncrement( &This->ref );
102 /******************************************************************************
103 * IPStore->Release
105 static ULONG WINAPI PStore_fnRelease(IPStore* iface)
107 PStore_impl *This = impl_from_IPStore(iface);
108 LONG ref;
110 TRACE("%p %u\n", This, This->ref);
112 ref = InterlockedDecrement( &This->ref );
113 if( !ref )
114 HeapFree( GetProcessHeap(), 0, This );
116 return ref;
119 /******************************************************************************
120 * IPStore->GetInfo
122 static HRESULT WINAPI PStore_fnGetInfo( IPStore* iface, PPST_PROVIDERINFO* ppProperties)
124 FIXME("\n");
125 return E_NOTIMPL;
128 /******************************************************************************
129 * IPStore->GetProvParam
131 static HRESULT WINAPI PStore_fnGetProvParam( IPStore* iface,
132 DWORD dwParam, DWORD* pcbData, BYTE** ppbData, DWORD dwFlags)
134 FIXME("\n");
135 return E_NOTIMPL;
138 /******************************************************************************
139 * IPStore->SetProvParam
141 static HRESULT WINAPI PStore_fnSetProvParam( IPStore* This,
142 DWORD dwParam, DWORD cbData, BYTE* pbData, DWORD* dwFlags)
144 FIXME("\n");
145 return E_NOTIMPL;
148 /******************************************************************************
149 * IPStore->CreateType
151 static HRESULT WINAPI PStore_fnCreateType( IPStore* This,
152 PST_KEY Key, const GUID* pType, PPST_TYPEINFO pInfo, DWORD dwFlags)
154 FIXME("%p %08x %s %p(%d,%s) %08x\n", This, Key, debugstr_guid(pType),
155 pInfo, pInfo->cbSize, debugstr_w(pInfo->szDisplayName), dwFlags);
157 return E_NOTIMPL;
160 /******************************************************************************
161 * IPStore->GetTypeInfo
163 static HRESULT WINAPI PStore_fnGetTypeInfo( IPStore* This,
164 PST_KEY Key, const GUID* pType, PPST_TYPEINFO** ppInfo, DWORD dwFlags)
166 FIXME("\n");
167 return E_NOTIMPL;
170 /******************************************************************************
171 * IPStore->DeleteType
173 static HRESULT WINAPI PStore_fnDeleteType( IPStore* This,
174 PST_KEY Key, const GUID* pType, DWORD dwFlags)
176 FIXME("%p %d %s %08x\n", This, Key, debugstr_guid(pType), dwFlags);
177 return E_NOTIMPL;
180 /******************************************************************************
181 * IPStore->CreateSubtype
183 static HRESULT WINAPI PStore_fnCreateSubtype( IPStore* This,
184 PST_KEY Key, const GUID* pType, const GUID* pSubtype,
185 PPST_TYPEINFO pInfo, PPST_ACCESSRULESET pRules, DWORD dwFlags)
187 FIXME("%p %08x %s %s %p %p %08x\n", This, Key, debugstr_guid(pType),
188 debugstr_guid(pSubtype), pInfo, pRules, dwFlags);
189 return E_NOTIMPL;
192 /******************************************************************************
193 * IPStore->GetSubtypeInfo
195 static HRESULT WINAPI PStore_fnGetSubtypeInfo( IPStore* This,
196 PST_KEY Key, const GUID* pType, const GUID* pSubtype,
197 PPST_TYPEINFO** ppInfo, DWORD dwFlags)
199 FIXME("\n");
200 return E_NOTIMPL;
203 /******************************************************************************
204 * IPStore->DeleteSubtype
206 static HRESULT WINAPI PStore_fnDeleteSubtype( IPStore* This,
207 PST_KEY Key, const GUID* pType, const GUID* pSubtype, DWORD dwFlags)
209 FIXME("%p %u %s %s %08x\n", This, Key,
210 debugstr_guid(pType), debugstr_guid(pSubtype), dwFlags);
211 return E_NOTIMPL;
214 /******************************************************************************
215 * IPStore->ReadAccessRuleset
217 static HRESULT WINAPI PStore_fnReadAccessRuleset( IPStore* This,
218 PST_KEY Key, const GUID* pType, const GUID* pSubtype, PPST_TYPEINFO pInfo,
219 PPST_ACCESSRULESET** ppRules, DWORD dwFlags)
221 FIXME("\n");
222 return E_NOTIMPL;
225 /******************************************************************************
226 * IPStore->WriteAccessRuleSet
228 static HRESULT WINAPI PStore_fnWriteAccessRuleset( IPStore* This,
229 PST_KEY Key, const GUID* pType, const GUID* pSubtype,
230 PPST_TYPEINFO pInfo, PPST_ACCESSRULESET pRules, DWORD dwFlags)
232 FIXME("\n");
233 return E_NOTIMPL;
236 /******************************************************************************
237 * IPStore->EnumTypes
239 static HRESULT WINAPI PStore_fnEnumTypes( IPStore* This, PST_KEY Key,
240 DWORD dwFlags, IEnumPStoreTypes** ppenum)
242 FIXME("\n");
243 return E_NOTIMPL;
246 /******************************************************************************
247 * IPStore->EnumSubtypes
249 static HRESULT WINAPI PStore_fnEnumSubtypes( IPStore* This, PST_KEY Key,
250 const GUID* pType, DWORD dwFlags, IEnumPStoreTypes** ppenum)
252 FIXME("\n");
253 return E_NOTIMPL;
256 /******************************************************************************
257 * IPStore->DeleteItem
259 static HRESULT WINAPI PStore_fnDeleteItem( IPStore* This, PST_KEY Key,
260 const GUID* pItemType, const GUID* pItemSubType, LPCWSTR szItemName,
261 PPST_PROMPTINFO pPromptInfo, DWORD dwFlags)
263 FIXME("\n");
264 return E_NOTIMPL;
267 /******************************************************************************
268 * IPStore->ReadItem
270 static HRESULT WINAPI PStore_fnReadItem( IPStore* This, PST_KEY Key,
271 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
272 DWORD *cbData, BYTE** pbData, PPST_PROMPTINFO pPromptInfo, DWORD dwFlags)
274 FIXME("%p %08x %s %s %s %p %p %p %08x\n", This, Key,
275 debugstr_guid(pItemType), debugstr_guid(pItemSubtype),
276 debugstr_w(szItemName), cbData, pbData, pPromptInfo, dwFlags);
277 return E_NOTIMPL;
280 /******************************************************************************
281 * IPStore->WriteItem
283 static HRESULT WINAPI PStore_fnWriteItem( IPStore* This, PST_KEY Key,
284 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
285 DWORD cbData, BYTE* ppbData, PPST_PROMPTINFO pPromptInfo,
286 DWORD dwDefaultConfirmationStyle, DWORD dwFlags)
288 FIXME("%p %08x %s %s %s %d %p %p %08x\n", This, Key,
289 debugstr_guid(pItemType), debugstr_guid(pItemSubtype),
290 debugstr_w(szItemName), cbData, ppbData, pPromptInfo, dwFlags);
291 return E_NOTIMPL;
294 /******************************************************************************
295 * IPStore->OpenItem
297 static HRESULT WINAPI PStore_fnOpenItem( IPStore* This, PST_KEY Key,
298 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
299 PST_ACCESSMODE ModeFlags, PPST_PROMPTINFO pProomptInfo, DWORD dwFlags )
301 FIXME("(%p,%08x,%s,%s,%s,%08x,%p,%08x) stub\n", This, Key, debugstr_guid(pItemType),
302 debugstr_guid(pItemSubtype), debugstr_w(szItemName), ModeFlags, pProomptInfo, dwFlags);
303 return E_NOTIMPL;
306 /******************************************************************************
307 * IPStore->CloseItem
309 static HRESULT WINAPI PStore_fnCloseItem( IPStore* This, PST_KEY Key,
310 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR* szItemName,
311 DWORD dwFlags)
313 FIXME("\n");
314 return E_NOTIMPL;
317 /******************************************************************************
318 * IPStore->EnumItems
320 static HRESULT WINAPI PStore_fnEnumItems( IPStore* This, PST_KEY Key,
321 const GUID* pItemType, const GUID* pItemSubtype, DWORD dwFlags,
322 IEnumPStoreItems** ppenum)
324 FIXME("\n");
325 return E_NOTIMPL;
329 static const IPStoreVtbl pstores_vtbl =
331 PStore_fnQueryInterface,
332 PStore_fnAddRef,
333 PStore_fnRelease,
334 PStore_fnGetInfo,
335 PStore_fnGetProvParam,
336 PStore_fnSetProvParam,
337 PStore_fnCreateType,
338 PStore_fnGetTypeInfo,
339 PStore_fnDeleteType,
340 PStore_fnCreateSubtype,
341 PStore_fnGetSubtypeInfo,
342 PStore_fnDeleteSubtype,
343 PStore_fnReadAccessRuleset,
344 PStore_fnWriteAccessRuleset,
345 PStore_fnEnumTypes,
346 PStore_fnEnumSubtypes,
347 PStore_fnDeleteItem,
348 PStore_fnReadItem,
349 PStore_fnWriteItem,
350 PStore_fnOpenItem,
351 PStore_fnCloseItem,
352 PStore_fnEnumItems
355 HRESULT WINAPI PStoreCreateInstance( IPStore** ppProvider,
356 PST_PROVIDERID* pProviderID, void* pReserved, DWORD dwFlags)
358 PStore_impl *ips;
360 TRACE("%p %s %p %08x\n", ppProvider, debugstr_guid(pProviderID), pReserved, dwFlags);
362 ips = HeapAlloc( GetProcessHeap(), 0, sizeof (PStore_impl) );
363 if( !ips )
364 return E_OUTOFMEMORY;
366 ips->IPStore_iface.lpVtbl = &pstores_vtbl;
367 ips->ref = 1;
369 *ppProvider = (IPStore*) ips;
371 return S_OK;
374 HRESULT WINAPI DllRegisterServer(void)
376 FIXME("\n");
377 return S_OK;
380 HRESULT WINAPI DllUnregisterServer(void)
382 FIXME("\n");
383 return S_OK;
386 /***********************************************************************
387 * DllGetClassObject (PSTOREC.@)
389 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
391 FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
392 return CLASS_E_CLASSNOTAVAILABLE;
395 HRESULT WINAPI DllCanUnloadNow(void)
397 return S_OK;