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

downloader.c
Go to the documentation of this file.
00001 /*
00002  * IUpdateDownloader 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 "initguid.h"
00031 #include "wuapi.h"
00032 
00033 #include "wine/debug.h"
00034 
00035 WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
00036 
00037 typedef struct _update_downloader
00038 {
00039     const struct IUpdateDownloaderVtbl *vtbl;
00040     LONG refs;
00041 } update_downloader;
00042 
00043 static inline update_downloader *impl_from_IUpdateDownloader( IUpdateDownloader *iface )
00044 {
00045     return (update_downloader *)((char *)iface - FIELD_OFFSET( update_downloader, vtbl ));
00046 }
00047 
00048 static ULONG WINAPI update_downloader_AddRef(
00049     IUpdateDownloader *iface )
00050 {
00051     update_downloader *update_downloader = impl_from_IUpdateDownloader( iface );
00052     return InterlockedIncrement( &update_downloader->refs );
00053 }
00054 
00055 static ULONG WINAPI update_downloader_Release(
00056     IUpdateDownloader *iface )
00057 {
00058     update_downloader *update_downloader = impl_from_IUpdateDownloader( iface );
00059     LONG refs = InterlockedDecrement( &update_downloader->refs );
00060     if (!refs)
00061     {
00062         TRACE("destroying %p\n", update_downloader);
00063         HeapFree( GetProcessHeap(), 0, update_downloader );
00064     }
00065     return refs;
00066 }
00067 
00068 static HRESULT WINAPI update_downloader_QueryInterface(
00069     IUpdateDownloader *iface,
00070     REFIID riid,
00071     void **ppvObject )
00072 {
00073     update_downloader *This = impl_from_IUpdateDownloader( iface );
00074 
00075     TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
00076 
00077     if ( IsEqualGUID( riid, &IID_IUpdateDownloader ) ||
00078          IsEqualGUID( riid, &IID_IDispatch ) ||
00079          IsEqualGUID( riid, &IID_IUnknown ) )
00080     {
00081         *ppvObject = iface;
00082     }
00083     else
00084     {
00085         FIXME("interface %s not implemented\n", debugstr_guid(riid));
00086         return E_NOINTERFACE;
00087     }
00088     IUpdateDownloader_AddRef( iface );
00089     return S_OK;
00090 }
00091 
00092 static HRESULT WINAPI update_downloader_GetTypeInfoCount(
00093     IUpdateDownloader *iface,
00094     UINT *pctinfo )
00095 {
00096     FIXME("\n");
00097     return E_NOTIMPL;
00098 }
00099 
00100 static HRESULT WINAPI update_downloader_GetTypeInfo(
00101     IUpdateDownloader *iface,
00102     UINT iTInfo,
00103     LCID lcid,
00104     ITypeInfo **ppTInfo )
00105 {
00106     FIXME("\n");
00107     return E_NOTIMPL;
00108 }
00109 
00110 static HRESULT WINAPI update_downloader_GetIDsOfNames(
00111     IUpdateDownloader *iface,
00112     REFIID riid,
00113     LPOLESTR *rgszNames,
00114     UINT cNames,
00115     LCID lcid,
00116     DISPID *rgDispId )
00117 {
00118     FIXME("\n");
00119     return E_NOTIMPL;
00120 }
00121 
00122 static HRESULT WINAPI update_downloader_Invoke(
00123     IUpdateDownloader *iface,
00124     DISPID dispIdMember,
00125     REFIID riid,
00126     LCID lcid,
00127     WORD wFlags,
00128     DISPPARAMS *pDispParams,
00129     VARIANT *pVarResult,
00130     EXCEPINFO *pExcepInfo,
00131     UINT *puArgErr )
00132 {
00133     FIXME("\n");
00134     return E_NOTIMPL;
00135 }
00136 
00137 static HRESULT WINAPI update_downloader_get_IsForced(
00138     IUpdateDownloader *This,
00139     VARIANT_BOOL *retval )
00140 {
00141     FIXME("\n");
00142     return E_NOTIMPL;
00143 }
00144 
00145 static HRESULT WINAPI update_downloader_put_IsForced(
00146     IUpdateDownloader *This,
00147     VARIANT_BOOL value )
00148 {
00149     FIXME("%p, %d\n", This, value);
00150     return S_OK;
00151 }
00152 
00153 static HRESULT WINAPI update_downloader_get_ClientApplicationID(
00154     IUpdateDownloader *This,
00155     BSTR *retval )
00156 {
00157     FIXME("\n");
00158     return E_NOTIMPL;
00159 }
00160 
00161 static HRESULT WINAPI update_downloader_put_ClientApplicationID(
00162     IUpdateDownloader *This,
00163     BSTR value )
00164 {
00165     FIXME("%p, %s\n", This, debugstr_w(value));
00166     return E_NOTIMPL;
00167 }
00168 
00169 static HRESULT WINAPI update_downloader_get_Priority(
00170     IUpdateDownloader *This,
00171     DownloadPriority *retval )
00172 {
00173     FIXME("\n");
00174     return E_NOTIMPL;
00175 }
00176 
00177 static HRESULT WINAPI update_downloader_put_Priority(
00178     IUpdateDownloader *This,
00179     DownloadPriority value )
00180 {
00181     FIXME("\n");
00182     return E_NOTIMPL;
00183 }
00184 
00185 static HRESULT WINAPI update_downloader_get_Updates(
00186     IUpdateDownloader *This,
00187     IUpdateCollection **retval )
00188 {
00189     FIXME("\n");
00190     return E_NOTIMPL;
00191 }
00192 
00193 static HRESULT WINAPI update_downloader_put_Updates(
00194     IUpdateDownloader *This,
00195     IUpdateCollection *value )
00196 {
00197     FIXME("\n");
00198     return E_NOTIMPL;
00199 }
00200 
00201 static HRESULT WINAPI update_downloader_BeginDownload(
00202     IUpdateDownloader *This,
00203     IUnknown *onProgressChanged,
00204     IUnknown *onCompleted,
00205     VARIANT state,
00206     IDownloadJob **retval )
00207 {
00208     FIXME("\n");
00209     return E_NOTIMPL;
00210 }
00211 
00212 static HRESULT WINAPI update_downloader_Download(
00213     IUpdateDownloader *This,
00214     IDownloadResult **retval )
00215 {
00216     FIXME("\n");
00217     return E_NOTIMPL;
00218 }
00219 
00220 static HRESULT WINAPI update_downloader_EndDownload(
00221     IUpdateDownloader *This,
00222     IDownloadJob *value,
00223     IDownloadResult **retval )
00224 {
00225     FIXME("\n");
00226     return E_NOTIMPL;
00227 }
00228 
00229 static const struct IUpdateDownloaderVtbl update_downloader_vtbl =
00230 {
00231     update_downloader_QueryInterface,
00232     update_downloader_AddRef,
00233     update_downloader_Release,
00234     update_downloader_GetTypeInfoCount,
00235     update_downloader_GetTypeInfo,
00236     update_downloader_GetIDsOfNames,
00237     update_downloader_Invoke,
00238     update_downloader_get_ClientApplicationID,
00239     update_downloader_put_ClientApplicationID,
00240     update_downloader_get_IsForced,
00241     update_downloader_put_IsForced,
00242     update_downloader_get_Priority,
00243     update_downloader_put_Priority,
00244     update_downloader_get_Updates,
00245     update_downloader_put_Updates,
00246     update_downloader_BeginDownload,
00247     update_downloader_Download,
00248     update_downloader_EndDownload
00249 };
00250 
00251 HRESULT UpdateDownloader_create( IUnknown *pUnkOuter, LPVOID *ppObj )
00252 {
00253     update_downloader *downloader;
00254 
00255     TRACE("(%p,%p)\n", pUnkOuter, ppObj);
00256 
00257     downloader = HeapAlloc( GetProcessHeap(), 0, sizeof(*downloader) );
00258     if (!downloader) return E_OUTOFMEMORY;
00259 
00260     downloader->vtbl = &update_downloader_vtbl;
00261     downloader->refs = 1;
00262 
00263     *ppObj = &downloader->vtbl;
00264 
00265     TRACE("returning iface %p\n", *ppObj);
00266     return S_OK;
00267 }

Generated on Fri May 25 2012 04:25:13 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.