usp10: Fall back to 'dflt' language if shaping language tag isn't found.
[wine.git] / dlls / wuapi / systeminfo.c
blob7c62bed5296efa6c022c8c913a2ffa803f8cacc9
1 /*
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 COBJMACROS
24 #include "config.h"
25 #include <stdarg.h>
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winuser.h"
30 #include "ole2.h"
31 #include "wuapi.h"
32 #include "wuapi_private.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
38 typedef struct _systeminfo
40 ISystemInformation ISystemInformation_iface;
41 LONG refs;
42 } systeminfo;
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);
59 if (!refs)
61 TRACE("destroying %p\n", This);
62 HeapFree(GetProcessHeap(), 0, This);
64 return refs;
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))
78 *ppvObject = iface;
80 else
82 FIXME("interface %s not implemented\n", debugstr_guid(riid));
83 return E_NOINTERFACE;
85 ISystemInformation_AddRef(iface);
86 return S_OK;
89 static HRESULT WINAPI systeminfo_GetTypeInfoCount(ISystemInformation *iface,
90 UINT *pctinfo )
92 FIXME("\n");
93 return E_NOTIMPL;
96 static HRESULT WINAPI systeminfo_GetTypeInfo(ISystemInformation *iface,
97 UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
99 FIXME("\n");
100 return E_NOTIMPL;
103 static HRESULT WINAPI systeminfo_GetIDsOfNames(ISystemInformation *iface,
104 REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid,
105 DISPID *rgDispId)
107 FIXME("\n");
108 return E_NOTIMPL;
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 )
116 FIXME("\n");
117 return E_NOTIMPL;
120 static HRESULT WINAPI systeminfo_get_OemHardwareSupportLink(ISystemInformation *iface,
121 BSTR *retval)
123 FIXME("\n");
124 return E_NOTIMPL;
127 static HRESULT WINAPI systeminfo_get_RebootRequired(ISystemInformation *iface,
128 VARIANT_BOOL *retval)
130 *retval = VARIANT_FALSE;
131 return S_OK;
134 static const struct ISystemInformationVtbl systeminfo_vtbl =
136 systeminfo_QueryInterface,
137 systeminfo_AddRef,
138 systeminfo_Release,
139 systeminfo_GetTypeInfoCount,
140 systeminfo_GetTypeInfo,
141 systeminfo_GetIDsOfNames,
142 systeminfo_Invoke,
143 systeminfo_get_OemHardwareSupportLink,
144 systeminfo_get_RebootRequired
147 HRESULT SystemInformation_create(LPVOID *ppObj)
149 systeminfo *info;
151 TRACE("(%p)\n", ppObj);
153 info = HeapAlloc(GetProcessHeap(), 0, sizeof(*info));
154 if (!info)
155 return E_OUTOFMEMORY;
157 info->ISystemInformation_iface.lpVtbl = &systeminfo_vtbl;
158 info->refs = 1;
160 *ppObj = &info->ISystemInformation_iface;
162 TRACE("returning iface %p\n", *ppObj);
163 return S_OK;