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 IPStore IPStore_iface;
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);
51 case DLL_WINE_PREATTACH:
52 return FALSE; /* prefer native version */
53 case DLL_PROCESS_ATTACH:
54 DisableThreadLibraryCalls(hinst);
56 case DLL_PROCESS_DETACH:
62 /**************************************************************************
63 * IPStore->QueryInterface
65 static HRESULT WINAPI PStore_fnQueryInterface(
70 PStore_impl *This = impl_from_IPStore(iface);
72 TRACE("%p %s\n",This,debugstr_guid(riid));
76 if (IsEqualIID(riid, &IID_IUnknown))
83 IUnknown_AddRef((IUnknown*)(*ppvObj));
86 TRACE("-- Interface: E_NOINTERFACE\n");
90 /******************************************************************************
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 /******************************************************************************
105 static ULONG WINAPI PStore_fnRelease(IPStore* iface)
107 PStore_impl *This = impl_from_IPStore(iface);
110 TRACE("%p %u\n", This, This->ref);
112 ref = InterlockedDecrement( &This->ref );
114 HeapFree( GetProcessHeap(), 0, This );
119 /******************************************************************************
122 static HRESULT WINAPI PStore_fnGetInfo( IPStore* iface, PPST_PROVIDERINFO* ppProperties)
128 /******************************************************************************
129 * IPStore->GetProvParam
131 static HRESULT WINAPI PStore_fnGetProvParam( IPStore* iface,
132 DWORD dwParam, DWORD* pcbData, BYTE** ppbData, DWORD dwFlags)
138 /******************************************************************************
139 * IPStore->SetProvParam
141 static HRESULT WINAPI PStore_fnSetProvParam( IPStore* This,
142 DWORD dwParam, DWORD cbData, BYTE* pbData, DWORD* dwFlags)
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);
160 /******************************************************************************
161 * IPStore->GetTypeInfo
163 static HRESULT WINAPI PStore_fnGetTypeInfo( IPStore* This,
164 PST_KEY Key, const GUID* pType, PPST_TYPEINFO** ppInfo, DWORD dwFlags)
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);
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);
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)
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);
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)
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)
236 /******************************************************************************
239 static HRESULT WINAPI PStore_fnEnumTypes( IPStore* This, PST_KEY Key,
240 DWORD dwFlags, IEnumPStoreTypes** ppenum)
246 /******************************************************************************
247 * IPStore->EnumSubtypes
249 static HRESULT WINAPI PStore_fnEnumSubtypes( IPStore* This, PST_KEY Key,
250 const GUID* pType, DWORD dwFlags, IEnumPStoreTypes** ppenum)
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)
267 /******************************************************************************
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);
280 /******************************************************************************
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);
294 /******************************************************************************
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);
306 /******************************************************************************
309 static HRESULT WINAPI PStore_fnCloseItem( IPStore* This, PST_KEY Key,
310 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR* szItemName,
317 /******************************************************************************
320 static HRESULT WINAPI PStore_fnEnumItems( IPStore* This, PST_KEY Key,
321 const GUID* pItemType, const GUID* pItemSubtype, DWORD dwFlags,
322 IEnumPStoreItems** ppenum)
329 static const IPStoreVtbl pstores_vtbl =
331 PStore_fnQueryInterface,
335 PStore_fnGetProvParam,
336 PStore_fnSetProvParam,
338 PStore_fnGetTypeInfo,
340 PStore_fnCreateSubtype,
341 PStore_fnGetSubtypeInfo,
342 PStore_fnDeleteSubtype,
343 PStore_fnReadAccessRuleset,
344 PStore_fnWriteAccessRuleset,
346 PStore_fnEnumSubtypes,
355 HRESULT WINAPI PStoreCreateInstance( IPStore** ppProvider,
356 PST_PROVIDERID* pProviderID, void* pReserved, DWORD dwFlags)
360 TRACE("%p %s %p %08x\n", ppProvider, debugstr_guid(pProviderID), pReserved, dwFlags);
362 ips = HeapAlloc( GetProcessHeap(), 0, sizeof (PStore_impl) );
364 return E_OUTOFMEMORY;
366 ips->IPStore_iface.lpVtbl = &pstores_vtbl;
369 *ppProvider = (IPStore*) ips;
374 HRESULT WINAPI DllRegisterServer(void)
380 HRESULT WINAPI DllUnregisterServer(void)
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)