ReactOS  0.4.15-dev-1197-g8081ba9
session.c
Go to the documentation of this file.
1 /*
2  * IUpdateSession implementation
3  *
4  * Copyright 2008 Hans Leidekker
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #define COBJMACROS
22 
23 #include <stdarg.h>
24 
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "ole2.h"
29 #include "wuapi.h"
30 
31 #include "wine/debug.h"
32 #include "wuapi_private.h"
33 
35 
36 typedef struct _update_session
37 {
38  IUpdateSession IUpdateSession_iface;
41 
42 static inline update_session *impl_from_IUpdateSession( IUpdateSession *iface )
43 {
44  return CONTAINING_RECORD(iface, update_session, IUpdateSession_iface);
45 }
46 
48  IUpdateSession *iface )
49 {
52 }
53 
55  IUpdateSession *iface )
56 {
59  if (!refs)
60  {
61  TRACE("destroying %p\n", update_session);
63  }
64  return refs;
65 }
66 
68  IUpdateSession *iface,
69  REFIID riid,
70  void **ppvObject )
71 {
73 
74  TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
75 
76  if ( IsEqualGUID( riid, &IID_IUpdateSession ) ||
79  {
80  *ppvObject = iface;
81  }
82  else
83  {
84  FIXME("interface %s not implemented\n", debugstr_guid(riid));
85  return E_NOINTERFACE;
86  }
87  IUpdateSession_AddRef( iface );
88  return S_OK;
89 }
90 
92  IUpdateSession *iface,
93  UINT *pctinfo )
94 {
95  FIXME("\n");
96  return E_NOTIMPL;
97 }
98 
100  IUpdateSession *iface,
101  UINT iTInfo,
102  LCID lcid,
103  ITypeInfo **ppTInfo )
104 {
105  FIXME("\n");
106  return E_NOTIMPL;
107 }
108 
110  IUpdateSession *iface,
111  REFIID riid,
112  LPOLESTR *rgszNames,
113  UINT cNames,
114  LCID lcid,
115  DISPID *rgDispId )
116 {
117  FIXME("\n");
118  return E_NOTIMPL;
119 }
120 
122  IUpdateSession *iface,
123  DISPID dispIdMember,
124  REFIID riid,
125  LCID lcid,
126  WORD wFlags,
127  DISPPARAMS *pDispParams,
128  VARIANT *pVarResult,
129  EXCEPINFO *pExcepInfo,
130  UINT *puArgErr )
131 {
132  FIXME("\n");
133  return E_NOTIMPL;
134 }
135 
137  IUpdateSession *This,
138  BSTR *retval )
139 {
140  FIXME("\n");
141  return E_NOTIMPL;
142 }
143 
145  IUpdateSession *This,
146  BSTR value )
147 {
148  FIXME("%p, %s\n", This, debugstr_w(value));
149  return S_OK;
150 }
151 
153  IUpdateSession *This,
154  VARIANT_BOOL *retval )
155 {
156  FIXME("\n");
157  return E_NOTIMPL;
158 }
159 
161  IUpdateSession *This,
162  IWebProxy **retval )
163 {
164  FIXME("\n");
165  return E_NOTIMPL;
166 }
167 
169  IUpdateSession *This,
170  IWebProxy *value )
171 {
172  FIXME("\n");
173  return E_NOTIMPL;
174 }
175 
177  IUpdateSession *This,
178  IUpdateSearcher **retval )
179 {
180  TRACE("%p\n", This);
181  return UpdateSearcher_create( (LPVOID *)retval );
182 }
183 
185  IUpdateSession *This,
186  IUpdateDownloader **retval )
187 {
188  TRACE("%p\n", This);
189  return UpdateDownloader_create( (LPVOID *)retval );
190 }
191 
193  IUpdateSession *This,
194  IUpdateInstaller **retval )
195 {
196  TRACE("%p\n", This);
197  return UpdateInstaller_create( (LPVOID *)retval );
198 }
199 
200 static const struct IUpdateSessionVtbl update_session_vtbl =
201 {
217 };
218 
220 {
222 
223  TRACE("(%p)\n", ppObj);
224 
225  session = HeapAlloc( GetProcessHeap(), 0, sizeof(*session) );
226  if (!session) return E_OUTOFMEMORY;
227 
228  session->IUpdateSession_iface.lpVtbl = &update_session_vtbl;
229  session->refs = 1;
230 
231  *ppObj = &session->IUpdateSession_iface;
232 
233  TRACE("returning iface %p\n", *ppObj);
234  return S_OK;
235 }
struct _update_session update_session
IUpdateSession IUpdateSession_iface
Definition: session.c:38
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
static HRESULT WINAPI update_session_put_ClientApplicationID(IUpdateSession *This, BSTR value)
Definition: session.c:144
static HRESULT WINAPI update_session_GetIDsOfNames(IUpdateSession *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: session.c:109
HRESULT UpdateInstaller_create(LPVOID *ppObj)
Definition: installer.c:345
REFIID riid
Definition: precomp.h:44
WINE_DEFAULT_DEBUG_CHANNEL(urlmon)
static HRESULT WINAPI update_session_get_WebProxy(IUpdateSession *This, IWebProxy **retval)
Definition: session.c:160
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:2041
static LPOLESTR
Definition: stg_prop.c:27
static HRESULT WINAPI update_session_get_ReadOnly(IUpdateSession *This, VARIANT_BOOL *retval)
Definition: session.c:152
short VARIANT_BOOL
Definition: compat.h:2038
static HRESULT WINAPI update_session_CreateUpdateInstaller(IUpdateSession *This, IUpdateInstaller **retval)
Definition: session.c:192
HRESULT UpdateDownloader_create(LPVOID *ppObj)
Definition: downloader.c:251
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
HRESULT UpdateSearcher_create(LPVOID *ppObj)
Definition: searcher.c:317
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:79
static const struct IUpdateSessionVtbl update_session_vtbl
Definition: session.c:200
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:6
unsigned short WORD
Definition: ntddk_ex.h:93
static HRESULT WINAPI update_session_CreateUpdateSearcher(IUpdateSession *This, IUpdateSearcher **retval)
Definition: session.c:176
static HRESULT WINAPI update_session_put_WebProxy(IUpdateSession *This, IWebProxy *value)
Definition: session.c:168
const GUID IID_IDispatch
static HRESULT WINAPI update_session_GetTypeInfoCount(IUpdateSession *iface, UINT *pctinfo)
Definition: session.c:91
#define InterlockedDecrement
Definition: armddk.h:52
REFIID LPVOID * ppvObject
Definition: precomp.h:44
static ULONG WINAPI update_session_Release(IUpdateSession *iface)
Definition: session.c:54
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
struct stdole::EXCEPINFO EXCEPINFO
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define S_OK
Definition: intsafe.h:51
static HRESULT WINAPI update_session_QueryInterface(IUpdateSession *iface, REFIID riid, void **ppvObject)
Definition: session.c:67
#define InterlockedIncrement
Definition: armddk.h:53
static HRESULT WINAPI update_session_Invoke(IUpdateSession *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: session.c:121
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI update_session_GetTypeInfo(IUpdateSession *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: session.c:99
HRESULT UpdateSession_create(LPVOID *ppObj)
Definition: session.c:219
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static HRESULT WINAPI update_session_get_ClientApplicationID(IUpdateSession *This, BSTR *retval)
Definition: session.c:136
static HRESULT WINAPI update_session_CreateUpdateDownloader(IUpdateSession *This, IUpdateDownloader **retval)
Definition: session.c:184
struct stdole::DISPPARAMS DISPPARAMS
unsigned int ULONG
Definition: retypes.h:1
static update_session * impl_from_IUpdateSession(IUpdateSession *iface)
Definition: session.c:42
static ULONG WINAPI update_session_AddRef(IUpdateSession *iface)
Definition: session.c:47
#define HeapFree(x, y, z)
Definition: compat.h:483