mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
add IFileOperation
This commit is contained in:
60
src/Snap.Hutao/Snap.Hutao/Win32/Foundation/DECIMAL.cs
Normal file
60
src/Snap.Hutao/Snap.Hutao/Win32/Foundation/DECIMAL.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.Foundation;
|
||||
|
||||
[SuppressMessage("", "SA1201")]
|
||||
[SuppressMessage("", "SA1300")]
|
||||
[SuppressMessage("", "SA1307")]
|
||||
internal struct DECIMAL
|
||||
{
|
||||
public ushort wReserved;
|
||||
|
||||
public byte scale;
|
||||
|
||||
public byte sign;
|
||||
|
||||
public unsafe ushort signscale
|
||||
{
|
||||
get
|
||||
{
|
||||
fixed (DECIMAL* pThis = &this)
|
||||
{
|
||||
return *(ushort*)&pThis->scale;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
fixed (DECIMAL* pThis = &this)
|
||||
{
|
||||
*(ushort*)&pThis->scale = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public uint Hi32;
|
||||
|
||||
public uint Lo32;
|
||||
|
||||
public uint Mid32;
|
||||
|
||||
public unsafe ulong Lo64
|
||||
{
|
||||
get
|
||||
{
|
||||
fixed (DECIMAL* pThis = &this)
|
||||
{
|
||||
return *(ulong*)&pThis->Lo32;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
fixed (DECIMAL* pThis = &this)
|
||||
{
|
||||
*(ulong*)&pThis->Lo32 = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.System.Variant;
|
||||
|
||||
namespace Snap.Hutao.Win32.System.Com.StructuredStorage;
|
||||
|
||||
[SuppressMessage("", "IDE1006")]
|
||||
[SuppressMessage("", "SA1300")]
|
||||
[SuppressMessage("", "SA1307")]
|
||||
internal struct PROPVARIANT
|
||||
{
|
||||
public VARENUM vt;
|
||||
public ushort wReserved1;
|
||||
public ushort wReserved2;
|
||||
public ushort wReserved3;
|
||||
public nint Value;
|
||||
|
||||
// https://learn.microsoft.com/zh-cn/windows/win32/api/propidlbase/ns-propidlbase-propvariant
|
||||
public unsafe DECIMAL decVal
|
||||
{
|
||||
get
|
||||
{
|
||||
fixed (PROPVARIANT* pThis = &this)
|
||||
{
|
||||
return *(DECIMAL*)pThis;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
fixed (PROPVARIANT* pThis = &this)
|
||||
{
|
||||
*(DECIMAL*)pThis = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
60
src/Snap.Hutao/Snap.Hutao/Win32/System/Variant/VARENUM.cs
Normal file
60
src/Snap.Hutao/Snap.Hutao/Win32/System/Variant/VARENUM.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.System.Variant;
|
||||
|
||||
internal enum VARENUM : ushort
|
||||
{
|
||||
VT_EMPTY = 0,
|
||||
VT_NULL = 1,
|
||||
VT_I2 = 2,
|
||||
VT_I4 = 3,
|
||||
VT_R4 = 4,
|
||||
VT_R8 = 5,
|
||||
VT_CY = 6,
|
||||
VT_DATE = 7,
|
||||
VT_BSTR = 8,
|
||||
VT_DISPATCH = 9,
|
||||
VT_ERROR = 10,
|
||||
VT_BOOL = 11,
|
||||
VT_VARIANT = 12,
|
||||
VT_UNKNOWN = 13,
|
||||
VT_DECIMAL = 14,
|
||||
VT_I1 = 16,
|
||||
VT_UI1 = 17,
|
||||
VT_UI2 = 18,
|
||||
VT_UI4 = 19,
|
||||
VT_I8 = 20,
|
||||
VT_UI8 = 21,
|
||||
VT_INT = 22,
|
||||
VT_UINT = 23,
|
||||
VT_VOID = 24,
|
||||
VT_HRESULT = 25,
|
||||
VT_PTR = 26,
|
||||
VT_SAFEARRAY = 27,
|
||||
VT_CARRAY = 28,
|
||||
VT_USERDEFINED = 29,
|
||||
VT_LPSTR = 30,
|
||||
VT_LPWSTR = 31,
|
||||
VT_RECORD = 36,
|
||||
VT_INT_PTR = 37,
|
||||
VT_UINT_PTR = 38,
|
||||
VT_FILETIME = 64,
|
||||
VT_BLOB = 65,
|
||||
VT_STREAM = 66,
|
||||
VT_STORAGE = 67,
|
||||
VT_STREAMED_OBJECT = 68,
|
||||
VT_STORED_OBJECT = 69,
|
||||
VT_BLOB_OBJECT = 70,
|
||||
VT_CF = 71,
|
||||
VT_CLSID = 72,
|
||||
VT_VERSIONED_STREAM = 73,
|
||||
VT_BSTR_BLOB = 4095,
|
||||
VT_VECTOR = 4096,
|
||||
VT_ARRAY = 8192,
|
||||
VT_BYREF = 16384,
|
||||
VT_RESERVED = 32768,
|
||||
VT_ILLEGAL = 65535,
|
||||
VT_ILLEGALMASKED = 4095,
|
||||
VT_TYPEMASK = 4095,
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
[Flags]
|
||||
internal enum FILEOPERATION_FLAGS : uint
|
||||
{
|
||||
FOFX_NOSKIPJUNCTIONS = 0x00010000,
|
||||
FOFX_PREFERHARDLINK = 0x00020000,
|
||||
FOFX_SHOWELEVATIONPROMPT = 0x00040000,
|
||||
FOFX_RECYCLEONDELETE = 0x00080000,
|
||||
FOFX_EARLYFAILURE = 0x00100000,
|
||||
FOFX_PRESERVEFILEEXTENSIONS = 0x00200000,
|
||||
FOFX_KEEPNEWERFILE = 0x00400000,
|
||||
FOFX_NOCOPYHOOKS = 0x00800000,
|
||||
FOFX_NOMINIMIZEBOX = 0x01000000,
|
||||
FOFX_MOVEACLSACROSSVOLUMES = 0x02000000,
|
||||
FOFX_DONTDISPLAYSOURCEPATH = 0x04000000,
|
||||
FOFX_DONTDISPLAYDESTPATH = 0x08000000,
|
||||
FOFX_REQUIREELEVATION = 0x10000000,
|
||||
FOFX_ADDUNDORECORD = 0x20000000,
|
||||
FOFX_COPYASDOWNLOAD = 0x40000000,
|
||||
FOFX_DONTDISPLAYLOCATIONS = 0x80000000,
|
||||
FOF_MULTIDESTFILES = 0x00000001,
|
||||
FOF_CONFIRMMOUSE = 0x00000002,
|
||||
FOF_SILENT = 0x00000004,
|
||||
FOF_RENAMEONCOLLISION = 0x00000008,
|
||||
FOF_NOCONFIRMATION = 0x00000010,
|
||||
FOF_WANTMAPPINGHANDLE = 0x00000020,
|
||||
FOF_ALLOWUNDO = 0x00000040,
|
||||
FOF_FILESONLY = 0x00000080,
|
||||
FOF_SIMPLEPROGRESS = 0x00000100,
|
||||
FOF_NOCONFIRMMKDIR = 0x00000200,
|
||||
FOF_NOERRORUI = 0x00000400,
|
||||
FOF_NOCOPYSECURITYATTRIBS = 0x00000800,
|
||||
FOF_NORECURSION = 0x00001000,
|
||||
FOF_NO_CONNECTED_ELEMENTS = 0x00002000,
|
||||
FOF_WANTNUKEWARNING = 0x00004000,
|
||||
FOF_NORECURSEREPARSE = 0x00008000,
|
||||
FOF_NO_UI = 0x00000614,
|
||||
}
|
||||
74
src/Snap.Hutao/Snap.Hutao/Win32/UI/Shell/IFileOperation.cs
Normal file
74
src/Snap.Hutao/Snap.Hutao/Win32/UI/Shell/IFileOperation.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using Snap.Hutao.Win32.UI.Shell.PropertiesSystem;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
[Guid("947AAB5F-0A5C-4C13-B4D6-4BF7836FC9F8")]
|
||||
internal unsafe struct IFileOperation
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
internal static unsafe ref readonly Guid IID
|
||||
{
|
||||
get
|
||||
{
|
||||
ReadOnlySpan<byte> data = [0x5F, 0xAB, 0x7A, 0x94, 0x5C, 0x0A, 0x13, 0x4C, 0xB4, 0xD6, 0x4B, 0xF7, 0x83, 0x6F, 0xC9, 0xF8];
|
||||
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe HRESULT QueryInterface<TInterface>(ref readonly Guid riid, out TInterface* pvObject)
|
||||
where TInterface : unmanaged
|
||||
{
|
||||
fixed (Guid* riid2 = &riid)
|
||||
{
|
||||
fixed (TInterface** ppvObject = &pvObject)
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.QueryInterface((IUnknown*)Unsafe.AsPointer(ref this), riid2, (void**)ppvObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public uint AddRef()
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.AddRef((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
public uint Release()
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.Release((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
internal readonly struct Vftbl
|
||||
{
|
||||
internal readonly IUnknown.Vftbl IUnknownVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IFileOperationProgressSink*, uint*, HRESULT> Advise;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, uint, HRESULT> Unadvise;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, FILEOPERATION_FLAGS, HRESULT> SetOperationFlags;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, PCWSTR, HRESULT> SetProgressMessage;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IOperationsProgressDialog*, HRESULT> SetProgressDialog;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IPropertyChangeArray*, HRESULT> SetProperties;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, HWND, HRESULT> SetOwnerWindow;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IShellItem*, HRESULT> ApplyPropertiesToItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IUnknown*, HRESULT> ApplyPropertiesToItems;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IShellItem*, PCWSTR, IFileOperationProgressSink*, HRESULT> RenameItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IUnknown*, PCWSTR, HRESULT> RenameItems;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IShellItem*, IShellItem*, PCWSTR, IFileOperationProgressSink*, HRESULT> MoveItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IUnknown*, IShellItem*, HRESULT> MoveItems;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IShellItem*, IShellItem*, PCWSTR, IFileOperationProgressSink*, HRESULT> CopyItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IUnknown*, IShellItem*, HRESULT> CopyItems;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IShellItem*, IFileOperationProgressSink*, HRESULT> DeleteItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IUnknown*, HRESULT> DeleteItems;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, IShellItem*, uint, PCWSTR, PCWSTR, IFileOperationProgressSink*, HRESULT> NewItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, HRESULT> PerformOperations;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperation*, BOOL*, HRESULT> GetAnyOperationsAborted;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
[Guid("04B0F1A7-9490-44BC-96E1-4296A31252E2")]
|
||||
internal unsafe struct IFileOperationProgressSink
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
internal static unsafe ref readonly Guid IID
|
||||
{
|
||||
get
|
||||
{
|
||||
ReadOnlySpan<byte> data = [0xA7, 0xF1, 0xB0, 0x04, 0x90, 0x94, 0xBC, 0x44, 0x96, 0xE1, 0x42, 0x96, 0xA3, 0x12, 0x52, 0xE2];
|
||||
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe HRESULT QueryInterface<TInterface>(ref readonly Guid riid, out TInterface* pvObject)
|
||||
where TInterface : unmanaged
|
||||
{
|
||||
fixed (Guid* riid2 = &riid)
|
||||
{
|
||||
fixed (TInterface** ppvObject = &pvObject)
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.QueryInterface((IUnknown*)Unsafe.AsPointer(ref this), riid2, (void**)ppvObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public uint AddRef()
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.AddRef((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
public uint Release()
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.Release((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
internal readonly struct Vftbl
|
||||
{
|
||||
internal readonly IUnknown.Vftbl IUnknownVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, HRESULT> StartOperations;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, HRESULT, HRESULT> FinishOperations;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, uint, IShellItem*, PCWSTR, HRESULT> PreRenameItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, uint, IShellItem*, PCWSTR, HRESULT, IShellItem*, HRESULT> PostRenameItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, uint, IShellItem*, IShellItem*, PCWSTR, HRESULT> PreMoveItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, uint, IShellItem*, IShellItem*, PCWSTR, HRESULT, IShellItem*, HRESULT> PostMoveItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, uint, IShellItem*, IShellItem*, PCWSTR, HRESULT> PreCopyItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, uint, IShellItem*, IShellItem*, PCWSTR, HRESULT, IShellItem*, HRESULT> PostCopyItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, uint, IShellItem*, HRESULT> PreDeleteItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, uint, IShellItem*, HRESULT, IShellItem*, HRESULT> PostDeleteItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, uint, IShellItem*, PCWSTR, HRESULT> PreNewItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, uint, IShellItem*, PCWSTR, PCWSTR, uint, HRESULT, IShellItem*, HRESULT> PostNewItem;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, uint, uint, HRESULT> UpdateProgress;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, HRESULT> ResetTimer;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, HRESULT> PauseTimer;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IFileOperationProgressSink*, HRESULT> ResumeTimer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using Snap.Hutao.Win32.UI.Shell.PropertiesSystem;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
[Guid("0C9FB851-E5C9-43EB-A370-F0677B13874C")]
|
||||
internal unsafe struct IOperationsProgressDialog
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
internal static unsafe ref readonly Guid IID
|
||||
{
|
||||
get
|
||||
{
|
||||
ReadOnlySpan<byte> data = [0x51, 0xB8, 0x9F, 0x0C, 0xC9, 0xE5, 0xEB, 0x43, 0xA3, 0x70, 0xF0, 0x67, 0x7B, 0x13, 0x87, 0x4C];
|
||||
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe HRESULT QueryInterface<TInterface>(ref readonly Guid riid, out TInterface* pvObject)
|
||||
where TInterface : unmanaged
|
||||
{
|
||||
fixed (Guid* riid2 = &riid)
|
||||
{
|
||||
fixed (TInterface** ppvObject = &pvObject)
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.QueryInterface((IUnknown*)Unsafe.AsPointer(ref this), riid2, (void**)ppvObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public uint AddRef()
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.AddRef((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
public uint Release()
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.Release((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
internal readonly struct Vftbl
|
||||
{
|
||||
internal readonly IUnknown.Vftbl IUnknownVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IOperationsProgressDialog*, HWND, uint, HRESULT> StartProgressDialog;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IOperationsProgressDialog*, HRESULT> StopProgressDialog;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IOperationsProgressDialog*, SPACTION, HRESULT> SetOperation;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IOperationsProgressDialog*, uint, HRESULT> SetMode;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IOperationsProgressDialog*, ulong, ulong, ulong, ulong, ulong, ulong, HRESULT> UpdateProgress;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IOperationsProgressDialog*, IShellItem*, IShellItem*, IShellItem*, HRESULT> UpdateLocations;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IOperationsProgressDialog*, HRESULT> ResetTimer;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IOperationsProgressDialog*, HRESULT> PauseTimer;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IOperationsProgressDialog*, HRESULT> ResumeTimer;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IOperationsProgressDialog*, ulong*, ulong*, HRESULT> GetMilliseconds;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IOperationsProgressDialog*, PDOPSTATUS*, HRESULT> GetOperationStatus;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell.PropertiesSystem;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
[Guid("FC0CA0A7-C316-4FD2-9031-3E628E6D4F23")]
|
||||
internal unsafe struct IObjectWithPropertyKey
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
internal static unsafe ref readonly Guid IID
|
||||
{
|
||||
get
|
||||
{
|
||||
ReadOnlySpan<byte> data = [0xA7, 0xA0, 0x0C, 0xFC, 0x16, 0xC3, 0xD2, 0x4F, 0x90, 0x31, 0x3E, 0x62, 0x8E, 0x6D, 0x4F, 0x23];
|
||||
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe HRESULT QueryInterface<TInterface>(ref readonly Guid riid, out TInterface* pvObject)
|
||||
where TInterface : unmanaged
|
||||
{
|
||||
fixed (Guid* riid2 = &riid)
|
||||
{
|
||||
fixed (TInterface** ppvObject = &pvObject)
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.QueryInterface((IUnknown*)Unsafe.AsPointer(ref this), riid2, (void**)ppvObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public uint AddRef()
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.AddRef((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
public uint Release()
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.Release((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
internal readonly struct Vftbl
|
||||
{
|
||||
internal readonly IUnknown.Vftbl IUnknownVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IObjectWithPropertyKey*, PROPERTYKEY*, HRESULT> SetPropertyKey;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IObjectWithPropertyKey*, PROPERTYKEY*, HRESULT> GetPropertyKey;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using Snap.Hutao.Win32.System.Com.StructuredStorage;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell.PropertiesSystem;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
[Guid("F917BC8A-1BBA-4478-A245-1BDE03EB9431")]
|
||||
internal unsafe struct IPropertyChange
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
internal static unsafe ref readonly Guid IID
|
||||
{
|
||||
get
|
||||
{
|
||||
ReadOnlySpan<byte> data = [0x8A, 0xBC, 0x17, 0xF9, 0xBA, 0x1B, 0x78, 0x44, 0xA2, 0x45, 0x1B, 0xDE, 0x03, 0xEB, 0x94, 0x31];
|
||||
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe HRESULT QueryInterface<TInterface>(ref readonly Guid riid, out TInterface* pvObject)
|
||||
where TInterface : unmanaged
|
||||
{
|
||||
fixed (Guid* riid2 = &riid)
|
||||
{
|
||||
fixed (TInterface** ppvObject = &pvObject)
|
||||
{
|
||||
return ThisPtr->IObjectWithPropertyKeyVftbl.IUnknownVftbl.QueryInterface((IUnknown*)Unsafe.AsPointer(ref this), riid2, (void**)ppvObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public uint AddRef()
|
||||
{
|
||||
return ThisPtr->IObjectWithPropertyKeyVftbl.IUnknownVftbl.AddRef((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
public uint Release()
|
||||
{
|
||||
return ThisPtr->IObjectWithPropertyKeyVftbl.IUnknownVftbl.Release((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
internal readonly struct Vftbl
|
||||
{
|
||||
internal readonly IObjectWithPropertyKey.Vftbl IObjectWithPropertyKeyVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IPropertyChange*, PROPVARIANT*, PROPVARIANT*, HRESULT> ApplyToPropVariant;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell.PropertiesSystem;
|
||||
|
||||
[SupportedOSPlatform("windows6.0.6000")]
|
||||
[Guid("380F5CAD-1B5E-42F2-805D-637FD392D31E")]
|
||||
internal unsafe struct IPropertyChangeArray
|
||||
{
|
||||
public readonly Vftbl* ThisPtr;
|
||||
|
||||
internal static unsafe ref readonly Guid IID
|
||||
{
|
||||
get
|
||||
{
|
||||
ReadOnlySpan<byte> data = [0xAD, 0x5C, 0x0F, 0x38, 0x5E, 0x1B, 0xF2, 0x42, 0x80, 0x5D, 0x63, 0x7F, 0xD3, 0x92, 0xD3, 0x1E];
|
||||
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe HRESULT QueryInterface<TInterface>(ref readonly Guid riid, out TInterface* pvObject)
|
||||
where TInterface : unmanaged
|
||||
{
|
||||
fixed (Guid* riid2 = &riid)
|
||||
{
|
||||
fixed (TInterface** ppvObject = &pvObject)
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.QueryInterface((IUnknown*)Unsafe.AsPointer(ref this), riid2, (void**)ppvObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public uint AddRef()
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.AddRef((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
public uint Release()
|
||||
{
|
||||
return ThisPtr->IUnknownVftbl.Release((IUnknown*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
internal readonly struct Vftbl
|
||||
{
|
||||
internal readonly IUnknown.Vftbl IUnknownVftbl;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IPropertyChangeArray*, uint*, HRESULT> GetCount;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IPropertyChangeArray*, uint, Guid*, void**, HRESULT> GetAt;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IPropertyChangeArray*, uint, IPropertyChange*, HRESULT> InsertAt;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IPropertyChangeArray*, IPropertyChange*, HRESULT> Append;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IPropertyChangeArray*, IPropertyChange*, HRESULT> AppendOrReplace;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IPropertyChangeArray*, uint, HRESULT> RemoveAt;
|
||||
internal readonly delegate* unmanaged[Stdcall]<IPropertyChangeArray*, PROPERTYKEY*, HRESULT> IsKeyInArray;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell.PropertiesSystem;
|
||||
|
||||
internal enum PDOPSTATUS
|
||||
{
|
||||
PDOPS_RUNNING = 1,
|
||||
PDOPS_PAUSED = 2,
|
||||
PDOPS_CANCELLED = 3,
|
||||
PDOPS_STOPPED = 4,
|
||||
PDOPS_ERRORS = 5,
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell.PropertiesSystem;
|
||||
|
||||
[SuppressMessage("", "SA1307")]
|
||||
internal struct PROPERTYKEY
|
||||
{
|
||||
public Guid fmtid;
|
||||
public uint pid;
|
||||
}
|
||||
22
src/Snap.Hutao/Snap.Hutao/Win32/UI/Shell/SPACTION.cs
Normal file
22
src/Snap.Hutao/Snap.Hutao/Win32/UI/Shell/SPACTION.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Win32.UI.Shell;
|
||||
|
||||
internal enum SPACTION
|
||||
{
|
||||
SPACTION_NONE = 0,
|
||||
SPACTION_MOVING = 1,
|
||||
SPACTION_COPYING = 2,
|
||||
SPACTION_RECYCLING = 3,
|
||||
SPACTION_APPLYINGATTRIBS = 4,
|
||||
SPACTION_DOWNLOADING = 5,
|
||||
SPACTION_SEARCHING_INTERNET = 6,
|
||||
SPACTION_CALCULATING = 7,
|
||||
SPACTION_UPLOADING = 8,
|
||||
SPACTION_SEARCHING_FILES = 9,
|
||||
SPACTION_DELETING = 10,
|
||||
SPACTION_RENAMING = 11,
|
||||
SPACTION_FORMATTING = 12,
|
||||
SPACTION_COPY_MOVING = 13,
|
||||
}
|
||||
Reference in New Issue
Block a user