ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

pstorec.c
Go to the documentation of this file.
00001 /*
00002  * Protected Storage (pstores)
00003  *
00004  * Copyright 2004 Mike McCormack for CodeWeavers
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00019  */
00020 
00021 #include <stdarg.h>
00022 
00023 #define COBJMACROS
00024 #include "windef.h"
00025 #include "winbase.h"
00026 #include "winuser.h"
00027 #include "ole2.h"
00028 #include "pstore.h"
00029 
00030 #include "wine/debug.h"
00031 
00032 WINE_DEFAULT_DEBUG_CHANNEL(pstores);
00033 
00034 typedef struct
00035 {
00036     IPStore IPStore_iface;
00037     LONG ref;
00038 } PStore_impl;
00039 
00040 static inline PStore_impl *impl_from_IPStore(IPStore *iface)
00041 {
00042     return CONTAINING_RECORD(iface, PStore_impl, IPStore_iface);
00043 }
00044 
00045 BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad)
00046 {
00047     TRACE("%p %x %p\n", hinst, fdwReason, fImpLoad);
00048 
00049     switch (fdwReason)
00050     {
00051     case DLL_WINE_PREATTACH:
00052         return FALSE;  /* prefer native version */
00053     case DLL_PROCESS_ATTACH:
00054         DisableThreadLibraryCalls(hinst);
00055         break;
00056     case DLL_PROCESS_DETACH:
00057         break;
00058     }
00059     return TRUE;
00060 }
00061 
00062 /**************************************************************************
00063  *  IPStore->QueryInterface
00064  */
00065 static HRESULT WINAPI PStore_fnQueryInterface(
00066         IPStore* iface,
00067         REFIID riid,
00068         LPVOID *ppvObj)
00069 {
00070     PStore_impl *This = impl_from_IPStore(iface);
00071 
00072     TRACE("%p %s\n",This,debugstr_guid(riid));
00073 
00074     *ppvObj = NULL;
00075 
00076     if (IsEqualIID(riid, &IID_IUnknown))
00077     {
00078         *ppvObj = This;
00079     }
00080 
00081     if (*ppvObj)
00082     {
00083         IUnknown_AddRef((IUnknown*)(*ppvObj));
00084         return S_OK;
00085     }
00086     TRACE("-- Interface: E_NOINTERFACE\n");
00087     return E_NOINTERFACE;
00088 }
00089 
00090 /******************************************************************************
00091  * IPStore->AddRef
00092  */
00093 static ULONG WINAPI PStore_fnAddRef(IPStore* iface)
00094 {
00095     PStore_impl *This = impl_from_IPStore(iface);
00096 
00097     TRACE("%p %u\n", This, This->ref);
00098 
00099     return InterlockedIncrement( &This->ref );
00100 }
00101 
00102 /******************************************************************************
00103  * IPStore->Release
00104  */
00105 static ULONG WINAPI PStore_fnRelease(IPStore* iface)
00106 {
00107     PStore_impl *This = impl_from_IPStore(iface);
00108     LONG ref;
00109 
00110     TRACE("%p %u\n", This, This->ref);
00111 
00112     ref = InterlockedDecrement( &This->ref );
00113     if( !ref )
00114         HeapFree( GetProcessHeap(), 0, This );
00115 
00116     return ref;
00117 }
00118 
00119 /******************************************************************************
00120  * IPStore->GetInfo
00121  */
00122 static HRESULT WINAPI PStore_fnGetInfo( IPStore* iface, PPST_PROVIDERINFO* ppProperties)
00123 {
00124     FIXME("\n");
00125     return E_NOTIMPL;
00126 }
00127 
00128 /******************************************************************************
00129  * IPStore->GetProvParam
00130  */
00131 static HRESULT WINAPI PStore_fnGetProvParam( IPStore* iface,
00132     DWORD dwParam, DWORD* pcbData, BYTE** ppbData, DWORD dwFlags)
00133 {
00134     FIXME("\n");
00135     return E_NOTIMPL;
00136 }
00137 
00138 /******************************************************************************
00139  * IPStore->SetProvParam
00140  */
00141 static HRESULT WINAPI PStore_fnSetProvParam( IPStore* This,
00142     DWORD dwParam, DWORD cbData, BYTE* pbData, DWORD* dwFlags)
00143 {
00144     FIXME("\n");
00145     return E_NOTIMPL;
00146 }
00147 
00148 /******************************************************************************
00149  * IPStore->CreateType
00150  */
00151 static HRESULT WINAPI PStore_fnCreateType( IPStore* This,
00152     PST_KEY Key, const GUID* pType, PPST_TYPEINFO pInfo, DWORD dwFlags)
00153 {
00154     FIXME("%p %08x %s %p(%d,%s) %08x\n", This, Key, debugstr_guid(pType),
00155           pInfo, pInfo->cbSize, debugstr_w(pInfo->szDisplayName), dwFlags);
00156 
00157     return E_NOTIMPL;
00158 }
00159 
00160 /******************************************************************************
00161  * IPStore->GetTypeInfo
00162  */
00163 static HRESULT WINAPI PStore_fnGetTypeInfo( IPStore* This,
00164     PST_KEY Key, const GUID* pType, PPST_TYPEINFO** ppInfo, DWORD dwFlags)
00165 {
00166     FIXME("\n");
00167     return E_NOTIMPL;
00168 }
00169 
00170 /******************************************************************************
00171  * IPStore->DeleteType
00172  */
00173 static HRESULT WINAPI PStore_fnDeleteType( IPStore* This,
00174     PST_KEY Key, const GUID* pType, DWORD dwFlags)
00175 {
00176     FIXME("%p %d %s %08x\n", This, Key, debugstr_guid(pType), dwFlags);
00177     return E_NOTIMPL;
00178 }
00179 
00180 /******************************************************************************
00181  * IPStore->CreateSubtype
00182  */
00183 static HRESULT WINAPI PStore_fnCreateSubtype( IPStore* This,
00184     PST_KEY Key, const GUID* pType, const GUID* pSubtype,
00185     PPST_TYPEINFO pInfo, PPST_ACCESSRULESET pRules, DWORD dwFlags)
00186 {
00187     FIXME("%p %08x %s %s %p %p %08x\n", This, Key, debugstr_guid(pType),
00188            debugstr_guid(pSubtype), pInfo, pRules, dwFlags);
00189     return E_NOTIMPL;
00190 }
00191 
00192 /******************************************************************************
00193  * IPStore->GetSubtypeInfo
00194  */
00195 static HRESULT WINAPI PStore_fnGetSubtypeInfo( IPStore* This,
00196     PST_KEY Key, const GUID* pType, const GUID* pSubtype,
00197     PPST_TYPEINFO** ppInfo, DWORD dwFlags)
00198 {
00199     FIXME("\n");
00200     return E_NOTIMPL;
00201 }
00202 
00203 /******************************************************************************
00204  * IPStore->DeleteSubtype
00205  */
00206 static HRESULT WINAPI PStore_fnDeleteSubtype( IPStore* This,
00207     PST_KEY Key, const GUID* pType, const GUID* pSubtype, DWORD dwFlags)
00208 {
00209     FIXME("%p %u %s %s %08x\n", This, Key,
00210           debugstr_guid(pType), debugstr_guid(pSubtype), dwFlags);
00211     return E_NOTIMPL;
00212 }
00213 
00214 /******************************************************************************
00215  * IPStore->ReadAccessRuleset
00216  */
00217 static HRESULT WINAPI PStore_fnReadAccessRuleset( IPStore* This,
00218     PST_KEY Key, const GUID* pType, const GUID* pSubtype, PPST_TYPEINFO pInfo,
00219     PPST_ACCESSRULESET** ppRules, DWORD dwFlags)
00220 {
00221     FIXME("\n");
00222     return E_NOTIMPL;
00223 }
00224 
00225 /******************************************************************************
00226  * IPStore->WriteAccessRuleSet
00227  */
00228 static HRESULT WINAPI PStore_fnWriteAccessRuleset( IPStore* This,
00229     PST_KEY Key, const GUID* pType, const GUID* pSubtype,
00230     PPST_TYPEINFO pInfo, PPST_ACCESSRULESET pRules, DWORD dwFlags)
00231 {
00232     FIXME("\n");
00233     return E_NOTIMPL;
00234 }
00235 
00236 /******************************************************************************
00237  * IPStore->EnumTypes
00238  */
00239 static HRESULT WINAPI PStore_fnEnumTypes( IPStore* This, PST_KEY Key,
00240     DWORD dwFlags, IEnumPStoreTypes** ppenum)
00241 {
00242     FIXME("\n");
00243     return E_NOTIMPL;
00244 }
00245 
00246 /******************************************************************************
00247  * IPStore->EnumSubtypes
00248  */
00249 static HRESULT WINAPI PStore_fnEnumSubtypes( IPStore* This, PST_KEY Key,
00250     const GUID* pType, DWORD dwFlags, IEnumPStoreTypes** ppenum)
00251 {
00252     FIXME("\n");
00253     return E_NOTIMPL;
00254 }
00255 
00256 /******************************************************************************
00257  * IPStore->DeleteItem
00258  */
00259 static HRESULT WINAPI PStore_fnDeleteItem( IPStore* This, PST_KEY Key,
00260     const GUID* pItemType, const GUID* pItemSubType, LPCWSTR szItemName,
00261     PPST_PROMPTINFO pPromptInfo, DWORD dwFlags)
00262 {
00263     FIXME("\n");
00264     return E_NOTIMPL;
00265 }
00266 
00267 /******************************************************************************
00268  * IPStore->ReadItem
00269  */
00270 static HRESULT WINAPI PStore_fnReadItem( IPStore* This, PST_KEY Key,
00271     const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
00272     DWORD *cbData, BYTE** pbData, PPST_PROMPTINFO pPromptInfo, DWORD dwFlags)
00273 {
00274     FIXME("%p %08x %s %s %s %p %p %p %08x\n", This, Key,
00275           debugstr_guid(pItemType), debugstr_guid(pItemSubtype),
00276           debugstr_w(szItemName), cbData, pbData, pPromptInfo, dwFlags);
00277     return E_NOTIMPL;
00278 }
00279 
00280 /******************************************************************************
00281  * IPStore->WriteItem
00282  */
00283 static HRESULT WINAPI PStore_fnWriteItem( IPStore* This, PST_KEY Key,
00284     const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
00285     DWORD cbData, BYTE* ppbData, PPST_PROMPTINFO pPromptInfo,
00286     DWORD dwDefaultConfirmationStyle, DWORD dwFlags)
00287 {
00288     FIXME("%p %08x %s %s %s %d %p %p %08x\n", This, Key,
00289           debugstr_guid(pItemType), debugstr_guid(pItemSubtype),
00290           debugstr_w(szItemName), cbData, ppbData, pPromptInfo, dwFlags);
00291     return E_NOTIMPL;
00292 }
00293 
00294 /******************************************************************************
00295  * IPStore->OpenItem
00296  */
00297 static HRESULT WINAPI PStore_fnOpenItem( IPStore* This, PST_KEY Key,
00298     const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR szItemName,
00299     PST_ACCESSMODE ModeFlags, PPST_PROMPTINFO pProomptInfo, DWORD dwFlags )
00300 {
00301     FIXME("(%p,%08x,%s,%s,%s,%08x,%p,%08x) stub\n", This, Key, debugstr_guid(pItemType),
00302            debugstr_guid(pItemSubtype), debugstr_w(szItemName), ModeFlags, pProomptInfo, dwFlags);
00303     return E_NOTIMPL;
00304 }
00305 
00306 /******************************************************************************
00307  * IPStore->CloseItem
00308  */
00309 static HRESULT WINAPI PStore_fnCloseItem( IPStore* This, PST_KEY Key,
00310     const GUID* pItemType, const GUID* pItemSubtype, LPCWSTR* szItemName,
00311     DWORD dwFlags)
00312 {
00313     FIXME("\n");
00314     return E_NOTIMPL;
00315 }
00316 
00317 /******************************************************************************
00318  * IPStore->EnumItems
00319  */
00320 static HRESULT WINAPI PStore_fnEnumItems( IPStore* This, PST_KEY Key,
00321     const GUID* pItemType, const GUID* pItemSubtype, DWORD dwFlags,
00322     IEnumPStoreItems** ppenum)
00323 {
00324     FIXME("\n");
00325     return E_NOTIMPL;
00326 }
00327 
00328 
00329 static const IPStoreVtbl pstores_vtbl =
00330 {
00331     PStore_fnQueryInterface,
00332     PStore_fnAddRef,
00333     PStore_fnRelease,
00334     PStore_fnGetInfo,
00335     PStore_fnGetProvParam,
00336     PStore_fnSetProvParam,
00337     PStore_fnCreateType,
00338     PStore_fnGetTypeInfo,
00339     PStore_fnDeleteType,
00340     PStore_fnCreateSubtype,
00341     PStore_fnGetSubtypeInfo,
00342     PStore_fnDeleteSubtype,
00343     PStore_fnReadAccessRuleset,
00344     PStore_fnWriteAccessRuleset,
00345     PStore_fnEnumTypes,
00346     PStore_fnEnumSubtypes,
00347     PStore_fnDeleteItem,
00348     PStore_fnReadItem,
00349     PStore_fnWriteItem,
00350     PStore_fnOpenItem,
00351     PStore_fnCloseItem,
00352     PStore_fnEnumItems
00353 };
00354 
00355 HRESULT WINAPI PStoreCreateInstance( IPStore** ppProvider,
00356             PST_PROVIDERID* pProviderID, void* pReserved, DWORD dwFlags)
00357 {
00358     PStore_impl *ips;
00359 
00360     TRACE("%p %s %p %08x\n", ppProvider, debugstr_guid(pProviderID), pReserved, dwFlags);
00361 
00362     ips = HeapAlloc( GetProcessHeap(), 0, sizeof (PStore_impl) );
00363     if( !ips )
00364         return E_OUTOFMEMORY;
00365 
00366     ips->IPStore_iface.lpVtbl = &pstores_vtbl;
00367     ips->ref = 1;
00368 
00369     *ppProvider = (IPStore*) ips;
00370 
00371     return S_OK;
00372 }
00373 
00374 HRESULT WINAPI DllRegisterServer(void)
00375 {
00376     FIXME("\n");
00377     return S_OK;
00378 }
00379 
00380 HRESULT WINAPI DllUnregisterServer(void)
00381 {
00382     FIXME("\n");
00383     return S_OK;
00384 }
00385 
00386 /***********************************************************************
00387  *             DllGetClassObject (PSTOREC.@)
00388  */
00389 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
00390 {
00391     FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
00392     return CLASS_E_CLASSNOTAVAILABLE;
00393 }
00394 
00395 HRESULT WINAPI DllCanUnloadNow(void)
00396 {
00397     return S_OK;
00398 }

Generated on Sun May 27 2012 04:25:55 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.