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 /**************************************************************************
47 * IPStore->QueryInterface
49 static HRESULT WINAPI
PStore_fnQueryInterface(
54 PStore_impl
*This
= impl_from_IPStore(iface
);
56 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObj
);
60 if (IsEqualIID(riid
, &IID_IPStore
) || IsEqualIID(riid
, &IID_IUnknown
))
62 *ppvObj
= &This
->IPStore_iface
;
67 IUnknown_AddRef((IUnknown
*)(*ppvObj
));
70 TRACE("-- Interface: E_NOINTERFACE\n");
74 /******************************************************************************
77 static ULONG WINAPI
PStore_fnAddRef(IPStore
* iface
)
79 PStore_impl
*This
= impl_from_IPStore(iface
);
81 TRACE("%p %u\n", This
, This
->ref
);
83 return InterlockedIncrement( &This
->ref
);
86 /******************************************************************************
89 static ULONG WINAPI
PStore_fnRelease(IPStore
* iface
)
91 PStore_impl
*This
= impl_from_IPStore(iface
);
94 TRACE("%p %u\n", This
, This
->ref
);
96 ref
= InterlockedDecrement( &This
->ref
);
98 HeapFree( GetProcessHeap(), 0, This
);
103 /******************************************************************************
106 static HRESULT WINAPI
PStore_fnGetInfo( IPStore
* iface
, PPST_PROVIDERINFO
* ppProperties
)
112 /******************************************************************************
113 * IPStore->GetProvParam
115 static HRESULT WINAPI
PStore_fnGetProvParam( IPStore
* iface
,
116 DWORD dwParam
, DWORD
* pcbData
, BYTE
** ppbData
, DWORD dwFlags
)
122 /******************************************************************************
123 * IPStore->SetProvParam
125 static HRESULT WINAPI
PStore_fnSetProvParam( IPStore
* This
,
126 DWORD dwParam
, DWORD cbData
, BYTE
* pbData
, DWORD
* dwFlags
)
132 /******************************************************************************
133 * IPStore->CreateType
135 static HRESULT WINAPI
PStore_fnCreateType( IPStore
* This
,
136 PST_KEY Key
, const GUID
* pType
, PPST_TYPEINFO pInfo
, DWORD dwFlags
)
138 FIXME("%p %08x %s %p(%d,%s) %08x\n", This
, Key
, debugstr_guid(pType
),
139 pInfo
, pInfo
->cbSize
, debugstr_w(pInfo
->szDisplayName
), dwFlags
);
144 /******************************************************************************
145 * IPStore->GetTypeInfo
147 static HRESULT WINAPI
PStore_fnGetTypeInfo( IPStore
* This
,
148 PST_KEY Key
, const GUID
* pType
, PPST_TYPEINFO
** ppInfo
, DWORD dwFlags
)
154 /******************************************************************************
155 * IPStore->DeleteType
157 static HRESULT WINAPI
PStore_fnDeleteType( IPStore
* This
,
158 PST_KEY Key
, const GUID
* pType
, DWORD dwFlags
)
160 FIXME("%p %d %s %08x\n", This
, Key
, debugstr_guid(pType
), dwFlags
);
164 /******************************************************************************
165 * IPStore->CreateSubtype
167 static HRESULT WINAPI
PStore_fnCreateSubtype( IPStore
* This
,
168 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
,
169 PPST_TYPEINFO pInfo
, PPST_ACCESSRULESET pRules
, DWORD dwFlags
)
171 FIXME("%p %08x %s %s %p %p %08x\n", This
, Key
, debugstr_guid(pType
),
172 debugstr_guid(pSubtype
), pInfo
, pRules
, dwFlags
);
176 /******************************************************************************
177 * IPStore->GetSubtypeInfo
179 static HRESULT WINAPI
PStore_fnGetSubtypeInfo( IPStore
* This
,
180 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
,
181 PPST_TYPEINFO
** ppInfo
, DWORD dwFlags
)
187 /******************************************************************************
188 * IPStore->DeleteSubtype
190 static HRESULT WINAPI
PStore_fnDeleteSubtype( IPStore
* This
,
191 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
, DWORD dwFlags
)
193 FIXME("%p %u %s %s %08x\n", This
, Key
,
194 debugstr_guid(pType
), debugstr_guid(pSubtype
), dwFlags
);
198 /******************************************************************************
199 * IPStore->ReadAccessRuleset
201 static HRESULT WINAPI
PStore_fnReadAccessRuleset( IPStore
* This
,
202 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
, PPST_TYPEINFO pInfo
,
203 PPST_ACCESSRULESET
** ppRules
, DWORD dwFlags
)
209 /******************************************************************************
210 * IPStore->WriteAccessRuleSet
212 static HRESULT WINAPI
PStore_fnWriteAccessRuleset( IPStore
* This
,
213 PST_KEY Key
, const GUID
* pType
, const GUID
* pSubtype
,
214 PPST_TYPEINFO pInfo
, PPST_ACCESSRULESET pRules
, DWORD dwFlags
)
220 /******************************************************************************
223 static HRESULT WINAPI
PStore_fnEnumTypes( IPStore
* This
, PST_KEY Key
,
224 DWORD dwFlags
, IEnumPStoreTypes
** ppenum
)
230 /******************************************************************************
231 * IPStore->EnumSubtypes
233 static HRESULT WINAPI
PStore_fnEnumSubtypes( IPStore
* This
, PST_KEY Key
,
234 const GUID
* pType
, DWORD dwFlags
, IEnumPStoreTypes
** ppenum
)
240 /******************************************************************************
241 * IPStore->DeleteItem
243 static HRESULT WINAPI
PStore_fnDeleteItem( IPStore
* This
, PST_KEY Key
,
244 const GUID
* pItemType
, const GUID
* pItemSubType
, LPCWSTR szItemName
,
245 PPST_PROMPTINFO pPromptInfo
, DWORD dwFlags
)
251 /******************************************************************************
254 static HRESULT WINAPI
PStore_fnReadItem( IPStore
* This
, PST_KEY Key
,
255 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR szItemName
,
256 DWORD
*cbData
, BYTE
** pbData
, PPST_PROMPTINFO pPromptInfo
, DWORD dwFlags
)
258 FIXME("%p %08x %s %s %s %p %p %p %08x\n", This
, Key
,
259 debugstr_guid(pItemType
), debugstr_guid(pItemSubtype
),
260 debugstr_w(szItemName
), cbData
, pbData
, pPromptInfo
, dwFlags
);
264 /******************************************************************************
267 static HRESULT WINAPI
PStore_fnWriteItem( IPStore
* This
, PST_KEY Key
,
268 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR szItemName
,
269 DWORD cbData
, BYTE
* ppbData
, PPST_PROMPTINFO pPromptInfo
,
270 DWORD dwDefaultConfirmationStyle
, DWORD dwFlags
)
272 FIXME("%p %08x %s %s %s %d %p %p %08x\n", This
, Key
,
273 debugstr_guid(pItemType
), debugstr_guid(pItemSubtype
),
274 debugstr_w(szItemName
), cbData
, ppbData
, pPromptInfo
, dwFlags
);
278 /******************************************************************************
281 static HRESULT WINAPI
PStore_fnOpenItem( IPStore
* This
, PST_KEY Key
,
282 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR szItemName
,
283 PST_ACCESSMODE ModeFlags
, PPST_PROMPTINFO pPromptInfo
, DWORD dwFlags
)
285 FIXME("(%p,%08x,%s,%s,%s,%08x,%p,%08x) stub\n", This
, Key
, debugstr_guid(pItemType
),
286 debugstr_guid(pItemSubtype
), debugstr_w(szItemName
), ModeFlags
, pPromptInfo
, dwFlags
);
290 /******************************************************************************
293 static HRESULT WINAPI
PStore_fnCloseItem( IPStore
* This
, PST_KEY Key
,
294 const GUID
* pItemType
, const GUID
* pItemSubtype
, LPCWSTR
* szItemName
,
301 /******************************************************************************
304 static HRESULT WINAPI
PStore_fnEnumItems( IPStore
* This
, PST_KEY Key
,
305 const GUID
* pItemType
, const GUID
* pItemSubtype
, DWORD dwFlags
,
306 IEnumPStoreItems
** ppenum
)
313 static const IPStoreVtbl pstores_vtbl
=
315 PStore_fnQueryInterface
,
319 PStore_fnGetProvParam
,
320 PStore_fnSetProvParam
,
322 PStore_fnGetTypeInfo
,
324 PStore_fnCreateSubtype
,
325 PStore_fnGetSubtypeInfo
,
326 PStore_fnDeleteSubtype
,
327 PStore_fnReadAccessRuleset
,
328 PStore_fnWriteAccessRuleset
,
330 PStore_fnEnumSubtypes
,
339 HRESULT WINAPI
PStoreCreateInstance( IPStore
** ppProvider
,
340 PST_PROVIDERID
* pProviderID
, void* pReserved
, DWORD dwFlags
)
344 TRACE("%p %s %p %08x\n", ppProvider
, debugstr_guid(pProviderID
), pReserved
, dwFlags
);
346 ips
= HeapAlloc( GetProcessHeap(), 0, sizeof (PStore_impl
) );
348 return E_OUTOFMEMORY
;
350 ips
->IPStore_iface
.lpVtbl
= &pstores_vtbl
;
353 *ppProvider
= &ips
->IPStore_iface
;
358 /***********************************************************************
359 * DllGetClassObject (PSTOREC.@)
361 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID iid
, LPVOID
*ppv
)
363 FIXME("%s %s %p\n", debugstr_guid(rclsid
), debugstr_guid(iid
), ppv
);
364 return CLASS_E_CLASSNOTAVAILABLE
;