Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenpropertybag.c
Go to the documentation of this file.
00001 /* 00002 * Copyright 2009 Vincent Povirk for CodeWeavers 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00017 */ 00018 00019 #include "config.h" 00020 00021 #include <stdarg.h> 00022 00023 #define COBJMACROS 00024 00025 #include "windef.h" 00026 #include "winbase.h" 00027 #include "objbase.h" 00028 #include "wincodec.h" 00029 00030 #include "wincodecs_private.h" 00031 00032 #include "wine/debug.h" 00033 00034 WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); 00035 00036 typedef struct PropertyBag { 00037 const IPropertyBag2Vtbl *lpVtbl; 00038 LONG ref; 00039 } PropertyBag; 00040 00041 static HRESULT WINAPI PropertyBag_QueryInterface(IPropertyBag2 *iface, REFIID iid, 00042 void **ppv) 00043 { 00044 PropertyBag *This = (PropertyBag*)iface; 00045 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); 00046 00047 if (!ppv) return E_INVALIDARG; 00048 00049 if (IsEqualIID(&IID_IUnknown, iid) || 00050 IsEqualIID(&IID_IPropertyBag2, iid)) 00051 { 00052 *ppv = This; 00053 } 00054 else 00055 { 00056 *ppv = NULL; 00057 return E_NOINTERFACE; 00058 } 00059 00060 IUnknown_AddRef((IUnknown*)*ppv); 00061 return S_OK; 00062 } 00063 00064 static ULONG WINAPI PropertyBag_AddRef(IPropertyBag2 *iface) 00065 { 00066 PropertyBag *This = (PropertyBag*)iface; 00067 ULONG ref = InterlockedIncrement(&This->ref); 00068 00069 TRACE("(%p) refcount=%u\n", iface, ref); 00070 00071 return ref; 00072 } 00073 00074 static ULONG WINAPI PropertyBag_Release(IPropertyBag2 *iface) 00075 { 00076 PropertyBag *This = (PropertyBag*)iface; 00077 ULONG ref = InterlockedDecrement(&This->ref); 00078 00079 TRACE("(%p) refcount=%u\n", iface, ref); 00080 00081 if (ref == 0) 00082 { 00083 HeapFree(GetProcessHeap(), 0, This); 00084 } 00085 00086 return ref; 00087 } 00088 00089 static HRESULT WINAPI PropertyBag_Read(IPropertyBag2 *iface, ULONG cProperties, 00090 PROPBAG2 *pPropBag, IErrorLog *pErrLog, VARIANT *pvarValue, HRESULT *phrError) 00091 { 00092 FIXME("(%p,%u,%p,%p,%p,%p): stub\n", iface, cProperties, pPropBag, pErrLog, pvarValue, phrError); 00093 return E_NOTIMPL; 00094 } 00095 00096 static HRESULT WINAPI PropertyBag_Write(IPropertyBag2 *iface, ULONG cProperties, 00097 PROPBAG2 *pPropBag, VARIANT *pvarValue) 00098 { 00099 FIXME("(%p,%u,%p,%p): stub\n", iface, cProperties, pPropBag, pvarValue); 00100 return E_NOTIMPL; 00101 } 00102 00103 static HRESULT WINAPI PropertyBag_CountProperties(IPropertyBag2 *iface, ULONG *pcProperties) 00104 { 00105 FIXME("(%p,%p): stub\n", iface, pcProperties); 00106 return E_NOTIMPL; 00107 } 00108 00109 static HRESULT WINAPI PropertyBag_GetPropertyInfo(IPropertyBag2 *iface, ULONG iProperty, 00110 ULONG cProperties, PROPBAG2 *pPropBag, ULONG *pcProperties) 00111 { 00112 FIXME("(%p,%u,%u,%p,%p): stub\n", iface, iProperty, cProperties, pPropBag, pcProperties); 00113 return E_NOTIMPL; 00114 } 00115 00116 static HRESULT WINAPI PropertyBag_LoadObject(IPropertyBag2 *iface, LPCOLESTR pstrName, 00117 DWORD dwHint, IUnknown *pUnkObject, IErrorLog *pErrLog) 00118 { 00119 FIXME("(%p,%s,%u,%p,%p): stub\n", iface, debugstr_w(pstrName), dwHint, pUnkObject, pErrLog); 00120 return E_NOTIMPL; 00121 } 00122 00123 static const IPropertyBag2Vtbl PropertyBag_Vtbl = { 00124 PropertyBag_QueryInterface, 00125 PropertyBag_AddRef, 00126 PropertyBag_Release, 00127 PropertyBag_Read, 00128 PropertyBag_Write, 00129 PropertyBag_CountProperties, 00130 PropertyBag_GetPropertyInfo, 00131 PropertyBag_LoadObject 00132 }; 00133 00134 extern HRESULT CreatePropertyBag2(IPropertyBag2 **ppPropertyBag2) 00135 { 00136 PropertyBag *This; 00137 00138 This = HeapAlloc(GetProcessHeap(), 0, sizeof(PropertyBag)); 00139 if (!This) return E_OUTOFMEMORY; 00140 00141 This->lpVtbl = &PropertyBag_Vtbl; 00142 This->ref = 1; 00143 00144 *ppPropertyBag2 = (IPropertyBag2*)This; 00145 00146 return S_OK; 00147 } Generated on Sat May 26 2012 04:25:25 for ReactOS by
1.7.6.1
|