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
);
60 /**************************************************************************
61 * IPStore->QueryInterface
63 static HRESULT WINAPI
PStore_fnQueryInterface(
68 PStore_impl
*This
= impl_from_IPStore(iface
);
70 TRACE("%p %s\n",This
,debugstr_guid(riid
));
74 if (IsEqualIID(riid
, &IID_IUnknown
))
81 IUnknown_AddRef((IUnknown
*)(*ppvObj
));
84 TRACE("-- Interface: E_NOINTERFACE\n");
88 /******************************************************************************
91 static ULONG WINAPI
PStore_fnAddRef(IPStore
* iface
)
93 PStore_impl
*This
= impl_from_IPStore(iface
);
95 TRACE("%p %u\n", This
, This
->ref
);
97 return InterlockedIncrement( &This
->ref
);
100 /******************************************************************************
103 static ULONG WINAPI
PStore_fnRelease(IPStore
* iface
)
105 PStore_impl
*This
= impl_from_IPStore(iface
);
108 TRACE("%p %u\n", This
, This
->ref
);
110 ref
= InterlockedDecrement( &This
->ref
);
112 HeapFree( GetProcessHeap(), 0, This
);
117 /******************************************************************************
120 static HRESULT WINAPI
PStore_fnGetInfo( IPStore
* iface
, PPST_PROVIDERINFO
* ppProperties
)
126 /******************************************************************************
127 * IPStore->GetProvParam
129 static HRESULT WINAPI
PStore_fnGetProvParam( IPStore
* iface
,
130 DWORD dwParam
, DWORD
* pcbData
, BYTE
** ppbData
, DWORD dwFlags
)
136 /******************************************************************************
137 * IPStore->SetProvParam
139 static HRESULT WINAPI
PStore_fnSetProvParam( IPStore
* This
,
140 DWORD dwParam
, DWORD cbData
, BYTE
* pbData
, DWORD
* dwFlags
)
146 /******************************************************************************
147 * IPStore->CreateType
149 static HRESULT WINAPI
PStore_fnCreateType( IPStore
* This
,
150 PST_KEY Key
, const GUID
* pType
, PPST_TYPEINFO pInfo
, DWORD dwFlags
)
152 FIXME("%p %08x %s %p(%d,%s) %08x\n", This
, Key
, debugstr_guid(pType
),
153 pInfo
, pInfo
->cbSize
, debugstr_w(pInfo
->szDisplayName
), dwFlags
);
158 /******************************************************************************
159 * IPStore->GetTypeInfo
161 static HRESULT WINAPI
PStore_fnGetTypeInfo( IPStore
* This
,
162 PST_KEY Key
, const GUID
* pType
, PPST_TYPEINFO
** ppInfo
, DWORD dwFlags
)
168 /******************************************************************************
169 * IPStore->DeleteType
171 static HRESULT WINAPI
PStore_fnDeleteType( IPStore
* This
,
172 PST_KEY Key
, const GUID
* pType
, DWORD dwFlags
)
174 FIXME("%p %d %s %08x\n", This
, Key
, debugstr_guid(pType
), dwFlags
);
178 /******************************************************************************
179 * IPStore->CreateSubtype
181 static HRESULT WINAPI
PStore_fnCreateSubtype( IPStore
* This
,
182 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
,
183 PPST_TYPEINFO pInfo
, PPST_ACCESSRULESET pRules
, DWORD dwFlags
)
185 FIXME("%p %08x %s %s %p %p %08x\n", This
, Key
, debugstr_guid(pType
),
186 debugstr_guid(pSubtype
), pInfo
, pRules
, dwFlags
);
190 /******************************************************************************
191 * IPStore->GetSubtypeInfo
193 static HRESULT WINAPI
PStore_fnGetSubtypeInfo( IPStore
* This
,
194 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
,
195 PPST_TYPEINFO
** ppInfo
, DWORD dwFlags
)
201 /******************************************************************************
202 * IPStore->DeleteSubtype
204 static HRESULT WINAPI
PStore_fnDeleteSubtype( IPStore
* This
,
205 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
, DWORD dwFlags
)
207 FIXME("%p %u %s %s %08x\n", This
, Key
,
208 debugstr_guid(pType
), debugstr_guid(pSubtype
), dwFlags
);
212 /******************************************************************************
213 * IPStore->ReadAccessRuleset
215 static HRESULT WINAPI
PStore_fnReadAccessRuleset( IPStore
* This
,
216 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
, PPST_TYPEINFO pInfo
,
217 PPST_ACCESSRULESET
** ppRules
, DWORD dwFlags
)
223 /******************************************************************************
224 * IPStore->WriteAccessRuleSet
226 static HRESULT WINAPI
PStore_fnWriteAccessRuleset( IPStore
* This
,
227 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
,
228 PPST_TYPEINFO pInfo
, PPST_ACCESSRULESET pRules
, DWORD dwFlags
)
234 /******************************************************************************
237 static HRESULT WINAPI
PStore_fnEnumTypes( IPStore
* This
, PST_KEY Key
,
238 DWORD dwFlags
, IEnumPStoreTypes
** ppenum
)
244 /******************************************************************************
245 * IPStore->EnumSubtypes
247 static HRESULT WINAPI
PStore_fnEnumSubtypes( IPStore
* This
, PST_KEY Key
,
248 const GUID
* pType
, DWORD dwFlags
, IEnumPStoreTypes
** ppenum
)
254 /******************************************************************************
255 * IPStore->DeleteItem
257 static HRESULT WINAPI
PStore_fnDeleteItem( IPStore
* This
, PST_KEY Key
,
258 const GUID
* pItemType
, const GUID
* pItemSubType
, LPCWSTR szItemName
,
259 PPST_PROMPTINFO pPromptInfo
, DWORD dwFlags
)
265 /******************************************************************************
268 static HRESULT WINAPI
PStore_fnReadItem( IPStore
* This
, PST_KEY Key
,
269 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR szItemName
,
270 DWORD
*cbData
, BYTE
** pbData
, PPST_PROMPTINFO pPromptInfo
, DWORD dwFlags
)
272 FIXME("%p %08x %s %s %s %p %p %p %08x\n", This
, Key
,
273 debugstr_guid(pItemType
), debugstr_guid(pItemSubtype
),
274 debugstr_w(szItemName
), cbData
, pbData
, pPromptInfo
, dwFlags
);
278 /******************************************************************************
281 static HRESULT WINAPI
PStore_fnWriteItem( IPStore
* This
, PST_KEY Key
,
282 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR szItemName
,
283 DWORD cbData
, BYTE
* ppbData
, PPST_PROMPTINFO pPromptInfo
,
284 DWORD dwDefaultConfirmationStyle
, DWORD dwFlags
)
286 FIXME("%p %08x %s %s %s %d %p %p %08x\n", This
, Key
,
287 debugstr_guid(pItemType
), debugstr_guid(pItemSubtype
),
288 debugstr_w(szItemName
), cbData
, ppbData
, pPromptInfo
, dwFlags
);
292 /******************************************************************************
295 static HRESULT WINAPI
PStore_fnOpenItem( IPStore
* This
, PST_KEY Key
,
296 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR szItemName
,
297 PST_ACCESSMODE ModeFlags
, PPST_PROMPTINFO pProomptInfo
, DWORD dwFlags
)
299 FIXME("(%p,%08x,%s,%s,%s,%08x,%p,%08x) stub\n", This
, Key
, debugstr_guid(pItemType
),
300 debugstr_guid(pItemSubtype
), debugstr_w(szItemName
), ModeFlags
, pProomptInfo
, dwFlags
);
304 /******************************************************************************
307 static HRESULT WINAPI
PStore_fnCloseItem( IPStore
* This
, PST_KEY Key
,
308 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR
* szItemName
,
315 /******************************************************************************
318 static HRESULT WINAPI
PStore_fnEnumItems( IPStore
* This
, PST_KEY Key
,
319 const GUID
* pItemType
, const GUID
* pItemSubtype
, DWORD dwFlags
,
320 IEnumPStoreItems
** ppenum
)
327 static const IPStoreVtbl pstores_vtbl
=
329 PStore_fnQueryInterface
,
333 PStore_fnGetProvParam
,
334 PStore_fnSetProvParam
,
336 PStore_fnGetTypeInfo
,
338 PStore_fnCreateSubtype
,
339 PStore_fnGetSubtypeInfo
,
340 PStore_fnDeleteSubtype
,
341 PStore_fnReadAccessRuleset
,
342 PStore_fnWriteAccessRuleset
,
344 PStore_fnEnumSubtypes
,
353 HRESULT WINAPI
PStoreCreateInstance( IPStore
** ppProvider
,
354 PST_PROVIDERID
* pProviderID
, void* pReserved
, DWORD dwFlags
)
358 TRACE("%p %s %p %08x\n", ppProvider
, debugstr_guid(pProviderID
), pReserved
, dwFlags
);
360 ips
= HeapAlloc( GetProcessHeap(), 0, sizeof (PStore_impl
) );
362 return E_OUTOFMEMORY
;
364 ips
->IPStore_iface
.lpVtbl
= &pstores_vtbl
;
367 *ppProvider
= (IPStore
*) ips
;
372 HRESULT WINAPI
DllRegisterServer(void)
378 HRESULT WINAPI
DllUnregisterServer(void)
384 /***********************************************************************
385 * DllGetClassObject (PSTOREC.@)
387 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID iid
, LPVOID
*ppv
)
389 FIXME("%s %s %p\n", debugstr_guid(rclsid
), debugstr_guid(iid
), ppv
);
390 return CLASS_E_CLASSNOTAVAILABLE
;
393 HRESULT WINAPI
DllCanUnloadNow(void)