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

session.c
Go to the documentation of this file.
00001 /*
00002  * IUpdateSession 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 #include "wuapi_private.h"
00034 
00035 WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
00036 
00037 typedef struct _update_session
00038 {
00039     const struct IUpdateSessionVtbl *vtbl;
00040     LONG refs;
00041 } update_session;
00042 
00043 static inline update_session *impl_from_IUpdateSession( IUpdateSession *iface )
00044 {
00045     return (update_session *)((char *)iface - FIELD_OFFSET( update_session, vtbl ));
00046 }
00047 
00048 static ULONG WINAPI update_session_AddRef(
00049     IUpdateSession *iface )
00050 {
00051     update_session *update_session = impl_from_IUpdateSession( iface );
00052     return InterlockedIncrement( &update_session->refs );
00053 }
00054 
00055 static ULONG WINAPI update_session_Release(
00056     IUpdateSession *iface )
00057 {
00058     update_session *update_session = impl_from_IUpdateSession( iface );
00059     LONG refs = InterlockedDecrement( &update_session->refs );
00060     if (!refs)
00061     {
00062         TRACE("destroying %p\n", update_session);
00063         HeapFree( GetProcessHeap(), 0, update_session );
00064     }
00065     return refs;
00066 }
00067 
00068 static HRESULT WINAPI update_session_QueryInterface(
00069     IUpdateSession *iface,
00070     REFIID riid,
00071     void **ppvObject )
00072 {
00073     update_session *This = impl_from_IUpdateSession( iface );
00074 
00075     TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
00076 
00077     if ( IsEqualGUID( riid, &IID_IUpdateSession ) ||
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     IUpdateSession_AddRef( iface );
00089     return S_OK;
00090 }
00091 
00092 static HRESULT WINAPI update_session_GetTypeInfoCount(
00093     IUpdateSession *iface,
00094     UINT *pctinfo )
00095 {
00096     FIXME("\n");
00097     return E_NOTIMPL;
00098 }
00099 
00100 static HRESULT WINAPI update_session_GetTypeInfo(
00101     IUpdateSession *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_session_GetIDsOfNames(
00111     IUpdateSession *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_session_Invoke(
00123     IUpdateSession *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_session_get_ClientApplicationID(
00138     IUpdateSession *This,
00139     BSTR *retval )
00140 {
00141     FIXME("\n");
00142     return E_NOTIMPL;
00143 }
00144 
00145 static HRESULT WINAPI update_session_put_ClientApplicationID(
00146     IUpdateSession *This,
00147     BSTR value )
00148 {
00149     FIXME("%p, %s\n", This, debugstr_w(value));
00150     return S_OK;
00151 }
00152 
00153 static HRESULT WINAPI update_session_get_ReadOnly(
00154     IUpdateSession *This,
00155     VARIANT_BOOL *retval )
00156 {
00157     FIXME("\n");
00158     return E_NOTIMPL;
00159 }
00160 
00161 static HRESULT WINAPI update_session_get_WebProxy(
00162     IUpdateSession *This,
00163     IWebProxy **retval )
00164 {
00165     FIXME("\n");
00166     return E_NOTIMPL;
00167 }
00168 
00169 static HRESULT WINAPI update_session_put_WebProxy(
00170     IUpdateSession *This,
00171     IWebProxy *value )
00172 {
00173     FIXME("\n");
00174     return E_NOTIMPL;
00175 }
00176 
00177 static HRESULT WINAPI update_session_CreateUpdateSearcher(
00178     IUpdateSession *This,
00179     IUpdateSearcher **retval )
00180 {
00181     TRACE("%p\n", This);
00182     return UpdateSearcher_create( NULL, (LPVOID *)retval );
00183 }
00184 
00185 static HRESULT WINAPI update_session_CreateUpdateDownloader(
00186     IUpdateSession *This,
00187     IUpdateDownloader **retval )
00188 {
00189     TRACE("%p\n", This);
00190     return UpdateDownloader_create( NULL, (LPVOID *)retval );
00191 }
00192 
00193 static HRESULT WINAPI update_session_CreateUpdateInstaller(
00194     IUpdateSession *This,
00195     IUpdateInstaller **retval )
00196 {
00197     TRACE("%p\n", This);
00198     return UpdateInstaller_create( NULL, (LPVOID *)retval );
00199 }
00200 
00201 static const struct IUpdateSessionVtbl update_session_vtbl =
00202 {
00203     update_session_QueryInterface,
00204     update_session_AddRef,
00205     update_session_Release,
00206     update_session_GetTypeInfoCount,
00207     update_session_GetTypeInfo,
00208     update_session_GetIDsOfNames,
00209     update_session_Invoke,
00210     update_session_get_ClientApplicationID,
00211     update_session_put_ClientApplicationID,
00212     update_session_get_ReadOnly,
00213     update_session_get_WebProxy,
00214     update_session_put_WebProxy,
00215     update_session_CreateUpdateSearcher,
00216     update_session_CreateUpdateDownloader,
00217     update_session_CreateUpdateInstaller
00218 };
00219 
00220 HRESULT UpdateSession_create( IUnknown *pUnkOuter, LPVOID *ppObj )
00221 {
00222     update_session *session;
00223 
00224     TRACE("(%p,%p)\n", pUnkOuter, ppObj);
00225 
00226     session = HeapAlloc( GetProcessHeap(), 0, sizeof(*session) );
00227     if (!session) return E_OUTOFMEMORY;
00228 
00229     session->vtbl = &update_session_vtbl;
00230     session->refs = 1;
00231 
00232     *ppObj = &session->vtbl;
00233 
00234     TRACE("returning iface %p\n", *ppObj);
00235     return S_OK;
00236 }

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