2 * IUpdateSession implementation
4 * Copyright 2008 Hans Leidekker
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.
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.
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
21 #define WIN32_NO_STATUS
31 //#include "winuser.h"
35 #include <wine/debug.h>
36 #include "wuapi_private.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(wuapi
);
40 typedef struct _update_session
42 IUpdateSession IUpdateSession_iface
;
46 static inline update_session
*impl_from_IUpdateSession( IUpdateSession
*iface
)
48 return CONTAINING_RECORD(iface
, update_session
, IUpdateSession_iface
);
51 static ULONG WINAPI
update_session_AddRef(
52 IUpdateSession
*iface
)
54 update_session
*update_session
= impl_from_IUpdateSession( iface
);
55 return InterlockedIncrement( &update_session
->refs
);
58 static ULONG WINAPI
update_session_Release(
59 IUpdateSession
*iface
)
61 update_session
*update_session
= impl_from_IUpdateSession( iface
);
62 LONG refs
= InterlockedDecrement( &update_session
->refs
);
65 TRACE("destroying %p\n", update_session
);
66 HeapFree( GetProcessHeap(), 0, update_session
);
71 static HRESULT WINAPI
update_session_QueryInterface(
72 IUpdateSession
*iface
,
76 update_session
*This
= impl_from_IUpdateSession( iface
);
78 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
80 if ( IsEqualGUID( riid
, &IID_IUpdateSession
) ||
81 IsEqualGUID( riid
, &IID_IDispatch
) ||
82 IsEqualGUID( riid
, &IID_IUnknown
) )
88 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
91 IUpdateSession_AddRef( iface
);
95 static HRESULT WINAPI
update_session_GetTypeInfoCount(
96 IUpdateSession
*iface
,
103 static HRESULT WINAPI
update_session_GetTypeInfo(
104 IUpdateSession
*iface
,
107 ITypeInfo
**ppTInfo
)
113 static HRESULT WINAPI
update_session_GetIDsOfNames(
114 IUpdateSession
*iface
,
125 static HRESULT WINAPI
update_session_Invoke(
126 IUpdateSession
*iface
,
131 DISPPARAMS
*pDispParams
,
133 EXCEPINFO
*pExcepInfo
,
140 static HRESULT WINAPI
update_session_get_ClientApplicationID(
141 IUpdateSession
*This
,
148 static HRESULT WINAPI
update_session_put_ClientApplicationID(
149 IUpdateSession
*This
,
152 FIXME("%p, %s\n", This
, debugstr_w(value
));
156 static HRESULT WINAPI
update_session_get_ReadOnly(
157 IUpdateSession
*This
,
158 VARIANT_BOOL
*retval
)
164 static HRESULT WINAPI
update_session_get_WebProxy(
165 IUpdateSession
*This
,
172 static HRESULT WINAPI
update_session_put_WebProxy(
173 IUpdateSession
*This
,
180 static HRESULT WINAPI
update_session_CreateUpdateSearcher(
181 IUpdateSession
*This
,
182 IUpdateSearcher
**retval
)
185 return UpdateSearcher_create( NULL
, (LPVOID
*)retval
);
188 static HRESULT WINAPI
update_session_CreateUpdateDownloader(
189 IUpdateSession
*This
,
190 IUpdateDownloader
**retval
)
193 return UpdateDownloader_create( NULL
, (LPVOID
*)retval
);
196 static HRESULT WINAPI
update_session_CreateUpdateInstaller(
197 IUpdateSession
*This
,
198 IUpdateInstaller
**retval
)
201 return UpdateInstaller_create( NULL
, (LPVOID
*)retval
);
204 static const struct IUpdateSessionVtbl update_session_vtbl
=
206 update_session_QueryInterface
,
207 update_session_AddRef
,
208 update_session_Release
,
209 update_session_GetTypeInfoCount
,
210 update_session_GetTypeInfo
,
211 update_session_GetIDsOfNames
,
212 update_session_Invoke
,
213 update_session_get_ClientApplicationID
,
214 update_session_put_ClientApplicationID
,
215 update_session_get_ReadOnly
,
216 update_session_get_WebProxy
,
217 update_session_put_WebProxy
,
218 update_session_CreateUpdateSearcher
,
219 update_session_CreateUpdateDownloader
,
220 update_session_CreateUpdateInstaller
223 HRESULT
UpdateSession_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
225 update_session
*session
;
227 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
229 session
= HeapAlloc( GetProcessHeap(), 0, sizeof(*session
) );
230 if (!session
) return E_OUTOFMEMORY
;
232 session
->IUpdateSession_iface
.lpVtbl
= &update_session_vtbl
;
235 *ppObj
= &session
->IUpdateSession_iface
;
237 TRACE("returning iface %p\n", *ppObj
);