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
31 #include "wuapi_private.h"
33 #include "wine/debug.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(wuapi
);
37 typedef struct _systeminfo
39 ISystemInformation ISystemInformation_iface
;
43 static inline systeminfo
*impl_from_ISystemInformation(ISystemInformation
*iface
)
45 return CONTAINING_RECORD(iface
, systeminfo
, ISystemInformation_iface
);
48 static ULONG WINAPI
systeminfo_AddRef(ISystemInformation
*iface
)
50 systeminfo
*This
= impl_from_ISystemInformation(iface
);
51 return InterlockedIncrement(&This
->refs
);
54 static ULONG WINAPI
systeminfo_Release(ISystemInformation
*iface
)
56 systeminfo
*This
= impl_from_ISystemInformation(iface
);
57 LONG refs
= InterlockedDecrement(&This
->refs
);
60 TRACE("destroying %p\n", This
);
61 HeapFree(GetProcessHeap(), 0, This
);
66 static HRESULT WINAPI
systeminfo_QueryInterface(ISystemInformation
*iface
,
67 REFIID riid
, void **ppvObject
)
69 systeminfo
*This
= impl_from_ISystemInformation(iface
);
71 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObject
);
73 if (IsEqualGUID(riid
, &IID_ISystemInformation
) ||
74 IsEqualGUID(riid
, &IID_IDispatch
) ||
75 IsEqualGUID(riid
, &IID_IUnknown
))
81 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
84 ISystemInformation_AddRef(iface
);
88 static HRESULT WINAPI
systeminfo_GetTypeInfoCount(ISystemInformation
*iface
,
95 static HRESULT WINAPI
systeminfo_GetTypeInfo(ISystemInformation
*iface
,
96 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
102 static HRESULT WINAPI
systeminfo_GetIDsOfNames(ISystemInformation
*iface
,
103 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
,
110 static HRESULT WINAPI
systeminfo_Invoke(ISystemInformation
*iface
,
111 DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
,
112 DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
113 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
119 static HRESULT WINAPI
systeminfo_get_OemHardwareSupportLink(ISystemInformation
*iface
,
126 static HRESULT WINAPI
systeminfo_get_RebootRequired(ISystemInformation
*iface
,
127 VARIANT_BOOL
*retval
)
129 *retval
= VARIANT_FALSE
;
133 static const struct ISystemInformationVtbl systeminfo_vtbl
=
135 systeminfo_QueryInterface
,
138 systeminfo_GetTypeInfoCount
,
139 systeminfo_GetTypeInfo
,
140 systeminfo_GetIDsOfNames
,
142 systeminfo_get_OemHardwareSupportLink
,
143 systeminfo_get_RebootRequired
146 HRESULT
SystemInformation_create(LPVOID
*ppObj
)
150 TRACE("(%p)\n", ppObj
);
152 info
= HeapAlloc(GetProcessHeap(), 0, sizeof(*info
));
154 return E_OUTOFMEMORY
;
156 info
->ISystemInformation_iface
.lpVtbl
= &systeminfo_vtbl
;
159 *ppObj
= &info
->ISystemInformation_iface
;
161 TRACE("returning iface %p\n", *ppObj
);