Target .NET 8, 9, 10, Framework 4.7.2, and Framework 4.8. Rename samples to stable Core and Framework names. Add raw-vtable COM tests for x64, x86, and ARM64, and require the Azure architecture matrix before packaging.
52 lines
1.6 KiB
C#
52 lines
1.6 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using Lithnet.CredentialProvider.Interop;
|
|
|
|
namespace Lithnet.CredentialProvider.UnitTests.ComInterop
|
|
{
|
|
[ComVisible(true)]
|
|
[ClassInterface(ClassInterfaceType.None)]
|
|
// The in-process call also requires the callback to implement the parameter's managed interface type.
|
|
// ITestCredentialProviderUserArray keeps the COM contract under test independent of that adapter.
|
|
internal sealed class TestCredentialProviderUserArray : ITestCredentialProviderUserArray, ICredentialProviderUserArray
|
|
{
|
|
public int GetCountCallCount { get; private set; }
|
|
|
|
public int SetProviderFilter(ref Guid providerToFilterTo)
|
|
{
|
|
return CredentialProviderAbi.E_NOTIMPL;
|
|
}
|
|
|
|
public int GetAccountOptions(out int accountOptions)
|
|
{
|
|
accountOptions = 0;
|
|
return CredentialProviderAbi.S_OK;
|
|
}
|
|
|
|
public int GetCount(out uint userCount)
|
|
{
|
|
this.GetCountCallCount++;
|
|
userCount = 0;
|
|
return CredentialProviderAbi.S_OK;
|
|
}
|
|
|
|
public int GetAt(uint userIndex, out IntPtr user)
|
|
{
|
|
user = IntPtr.Zero;
|
|
return CredentialProviderAbi.E_INVALIDARG;
|
|
}
|
|
|
|
int ICredentialProviderUserArray.GetAccountOptions(out AccountOptions accountOptions)
|
|
{
|
|
accountOptions = AccountOptions.None;
|
|
return CredentialProviderAbi.S_OK;
|
|
}
|
|
|
|
int ICredentialProviderUserArray.GetAt(uint userIndex, out ICredentialProviderUser user)
|
|
{
|
|
user = null;
|
|
return CredentialProviderAbi.E_INVALIDARG;
|
|
}
|
|
}
|
|
}
|