2 * IAutomaticUpdates implementation
4 * Copyright 2008 Hans Leidekker
5 * Copyright 2011 Bernhard Loos
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wuapi_private.h"
24 typedef struct _systeminfo
26 ISystemInformation ISystemInformation_iface
;
30 static inline systeminfo
*impl_from_ISystemInformation(ISystemInformation
*iface
)
32 return CONTAINING_RECORD(iface
, systeminfo
, ISystemInformation_iface
);
35 static ULONG WINAPI
systeminfo_AddRef(ISystemInformation
*iface
)
37 systeminfo
*This
= impl_from_ISystemInformation(iface
);
38 return InterlockedIncrement(&This
->refs
);
41 static ULONG WINAPI
systeminfo_Release(ISystemInformation
*iface
)
43 systeminfo
*This
= impl_from_ISystemInformation(iface
);
44 LONG refs
= InterlockedDecrement(&This
->refs
);
47 TRACE("destroying %p\n", This
);
48 HeapFree(GetProcessHeap(), 0, This
);
53 static HRESULT WINAPI
systeminfo_QueryInterface(ISystemInformation
*iface
,
54 REFIID riid
, void **ppvObject
)
56 systeminfo
*This
= impl_from_ISystemInformation(iface
);
58 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObject
);
60 if (IsEqualGUID(riid
, &IID_ISystemInformation
) ||
61 IsEqualGUID(riid
, &IID_IDispatch
) ||
62 IsEqualGUID(riid
, &IID_IUnknown
))
68 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
71 ISystemInformation_AddRef(iface
);
75 static HRESULT WINAPI
systeminfo_GetTypeInfoCount(ISystemInformation
*iface
,
82 static HRESULT WINAPI
systeminfo_GetTypeInfo(ISystemInformation
*iface
,
83 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
89 static HRESULT WINAPI
systeminfo_GetIDsOfNames(ISystemInformation
*iface
,
90 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
,
97 static HRESULT WINAPI
systeminfo_Invoke(ISystemInformation
*iface
,
98 DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
,
99 DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
100 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
106 static HRESULT WINAPI
systeminfo_get_OemHardwareSupportLink(ISystemInformation
*iface
,
113 static HRESULT WINAPI
systeminfo_get_RebootRequired(ISystemInformation
*iface
,
114 VARIANT_BOOL
*retval
)
116 *retval
= VARIANT_FALSE
;
120 static const struct ISystemInformationVtbl systeminfo_vtbl
=
122 systeminfo_QueryInterface
,
125 systeminfo_GetTypeInfoCount
,
126 systeminfo_GetTypeInfo
,
127 systeminfo_GetIDsOfNames
,
129 systeminfo_get_OemHardwareSupportLink
,
130 systeminfo_get_RebootRequired
133 HRESULT
SystemInformation_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
137 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
139 info
= HeapAlloc(GetProcessHeap(), 0, sizeof(*info
));
141 return E_OUTOFMEMORY
;
143 info
->ISystemInformation_iface
.lpVtbl
= &systeminfo_vtbl
;
146 *ppObj
= &info
->ISystemInformation_iface
;
148 TRACE("returning iface %p\n", *ppObj
);