nsiproxy.sys: Implement change notifications for NSI_IP_UNICAST_TABLE.
[wine.git] / dlls / graphicscapture / session.c
blob8c7aecfc7931647c8353be20713e43dbbb1d047f
1 /* WinRT GraphicsCaptureSession Implementation
3 * Copyright (C) 2023 Mohamad Al-Jaf
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "private.h"
21 #include "wine/debug.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(graphicscapture);
25 struct session
27 IActivationFactory IActivationFactory_iface;
28 IGraphicsCaptureSessionStatics IGraphicsCaptureSessionStatics_iface;
29 LONG ref;
32 static inline struct session *impl_from_IActivationFactory( IActivationFactory *iface )
34 return CONTAINING_RECORD( iface, struct session, IActivationFactory_iface );
37 static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID iid, void **out )
39 struct session *impl = impl_from_IActivationFactory( iface );
41 TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out );
43 if (IsEqualGUID( iid, &IID_IUnknown ) ||
44 IsEqualGUID( iid, &IID_IInspectable ) ||
45 IsEqualGUID( iid, &IID_IAgileObject ) ||
46 IsEqualGUID( iid, &IID_IActivationFactory ))
48 *out = &impl->IActivationFactory_iface;
49 IInspectable_AddRef( *out );
50 return S_OK;
53 if (IsEqualGUID( iid, &IID_IGraphicsCaptureSessionStatics ))
55 *out = &impl->IGraphicsCaptureSessionStatics_iface;
56 IInspectable_AddRef( *out );
57 return S_OK;
60 FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) );
61 *out = NULL;
62 return E_NOINTERFACE;
65 static ULONG WINAPI factory_AddRef( IActivationFactory *iface )
67 struct session *impl = impl_from_IActivationFactory( iface );
68 ULONG ref = InterlockedIncrement( &impl->ref );
69 TRACE( "iface %p increasing refcount to %lu.\n", iface, ref );
70 return ref;
73 static ULONG WINAPI factory_Release( IActivationFactory *iface )
75 struct session *impl = impl_from_IActivationFactory( iface );
76 ULONG ref = InterlockedDecrement( &impl->ref );
77 TRACE( "iface %p decreasing refcount to %lu.\n", iface, ref );
78 return ref;
81 static HRESULT WINAPI factory_GetIids( IActivationFactory *iface, ULONG *iid_count, IID **iids )
83 FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids );
84 return E_NOTIMPL;
87 static HRESULT WINAPI factory_GetRuntimeClassName( IActivationFactory *iface, HSTRING *class_name )
89 FIXME( "iface %p, class_name %p stub!\n", iface, class_name );
90 return E_NOTIMPL;
93 static HRESULT WINAPI factory_GetTrustLevel( IActivationFactory *iface, TrustLevel *trust_level )
95 FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level );
96 return E_NOTIMPL;
99 static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInspectable **instance )
101 FIXME( "iface %p, instance %p stub!\n", iface, instance );
102 return E_NOTIMPL;
105 static const struct IActivationFactoryVtbl factory_vtbl =
107 factory_QueryInterface,
108 factory_AddRef,
109 factory_Release,
110 /* IInspectable methods */
111 factory_GetIids,
112 factory_GetRuntimeClassName,
113 factory_GetTrustLevel,
114 /* IActivationFactory methods */
115 factory_ActivateInstance,
118 DEFINE_IINSPECTABLE( session_statics, IGraphicsCaptureSessionStatics, struct session, IActivationFactory_iface )
120 static HRESULT WINAPI session_statics_IsSupported( IGraphicsCaptureSessionStatics *iface, boolean *result )
122 TRACE( "iface %p, result %p\n", iface, result );
124 *result = FALSE;
125 return S_OK;
128 static const struct IGraphicsCaptureSessionStaticsVtbl session_statics_vtbl =
130 session_statics_QueryInterface,
131 session_statics_AddRef,
132 session_statics_Release,
133 /* IInspectable methods */
134 session_statics_GetIids,
135 session_statics_GetRuntimeClassName,
136 session_statics_GetTrustLevel,
137 /* IGraphicsCaptureSessionStatics methods */
138 session_statics_IsSupported,
141 static struct session session_statics =
143 {&factory_vtbl},
144 {&session_statics_vtbl},
148 IActivationFactory *session_factory = &session_statics.IActivationFactory_iface;