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
32 #include "wuapi_private.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(wuapi
);
38 typedef struct _systeminfo
40 ISystemInformation ISystemInformation_iface
;
44 static inline systeminfo
*impl_from_ISystemInformation(ISystemInformation
*iface
)
46 return CONTAINING_RECORD(iface
, systeminfo
, ISystemInformation_iface
);
49 static ULONG WINAPI
systeminfo_AddRef(ISystemInformation
*iface
)
51 systeminfo
*This
= impl_from_ISystemInformation(iface
);
52 return InterlockedIncrement(&This
->refs
);
55 static ULONG WINAPI
systeminfo_Release(ISystemInformation
*iface
)
57 systeminfo
*This
= impl_from_ISystemInformation(iface
);
58 LONG refs
= InterlockedDecrement(&This
->refs
);
61 TRACE("destroying %p\n", This
);
62 HeapFree(GetProcessHeap(), 0, This
);
67 static HRESULT WINAPI
systeminfo_QueryInterface(ISystemInformation
*iface
,
68 REFIID riid
, void **ppvObject
)
70 systeminfo
*This
= impl_from_ISystemInformation(iface
);
72 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObject
);
74 if (IsEqualGUID(riid
, &IID_ISystemInformation
) ||
75 IsEqualGUID(riid
, &IID_IDispatch
) ||
76 IsEqualGUID(riid
, &IID_IUnknown
))
82 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
85 ISystemInformation_AddRef(iface
);
89 static HRESULT WINAPI
systeminfo_GetTypeInfoCount(ISystemInformation
*iface
,
96 static HRESULT WINAPI
systeminfo_GetTypeInfo(ISystemInformation
*iface
,
97 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
103 static HRESULT WINAPI
systeminfo_GetIDsOfNames(ISystemInformation
*iface
,
104 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
,
111 static HRESULT WINAPI
systeminfo_Invoke(ISystemInformation
*iface
,
112 DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
,
113 DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
114 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
120 static HRESULT WINAPI
systeminfo_get_OemHardwareSupportLink(ISystemInformation
*iface
,
127 static HRESULT WINAPI
systeminfo_get_RebootRequired(ISystemInformation
*iface
,
128 VARIANT_BOOL
*retval
)
130 *retval
= VARIANT_FALSE
;
134 static const struct ISystemInformationVtbl systeminfo_vtbl
=
136 systeminfo_QueryInterface
,
139 systeminfo_GetTypeInfoCount
,
140 systeminfo_GetTypeInfo
,
141 systeminfo_GetIDsOfNames
,
143 systeminfo_get_OemHardwareSupportLink
,
144 systeminfo_get_RebootRequired
147 HRESULT
SystemInformation_create(LPVOID
*ppObj
)
151 TRACE("(%p)\n", ppObj
);
153 info
= HeapAlloc(GetProcessHeap(), 0, sizeof(*info
));
155 return E_OUTOFMEMORY
;
157 info
->ISystemInformation_iface
.lpVtbl
= &systeminfo_vtbl
;
160 *ppObj
= &info
->ISystemInformation_iface
;
162 TRACE("returning iface %p\n", *ppObj
);