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
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(pstores
);
37 IPStore IPStore_iface
;
41 static inline PStore_impl
*impl_from_IPStore(IPStore
*iface
)
43 return CONTAINING_RECORD(iface
, PStore_impl
, IPStore_iface
);
46 BOOL WINAPI
DllMain(HINSTANCE hinst
, DWORD fdwReason
, LPVOID fImpLoad
)
48 TRACE("%p %x %p\n", hinst
, fdwReason
, fImpLoad
);
52 case DLL_WINE_PREATTACH
:
53 return FALSE
; /* prefer native version */
54 case DLL_PROCESS_ATTACH
:
55 DisableThreadLibraryCalls(hinst
);
61 /**************************************************************************
62 * IPStore->QueryInterface
64 static HRESULT WINAPI
PStore_fnQueryInterface(
69 PStore_impl
*This
= impl_from_IPStore(iface
);
71 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObj
);
75 if (IsEqualIID(riid
, &IID_IPStore
) || IsEqualIID(riid
, &IID_IUnknown
))
77 *ppvObj
= &This
->IPStore_iface
;
82 IUnknown_AddRef((IUnknown
*)(*ppvObj
));
85 TRACE("-- Interface: E_NOINTERFACE\n");
89 /******************************************************************************
92 static ULONG WINAPI
PStore_fnAddRef(IPStore
* iface
)
94 PStore_impl
*This
= impl_from_IPStore(iface
);
96 TRACE("%p %u\n", This
, This
->ref
);
98 return InterlockedIncrement( &This
->ref
);
101 /******************************************************************************
104 static ULONG WINAPI
PStore_fnRelease(IPStore
* iface
)
106 PStore_impl
*This
= impl_from_IPStore(iface
);
109 TRACE("%p %u\n", This
, This
->ref
);
111 ref
= InterlockedDecrement( &This
->ref
);
113 HeapFree( GetProcessHeap(), 0, This
);
118 /******************************************************************************
121 static HRESULT WINAPI
PStore_fnGetInfo( IPStore
* iface
, PPST_PROVIDERINFO
* ppProperties
)
127 /******************************************************************************
128 * IPStore->GetProvParam
130 static HRESULT WINAPI
PStore_fnGetProvParam( IPStore
* iface
,
131 DWORD dwParam
, DWORD
* pcbData
, BYTE
** ppbData
, DWORD dwFlags
)
137 /******************************************************************************
138 * IPStore->SetProvParam
140 static HRESULT WINAPI
PStore_fnSetProvParam( IPStore
* This
,
141 DWORD dwParam
, DWORD cbData
, BYTE
* pbData
, DWORD
* dwFlags
)
147 /******************************************************************************
148 * IPStore->CreateType
150 static HRESULT WINAPI
PStore_fnCreateType( IPStore
* This
,
151 PST_KEY Key
, const GUID
* pType
, PPST_TYPEINFO pInfo
, DWORD dwFlags
)
153 FIXME("%p %08x %s %p(%d,%s) %08x\n", This
, Key
, debugstr_guid(pType
),
154 pInfo
, pInfo
->cbSize
, debugstr_w(pInfo
->szDisplayName
), dwFlags
);
159 /******************************************************************************
160 * IPStore->GetTypeInfo
162 static HRESULT WINAPI
PStore_fnGetTypeInfo( IPStore
* This
,
163 PST_KEY Key
, const GUID
* pType
, PPST_TYPEINFO
** ppInfo
, DWORD dwFlags
)
169 /******************************************************************************
170 * IPStore->DeleteType
172 static HRESULT WINAPI
PStore_fnDeleteType( IPStore
* This
,
173 PST_KEY Key
, const GUID
* pType
, DWORD dwFlags
)
175 FIXME("%p %d %s %08x\n", This
, Key
, debugstr_guid(pType
), dwFlags
);
179 /******************************************************************************
180 * IPStore->CreateSubtype
182 static HRESULT WINAPI
PStore_fnCreateSubtype( IPStore
* This
,
183 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
,
184 PPST_TYPEINFO pInfo
, PPST_ACCESSRULESET pRules
, DWORD dwFlags
)
186 FIXME("%p %08x %s %s %p %p %08x\n", This
, Key
, debugstr_guid(pType
),
187 debugstr_guid(pSubtype
), pInfo
, pRules
, dwFlags
);
191 /******************************************************************************
192 * IPStore->GetSubtypeInfo
194 static HRESULT WINAPI
PStore_fnGetSubtypeInfo( IPStore
* This
,
195 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
,
196 PPST_TYPEINFO
** ppInfo
, DWORD dwFlags
)
202 /******************************************************************************
203 * IPStore->DeleteSubtype
205 static HRESULT WINAPI
PStore_fnDeleteSubtype( IPStore
* This
,
206 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
, DWORD dwFlags
)
208 FIXME("%p %u %s %s %08x\n", This
, Key
,
209 debugstr_guid(pType
), debugstr_guid(pSubtype
), dwFlags
);
213 /******************************************************************************
214 * IPStore->ReadAccessRuleset
216 static HRESULT WINAPI
PStore_fnReadAccessRuleset( IPStore
* This
,
217 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
, PPST_TYPEINFO pInfo
,
218 PPST_ACCESSRULESET
** ppRules
, DWORD dwFlags
)
224 /******************************************************************************
225 * IPStore->WriteAccessRuleSet
227 static HRESULT WINAPI
PStore_fnWriteAccessRuleset( IPStore
* This
,
228 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
,
229 PPST_TYPEINFO pInfo
, PPST_ACCESSRULESET pRules
, DWORD dwFlags
)
235 /******************************************************************************
238 static HRESULT WINAPI
PStore_fnEnumTypes( IPStore
* This
, PST_KEY Key
,
239 DWORD dwFlags
, IEnumPStoreTypes
** ppenum
)
245 /******************************************************************************
246 * IPStore->EnumSubtypes
248 static HRESULT WINAPI
PStore_fnEnumSubtypes( IPStore
* This
, PST_KEY Key
,
249 const GUID
* pType
, DWORD dwFlags
, IEnumPStoreTypes
** ppenum
)
255 /******************************************************************************
256 * IPStore->DeleteItem
258 static HRESULT WINAPI
PStore_fnDeleteItem( IPStore
* This
, PST_KEY Key
,
259 const GUID
* pItemType
, const GUID
* pItemSubType
, LPCWSTR szItemName
,
260 PPST_PROMPTINFO pPromptInfo
, DWORD dwFlags
)
266 /******************************************************************************
269 static HRESULT WINAPI
PStore_fnReadItem( IPStore
* This
, PST_KEY Key
,
270 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR szItemName
,
271 DWORD
*cbData
, BYTE
** pbData
, PPST_PROMPTINFO pPromptInfo
, DWORD dwFlags
)
273 FIXME("%p %08x %s %s %s %p %p %p %08x\n", This
, Key
,
274 debugstr_guid(pItemType
), debugstr_guid(pItemSubtype
),
275 debugstr_w(szItemName
), cbData
, pbData
, pPromptInfo
, dwFlags
);
279 /******************************************************************************
282 static HRESULT WINAPI
PStore_fnWriteItem( IPStore
* This
, PST_KEY Key
,
283 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR szItemName
,
284 DWORD cbData
, BYTE
* ppbData
, PPST_PROMPTINFO pPromptInfo
,
285 DWORD dwDefaultConfirmationStyle
, DWORD dwFlags
)
287 FIXME("%p %08x %s %s %s %d %p %p %08x\n", This
, Key
,
288 debugstr_guid(pItemType
), debugstr_guid(pItemSubtype
),
289 debugstr_w(szItemName
), cbData
, ppbData
, pPromptInfo
, dwFlags
);
293 /******************************************************************************
296 static HRESULT WINAPI
PStore_fnOpenItem( IPStore
* This
, PST_KEY Key
,
297 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR szItemName
,
298 PST_ACCESSMODE ModeFlags
, PPST_PROMPTINFO pPromptInfo
, DWORD dwFlags
)
300 FIXME("(%p,%08x,%s,%s,%s,%08x,%p,%08x) stub\n", This
, Key
, debugstr_guid(pItemType
),
301 debugstr_guid(pItemSubtype
), debugstr_w(szItemName
), ModeFlags
, pPromptInfo
, dwFlags
);
305 /******************************************************************************
308 static HRESULT WINAPI
PStore_fnCloseItem( IPStore
* This
, PST_KEY Key
,
309 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR
* szItemName
,
316 /******************************************************************************
319 static HRESULT WINAPI
PStore_fnEnumItems( IPStore
* This
, PST_KEY Key
,
320 const GUID
* pItemType
, const GUID
* pItemSubtype
, DWORD dwFlags
,
321 IEnumPStoreItems
** ppenum
)
328 static const IPStoreVtbl pstores_vtbl
=
330 PStore_fnQueryInterface
,
334 PStore_fnGetProvParam
,
335 PStore_fnSetProvParam
,
337 PStore_fnGetTypeInfo
,
339 PStore_fnCreateSubtype
,
340 PStore_fnGetSubtypeInfo
,
341 PStore_fnDeleteSubtype
,
342 PStore_fnReadAccessRuleset
,
343 PStore_fnWriteAccessRuleset
,
345 PStore_fnEnumSubtypes
,
354 HRESULT WINAPI
PStoreCreateInstance( IPStore
** ppProvider
,
355 PST_PROVIDERID
* pProviderID
, void* pReserved
, DWORD dwFlags
)
359 TRACE("%p %s %p %08x\n", ppProvider
, debugstr_guid(pProviderID
), pReserved
, dwFlags
);
361 ips
= HeapAlloc( GetProcessHeap(), 0, sizeof (PStore_impl
) );
363 return E_OUTOFMEMORY
;
365 ips
->IPStore_iface
.lpVtbl
= &pstores_vtbl
;
368 *ppProvider
= &ips
->IPStore_iface
;
373 HRESULT WINAPI
DllRegisterServer(void)
379 HRESULT WINAPI
DllUnregisterServer(void)
385 /***********************************************************************
386 * DllGetClassObject (PSTOREC.@)
388 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID iid
, LPVOID
*ppv
)
390 FIXME("%s %s %p\n", debugstr_guid(rclsid
), debugstr_guid(iid
), ppv
);
391 return CLASS_E_CLASSNOTAVAILABLE
;
394 HRESULT WINAPI
DllCanUnloadNow(void)