cmd: DIR command outputs free space for the path.
[wine.git] / dlls / cryptowinrt / credentials.c
blobe23c5d9469644f5d8683a2ddc530e4e5a1ad6205
1 /* CryptoWinRT Credentials Implementation
3 * Copyright (C) 2022 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"
22 #include "wine/debug.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(crypto);
26 struct credentials_statics
28 IActivationFactory IActivationFactory_iface;
29 IKeyCredentialManagerStatics IKeyCredentialManagerStatics_iface;
30 LONG ref;
33 static inline struct credentials_statics *impl_from_IActivationFactory( IActivationFactory *iface )
35 return CONTAINING_RECORD( iface, struct credentials_statics, IActivationFactory_iface );
38 static HRESULT WINAPI credentials_QueryInterface( IActivationFactory *iface, REFIID iid, void **out )
40 struct credentials_statics *factory = impl_from_IActivationFactory( iface );
42 TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out );
44 if (IsEqualGUID( iid, &IID_IUnknown ) ||
45 IsEqualGUID( iid, &IID_IInspectable ) ||
46 IsEqualGUID( iid, &IID_IAgileObject ) ||
47 IsEqualGUID( iid, &IID_IActivationFactory ))
49 IUnknown_AddRef( iface );
50 *out = &factory->IActivationFactory_iface;
51 return S_OK;
54 if (IsEqualGUID( iid, &IID_IKeyCredentialManagerStatics ))
56 IUnknown_AddRef( iface );
57 *out = &factory->IKeyCredentialManagerStatics_iface;
58 return S_OK;
61 FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) );
62 *out = NULL;
63 return E_NOINTERFACE;
66 static ULONG WINAPI credentials_AddRef( IActivationFactory *iface )
68 struct credentials_statics *impl = impl_from_IActivationFactory( iface );
69 ULONG ref = InterlockedIncrement( &impl->ref );
70 TRACE( "iface %p increasing refcount to %lu.\n", iface, ref );
71 return ref;
74 static ULONG WINAPI credentials_Release( IActivationFactory *iface )
76 struct credentials_statics *impl = impl_from_IActivationFactory( iface );
77 ULONG ref = InterlockedDecrement( &impl->ref );
78 TRACE( "iface %p decreasing refcount to %lu.\n", iface, ref );
79 return ref;
82 static HRESULT WINAPI credentials_GetIids( IActivationFactory *iface, ULONG *iid_count, IID **iids )
84 FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids );
85 return E_NOTIMPL;
88 static HRESULT WINAPI credentials_GetRuntimeClassName( IActivationFactory *iface, HSTRING *class_name )
90 FIXME( "iface %p, class_name %p stub!\n", iface, class_name );
91 return E_NOTIMPL;
94 static HRESULT WINAPI credentials_GetTrustLevel( IActivationFactory *iface, TrustLevel *trust_level )
96 FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level );
97 return E_NOTIMPL;
100 static HRESULT WINAPI credentials_ActivateInstance( IActivationFactory *iface, IInspectable **instance )
102 FIXME( "iface %p, instance %p stub!\n", iface, instance );
103 return E_NOTIMPL;
106 static const struct IActivationFactoryVtbl factory_vtbl =
108 credentials_QueryInterface,
109 credentials_AddRef,
110 credentials_Release,
111 /* IInspectable methods */
112 credentials_GetIids,
113 credentials_GetRuntimeClassName,
114 credentials_GetTrustLevel,
115 /* IActivationFactory methods */
116 credentials_ActivateInstance,
119 DEFINE_IINSPECTABLE( credentials_statics, IKeyCredentialManagerStatics, struct credentials_statics, IActivationFactory_iface );
121 static HRESULT WINAPI is_supported_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result )
123 result->vt = VT_BOOL;
124 result->boolVal = FALSE;
125 return S_OK;
128 static HRESULT WINAPI credentials_statics_IsSupportedAsync( IKeyCredentialManagerStatics *iface, IAsyncOperation_boolean **value )
130 TRACE( "iface %p, value %p.\n", iface, value );
131 return async_operation_boolean_create( (IUnknown *)iface, NULL, is_supported_async, value );
134 static HRESULT WINAPI credentials_statics_RenewAttestationAsync( IKeyCredentialManagerStatics *iface, IAsyncAction **operation )
136 FIXME( "iface %p, operation %p stub!\n", iface, operation );
137 return E_NOTIMPL;
140 static HRESULT WINAPI credentials_statics_RequestCreateAsync( IKeyCredentialManagerStatics *iface,
141 HSTRING name, KeyCredentialCreationOption option, IAsyncOperation_KeyCredentialRetrievalResult **value )
143 FIXME( "iface %p, name %s, %d option, %p value stub!\n", iface, debugstr_hstring(name), option, value );
144 return E_NOTIMPL;
147 static HRESULT WINAPI credentials_statics_OpenAsync(IKeyCredentialManagerStatics *iface,
148 HSTRING name, IAsyncOperation_KeyCredentialRetrievalResult **value)
150 FIXME( "iface %p, name %s, %p value stub!\n", iface, debugstr_hstring(name), value );
151 return E_NOTIMPL;
154 static HRESULT WINAPI credentials_statics_DeleteAsync( IKeyCredentialManagerStatics *iface, HSTRING name, IAsyncAction **operation )
156 FIXME( "iface %p, name %s, %p operation stub!\n", iface, debugstr_hstring(name), operation );
157 return E_NOTIMPL;
160 static const struct IKeyCredentialManagerStaticsVtbl credentials_statics_vtbl =
162 credentials_statics_QueryInterface,
163 credentials_statics_AddRef,
164 credentials_statics_Release,
165 /* IInspectable methods */
166 credentials_statics_GetIids,
167 credentials_statics_GetRuntimeClassName,
168 credentials_statics_GetTrustLevel,
169 /* IKeyCredentialManagerStatics methods */
170 credentials_statics_IsSupportedAsync,
171 credentials_statics_RenewAttestationAsync,
172 credentials_statics_RequestCreateAsync,
173 credentials_statics_OpenAsync,
174 credentials_statics_DeleteAsync,
177 static struct credentials_statics credentials_statics =
179 {&factory_vtbl},
180 {&credentials_statics_vtbl},
184 IActivationFactory *credentials_activation_factory = &credentials_statics.IActivationFactory_iface;