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
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(pstores);
36 const IPStoreVtbl *lpVtbl;
40 BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad)
42 TRACE("%p %x %p\n", hinst, fdwReason, fImpLoad);
46 case DLL_WINE_PREATTACH:
47 return FALSE; /* prefer native version */
48 case DLL_PROCESS_ATTACH:
49 DisableThreadLibraryCalls(hinst);
51 case DLL_PROCESS_DETACH:
57 /**************************************************************************
58 * IPStore->QueryInterface
60 static HRESULT WINAPI PStore_fnQueryInterface(
65 PStore_impl *This = (PStore_impl *)iface;
67 TRACE("%p %s\n",This,debugstr_guid(riid));
71 if (IsEqualIID(riid, &IID_IUnknown))
78 IUnknown_AddRef((IUnknown*)(*ppvObj));
81 TRACE("-- Interface: E_NOINTERFACE\n");
85 /******************************************************************************
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 /******************************************************************************
100 static ULONG WINAPI PStore_fnRelease(IPStore* iface)
102 PStore_impl *This = (PStore_impl *)iface;
105 TRACE("%p %u\n", This, This->ref);
107 ref = InterlockedDecrement( &This->ref );
109 HeapFree( GetProcessHeap(), 0, This );
114 /******************************************************************************
117 static HRESULT WINAPI PStore_fnGetInfo( IPStore* iface, PPST_PROVIDERINFO* ppProperties)
123 /******************************************************************************
124 * IPStore->GetProvParam
126 static HRESULT WINAPI PStore_fnGetProvParam( IPStore* iface,
127 DWORD dwParam, DWORD* pcbData, BYTE** ppbData, DWORD dwFlags)
133 /******************************************************************************
134 * IPStore->SetProvParam
136 static HRESULT WINAPI PStore_fnSetProvParam( IPStore* This,
137 DWORD dwParam, DWORD cbData, BYTE* pbData, DWORD* dwFlags)
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);
155 /******************************************************************************
156 * IPStore->GetTypeInfo
158 static HRESULT WINAPI PStore_fnGetTypeInfo( IPStore* This,
159 PST_KEY Key, const GUID* pType, PPST_TYPEINFO** ppInfo, DWORD dwFlags)
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);
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);
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)
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);
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)
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)
231 /******************************************************************************
234 static HRESULT WINAPI PStore_fnEnumTypes( IPStore* This, PST_KEY Key,
235 DWORD dwFlags, IEnumPStoreTypes** ppenum)
241 /******************************************************************************
242 * IPStore->EnumSubtypes
244 static HRESULT WINAPI PStore_fnEnumSubtypes( IPStore* This, PST_KEY Key,
245 const GUID* pType, DWORD dwFlags, IEnumPStoreTypes** ppenum)
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)
262 /******************************************************************************
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_PROMPTIFO 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);
275 /******************************************************************************
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_PROMPTIFO 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);
289 /******************************************************************************
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_PROMPTIFO 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);
302 /******************************************************************************
305 static HRESULT WINAPI PStore_fnCloseItem( IPStore* This, PST_KEY Key,
306 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR* szItemName,
313 /******************************************************************************
316 static HRESULT WINAPI PStore_fnEnumItems( IPStore* This, PST_KEY Key,
317 const GUID* pItemType, const GUID* pItemSubtype, DWORD dwFlags,
318 IEnumPStoreItems** ppenum)
325 static const IPStoreVtbl pstores_vtbl =
327 PStore_fnQueryInterface,
331 PStore_fnGetProvParam,
332 PStore_fnSetProvParam,
334 PStore_fnGetTypeInfo,
336 PStore_fnCreateSubtype,
337 PStore_fnGetSubtypeInfo,
338 PStore_fnDeleteSubtype,
339 PStore_fnReadAccessRuleset,
340 PStore_fnWriteAccessRuleset,
342 PStore_fnEnumSubtypes,
351 HRESULT WINAPI PStoreCreateInstance( IPStore** ppProvider,
352 PST_PROVIDERID* pProviderID, void* pReserved, DWORD dwFlags)
356 TRACE("%p %s %p %08x\n", ppProvider, debugstr_guid(pProviderID), pReserved, dwFlags);
358 ips = HeapAlloc( GetProcessHeap(), 0, sizeof (PStore_impl) );
360 return E_OUTOFMEMORY;
362 ips->lpVtbl = &pstores_vtbl;
365 *ppProvider = (IPStore*) ips;
370 HRESULT WINAPI DllRegisterServer(void)
376 HRESULT WINAPI DllUnregisterServer(void)
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)