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 #define WIN32_NO_STATUS
32 //#include "winuser.h"
36 #include <wine/debug.h>
38 WINE_DEFAULT_DEBUG_CHANNEL(wuapi
);
40 typedef struct _systeminfo
42 ISystemInformation ISystemInformation_iface
;
46 static inline systeminfo
*impl_from_ISystemInformation(ISystemInformation
*iface
)
48 return CONTAINING_RECORD(iface
, systeminfo
, ISystemInformation_iface
);
51 static ULONG WINAPI
systeminfo_AddRef(ISystemInformation
*iface
)
53 systeminfo
*This
= impl_from_ISystemInformation(iface
);
54 return InterlockedIncrement(&This
->refs
);
57 static ULONG WINAPI
systeminfo_Release(ISystemInformation
*iface
)
59 systeminfo
*This
= impl_from_ISystemInformation(iface
);
60 LONG refs
= InterlockedDecrement(&This
->refs
);
63 TRACE("destroying %p\n", This
);
64 HeapFree(GetProcessHeap(), 0, This
);
69 static HRESULT WINAPI
systeminfo_QueryInterface(ISystemInformation
*iface
,
70 REFIID riid
, void **ppvObject
)
72 systeminfo
*This
= impl_from_ISystemInformation(iface
);
74 TRACE("%p %s %p\n", This
, debugstr_guid(riid
), ppvObject
);
76 if (IsEqualGUID(riid
, &IID_ISystemInformation
) ||
77 IsEqualGUID(riid
, &IID_IDispatch
) ||
78 IsEqualGUID(riid
, &IID_IUnknown
))
84 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
87 ISystemInformation_AddRef(iface
);
91 static HRESULT WINAPI
systeminfo_GetTypeInfoCount(ISystemInformation
*iface
,
98 static HRESULT WINAPI
systeminfo_GetTypeInfo(ISystemInformation
*iface
,
99 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
105 static HRESULT WINAPI
systeminfo_GetIDsOfNames(ISystemInformation
*iface
,
106 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
,
113 static HRESULT WINAPI
systeminfo_Invoke(ISystemInformation
*iface
,
114 DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
,
115 DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
,
116 EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
122 static HRESULT WINAPI
systeminfo_get_OemHardwareSupportLink(ISystemInformation
*iface
,
129 static HRESULT WINAPI
systeminfo_get_RebootRequired(ISystemInformation
*iface
,
130 VARIANT_BOOL
*retval
)
132 *retval
= VARIANT_FALSE
;
136 static const struct ISystemInformationVtbl systeminfo_vtbl
=
138 systeminfo_QueryInterface
,
141 systeminfo_GetTypeInfoCount
,
142 systeminfo_GetTypeInfo
,
143 systeminfo_GetIDsOfNames
,
145 systeminfo_get_OemHardwareSupportLink
,
146 systeminfo_get_RebootRequired
149 HRESULT
SystemInformation_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
153 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
155 info
= HeapAlloc(GetProcessHeap(), 0, sizeof(*info
));
157 return E_OUTOFMEMORY
;
159 info
->ISystemInformation_iface
.lpVtbl
= &systeminfo_vtbl
;
162 *ppObj
= &info
->ISystemInformation_iface
;
164 TRACE("returning iface %p\n", *ppObj
);