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

searcher.c
Go to the documentation of this file.
00001 /*
00002  * IUpdateSearcher implementation
00003  *
00004  * Copyright 2008 Hans Leidekker
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 #define COBJMACROS
00022 
00023 #include "config.h"
00024 #include <stdarg.h>
00025 
00026 #include "windef.h"
00027 #include "winbase.h"
00028 #include "winuser.h"
00029 #include "ole2.h"
00030 #include "wuapi.h"
00031 
00032 #include "wine/debug.h"
00033 
00034 WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
00035 
00036 typedef struct _update_searcher
00037 {
00038     const struct IUpdateSearcherVtbl *vtbl;
00039     LONG refs;
00040 } update_searcher;
00041 
00042 static inline update_searcher *impl_from_IUpdateSearcher( IUpdateSearcher *iface )
00043 {
00044     return (update_searcher *)((char *)iface - FIELD_OFFSET( update_searcher, vtbl ));
00045 }
00046 
00047 static ULONG WINAPI update_searcher_AddRef(
00048     IUpdateSearcher *iface )
00049 {
00050     update_searcher *update_searcher = impl_from_IUpdateSearcher( iface );
00051     return InterlockedIncrement( &update_searcher->refs );
00052 }
00053 
00054 static ULONG WINAPI update_searcher_Release(
00055     IUpdateSearcher *iface )
00056 {
00057     update_searcher *update_searcher = impl_from_IUpdateSearcher( iface );
00058     LONG refs = InterlockedDecrement( &update_searcher->refs );
00059     if (!refs)
00060     {
00061         TRACE("destroying %p\n", update_searcher);
00062         HeapFree( GetProcessHeap(), 0, update_searcher );
00063     }
00064     return refs;
00065 }
00066 
00067 static HRESULT WINAPI update_searcher_QueryInterface(
00068     IUpdateSearcher *iface,
00069     REFIID riid,
00070     void **ppvObject )
00071 {
00072     update_searcher *This = impl_from_IUpdateSearcher( iface );
00073 
00074     TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
00075 
00076     if ( IsEqualGUID( riid, &IID_IUpdateSearcher ) ||
00077          IsEqualGUID( riid, &IID_IDispatch ) ||
00078          IsEqualGUID( riid, &IID_IUnknown ) )
00079     {
00080         *ppvObject = iface;
00081     }
00082     else
00083     {
00084         FIXME("interface %s not implemented\n", debugstr_guid(riid));
00085         return E_NOINTERFACE;
00086     }
00087     IUpdateSearcher_AddRef( iface );
00088     return S_OK;
00089 }
00090 
00091 static HRESULT WINAPI update_searcher_GetTypeInfoCount(
00092     IUpdateSearcher *iface,
00093     UINT *pctinfo )
00094 {
00095     FIXME("\n");
00096     return E_NOTIMPL;
00097 }
00098 
00099 static HRESULT WINAPI update_searcher_GetTypeInfo(
00100     IUpdateSearcher *iface,
00101     UINT iTInfo,
00102     LCID lcid,
00103     ITypeInfo **ppTInfo )
00104 {
00105     FIXME("\n");
00106     return E_NOTIMPL;
00107 }
00108 
00109 static HRESULT WINAPI update_searcher_GetIDsOfNames(
00110     IUpdateSearcher *iface,
00111     REFIID riid,
00112     LPOLESTR *rgszNames,
00113     UINT cNames,
00114     LCID lcid,
00115     DISPID *rgDispId )
00116 {
00117     FIXME("\n");
00118     return E_NOTIMPL;
00119 }
00120 
00121 static HRESULT WINAPI update_searcher_Invoke(
00122     IUpdateSearcher *iface,
00123     DISPID dispIdMember,
00124     REFIID riid,
00125     LCID lcid,
00126     WORD wFlags,
00127     DISPPARAMS *pDispParams,
00128     VARIANT *pVarResult,
00129     EXCEPINFO *pExcepInfo,
00130     UINT *puArgErr )
00131 {
00132     FIXME("\n");
00133     return E_NOTIMPL;
00134 }
00135 
00136 static HRESULT WINAPI update_searcher_get_CanAutomaticallyUpgradeService(
00137     IUpdateSearcher *This,
00138     VARIANT_BOOL *retval )
00139 {
00140     FIXME("\n");
00141     return E_NOTIMPL;
00142 }
00143 
00144 static HRESULT WINAPI update_searcher_put_CanAutomaticallyUpgradeService(
00145     IUpdateSearcher *This,
00146     VARIANT_BOOL value )
00147 {
00148     FIXME("%p, %d\n", This, value);
00149     return S_OK;
00150 }
00151 
00152 static HRESULT WINAPI update_searcher_get_ClientApplicationID(
00153     IUpdateSearcher *This,
00154     BSTR *retval )
00155 {
00156     FIXME("\n");
00157     return E_NOTIMPL;
00158 }
00159 
00160 static HRESULT WINAPI update_searcher_put_ClientApplicationID(
00161     IUpdateSearcher *This,
00162     BSTR value )
00163 {
00164     FIXME("%p, %s\n", This, debugstr_w(value));
00165     return E_NOTIMPL;
00166 }
00167 
00168 static HRESULT WINAPI update_searcher_get_IncludePotentiallySupersededUpdates(
00169     IUpdateSearcher *This,
00170     VARIANT_BOOL *retval )
00171 {
00172     FIXME("\n");
00173     return E_NOTIMPL;
00174 }
00175 
00176 static HRESULT WINAPI update_searcher_put_IncludePotentiallySupersededUpdates(
00177     IUpdateSearcher *This,
00178     VARIANT_BOOL value )
00179 {
00180     FIXME("\n");
00181     return E_NOTIMPL;
00182 }
00183 
00184 static HRESULT WINAPI update_searcher_get_ServerSelection(
00185     IUpdateSearcher *This,
00186     ServerSelection *retval )
00187 {
00188     FIXME("\n");
00189     return E_NOTIMPL;
00190 }
00191 
00192 static HRESULT WINAPI update_searcher_put_ServerSelection(
00193     IUpdateSearcher *This,
00194     ServerSelection value )
00195 {
00196     FIXME("\n");
00197     return E_NOTIMPL;
00198 }
00199 
00200 static HRESULT WINAPI update_searcher_BeginSearch(
00201     IUpdateSearcher *This,
00202     BSTR criteria,
00203     IUnknown *onCompleted,
00204     VARIANT state,
00205     ISearchJob **retval )
00206 {
00207     FIXME("\n");
00208     return E_NOTIMPL;
00209 }
00210 
00211 static HRESULT WINAPI update_searcher_EndSearch(
00212     IUpdateSearcher *This,
00213     ISearchJob *searchJob,
00214     ISearchResult **retval )
00215 {
00216     FIXME("\n");
00217     return E_NOTIMPL;
00218 }
00219 
00220 static const struct IUpdateSearcherVtbl update_searcher_vtbl =
00221 {
00222     update_searcher_QueryInterface,
00223     update_searcher_AddRef,
00224     update_searcher_Release,
00225     update_searcher_GetTypeInfoCount,
00226     update_searcher_GetTypeInfo,
00227     update_searcher_GetIDsOfNames,
00228     update_searcher_Invoke,
00229     update_searcher_get_CanAutomaticallyUpgradeService,
00230     update_searcher_put_CanAutomaticallyUpgradeService,
00231     update_searcher_get_ClientApplicationID,
00232     update_searcher_put_ClientApplicationID,
00233     update_searcher_get_IncludePotentiallySupersededUpdates,
00234     update_searcher_put_IncludePotentiallySupersededUpdates,
00235     update_searcher_get_ServerSelection,
00236     update_searcher_put_ServerSelection,
00237     update_searcher_BeginSearch,
00238     update_searcher_EndSearch
00239 };
00240 
00241 HRESULT UpdateSearcher_create( IUnknown *pUnkOuter, LPVOID *ppObj )
00242 {
00243     update_searcher *searcher;
00244 
00245     TRACE("(%p,%p)\n", pUnkOuter, ppObj);
00246 
00247     searcher = HeapAlloc( GetProcessHeap(), 0, sizeof(*searcher) );
00248     if (!searcher) return E_OUTOFMEMORY;
00249 
00250     searcher->vtbl = &update_searcher_vtbl;
00251     searcher->refs = 1;
00252 
00253     *ppObj = &searcher->vtbl;
00254 
00255     TRACE("returning iface %p\n", *ppObj);
00256     return S_OK;
00257 }

Generated on Sun May 27 2012 04:27:12 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.