mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
code style
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Windows.Graphics;
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ using Snap.Hutao.Core.ExceptionService;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.InterChange.Achievement;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
using Snap.Hutao.UI.Xaml.Data;
|
||||
using Snap.Hutao.ViewModel.Achievement;
|
||||
using System.Collections.ObjectModel;
|
||||
using EntityAchievement = Snap.Hutao.Model.Entity.Achievement;
|
||||
|
||||
@@ -148,7 +148,7 @@ internal struct GameScreenCaptureContext : IDisposable
|
||||
return clientBox.right <= width && clientBox.bottom <= height;
|
||||
}
|
||||
|
||||
public unsafe readonly void AttachPreview(GameScreenCaptureDebugPreviewWindow? window)
|
||||
public readonly unsafe void AttachPreview(GameScreenCaptureDebugPreviewWindow? window)
|
||||
{
|
||||
if (PreviewEnabled && window is not null)
|
||||
{
|
||||
@@ -156,7 +156,7 @@ internal struct GameScreenCaptureContext : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe readonly void UpdatePreview(GameScreenCaptureDebugPreviewWindow? window, IDirect3DSurface surface)
|
||||
public readonly unsafe void UpdatePreview(GameScreenCaptureDebugPreviewWindow? window, IDirect3DSurface surface)
|
||||
{
|
||||
if (PreviewEnabled && window is not null)
|
||||
{
|
||||
@@ -164,7 +164,7 @@ internal struct GameScreenCaptureContext : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe readonly void DetachPreview(GameScreenCaptureDebugPreviewWindow? window)
|
||||
public readonly unsafe void DetachPreview(GameScreenCaptureDebugPreviewWindow? window)
|
||||
{
|
||||
if (PreviewEnabled && window is not null)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ internal struct GameScreenCaptureContext : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe readonly void Dispose()
|
||||
public readonly unsafe void Dispose()
|
||||
{
|
||||
IUnknownMarshal.Release(factory);
|
||||
IUnknownMarshal.Release(swapChain);
|
||||
|
||||
@@ -22,7 +22,6 @@ using Snap.Hutao.UI.Xaml.Media.Backdrop;
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.Graphics.Dwm;
|
||||
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using Windows.Foundation;
|
||||
using Windows.Graphics;
|
||||
|
||||
@@ -45,15 +45,30 @@ internal sealed class InterspersedObservableCollection : IList, IEnumerable<obje
|
||||
|
||||
public IList ItemsSource { get; private set; }
|
||||
|
||||
public bool IsFixedSize => false;
|
||||
public bool IsFixedSize
|
||||
{
|
||||
get => false;
|
||||
}
|
||||
|
||||
public bool IsReadOnly => false;
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get => false;
|
||||
}
|
||||
|
||||
public int Count => ItemsSource.Count + interspersedObjects.Count;
|
||||
public int Count
|
||||
{
|
||||
get => ItemsSource.Count + interspersedObjects.Count;
|
||||
}
|
||||
|
||||
public bool IsSynchronized => false;
|
||||
public bool IsSynchronized
|
||||
{
|
||||
get => false;
|
||||
}
|
||||
|
||||
public object SyncRoot => new();
|
||||
public object SyncRoot
|
||||
{
|
||||
get => new();
|
||||
}
|
||||
|
||||
public object? this[int index]
|
||||
{
|
||||
|
||||
@@ -14,7 +14,6 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Runtime.InteropServices;
|
||||
using Windows.Foundation;
|
||||
|
||||
namespace Snap.Hutao.UI.Xaml.Control.Image;
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.Graphics.Display;
|
||||
using Microsoft.UI.Windowing;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.Web.WebView2.Core;
|
||||
using Snap.Hutao.Core.Graphics;
|
||||
using Snap.Hutao.Service.Notification;
|
||||
|
||||
@@ -2,12 +2,9 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
using Snap.Hutao.Core.DataTransfer;
|
||||
using Snap.Hutao.Core.ExceptionService;
|
||||
using Snap.Hutao.Core.Graphics.Imaging;
|
||||
using Snap.Hutao.Factory.ContentDialog;
|
||||
using Snap.Hutao.Model.Calculable;
|
||||
using Snap.Hutao.Model.Entity.Primitive;
|
||||
@@ -15,15 +12,11 @@ using Snap.Hutao.Service.AvatarInfo;
|
||||
using Snap.Hutao.Service.Cultivation;
|
||||
using Snap.Hutao.Service.Notification;
|
||||
using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.UI;
|
||||
using Snap.Hutao.UI.Xaml.Control;
|
||||
using Snap.Hutao.UI.Xaml.View.Dialog;
|
||||
using Snap.Hutao.ViewModel.User;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate;
|
||||
using Snap.Hutao.Web.Response;
|
||||
using Windows.Graphics.Imaging;
|
||||
using Windows.Storage.Streams;
|
||||
using Windows.UI;
|
||||
using CalculatorAvatarPromotionDelta = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.AvatarPromotionDelta;
|
||||
using CalculatorBatchConsumption = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.BatchConsumption;
|
||||
using CalculatorClient = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.CalculateClient;
|
||||
|
||||
@@ -15,8 +15,6 @@ using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.UI.Xaml.Control;
|
||||
using Snap.Hutao.UI.Xaml.View.Dialog;
|
||||
using Snap.Hutao.UI.Xaml.View.Window.WebView2;
|
||||
using Snap.Hutao.ViewModel.User;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.Binding;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Snap.Hutao.ViewModel.DailyNote;
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.RoleCombat;
|
||||
|
||||
internal sealed class RoleCombatBuff
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.RoleCombat;
|
||||
|
||||
internal sealed class RoleCombatData
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.RoleCombat;
|
||||
|
||||
internal sealed class RoleCombatDetail
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.RoleCombat;
|
||||
|
||||
internal sealed class RoleCombatLinks
|
||||
|
||||
@@ -15,7 +15,7 @@ internal static class AdvApi32
|
||||
{
|
||||
[DllImport("ADVAPI32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows5.1.2600")]
|
||||
public static unsafe extern BOOL ConvertSidToStringSidW(PSID Sid, PWSTR* StringSid);
|
||||
public static extern unsafe BOOL ConvertSidToStringSidW(PSID Sid, PWSTR* StringSid);
|
||||
|
||||
public static unsafe BOOL ConvertSidToStringSidW(PSID Sid, out PWSTR StringSid)
|
||||
{
|
||||
@@ -27,7 +27,7 @@ internal static class AdvApi32
|
||||
|
||||
[DllImport("ADVAPI32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows5.1.2600")]
|
||||
public static unsafe extern BOOL ConvertStringSidToSidW(PCWSTR StringSid, PSID* Sid);
|
||||
public static extern unsafe BOOL ConvertStringSidToSidW(PCWSTR StringSid, PSID* Sid);
|
||||
|
||||
public static unsafe BOOL ConvertStringSidToSidW(ReadOnlySpan<char> StringSid, out PSID Sid)
|
||||
{
|
||||
@@ -54,7 +54,7 @@ internal static class AdvApi32
|
||||
|
||||
[DllImport("ADVAPI32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
public static unsafe extern WIN32_ERROR RegOpenKeyExW(HKEY hKey, [AllowNull] PCWSTR lpSubKey, [AllowNull] uint ulOptions, REG_SAM_FLAGS samDesired, HKEY* phkResult);
|
||||
public static extern unsafe WIN32_ERROR RegOpenKeyExW(HKEY hKey, [AllowNull] PCWSTR lpSubKey, [AllowNull] uint ulOptions, REG_SAM_FLAGS samDesired, HKEY* phkResult);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe WIN32_ERROR RegOpenKeyExW(HKEY hKey, ReadOnlySpan<char> subKey, uint ulOptions, REG_SAM_FLAGS samDesired, out HKEY hkResult)
|
||||
|
||||
@@ -22,5 +22,5 @@ internal static class ComCtl32
|
||||
|
||||
[DllImport("COMCTL32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows5.1.2600")]
|
||||
public static unsafe extern BOOL SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, nuint uIdSubclass, nuint dwRefData);
|
||||
public static extern unsafe BOOL SetWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, nuint uIdSubclass, nuint dwRefData);
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace Snap.Hutao.Win32;
|
||||
internal static class D3d11
|
||||
{
|
||||
[DllImport("d3d11.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
public static unsafe extern HRESULT CreateDirect3D11DeviceFromDXGIDevice(IDXGIDevice* dxgiDevice, IInspectable** graphicsDevice);
|
||||
public static extern unsafe HRESULT CreateDirect3D11DeviceFromDXGIDevice(IDXGIDevice* dxgiDevice, IInspectable** graphicsDevice);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe HRESULT CreateDirect3D11DeviceFromDXGIDevice(IDXGIDevice* dxgiDevice, out IInspectable* graphicsDevice)
|
||||
@@ -28,7 +28,7 @@ internal static class D3d11
|
||||
}
|
||||
|
||||
[DllImport("d3d11.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
public static unsafe extern HRESULT D3D11CreateDevice([AllowNull] IDXGIAdapter* pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, D3D11_CREATE_DEVICE_FLAG Flags, [AllowNull] D3D_FEATURE_LEVEL* pFeatureLevels, uint FeatureLevels, uint SDKVersion, [MaybeNull] ID3D11Device** ppDevice, [MaybeNull] D3D_FEATURE_LEVEL* pFeatureLevel, [MaybeNull] ID3D11DeviceContext** ppImmediateContext);
|
||||
public static extern unsafe HRESULT D3D11CreateDevice([AllowNull] IDXGIAdapter* pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, D3D11_CREATE_DEVICE_FLAG Flags, [AllowNull] D3D_FEATURE_LEVEL* pFeatureLevels, uint FeatureLevels, uint SDKVersion, [MaybeNull] ID3D11Device** ppDevice, [MaybeNull] D3D_FEATURE_LEVEL* pFeatureLevel, [MaybeNull] ID3D11DeviceContext** ppImmediateContext);
|
||||
|
||||
public static unsafe HRESULT D3D11CreateDevice([AllowNull] IDXGIAdapter* pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, D3D11_CREATE_DEVICE_FLAG Flags, [AllowNull] ReadOnlySpan<D3D_FEATURE_LEVEL> featureLevels, uint SDKVersion, out ID3D11Device* pDevice, out D3D_FEATURE_LEVEL featureLevel, out ID3D11DeviceContext* pImmediateContext)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ internal static class DwmApi
|
||||
{
|
||||
[DllImport("dwmapi.dll", ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
public static unsafe extern HRESULT DwmGetWindowAttribute(HWND hwnd, uint dwAttribute, void* pvAttribute, uint cbAttribute);
|
||||
public static extern unsafe HRESULT DwmGetWindowAttribute(HWND hwnd, uint dwAttribute, void* pvAttribute, uint cbAttribute);
|
||||
|
||||
public static unsafe HRESULT DwmGetWindowAttribute<T>(HWND hwnd, DWMWINDOWATTRIBUTE dwAttribute, out T attribute)
|
||||
where T : unmanaged
|
||||
@@ -27,7 +27,7 @@ internal static class DwmApi
|
||||
|
||||
[DllImport("dwmapi.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
public static unsafe extern HRESULT DwmSetWindowAttribute(HWND hwnd, uint dwAttribute, void* pvAttribute, uint cbAttribute);
|
||||
public static extern unsafe HRESULT DwmSetWindowAttribute(HWND hwnd, uint dwAttribute, void* pvAttribute, uint cbAttribute);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe HRESULT DwmSetWindowAttribute<T>(HWND hwnd, DWMWINDOWATTRIBUTE dwAttribute, ref readonly T attribute)
|
||||
|
||||
@@ -13,7 +13,7 @@ internal static class Dxgi
|
||||
{
|
||||
[DllImport("dxgi.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows8.1")]
|
||||
public static unsafe extern HRESULT CreateDXGIFactory2(uint Flags, Guid* riid, void** ppFactory);
|
||||
public static extern unsafe HRESULT CreateDXGIFactory2(uint Flags, Guid* riid, void** ppFactory);
|
||||
|
||||
public static unsafe HRESULT CreateDXGIFactory2<T>(uint Flags, ref readonly Guid iid, out T* pFactory)
|
||||
where T : unmanaged
|
||||
|
||||
@@ -16,7 +16,7 @@ internal static class FirewallApi
|
||||
{
|
||||
[DllImport("api-ms-win-net-isolation-l1-1-0.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows8.0")]
|
||||
public static unsafe extern uint NetworkIsolationEnumAppContainers(uint Flags, uint* pdwNumPublicAppCs, INET_FIREWALL_APP_CONTAINER** ppPublicAppCs);
|
||||
public static extern unsafe uint NetworkIsolationEnumAppContainers(uint Flags, uint* pdwNumPublicAppCs, INET_FIREWALL_APP_CONTAINER** ppPublicAppCs);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe WIN32_ERROR NetworkIsolationEnumAppContainers(NETISO_FLAG Flags, out uint dwNumPublicAppCs, out INET_FIREWALL_APP_CONTAINER* pPublicAppCs)
|
||||
@@ -33,7 +33,7 @@ internal static class FirewallApi
|
||||
|
||||
[DllImport("api-ms-win-net-isolation-l1-1-0.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows8.0")]
|
||||
public static unsafe extern uint NetworkIsolationFreeAppContainers(INET_FIREWALL_APP_CONTAINER* pPublicAppCs);
|
||||
public static extern unsafe uint NetworkIsolationFreeAppContainers(INET_FIREWALL_APP_CONTAINER* pPublicAppCs);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe WIN32_ERROR NetworkIsolationFreeAppContainers(ref readonly INET_FIREWALL_APP_CONTAINER publicAppCs)
|
||||
@@ -47,7 +47,7 @@ internal static class FirewallApi
|
||||
|
||||
[DllImport("api-ms-win-net-isolation-l1-1-0.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows8.0")]
|
||||
public static unsafe extern uint NetworkIsolationGetAppContainerConfig(uint* pdwNumPublicAppCs, SID_AND_ATTRIBUTES** appContainerSids);
|
||||
public static extern unsafe uint NetworkIsolationGetAppContainerConfig(uint* pdwNumPublicAppCs, SID_AND_ATTRIBUTES** appContainerSids);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe WIN32_ERROR NetworkIsolationGetAppContainerConfig(out uint dwNumPublicAppCs, out SID_AND_ATTRIBUTES* appContainerSids)
|
||||
@@ -64,7 +64,7 @@ internal static class FirewallApi
|
||||
|
||||
[DllImport("api-ms-win-net-isolation-l1-1-0.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows8.0")]
|
||||
public static unsafe extern uint NetworkIsolationSetAppContainerConfig(uint dwNumPublicAppCs, SID_AND_ATTRIBUTES* appContainerSids);
|
||||
public static extern unsafe uint NetworkIsolationSetAppContainerConfig(uint dwNumPublicAppCs, SID_AND_ATTRIBUTES* appContainerSids);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe WIN32_ERROR NetworkIsolationSetAppContainerConfig(ReadOnlySpan<SID_AND_ATTRIBUTES> appContainerSids)
|
||||
|
||||
@@ -9,13 +9,28 @@ internal readonly struct BOOL
|
||||
|
||||
public readonly int Value;
|
||||
|
||||
public BOOL(bool value) => Value = value ? 1 : 0;
|
||||
public BOOL(bool value)
|
||||
{
|
||||
Value = value ? 1 : 0;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator int(BOOL value) => *(int*)&value;
|
||||
public static unsafe implicit operator int(BOOL value)
|
||||
{
|
||||
return *(int*)&value;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator BOOL(int value) => *(BOOL*)&value;
|
||||
public static unsafe implicit operator BOOL(int value)
|
||||
{
|
||||
return *(BOOL*)&value;
|
||||
}
|
||||
|
||||
public static implicit operator BOOL(bool value) => new(value);
|
||||
public static implicit operator BOOL(bool value)
|
||||
{
|
||||
return new(value);
|
||||
}
|
||||
|
||||
public static implicit operator bool(BOOL value) => value != 0;
|
||||
public static implicit operator bool(BOOL value)
|
||||
{
|
||||
return value != 0;
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,18 @@ internal readonly struct HANDLE
|
||||
{
|
||||
public readonly nint Value;
|
||||
|
||||
public static unsafe implicit operator HANDLE(nint value) => *(HANDLE*)&value;
|
||||
public static unsafe implicit operator HANDLE(nint value)
|
||||
{
|
||||
return *(HANDLE*)&value;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator nint(HANDLE handle) => *(nint*)&handle;
|
||||
public static unsafe implicit operator nint(HANDLE handle)
|
||||
{
|
||||
return *(nint*)&handle;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator HANDLE(BOOL value) => *(int*)&value;
|
||||
public static unsafe implicit operator HANDLE(BOOL value)
|
||||
{
|
||||
return *(int*)&value;
|
||||
}
|
||||
}
|
||||
@@ -9,5 +9,8 @@ internal readonly struct HINSTANCE
|
||||
{
|
||||
public readonly nint Value;
|
||||
|
||||
public static unsafe implicit operator HINSTANCE(HANDLE value) => *(HINSTANCE*)&value;
|
||||
public static unsafe implicit operator HINSTANCE(HANDLE value)
|
||||
{
|
||||
return *(HINSTANCE*)&value;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,13 @@ internal readonly struct HMODULE
|
||||
{
|
||||
public readonly nint Value;
|
||||
|
||||
public static unsafe implicit operator HMODULE(nint value) => *(HMODULE*)&value;
|
||||
public static unsafe implicit operator HMODULE(nint value)
|
||||
{
|
||||
return *(HMODULE*)&value;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator nint(HMODULE module) => *(nint*)&module;
|
||||
public static unsafe implicit operator nint(HMODULE module)
|
||||
{
|
||||
return *(nint*)&module;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ namespace Snap.Hutao.Win32.Foundation;
|
||||
[SuppressMessage("", "SA1310")]
|
||||
internal readonly partial struct HRESULT
|
||||
{
|
||||
public static readonly HRESULT S_OK = unchecked((int)0x00000000);
|
||||
public static readonly HRESULT S_OK = unchecked(0x00000000);
|
||||
public static readonly HRESULT E_ASYNC_OPERATION_NOT_STARTED = unchecked((int)0x80000019);
|
||||
public static readonly HRESULT E_FAIL = unchecked((int)0x80004005);
|
||||
public static readonly HRESULT DXGI_ERROR_NOT_FOUND = unchecked((int)0x887A0002);
|
||||
@@ -17,9 +17,15 @@ internal readonly partial struct HRESULT
|
||||
|
||||
public readonly int Value;
|
||||
|
||||
public static unsafe implicit operator int(HRESULT value) => *(int*)&value;
|
||||
public static unsafe implicit operator int(HRESULT value)
|
||||
{
|
||||
return *(int*)&value;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator HRESULT(int value) => *(HRESULT*)&value;
|
||||
public static unsafe implicit operator HRESULT(int value)
|
||||
{
|
||||
return *(HRESULT*)&value;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
|
||||
@@ -7,7 +7,13 @@ internal readonly struct HWND
|
||||
{
|
||||
public readonly nint Value;
|
||||
|
||||
public static unsafe implicit operator HWND(nint value) => *(HWND*)&value;
|
||||
public static unsafe implicit operator HWND(nint value)
|
||||
{
|
||||
return *(HWND*)&value;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator nint(HWND value) => *(nint*)&value;
|
||||
public static unsafe implicit operator nint(HWND value)
|
||||
{
|
||||
return *(nint*)&value;
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,8 @@ internal readonly struct LPARAM
|
||||
{
|
||||
public readonly nint Value;
|
||||
|
||||
public static unsafe implicit operator void*(LPARAM value) => *(void**)&value;
|
||||
public static unsafe implicit operator void*(LPARAM value)
|
||||
{
|
||||
return *(void**)&value;
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,8 @@ internal readonly struct LRESULT
|
||||
{
|
||||
public readonly nint Value;
|
||||
|
||||
public static unsafe implicit operator LRESULT(nint value) => *(LRESULT*)&value;
|
||||
public static unsafe implicit operator LRESULT(nint value)
|
||||
{
|
||||
return *(LRESULT*)&value;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,13 @@ internal readonly struct PCSTR
|
||||
{
|
||||
public readonly unsafe byte* Value;
|
||||
|
||||
public static unsafe implicit operator PCSTR(byte* value) => *(PCSTR*)&value;
|
||||
public static unsafe implicit operator PCSTR(byte* value)
|
||||
{
|
||||
return *(PCSTR*)&value;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator byte*(PCSTR value) => *(byte**)&value;
|
||||
public static unsafe implicit operator byte*(PCSTR value)
|
||||
{
|
||||
return *(byte**)&value;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,13 @@ internal readonly struct PCWSTR
|
||||
{
|
||||
public readonly unsafe char* Value;
|
||||
|
||||
public static unsafe implicit operator PCWSTR(char* value) => *(PCWSTR*)&value;
|
||||
public static unsafe implicit operator PCWSTR(char* value)
|
||||
{
|
||||
return *(PCWSTR*)&value;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator char*(PCWSTR value) => *(char**)&value;
|
||||
public static unsafe implicit operator char*(PCWSTR value)
|
||||
{
|
||||
return *(char**)&value;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,13 @@ internal struct PSID
|
||||
{
|
||||
public unsafe void* Value;
|
||||
|
||||
public static unsafe implicit operator PSID(SID* value) => *(PSID*)&value;
|
||||
public static unsafe implicit operator PSID(SID* value)
|
||||
{
|
||||
return *(PSID*)&value;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator void*(PSID value) => *(void**)&value;
|
||||
public static unsafe implicit operator void*(PSID value)
|
||||
{
|
||||
return *(void**)&value;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,13 @@ internal readonly struct PWSTR
|
||||
{
|
||||
public readonly unsafe char* Value;
|
||||
|
||||
public static unsafe implicit operator PWSTR(char* value) => *(PWSTR*)&value;
|
||||
public static unsafe implicit operator PWSTR(char* value)
|
||||
{
|
||||
return *(PWSTR*)&value;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator char*(PWSTR value) => *(char**)&value;
|
||||
public static unsafe implicit operator char*(PWSTR value)
|
||||
{
|
||||
return *(char**)&value;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11Asynchronous
|
||||
internal readonly unsafe struct ID3D11Asynchronous
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11BlendState
|
||||
internal readonly unsafe struct ID3D11BlendState
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11Buffer
|
||||
internal readonly unsafe struct ID3D11Buffer
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11ClassInstance
|
||||
internal readonly unsafe struct ID3D11ClassInstance
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11ClassLinkage
|
||||
internal readonly unsafe struct ID3D11ClassLinkage
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11CommandList
|
||||
internal readonly unsafe struct ID3D11CommandList
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11ComputeShader
|
||||
internal readonly unsafe struct ID3D11ComputeShader
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11Counter
|
||||
internal readonly unsafe struct ID3D11Counter
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11DepthStencilState
|
||||
internal readonly unsafe struct ID3D11DepthStencilState
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11DepthStencilView
|
||||
internal readonly unsafe struct ID3D11DepthStencilView
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11DeviceChild
|
||||
internal readonly unsafe struct ID3D11DeviceChild
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11DomainShader
|
||||
internal readonly unsafe struct ID3D11DomainShader
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11GeometryShader
|
||||
internal readonly unsafe struct ID3D11GeometryShader
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11HullShader
|
||||
internal readonly unsafe struct ID3D11HullShader
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11InputLayout
|
||||
internal readonly unsafe struct ID3D11InputLayout
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11PixelShader
|
||||
internal readonly unsafe struct ID3D11PixelShader
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11Predicate
|
||||
internal readonly unsafe struct ID3D11Predicate
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11Query
|
||||
internal readonly unsafe struct ID3D11Query
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11RasterizerState
|
||||
internal readonly unsafe struct ID3D11RasterizerState
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11RenderTargetView
|
||||
internal readonly unsafe struct ID3D11RenderTargetView
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11Resource
|
||||
internal readonly unsafe struct ID3D11Resource
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11SamplerState
|
||||
internal readonly unsafe struct ID3D11SamplerState
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11ShaderResourceView
|
||||
internal readonly unsafe struct ID3D11ShaderResourceView
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11Texture1D
|
||||
internal readonly unsafe struct ID3D11Texture1D
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11Texture2D
|
||||
internal readonly unsafe struct ID3D11Texture2D
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11Texture3D
|
||||
internal readonly unsafe struct ID3D11Texture3D
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11UnorderedAccessView
|
||||
internal readonly unsafe struct ID3D11UnorderedAccessView
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11VertexShader
|
||||
internal readonly unsafe struct ID3D11VertexShader
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct ID3D11View
|
||||
internal readonly unsafe struct ID3D11View
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
internal unsafe readonly struct IDXGIAdapter
|
||||
internal readonly unsafe struct IDXGIAdapter
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
internal unsafe readonly struct IDXGIAdapter1
|
||||
internal readonly unsafe struct IDXGIAdapter1
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
internal unsafe readonly struct IDXGIDevice
|
||||
internal readonly unsafe struct IDXGIDevice
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
internal unsafe readonly struct IDXGIDeviceSubObject
|
||||
internal readonly unsafe struct IDXGIDeviceSubObject
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
internal unsafe readonly struct IDXGIFactory
|
||||
internal readonly unsafe struct IDXGIFactory
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
internal unsafe readonly struct IDXGIFactory1
|
||||
internal readonly unsafe struct IDXGIFactory1
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
[SupportedOSPlatform("windows8.0")]
|
||||
internal unsafe readonly struct IDXGIFactory2
|
||||
internal readonly unsafe struct IDXGIFactory2
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
[SupportedOSPlatform("windows8.1")]
|
||||
internal unsafe readonly struct IDXGIFactory3
|
||||
internal readonly unsafe struct IDXGIFactory3
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
internal unsafe readonly struct IDXGIFactory4
|
||||
internal readonly unsafe struct IDXGIFactory4
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
internal unsafe readonly struct IDXGIFactory5
|
||||
internal readonly unsafe struct IDXGIFactory5
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
internal unsafe readonly struct IDXGIObject
|
||||
internal readonly unsafe struct IDXGIObject
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
internal unsafe readonly struct IDXGIOutput
|
||||
internal readonly unsafe struct IDXGIOutput
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
|
||||
internal unsafe readonly struct IDXGISwapChain
|
||||
internal readonly unsafe struct IDXGISwapChain
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -11,10 +11,19 @@ internal readonly struct HDC
|
||||
|
||||
public readonly nint Value;
|
||||
|
||||
public static unsafe implicit operator HDC(nint value) => *(HDC*)&value;
|
||||
public static unsafe implicit operator HDC(nint value)
|
||||
{
|
||||
return *(HDC*)&value;
|
||||
}
|
||||
|
||||
public static unsafe bool operator ==(HDC left, HDC right) => *(nint*)&left == *(nint*)&right;
|
||||
public static unsafe bool operator ==(HDC left, HDC right)
|
||||
{
|
||||
return *(nint*)&left == *(nint*)&right;
|
||||
}
|
||||
|
||||
public static unsafe bool operator !=(HDC left, HDC right) => *(nint*)&left != *(nint*)&right;
|
||||
public static unsafe bool operator !=(HDC left, HDC right)
|
||||
{
|
||||
return *(nint*)&left != *(nint*)&right;
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0660, CS0661
|
||||
@@ -26,7 +26,7 @@ internal static class Kernel32
|
||||
|
||||
[DllImport("KERNEL32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows5.1.2600")]
|
||||
public static unsafe extern HANDLE CreateEventW([AllowNull] SECURITY_ATTRIBUTES* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, [AllowNull] PCWSTR lpName);
|
||||
public static extern unsafe HANDLE CreateEventW([AllowNull] SECURITY_ATTRIBUTES* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, [AllowNull] PCWSTR lpName);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe HANDLE CreateEventW(ref readonly SECURITY_ATTRIBUTES eventAttributes, BOOL bManualReset, BOOL bInitialState, [AllowNull] ReadOnlySpan<char> name)
|
||||
@@ -48,7 +48,7 @@ internal static class Kernel32
|
||||
public static extern BOOL FreeLibrary(HMODULE hLibModule);
|
||||
|
||||
[DllImport("KERNEL32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
public static unsafe extern BOOL GetConsoleMode(HANDLE hConsoleHandle, CONSOLE_MODE* lpMode);
|
||||
public static extern unsafe BOOL GetConsoleMode(HANDLE hConsoleHandle, CONSOLE_MODE* lpMode);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe BOOL GetConsoleMode(HANDLE hConsoleHandle, out CONSOLE_MODE mode)
|
||||
@@ -72,10 +72,10 @@ internal static class Kernel32
|
||||
|
||||
[DllImport("KERNEL32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows5.1.2600")]
|
||||
public static unsafe extern BOOL HeapFree(HANDLE hHeap, HEAP_FLAGS dwFlags, [AllowNull] void* lpMem);
|
||||
public static extern unsafe BOOL HeapFree(HANDLE hHeap, HEAP_FLAGS dwFlags, [AllowNull] void* lpMem);
|
||||
|
||||
[DllImport("KERNEL32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
public static unsafe extern BOOL K32EnumProcessModules(HANDLE hProcess, HMODULE* lphModule, uint cb, uint* lpcbNeeded);
|
||||
public static extern unsafe BOOL K32EnumProcessModules(HANDLE hProcess, HMODULE* lphModule, uint cb, uint* lpcbNeeded);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe BOOL K32EnumProcessModules(HANDLE hProcess, Span<HMODULE> hModules, out uint cbNeeded)
|
||||
@@ -102,7 +102,7 @@ internal static class Kernel32
|
||||
}
|
||||
|
||||
[DllImport("KERNEL32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
public static unsafe extern BOOL K32GetModuleInformation(HANDLE hProcess, HMODULE hModule, MODULEINFO* lpmodinfo, uint cb);
|
||||
public static extern unsafe BOOL K32GetModuleInformation(HANDLE hProcess, HMODULE hModule, MODULEINFO* lpmodinfo, uint cb);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe BOOL K32GetModuleInformation(HANDLE hProcess, HMODULE hModule, out MODULEINFO modinfo)
|
||||
@@ -132,7 +132,7 @@ internal static class Kernel32
|
||||
|
||||
[DllImport("KERNEL32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows5.1.2600")]
|
||||
public static unsafe extern BOOL ReadProcessMemory(HANDLE hProcess, void* lpBaseAddress, void* lpBuffer, nuint nSize, [MaybeNull] nuint* lpNumberOfBytesRead);
|
||||
public static extern unsafe BOOL ReadProcessMemory(HANDLE hProcess, void* lpBaseAddress, void* lpBuffer, nuint nSize, [MaybeNull] nuint* lpNumberOfBytesRead);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe BOOL ReadProcessMemory(HANDLE hProcess, void* lpBaseAddress, Span<byte> buffer, [MaybeNull] out nuint numberOfBytesRead)
|
||||
@@ -180,7 +180,7 @@ internal static class Kernel32
|
||||
|
||||
[DllImport("KERNEL32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows5.1.2600")]
|
||||
public static unsafe extern BOOL WriteProcessMemory(HANDLE hProcess, void* lpBaseAddress, void* lpBuffer, nuint nSize, nuint* lpNumberOfBytesWritten);
|
||||
public static extern unsafe BOOL WriteProcessMemory(HANDLE hProcess, void* lpBaseAddress, void* lpBuffer, nuint nSize, nuint* lpNumberOfBytesWritten);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe BOOL WriteProcessMemory(HANDLE hProcess, void* lpBaseAddress, ReadOnlySpan<byte> buffer, out nuint numberOfBytesWritten)
|
||||
|
||||
@@ -15,7 +15,7 @@ internal static class Ole32
|
||||
{
|
||||
[DllImport("OLE32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
public static unsafe extern HRESULT CoCreateInstance(Guid* rclsid, [AllowNull] IUnknown pUnkOuter, CLSCTX dwClsContext, Guid* riid, void** ppv);
|
||||
public static extern unsafe HRESULT CoCreateInstance(Guid* rclsid, [AllowNull] IUnknown pUnkOuter, CLSCTX dwClsContext, Guid* riid, void** ppv);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe HRESULT CoCreateInstance<T>(ref readonly Guid clsid, [AllowNull] IUnknown pUnkOuter, CLSCTX dwClsContext, ref readonly Guid iid, out T* pv)
|
||||
@@ -35,10 +35,10 @@ internal static class Ole32
|
||||
|
||||
[DllImport("OLE32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
public static unsafe extern void CoTaskMemFree([AllowNull] void* pv);
|
||||
public static extern unsafe void CoTaskMemFree([AllowNull] void* pv);
|
||||
|
||||
[DllImport("OLE32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
public static unsafe extern HRESULT CoWaitForMultipleObjects(uint dwFlags, uint dwTimeout, uint cHandles, HANDLE* pHandles, uint* lpdwindex);
|
||||
public static extern unsafe HRESULT CoWaitForMultipleObjects(uint dwFlags, uint dwTimeout, uint cHandles, HANDLE* pHandles, uint* lpdwindex);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe HRESULT CoWaitForMultipleObjects(CWMO_FLAGS dwFlags, uint dwTimeout, ReadOnlySpan<HANDLE> handles, out uint dwindex)
|
||||
|
||||
@@ -16,5 +16,8 @@ internal readonly struct HKEY
|
||||
|
||||
public readonly nint Value;
|
||||
|
||||
public static unsafe implicit operator HKEY(int value) => *(HKEY*)&value;
|
||||
public static unsafe implicit operator HKEY(int value)
|
||||
{
|
||||
return *(HKEY*)&value;
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ internal static class Shell32
|
||||
{
|
||||
[DllImport("SHELL32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
public static unsafe extern HRESULT SHCreateItemFromParsingName(PCWSTR pszPath, [AllowNull] IBindCtx pbc, Guid* riid, void** ppv);
|
||||
public static extern unsafe HRESULT SHCreateItemFromParsingName(PCWSTR pszPath, [AllowNull] IBindCtx pbc, Guid* riid, void** ppv);
|
||||
|
||||
[DebuggerStepThrough]
|
||||
public static unsafe HRESULT SHCreateItemFromParsingName<T>(ReadOnlySpan<char> szPath, [AllowNull] IBindCtx pbc, ref readonly Guid riid, out T* pv)
|
||||
@@ -35,7 +35,7 @@ internal static class Shell32
|
||||
|
||||
[DllImport("SHELL32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows6.1")]
|
||||
public static unsafe extern HRESULT Shell_NotifyIconGetRect(NOTIFYICONIDENTIFIER* identifier, RECT* iconLocation);
|
||||
public static extern unsafe HRESULT Shell_NotifyIconGetRect(NOTIFYICONIDENTIFIER* identifier, RECT* iconLocation);
|
||||
|
||||
public static unsafe HRESULT Shell_NotifyIconGetRect(ref readonly NOTIFYICONIDENTIFIER identifier, out RECT iconLocation)
|
||||
{
|
||||
@@ -50,7 +50,7 @@ internal static class Shell32
|
||||
|
||||
[DllImport("SHELL32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
[SupportedOSPlatform("windows5.1.2600")]
|
||||
public static unsafe extern BOOL Shell_NotifyIconW(NOTIFY_ICON_MESSAGE dwMessage, NOTIFYICONDATAW* lpData);
|
||||
public static extern unsafe BOOL Shell_NotifyIconW(NOTIFY_ICON_MESSAGE dwMessage, NOTIFYICONDATAW* lpData);
|
||||
|
||||
public static unsafe BOOL Shell_NotifyIconW(NOTIFY_ICON_MESSAGE dwMessage, ref readonly NOTIFYICONDATAW data)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.System.Com;
|
||||
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
internal unsafe readonly struct IBindCtx
|
||||
internal readonly unsafe struct IBindCtx
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.System.Com;
|
||||
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
internal unsafe readonly struct IEnumMoniker
|
||||
internal readonly unsafe struct IEnumMoniker
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.System.Com;
|
||||
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
internal unsafe readonly struct IEnumString
|
||||
internal readonly unsafe struct IEnumString
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.System.Com;
|
||||
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
internal unsafe readonly struct IMoniker
|
||||
internal readonly unsafe struct IMoniker
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.System.Com;
|
||||
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
internal unsafe readonly struct IPersist
|
||||
internal readonly unsafe struct IPersist
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.System.Com;
|
||||
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
internal unsafe readonly struct IPersistStream
|
||||
internal readonly unsafe struct IPersistStream
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.System.Com;
|
||||
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
internal unsafe readonly struct IRunningObjectTable
|
||||
internal readonly unsafe struct IRunningObjectTable
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.System.Com;
|
||||
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
internal unsafe readonly struct ISequentialStream
|
||||
internal readonly unsafe struct ISequentialStream
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.System.Com;
|
||||
|
||||
[SupportedOSPlatform("windows5.0")]
|
||||
internal unsafe readonly struct IStream
|
||||
internal readonly unsafe struct IStream
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.System.Com;
|
||||
|
||||
internal unsafe readonly struct IUnknown
|
||||
internal readonly unsafe struct IUnknown
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.System.WinRT;
|
||||
|
||||
internal unsafe readonly struct IInspectable
|
||||
internal readonly unsafe struct IInspectable
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
internal unsafe readonly struct FileOpenDialog
|
||||
internal readonly unsafe struct FileOpenDialog
|
||||
{
|
||||
internal static ref readonly Guid CLSID
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
internal unsafe readonly struct FileOperation
|
||||
internal readonly unsafe struct FileOperation
|
||||
{
|
||||
internal static ref readonly Guid CLSID
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
internal unsafe readonly struct FileSaveDialog
|
||||
internal readonly unsafe struct FileSaveDialog
|
||||
{
|
||||
internal static ref readonly Guid CLSID
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
internal unsafe readonly struct IFileDialogEvents
|
||||
internal readonly unsafe struct IFileDialogEvents
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
internal unsafe readonly struct IFileOperationProgressSink
|
||||
internal readonly unsafe struct IFileOperationProgressSink
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
[SupportedOSPlatform("windows5.1.2600")]
|
||||
internal unsafe readonly struct IModalWindow
|
||||
internal readonly unsafe struct IModalWindow
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
internal unsafe readonly struct IOperationsProgressDialog
|
||||
internal readonly unsafe struct IOperationsProgressDialog
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
internal unsafe readonly struct IShellItemFilter
|
||||
internal readonly unsafe struct IShellItemFilter
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ internal unsafe struct IShellLinkW
|
||||
}
|
||||
}
|
||||
|
||||
internal unsafe readonly struct Vftbl
|
||||
internal readonly unsafe struct Vftbl
|
||||
{
|
||||
internal readonly IUnknown.Vftbl IUnknownVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IShellLinkW*, PWSTR, int, WIN32_FIND_DATAW*, uint, HRESULT> GetPath;
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.UI.Shell.PropertiesSystem;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
internal unsafe readonly struct IObjectWithPropertyKey
|
||||
internal readonly unsafe struct IObjectWithPropertyKey
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Runtime.Versioning;
|
||||
namespace Snap.Hutao.Win32.UI.Shell.PropertiesSystem;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
internal unsafe readonly struct IPropertyChange
|
||||
internal readonly unsafe struct IPropertyChange
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user