Skip to content

Commit 4e287a7

Browse files
committed
Improved
1 parent 754c53b commit 4e287a7

File tree

3 files changed

+182
-186
lines changed

3 files changed

+182
-186
lines changed

src/Files.App.CsWin32/IInternalCustomDestinationList.cs

Lines changed: 37 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) 0x5BFA. All rights reserved.
22
// Licensed under the MIT License.
33

4+
using Files.Shared.Attributes;
45
using System;
56
using System.Runtime.CompilerServices;
67
using System.Runtime.InteropServices;
@@ -17,88 +18,54 @@ namespace Windows.Win32.System.Com
1718
/// </remarks>
1819
public unsafe partial struct IInternalCustomDestinationList : IComIID
1920
{
20-
#pragma warning disable CS0649 // Field 'field' is never assigned to, and will always have its default value 'value'
21-
private void** lpVtbl;
22-
#pragma warning restore CS0649 // Field 'field' is never assigned to, and will always have its default value 'value'
23-
24-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
25-
public HRESULT SetMinItems(uint dwMinItems)
26-
=> (HRESULT)((delegate* unmanaged[MemberFunction]<IInternalCustomDestinationList*, uint, int>)lpVtbl[3])(
27-
(IInternalCustomDestinationList*)Unsafe.AsPointer(ref this), dwMinItems);
28-
29-
/// <summary>
30-
/// Initializes this instance of <see cref="IInternalCustomDestinationList"/> with the specified Application User Model ID (AMUID).
31-
/// </summary>
21+
[GeneratedVTableFunction(Index = 3)]
22+
public partial HRESULT SetMinItems(uint dwMinItems);
23+
24+
/// <summary>Initializes this instance of <see cref="IInternalCustomDestinationList"/> with the specified Application User Model ID (AMUID).</summary>
3225
/// <param name="pszAppID">The Application User Model ID to initialize this instance of <see cref="IInternalCustomDestinationList"/> with.</param>
3326
/// <returns>Returns <see cref="HRESULT.S_OK"/> if successful, or an error value otherwise.</returns>
34-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
35-
public HRESULT SetApplicationID(PCWSTR pszAppID)
36-
=> (HRESULT)((delegate* unmanaged[MemberFunction]<IInternalCustomDestinationList*, PCWSTR, int>)lpVtbl[4])(
37-
(IInternalCustomDestinationList*)Unsafe.AsPointer(ref this), pszAppID);
38-
39-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
40-
public HRESULT GetSlotCount(uint* pSlotCount)
41-
=> (HRESULT)((delegate* unmanaged[MemberFunction]<IInternalCustomDestinationList*, uint*, int>)lpVtbl[5])(
42-
(IInternalCustomDestinationList*)Unsafe.AsPointer(ref this), pSlotCount);
43-
44-
/// <summary>
45-
/// Gets the number of categories in the custom destination list.
46-
/// </summary>
27+
[GeneratedVTableFunction(Index = 4)]
28+
public partial HRESULT SetApplicationID(PCWSTR pszAppID);
29+
30+
[GeneratedVTableFunction(Index = 5)]
31+
public partial HRESULT GetSlotCount(uint* pSlotCount);
32+
33+
/// <summary>Gets the number of categories in the custom destination list.</summary>
4734
/// <param name="pdwCategoryCount">A pointer that points to a valid <see langword="uint"/> var.</param>
4835
/// <returns>Returns <see cref="HRESULT.S_OK"/> if successful, or an error value otherwise.</returns>
49-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
50-
public HRESULT GetCategoryCount(uint* pCategoryCount)
51-
=> (HRESULT)((delegate* unmanaged[MemberFunction]<IInternalCustomDestinationList*, uint*, int>)lpVtbl[6])(
52-
(IInternalCustomDestinationList*)Unsafe.AsPointer(ref this), pCategoryCount);
53-
54-
/// <summary>
55-
/// Gets the category at the specified index in the custom destination list.
56-
/// </summary>
36+
[GeneratedVTableFunction(Index = 6)]
37+
public partial HRESULT GetCategoryCount(uint* pCategoryCount);
38+
39+
/// <summary>Gets the category at the specified index in the custom destination list.</summary>
5740
/// <param name="index">The index to get the category in the custom destination list at.</param>
5841
/// <param name="flags">The flags to filter up the queried destinations.</param>
5942
/// <param name="pCategory">A pointer that points to a valid <see cref="APPDESTCATEGORY"/> var.</param>
6043
/// <returns>Returns <see cref="HRESULT.S_OK"/> if successful, or an error value otherwise.</returns>
61-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
62-
public HRESULT GetCategory(uint index, GETCATFLAG flags, APPDESTCATEGORY* pCategory)
63-
=> (HRESULT)((delegate* unmanaged[MemberFunction]<IInternalCustomDestinationList*, uint, GETCATFLAG, APPDESTCATEGORY*, int>)lpVtbl[7])(
64-
(IInternalCustomDestinationList*)Unsafe.AsPointer(ref this), index, flags, pCategory);
65-
66-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
67-
public HRESULT DeleteCategory(uint index, BOOL deletePermanently)
68-
=> (HRESULT)((delegate* unmanaged[MemberFunction]<IInternalCustomDestinationList*, uint, BOOL, int>)lpVtbl[8])(
69-
(IInternalCustomDestinationList*)Unsafe.AsPointer(ref this), index, deletePermanently);
70-
71-
/// <summary>
72-
/// Enumerates the destinations at the specific index in the categories in the custom destinations.
73-
/// </summary>
44+
[GeneratedVTableFunction(Index = 7)]
45+
public partial HRESULT GetCategory(uint index, GETCATFLAG flags, APPDESTCATEGORY* pCategory);
46+
47+
[GeneratedVTableFunction(Index = 8)]
48+
public partial HRESULT DeleteCategory(uint index, BOOL deletePermanently);
49+
50+
/// <summary>Enumerates the destinations at the specific index in the categories in the custom destinations.</summary>
7451
/// <param name="index">The index to get the destinations at in the categories.</param>
7552
/// <param name="riid">A reference to the interface identifier (IID) of the interface being queried for.</param>
7653
/// <param name="ppvObject">The address of a pointer to an interface with the IID specified in the riid parameter.</param>
7754
/// <returns>Returns <see cref="HRESULT.S_OK"/> if successful, or an error value otherwise.</returns>
78-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
79-
public HRESULT EnumerateCategoryDestinations(uint index, Guid* riid, void** ppvObject)
80-
=> (HRESULT)((delegate* unmanaged[MemberFunction]<IInternalCustomDestinationList*, uint, Guid*, void**, int>)lpVtbl[9])(
81-
(IInternalCustomDestinationList*)Unsafe.AsPointer(ref this), index, riid, ppvObject);
82-
83-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
84-
public HRESULT RemoveDestination(IUnknown* pUnk)
85-
=> (HRESULT)((delegate* unmanaged[MemberFunction]<IInternalCustomDestinationList*, IUnknown*, int>)lpVtbl[10])
86-
((IInternalCustomDestinationList*)Unsafe.AsPointer(ref this), pUnk);
87-
88-
//[MethodImpl(MethodImplOptions.AggressiveInlining)]
89-
//public HRESULT ResolveDestination(...)
90-
// => (HRESULT)((delegate* unmanaged[MemberFunction]<IInternalCustomDestinationList*, ..., int>)lpVtbl[11])
91-
// ((IInternalCustomDestinationList*)Unsafe.AsPointer(ref this), ...);
92-
93-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
94-
public HRESULT HasListEx(int* a1, int* a2)
95-
=> (HRESULT)((delegate* unmanaged[MemberFunction]<IInternalCustomDestinationList*, int*, int*, int>)lpVtbl[12])
96-
((IInternalCustomDestinationList*)Unsafe.AsPointer(ref this), a1, a2);
97-
98-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
99-
public HRESULT ClearRemovedDestinations()
100-
=> (HRESULT)((delegate* unmanaged[MemberFunction]<IInternalCustomDestinationList*, int>)lpVtbl[13])
101-
((IInternalCustomDestinationList*)Unsafe.AsPointer(ref this));
55+
[GeneratedVTableFunction(Index = 9)]
56+
public partial HRESULT EnumerateCategoryDestinations(uint index, Guid* riid, void** ppvObject);
57+
58+
[GeneratedVTableFunction(Index = 10)]
59+
public partial HRESULT RemoveDestination(IUnknown* pUnk);
60+
61+
//[GeneratedVTableFunction(Index = 11)]
62+
//public partial HRESULT ResolveDestination(...);
63+
64+
[GeneratedVTableFunction(Index = 12)]
65+
public partial HRESULT HasListEx(int* a1, int* a2);
66+
67+
[GeneratedVTableFunction(Index = 13)]
68+
public partial HRESULT ClearRemovedDestinations();
10269

10370
static ref readonly Guid IComIID.Guid => throw new NotImplementedException();
10471
}

0 commit comments

Comments
 (0)