/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v4.0.38
src/Files.App.Server/Helpers.cs
33 строки
887 B
Yair
Code Quality: Updated license header
31 дек 2024, 05:03
31 дек 2024, 05:03
8436c6d
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Win32.Foundation; using Windows.Win32.System.WinRT; using WinRT; namespace Files.App.Server; unsafe partial class Helpers { [UnmanagedCallersOnly(CallConvs = [typeof(CallConvStdcall)])] public static HRESULT GetActivationFactory(HSTRING activatableClassId, IActivationFactory** factory) { if (activatableClassId.IsNull || factory is null) { return HRESULT.E_INVALIDARG; } try { *factory = (IActivationFactory*)Module.GetActivationFactory(MarshalString.FromAbi((IntPtr)activatableClassId)); return *factory is null ? HRESULT.CLASS_E_CLASSNOTAVAILABLE : HRESULT.S_OK; } catch (Exception e) { ExceptionHelpers.SetErrorInfo(e); return (HRESULT)ExceptionHelpers.GetHRForException(e); } } }