wined3d: Do not set last_was_pshader from the GLSL fragment pipe.
[wine.git] / dlls / wintypes / main.c
blobd5bfb5ad11c5dd536a733d790f2fd46edabb8a74
1 /*
2 * Copyright 2022 Zhiyi Zhang for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <stdarg.h>
21 #define COBJMACROS
22 #include "initguid.h"
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winstring.h"
26 #include "wine/debug.h"
27 #include "objbase.h"
29 #include "activation.h"
30 #include "rometadataresolution.h"
32 #define WIDL_using_Windows_Foundation_Metadata
33 #include "windows.foundation.metadata.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(wintypes);
37 struct wintypes
39 IActivationFactory IActivationFactory_iface;
40 IApiInformationStatics IApiInformationStatics_iface;
41 LONG ref;
44 static inline struct wintypes *impl_from_IActivationFactory(IActivationFactory *iface)
46 return CONTAINING_RECORD(iface, struct wintypes, IActivationFactory_iface);
49 static inline struct wintypes *impl_from_IApiInformationStatics(IApiInformationStatics *iface)
51 return CONTAINING_RECORD(iface, struct wintypes, IApiInformationStatics_iface);
54 static HRESULT STDMETHODCALLTYPE wintypes_QueryInterface(IActivationFactory *iface, REFIID iid,
55 void **out)
57 struct wintypes *impl = impl_from_IActivationFactory(iface);
59 TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
61 if (IsEqualGUID(iid, &IID_IUnknown)
62 || IsEqualGUID(iid, &IID_IInspectable)
63 || IsEqualGUID(iid, &IID_IAgileObject)
64 || IsEqualGUID(iid, &IID_IActivationFactory))
66 IUnknown_AddRef(iface);
67 *out = iface;
68 return S_OK;
71 if (IsEqualGUID(iid, &IID_IApiInformationStatics))
73 IUnknown_AddRef(iface);
74 *out = &impl->IApiInformationStatics_iface;
75 return S_OK;
78 FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
79 *out = NULL;
80 return E_NOINTERFACE;
83 static ULONG STDMETHODCALLTYPE wintypes_AddRef(IActivationFactory *iface)
85 struct wintypes *impl = impl_from_IActivationFactory(iface);
86 ULONG ref = InterlockedIncrement(&impl->ref);
87 TRACE("iface %p, ref %lu.\n", iface, ref);
88 return ref;
91 static ULONG STDMETHODCALLTYPE wintypes_Release(IActivationFactory *iface)
93 struct wintypes *impl = impl_from_IActivationFactory(iface);
94 ULONG ref = InterlockedDecrement(&impl->ref);
95 TRACE("iface %p, ref %lu.\n", iface, ref);
96 return ref;
99 static HRESULT STDMETHODCALLTYPE wintypes_GetIids(IActivationFactory *iface, ULONG *iid_count,
100 IID **iids)
102 FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids);
103 return E_NOTIMPL;
106 static HRESULT STDMETHODCALLTYPE wintypes_GetRuntimeClassName(IActivationFactory *iface,
107 HSTRING *class_name)
109 FIXME("iface %p, class_name %p stub!\n", iface, class_name);
110 return E_NOTIMPL;
113 static HRESULT STDMETHODCALLTYPE wintypes_GetTrustLevel(IActivationFactory *iface,
114 TrustLevel *trust_level)
116 FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
117 return E_NOTIMPL;
120 static HRESULT STDMETHODCALLTYPE wintypes_ActivateInstance(IActivationFactory *iface,
121 IInspectable **instance)
123 FIXME("iface %p, instance %p stub!\n", iface, instance);
124 return E_NOTIMPL;
127 static const struct IActivationFactoryVtbl activation_factory_vtbl =
129 wintypes_QueryInterface,
130 wintypes_AddRef,
131 wintypes_Release,
132 /* IInspectable methods */
133 wintypes_GetIids,
134 wintypes_GetRuntimeClassName,
135 wintypes_GetTrustLevel,
136 /* IActivationFactory methods */
137 wintypes_ActivateInstance,
140 static HRESULT STDMETHODCALLTYPE api_information_statics_QueryInterface(
141 IApiInformationStatics *iface, REFIID iid, void **out)
143 struct wintypes *impl = impl_from_IApiInformationStatics(iface);
144 return wintypes_QueryInterface(&impl->IActivationFactory_iface, iid, out);
147 static ULONG STDMETHODCALLTYPE api_information_statics_AddRef(
148 IApiInformationStatics *iface)
150 struct wintypes *impl = impl_from_IApiInformationStatics(iface);
151 return wintypes_AddRef(&impl->IActivationFactory_iface);
154 static ULONG STDMETHODCALLTYPE api_information_statics_Release(
155 IApiInformationStatics *iface)
157 struct wintypes *impl = impl_from_IApiInformationStatics(iface);
158 return wintypes_Release(&impl->IActivationFactory_iface);
161 static HRESULT STDMETHODCALLTYPE api_information_statics_GetIids(
162 IApiInformationStatics *iface, ULONG *iid_count, IID **iids)
164 FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids);
165 return E_NOTIMPL;
168 static HRESULT STDMETHODCALLTYPE api_information_statics_GetRuntimeClassName(
169 IApiInformationStatics *iface, HSTRING *class_name)
171 FIXME("iface %p, class_name %p stub!\n", iface, class_name);
172 return E_NOTIMPL;
175 static HRESULT STDMETHODCALLTYPE api_information_statics_GetTrustLevel(
176 IApiInformationStatics *iface, TrustLevel *trust_level)
178 FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
179 return E_NOTIMPL;
182 static HRESULT STDMETHODCALLTYPE api_information_statics_IsTypePresent(
183 IApiInformationStatics *iface, HSTRING type_name, BOOLEAN *value)
185 FIXME("iface %p, type_name %s, value %p stub!\n", iface, debugstr_hstring(type_name), value);
187 if (!type_name)
188 return E_INVALIDARG;
190 return E_NOTIMPL;
193 static HRESULT STDMETHODCALLTYPE api_information_statics_IsMethodPresent(
194 IApiInformationStatics *iface, HSTRING type_name, HSTRING method_name, BOOLEAN *value)
196 FIXME("iface %p, type_name %s, method_name %s, value %p stub!\n", iface,
197 debugstr_hstring(type_name), debugstr_hstring(method_name), value);
199 if (!type_name)
200 return E_INVALIDARG;
202 return E_NOTIMPL;
205 static HRESULT STDMETHODCALLTYPE api_information_statics_IsMethodPresentWithArity(
206 IApiInformationStatics *iface, HSTRING type_name, HSTRING method_name,
207 UINT32 input_parameter_count, BOOLEAN *value)
209 FIXME("iface %p, type_name %s, method_name %s, input_parameter_count %u, value %p stub!\n",
210 iface, debugstr_hstring(type_name), debugstr_hstring(method_name),
211 input_parameter_count, value);
213 if (!type_name)
214 return E_INVALIDARG;
216 return E_NOTIMPL;
219 static HRESULT STDMETHODCALLTYPE api_information_statics_IsEventPresent(
220 IApiInformationStatics *iface, HSTRING type_name, HSTRING event_name, BOOLEAN *value)
222 FIXME("iface %p, type_name %s, event_name %s, value %p stub!\n", iface,
223 debugstr_hstring(type_name), debugstr_hstring(event_name), value);
225 if (!type_name)
226 return E_INVALIDARG;
228 return E_NOTIMPL;
231 static HRESULT STDMETHODCALLTYPE api_information_statics_IsPropertyPresent(
232 IApiInformationStatics *iface, HSTRING type_name, HSTRING property_name, BOOLEAN *value)
234 FIXME("iface %p, type_name %s, property_name %s, value %p stub!\n", iface,
235 debugstr_hstring(type_name), debugstr_hstring(property_name), value);
237 if (!type_name)
238 return E_INVALIDARG;
240 return E_NOTIMPL;
243 static HRESULT STDMETHODCALLTYPE api_information_statics_IsReadOnlyPropertyPresent(
244 IApiInformationStatics *iface, HSTRING type_name, HSTRING property_name,
245 BOOLEAN *value)
247 FIXME("iface %p, type_name %s, property_name %s, value %p stub!\n", iface,
248 debugstr_hstring(type_name), debugstr_hstring(property_name), value);
250 if (!type_name)
251 return E_INVALIDARG;
253 return E_NOTIMPL;
256 static HRESULT STDMETHODCALLTYPE api_information_statics_IsWriteablePropertyPresent(
257 IApiInformationStatics *iface, HSTRING type_name, HSTRING property_name, BOOLEAN *value)
259 FIXME("iface %p, type_name %s, property_name %s, value %p stub!\n", iface,
260 debugstr_hstring(type_name), debugstr_hstring(property_name), value);
262 if (!type_name)
263 return E_INVALIDARG;
265 return E_NOTIMPL;
268 static HRESULT STDMETHODCALLTYPE api_information_statics_IsEnumNamedValuePresent(
269 IApiInformationStatics *iface, HSTRING enum_type_name, HSTRING value_name, BOOLEAN *value)
271 FIXME("iface %p, enum_type_name %s, value_name %s, value %p stub!\n", iface,
272 debugstr_hstring(enum_type_name), debugstr_hstring(value_name), value);
274 if (!enum_type_name)
275 return E_INVALIDARG;
277 return E_NOTIMPL;
280 static HRESULT STDMETHODCALLTYPE api_information_statics_IsApiContractPresentByMajor(
281 IApiInformationStatics *iface, HSTRING contract_name, UINT16 major_version, BOOLEAN *value)
283 FIXME("iface %p, contract_name %s, major_version %u, value %p stub!\n", iface,
284 debugstr_hstring(contract_name), major_version, value);
286 if (!contract_name)
287 return E_INVALIDARG;
289 *value = FALSE;
290 return S_OK;
293 static HRESULT STDMETHODCALLTYPE api_information_statics_IsApiContractPresentByMajorAndMinor(
294 IApiInformationStatics *iface, HSTRING contract_name, UINT16 major_version,
295 UINT16 minor_version, BOOLEAN *value)
297 FIXME("iface %p, contract_name %s, major_version %u, minor_version %u, value %p stub!\n", iface,
298 debugstr_hstring(contract_name), major_version, minor_version, value);
300 if (!contract_name)
301 return E_INVALIDARG;
303 return E_NOTIMPL;
306 static const struct IApiInformationStaticsVtbl api_information_statics_vtbl =
308 api_information_statics_QueryInterface,
309 api_information_statics_AddRef,
310 api_information_statics_Release,
311 /* IInspectable methods */
312 api_information_statics_GetIids,
313 api_information_statics_GetRuntimeClassName,
314 api_information_statics_GetTrustLevel,
315 /* IApiInformationStatics methods */
316 api_information_statics_IsTypePresent,
317 api_information_statics_IsMethodPresent,
318 api_information_statics_IsMethodPresentWithArity,
319 api_information_statics_IsEventPresent,
320 api_information_statics_IsPropertyPresent,
321 api_information_statics_IsReadOnlyPropertyPresent,
322 api_information_statics_IsWriteablePropertyPresent,
323 api_information_statics_IsEnumNamedValuePresent,
324 api_information_statics_IsApiContractPresentByMajor,
325 api_information_statics_IsApiContractPresentByMajorAndMinor
328 static struct wintypes wintypes =
330 {&activation_factory_vtbl},
331 {&api_information_statics_vtbl},
335 HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out)
337 FIXME("clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out);
338 return CLASS_E_CLASSNOTAVAILABLE;
341 HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **factory)
343 TRACE("classid %s, factory %p.\n", debugstr_hstring(classid), factory);
344 *factory = &wintypes.IActivationFactory_iface;
345 IUnknown_AddRef(*factory);
346 return S_OK;
349 HRESULT WINAPI RoIsApiContractMajorVersionPresent(const WCHAR *name, UINT16 major, BOOL *result)
351 FIXME("name %s, major %u, result %p\n", debugstr_w(name), major, result);
352 *result = FALSE;
353 return S_OK;
356 HRESULT WINAPI RoResolveNamespace(HSTRING name, HSTRING windowsMetaDataDir,
357 DWORD packageGraphDirsCount, const HSTRING *packageGraphDirs,
358 DWORD *metaDataFilePathsCount, HSTRING **metaDataFilePaths,
359 DWORD *subNamespacesCount, HSTRING **subNamespaces)
361 FIXME("name %s, windowsMetaDataDir %s, metaDataFilePaths %p, subNamespaces %p stub!\n",
362 debugstr_hstring(name), debugstr_hstring(windowsMetaDataDir),
363 metaDataFilePaths, subNamespaces);
365 if (!metaDataFilePaths && !subNamespaces)
366 return E_INVALIDARG;
368 return RO_E_METADATA_NAME_NOT_FOUND;