-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Code Quality: Self-defined IStorageProviderQuotaUI instead of using StorageProviderStatusUI.FromAbi #16965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Quality: Self-defined IStorageProviderQuotaUI instead of using StorageProviderStatusUI.FromAbi #16965
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // Copyright (c) Files Community | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System; | ||
| using System.Diagnostics; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
| using Windows.Win32.Foundation; | ||
|
|
||
| namespace Windows.Win32.System.WinRT | ||
| { | ||
| public unsafe struct IStorageProviderQuotaUI : IComIID | ||
| { | ||
| private void** lpVtbl; | ||
|
Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderQuotaUI.cs
|
||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public HRESULT GetQuotaTotalInBytes(ulong* value) | ||
| { | ||
| return ((delegate* unmanaged[Stdcall]<IStorageProviderQuotaUI*, ulong*, HRESULT>)(lpVtbl[6]))((IStorageProviderQuotaUI*)Unsafe.AsPointer(ref this), value); | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public HRESULT GetQuotaUsedInBytes(ulong* value) | ||
| { | ||
| return ((delegate* unmanaged[Stdcall]<IStorageProviderQuotaUI*, ulong*, HRESULT>)(lpVtbl[8]))((IStorageProviderQuotaUI*)Unsafe.AsPointer(ref this), value); | ||
| } | ||
|
|
||
| public static ref readonly Guid Guid | ||
| { | ||
| get | ||
| { | ||
| // BA6295C3-312E-544F-9FD5-1F81B21F3649 | ||
| ReadOnlySpan<byte> data = | ||
| [ | ||
| 0xC3, 0x95, 0x62, 0xBA, | ||
| 0x2E, 0x31, | ||
| 0x4F, 0x54, | ||
| 0x9F, 0xD5, | ||
| 0x1F, 0x81, 0xB2, 0x1F, 0x36, 0x49 | ||
| ]; | ||
|
|
||
| Debug.Assert(data.Length == sizeof(Guid)); | ||
| return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data)); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Copyright (c) Files Community | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System; | ||
| using System.Diagnostics; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
| using Windows.Win32.Foundation; | ||
|
|
||
| namespace Windows.Win32.System.WinRT | ||
| { | ||
| public unsafe struct IStorageProviderStatusUI : IComIID | ||
| { | ||
| private void** lpVtbl; | ||
|
Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUI.cs
|
||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public HRESULT GetQuotaUI(IStorageProviderQuotaUI** result) | ||
| { | ||
| return ((delegate* unmanaged[Stdcall]<IStorageProviderStatusUI*, IStorageProviderQuotaUI**, HRESULT>)lpVtbl[14])((IStorageProviderStatusUI*)Unsafe.AsPointer(ref this), result); | ||
| } | ||
|
|
||
| public static ref readonly Guid Guid | ||
| { | ||
| get | ||
| { | ||
| // d6b6a758-198d-5b80-977f-5ff73da33118 | ||
| ReadOnlySpan<byte> data = | ||
| [ | ||
| 0x58, 0xa7, 0xb6, 0xd6, | ||
| 0x8d, 0x19, | ||
| 0x80, 0x5b, | ||
| 0x97, 0x7f, | ||
| 0x5f, 0xf7, 0x3d, 0xa3, 0x31, 0x18 | ||
| ]; | ||
|
|
||
| Debug.Assert(data.Length == sizeof(Guid)); | ||
| return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data)); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Copyright (c) Files Community | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System; | ||
| using System.Diagnostics; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
| using Windows.Win32.Foundation; | ||
|
|
||
| namespace Windows.Win32.System.WinRT | ||
| { | ||
| public unsafe struct IStorageProviderStatusUISource : IComIID | ||
| { | ||
| private void** lpVtbl; | ||
|
Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUISource.cs
|
||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public HRESULT GetStatusUI(IStorageProviderStatusUI** result) | ||
| { | ||
| return ((delegate* unmanaged[Stdcall]<IStorageProviderStatusUISource*, IStorageProviderStatusUI**, HRESULT>)lpVtbl[6])((IStorageProviderStatusUISource*)Unsafe.AsPointer(ref this), result); | ||
| } | ||
|
|
||
| public static ref readonly Guid Guid | ||
| { | ||
| get | ||
| { | ||
| // A306C249-3D66-5E70-9007-E43DF96051FF | ||
| ReadOnlySpan<byte> data = | ||
| [ | ||
| 0x49, 0xc2, 0x06, 0xa3, | ||
| 0x66, 0x3d, | ||
| 0x70, 0x5e, | ||
| 0x90, 0x07, | ||
| 0xe4, 0x3d, 0xf9, 0x60, 0x51, 0xff | ||
| ]; | ||
|
|
||
| Debug.Assert(data.Length == sizeof(Guid)); | ||
| return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data)); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Copyright (c) Files Community | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System; | ||
| using System.Diagnostics; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
| using Windows.Win32.Foundation; | ||
|
|
||
| namespace Windows.Win32.System.WinRT | ||
| { | ||
| public unsafe struct IStorageProviderStatusUISourceFactory : IComIID | ||
| { | ||
| private void** lpVtbl; | ||
|
Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUISourceFactory.cs
|
||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public HRESULT GetStatusUISource(nint syncRootId, IStorageProviderStatusUISource** result) | ||
| { | ||
| return ((delegate* unmanaged[Stdcall]<IStorageProviderStatusUISourceFactory*, nint, IStorageProviderStatusUISource**, HRESULT>)lpVtbl[6])((IStorageProviderStatusUISourceFactory*)Unsafe.AsPointer(ref this), syncRootId, result); | ||
| } | ||
|
|
||
| public static ref readonly Guid Guid | ||
| { | ||
| get | ||
| { | ||
| // 12E46B74-4E5A-58D1-A62F-0376E8EE7DD8 | ||
| ReadOnlySpan<byte> data = | ||
| [ | ||
| 0x74, 0x6b, 0xe4, 0x12, | ||
| 0x5a, 0x4e, | ||
| 0xd1, 0x58, | ||
| 0xa6, 0x2f, | ||
| 0x03, 0x76, 0xe8, 0xee, 0x7d, 0xd8 | ||
| ]; | ||
|
|
||
| Debug.Assert(data.Length == sizeof(Guid)); | ||
| return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data)); | ||
| } | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.