tools: Assume that FreeType supports FT_Load_Sfnt_Table.
[wine/multimedia.git] / dlls / pstorec / pstorec.c
blobb2e729babdad0ffb3b96b7c0eaf30f3a6cd09774
1 /*
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
21 #include <stdarg.h>
23 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
28 #include "pstore.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(pstores);
34 typedef struct
36 IPStore IPStore_iface;
37 LONG ref;
38 } PStore_impl;
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);
49 switch (fdwReason)
51 case DLL_WINE_PREATTACH:
52 return FALSE; /* prefer native version */
53 case DLL_PROCESS_ATTACH:
54 DisableThreadLibraryCalls(hinst);
55 break;
56 case DLL_PROCESS_DETACH:
57 break;
59 return TRUE;
62 /**************************************************************************
63 * IPStore->QueryInterface
65 static HRESULT WINAPI PStore_fnQueryInterface(
66 IPStore* iface,
67 REFIID riid,
68 LPVOID *ppvObj)
70 PStore_impl *This = impl_from_IPStore(iface);
72 TRACE("%p %s\n",This,debugstr_guid(riid));
74 *ppvObj = NULL;
76 if (IsEqualIID(riid, &IID_IUnknown))
78 *ppvObj = This;
81 if (*ppvObj)
83 IUnknown_AddRef((IUnknown*)(*ppvObj));
84 return S_OK;
86 TRACE("-- Interface: E_NOINTERFACE\n");
87 return E_NOINTERFACE;
90 /******************************************************************************
91 * IPStore->AddRef
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 /******************************************************************************
103 * IPStore->Release
105 static ULONG WINAPI PStore_fnRelease(IPStore* iface)
107 PStore_impl *This = impl_from_IPStore(iface);
108 LONG ref;
110 TRACE("%p %u\n", This, This->ref);
112 ref = InterlockedDecrement( &This->ref );
113 if( !ref )
114 HeapFree( GetProcessHeap(), 0, This );
116 return ref;
119 /******************************************************************************
120 * IPStore->GetInfo
122 static HRESULT WINAPI PStore_fnGetInfo( IPStore* iface, PPST_PROVIDERINFO* ppProperties)
124 FIXME("\n");
125 return E_NOTIMPL;
128 /******************************************************************************
129 * IPStore->GetProvParam
131 static HRESULT WINAPI PStore_fnGetProvParam( IPStore* iface,
132 DWORD dwParam, DWORD* pcbData, BYTE** ppbData, DWORD dwFlags)
134 FIXME("\n");
135 return E_NOTIMPL;
138 /******************************************************************************
139 * IPStore->SetProvParam
141 static HRESULT WINAPI PStore_fnSetProvParam( IPStore* This,
142 DWORD dwParam, DWORD cbData, BYTE* pbData, DWORD* dwFlags)
144 FIXME("\n");
145 return E_NOTIMPL;
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);
157 return E_NOTIMPL;
160 /******************************************************************************
161 * IPStore->GetTypeInfo
163 static HRESULT WINAPI PStore_fnGetTypeInfo( IPStore* This,
164 PST_KEY Key, const GUID* pType, PPST_TYPEINFO** ppInfo, DWORD dwFlags)
166 FIXME("\n");
167 return E_NOTIMPL;
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);
177 return E_NOTIMPL;
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);
189 return E_NOTIMPL;
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)
199 FIXME("\n");
200 return E_NOTIMPL;
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);
211 return E_NOTIMPL;
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)
221 FIXME("\n");
222 return E_NOTIMPL;
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)
232 FIXME("\n");
233 return E_NOTIMPL;
236 /******************************************************************************
237 * IPStore->EnumTypes
239 static HRESULT WINAPI PStore_fnEnumTypes( IPStore* This, PST_KEY Key,
240 DWORD dwFlags, IEnumPStoreTypes** ppenum)
242 FIXME("\n");
243 return E_NOTIMPL;
246 /******************************************************************************
247 * IPStore->EnumSubtypes
249 static HRESULT WINAPI PStore_fnEnumSubtypes( IPStore* This, PST_KEY Key,
250 const GUID* pType, DWORD dwFlags, IEnumPStoreTypes** ppenum)
252 FIXME("\n");
253 return E_NOTIMPL;
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)
263 FIXME("\n");
264 return E_NOTIMPL;
267 /******************************************************************************
268 * IPStore->ReadItem
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);
277 return E_NOTIMPL;
280 /******************************************************************************
281 * IPStore->WriteItem
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);
291 return E_NOTIMPL;
294 /******************************************************************************
295 * IPStore->OpenItem
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 %p %08x %p %08x\n", This, Key,
302 debugstr_guid(pItemType), debugstr_guid(pItemSubtype),
303 debugstr_w(szItemName), ModeFlags, pProomptInfo, dwFlags);
304 return E_NOTIMPL;
307 /******************************************************************************
308 * IPStore->CloseItem
310 static HRESULT WINAPI PStore_fnCloseItem( IPStore* This, PST_KEY Key,
311 const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR* szItemName,
312 DWORD dwFlags)
314 FIXME("\n");
315 return E_NOTIMPL;
318 /******************************************************************************
319 * IPStore->EnumItems
321 static HRESULT WINAPI PStore_fnEnumItems( IPStore* This, PST_KEY Key,
322 const GUID* pItemType, const GUID* pItemSubtype, DWORD dwFlags,
323 IEnumPStoreItems** ppenum)
325 FIXME("\n");
326 return E_NOTIMPL;
330 static const IPStoreVtbl pstores_vtbl =
332 PStore_fnQueryInterface,
333 PStore_fnAddRef,
334 PStore_fnRelease,
335 PStore_fnGetInfo,
336 PStore_fnGetProvParam,
337 PStore_fnSetProvParam,
338 PStore_fnCreateType,
339 PStore_fnGetTypeInfo,
340 PStore_fnDeleteType,
341 PStore_fnCreateSubtype,
342 PStore_fnGetSubtypeInfo,
343 PStore_fnDeleteSubtype,
344 PStore_fnReadAccessRuleset,
345 PStore_fnWriteAccessRuleset,
346 PStore_fnEnumTypes,
347 PStore_fnEnumSubtypes,
348 PStore_fnDeleteItem,
349 PStore_fnReadItem,
350 PStore_fnWriteItem,
351 PStore_fnOpenItem,
352 PStore_fnCloseItem,
353 PStore_fnEnumItems
356 HRESULT WINAPI PStoreCreateInstance( IPStore** ppProvider,
357 PST_PROVIDERID* pProviderID, void* pReserved, DWORD dwFlags)
359 PStore_impl *ips;
361 TRACE("%p %s %p %08x\n", ppProvider, debugstr_guid(pProviderID), pReserved, dwFlags);
363 ips = HeapAlloc( GetProcessHeap(), 0, sizeof (PStore_impl) );
364 if( !ips )
365 return E_OUTOFMEMORY;
367 ips->IPStore_iface.lpVtbl = &pstores_vtbl;
368 ips->ref = 1;
370 *ppProvider = (IPStore*) ips;
372 return S_OK;
375 HRESULT WINAPI DllRegisterServer(void)
377 FIXME("\n");
378 return S_OK;
381 HRESULT WINAPI DllUnregisterServer(void)
383 FIXME("\n");
384 return S_OK;
387 /***********************************************************************
388 * DllGetClassObject (PSTOREC.@)
390 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
392 FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
393 return CLASS_E_CLASSNOTAVAILABLE;
396 HRESULT WINAPI DllCanUnloadNow(void)
398 return S_OK;