push 8b07bf1f08b23b9893a622b47d2be359556765b1
[wine/hacks.git] / dlls / pstorec / pstorec.c
blobdebb222797acf470cbe68e1b343a504bce72e204
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 const IPStoreVtbl *lpVtbl;
37 LONG ref;
38 } PStore_impl;
40 BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad)
42 TRACE("%p %x %p\n", hinst, fdwReason, fImpLoad);
44 switch (fdwReason)
46 case DLL_WINE_PREATTACH:
47 return FALSE; /* prefer native version */
48 case DLL_PROCESS_ATTACH:
49 DisableThreadLibraryCalls(hinst);
50 break;
51 case DLL_PROCESS_DETACH:
52 break;
54 return TRUE;
57 /**************************************************************************
58 * IPStore->QueryInterface
60 static HRESULT WINAPI PStore_fnQueryInterface(
61 IPStore* iface,
62 REFIID riid,
63 LPVOID *ppvObj)
65 PStore_impl *This = (PStore_impl *)iface;
67 TRACE("%p %s\n",This,debugstr_guid(riid));
69 *ppvObj = NULL;
71 if (IsEqualIID(riid, &IID_IUnknown))
73 *ppvObj = This;
76 if (*ppvObj)
78 IUnknown_AddRef((IUnknown*)(*ppvObj));
79 return S_OK;
81 TRACE("-- Interface: E_NOINTERFACE\n");
82 return E_NOINTERFACE;
85 /******************************************************************************
86 * IPStore->AddRef
88 static ULONG WINAPI PStore_fnAddRef(IPStore* iface)
90 PStore_impl *This = (PStore_impl *)iface;
92 TRACE("%p %u\n", This, This->ref);
94 return InterlockedIncrement( &This->ref );
97 /******************************************************************************
98 * IPStore->Release
100 static ULONG WINAPI PStore_fnRelease(IPStore* iface)
102 PStore_impl *This = (PStore_impl *)iface;
103 LONG ref;
105 TRACE("%p %u\n", This, This->ref);
107 ref = InterlockedDecrement( &This->ref );
108 if( !ref )
109 HeapFree( GetProcessHeap(), 0, This );
111 return ref;
114 /******************************************************************************
115 * IPStore->GetInfo
117 static HRESULT WINAPI PStore_fnGetInfo( IPStore* iface, PPST_PROVIDERINFO* ppProperties)
119 FIXME("\n");
120 return E_NOTIMPL;
123 /******************************************************************************
124 * IPStore->GetProvParam
126 static HRESULT WINAPI PStore_fnGetProvParam( IPStore* iface,
127 DWORD dwParam, DWORD* pcbData, BYTE** ppbData, DWORD dwFlags)
129 FIXME("\n");
130 return E_NOTIMPL;
133 /******************************************************************************
134 * IPStore->SetProvParam
136 static HRESULT WINAPI PStore_fnSetProvParam( IPStore* This,
137 DWORD dwParam, DWORD cbData, BYTE* pbData, DWORD* dwFlags)
139 FIXME("\n");
140 return E_NOTIMPL;
143 /******************************************************************************
144 * IPStore->CreateType
146 static HRESULT WINAPI PStore_fnCreateType( IPStore* This,
147 PST_KEY Key, const GUID* pType, PPST_TYPEINFO pInfo, DWORD dwFlags)
149 FIXME("%p %08x %s %p(%d,%s) %08x\n", This, Key, debugstr_guid(pType),
150 pInfo, pInfo->cbSize, debugstr_w(pInfo->szDisplayName), dwFlags);
152 return E_NOTIMPL;
155 /******************************************************************************
156 * IPStore->GetTypeInfo
158 static HRESULT WINAPI PStore_fnGetTypeInfo( IPStore* This,
159 PST_KEY Key, const GUID* pType, PPST_TYPEINFO** ppInfo, DWORD dwFlags)
161 FIXME("\n");
162 return E_NOTIMPL;
165 /******************************************************************************
166 * IPStore->DeleteType
168 static HRESULT WINAPI PStore_fnDeleteType( IPStore* This,
169 PST_KEY Key, const GUID* pType, DWORD dwFlags)
171 FIXME("%p %d %s %08x\n", This, Key, debugstr_guid(pType), dwFlags);
172 return E_NOTIMPL;
175 /******************************************************************************
176 * IPStore->CreateSubtype
178 static HRESULT WINAPI PStore_fnCreateSubtype( IPStore* This,
179 PST_KEY Key, const GUID* pType, const GUID* pSubtype,
180 PPST_TYPEINFO pInfo, PPST_ACCESSRULESET pRules, DWORD dwFlags)
182 FIXME("%p %08x %s %s %p %p %08x\n", This, Key, debugstr_guid(pType),
183 debugstr_guid(pSubtype), pInfo, pRules, dwFlags);
184 return E_NOTIMPL;
187 /******************************************************************************
188 * IPStore->GetSubtypeInfo
190 static HRESULT WINAPI PStore_fnGetSubtypeInfo( IPStore* This,
191 PST_KEY Key, const GUID* pType, const GUID* pSubtype,
192 PPST_TYPEINFO** ppInfo, DWORD dwFlags)
194 FIXME("\n");
195 return E_NOTIMPL;
198 /******************************************************************************
199 * IPStore->DeleteSubtype
201 static HRESULT WINAPI PStore_fnDeleteSubtype( IPStore* This,
202 PST_KEY Key, const GUID* pType, const GUID* pSubtype, DWORD dwFlags)
204 FIXME("%p %u %s %s %08x\n", This, Key,
205 debugstr_guid(pType), debugstr_guid(pSubtype), dwFlags);
206 return E_NOTIMPL;
209 /******************************************************************************
210 * IPStore->ReadAccessRuleset
212 static HRESULT WINAPI PStore_fnReadAccessRuleset( IPStore* This,
213 PST_KEY Key, const GUID* pType, const GUID* pSubtype, PPST_TYPEINFO pInfo,
214 PPST_ACCESSRULESET** ppRules, DWORD dwFlags)
216 FIXME("\n");
217 return E_NOTIMPL;
220 /******************************************************************************
221 * IPStore->WriteAccessRuleSet
223 static HRESULT WINAPI PStore_fnWriteAccessRuleset( IPStore* This,
224 PST_KEY Key, const GUID* pType, const GUID* pSubtype,
225 PPST_TYPEINFO pInfo, PPST_ACCESSRULESET pRules, DWORD dwFlags)
227 FIXME("\n");
228 return E_NOTIMPL;
231 /******************************************************************************
232 * IPStore->EnumTypes
234 static HRESULT WINAPI PStore_fnEnumTypes( IPStore* This, PST_KEY Key,
235 DWORD dwFlags, IEnumPStoreTypes** ppenum)
237 FIXME("\n");
238 return E_NOTIMPL;
241 /******************************************************************************
242 * IPStore->EnumSubtypes
244 static HRESULT WINAPI PStore_fnEnumSubtypes( IPStore* This, PST_KEY Key,
245 const GUID* pType, DWORD dwFlags, IEnumPStoreTypes** ppenum)
247 FIXME("\n");
248 return E_NOTIMPL;
251 /******************************************************************************
252 * IPStore->DeleteItem
254 static HRESULT WINAPI PStore_fnDeleteItem( IPStore* This, PST_KEY Key,
255 const GUID* pItemType, const GUID* pItemSubType, LPCWSTR szItemName,
256 PPST_PROMPTINFO pPromptInfo, DWORD dwFlags)
258 FIXME("\n");
259 return E_NOTIMPL;
262 /******************************************************************************
263 * IPStore->ReadItem
265 static HRESULT WINAPI PStore_fnReadItem( IPStore* This, PST_KEY Key,
266 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
267 DWORD *cbData, BYTE** pbData, PPST_PROMPTINFO pPromptInfo, DWORD dwFlags)
269 FIXME("%p %08x %s %s %s %p %p %p %08x\n", This, Key,
270 debugstr_guid(pItemType), debugstr_guid(pItemSubtype),
271 debugstr_w(szItemName), cbData, pbData, pPromptInfo, dwFlags);
272 return E_NOTIMPL;
275 /******************************************************************************
276 * IPStore->WriteItem
278 static HRESULT WINAPI PStore_fnWriteItem( IPStore* This, PST_KEY Key,
279 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
280 DWORD cbData, BYTE* ppbData, PPST_PROMPTINFO pPromptInfo,
281 DWORD dwDefaultConfirmationStyle, DWORD dwFlags)
283 FIXME("%p %08x %s %s %s %d %p %p %08x\n", This, Key,
284 debugstr_guid(pItemType), debugstr_guid(pItemSubtype),
285 debugstr_w(szItemName), cbData, ppbData, pPromptInfo, dwFlags);
286 return E_NOTIMPL;
289 /******************************************************************************
290 * IPStore->OpenItem
292 static HRESULT WINAPI PStore_fnOpenItem( IPStore* This, PST_KEY Key,
293 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
294 PST_ACCESSMODE ModeFlags, PPST_PROMPTINFO pProomptInfo, DWORD dwFlags )
296 FIXME("%p %08x %s %s %p %08x %p %08x\n", This, Key,
297 debugstr_guid(pItemType), debugstr_guid(pItemSubtype),
298 debugstr_w(szItemName), ModeFlags, pProomptInfo, dwFlags);
299 return E_NOTIMPL;
302 /******************************************************************************
303 * IPStore->CloseItem
305 static HRESULT WINAPI PStore_fnCloseItem( IPStore* This, PST_KEY Key,
306 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR* szItemName,
307 DWORD dwFlags)
309 FIXME("\n");
310 return E_NOTIMPL;
313 /******************************************************************************
314 * IPStore->EnumItems
316 static HRESULT WINAPI PStore_fnEnumItems( IPStore* This, PST_KEY Key,
317 const GUID* pItemType, const GUID* pItemSubtype, DWORD dwFlags,
318 IEnumPStoreItems** ppenum)
320 FIXME("\n");
321 return E_NOTIMPL;
325 static const IPStoreVtbl pstores_vtbl =
327 PStore_fnQueryInterface,
328 PStore_fnAddRef,
329 PStore_fnRelease,
330 PStore_fnGetInfo,
331 PStore_fnGetProvParam,
332 PStore_fnSetProvParam,
333 PStore_fnCreateType,
334 PStore_fnGetTypeInfo,
335 PStore_fnDeleteType,
336 PStore_fnCreateSubtype,
337 PStore_fnGetSubtypeInfo,
338 PStore_fnDeleteSubtype,
339 PStore_fnReadAccessRuleset,
340 PStore_fnWriteAccessRuleset,
341 PStore_fnEnumTypes,
342 PStore_fnEnumSubtypes,
343 PStore_fnDeleteItem,
344 PStore_fnReadItem,
345 PStore_fnWriteItem,
346 PStore_fnOpenItem,
347 PStore_fnCloseItem,
348 PStore_fnEnumItems
351 HRESULT WINAPI PStoreCreateInstance( IPStore** ppProvider,
352 PST_PROVIDERID* pProviderID, void* pReserved, DWORD dwFlags)
354 PStore_impl *ips;
356 TRACE("%p %s %p %08x\n", ppProvider, debugstr_guid(pProviderID), pReserved, dwFlags);
358 ips = HeapAlloc( GetProcessHeap(), 0, sizeof (PStore_impl) );
359 if( !ips )
360 return E_OUTOFMEMORY;
362 ips->lpVtbl = &pstores_vtbl;
363 ips->ref = 1;
365 *ppProvider = (IPStore*) ips;
367 return S_OK;
370 HRESULT WINAPI DllRegisterServer(void)
372 FIXME("\n");
373 return S_OK;
376 HRESULT WINAPI DllUnregisterServer(void)
378 FIXME("\n");
379 return S_OK;
382 /***********************************************************************
383 * DllGetClassObject (PSTOREC.@)
385 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
387 FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
388 return CLASS_E_CLASSNOTAVAILABLE;
391 HRESULT WINAPI DllCanUnloadNow(void)
393 FIXME("\n");
394 return S_OK;