Skip to content

Commit

Permalink
Fix typo in variable name (#54989)
Browse files Browse the repository at this point in the history
  • Loading branch information
kant2002 committed Jul 1, 2021
1 parent 3ed780d commit fc73461
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ private DrawingComWrappers() { }

private static ComInterfaceEntry* InitializeComInterfaceEntry()
{
GetIUnknownImpl(out IntPtr fpQueryInteface, out IntPtr fpAddRef, out IntPtr fpRelease);
GetIUnknownImpl(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease);

IntPtr iStreamVtbl = IStreamVtbl.Create(fpQueryInteface, fpAddRef, fpRelease);
IntPtr iStreamVtbl = IStreamVtbl.Create(fpQueryInterface, fpAddRef, fpRelease);

ComInterfaceEntry* wrapperEntry = (ComInterfaceEntry*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(DrawingComWrappers), sizeof(ComInterfaceEntry));
wrapperEntry->IID = IID_IStream;
Expand Down Expand Up @@ -68,10 +68,10 @@ protected override void ReleaseObjects(IEnumerable objects)

internal static class IStreamVtbl
{
public static IntPtr Create(IntPtr fpQueryInteface, IntPtr fpAddRef, IntPtr fpRelease)
public static IntPtr Create(IntPtr fpQueryInterface, IntPtr fpAddRef, IntPtr fpRelease)
{
IntPtr* vtblRaw = (IntPtr*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(IStreamVtbl), IntPtr.Size * 14);
vtblRaw[0] = fpQueryInteface;
vtblRaw[0] = fpQueryInterface;
vtblRaw[1] = fpAddRef;
vtblRaw[2] = fpRelease;
vtblRaw[3] = (IntPtr)(delegate* unmanaged<IntPtr, byte*, uint, uint*, int>)&Read;
Expand Down
12 changes: 6 additions & 6 deletions src/tests/Interop/COM/ComWrappers/API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class TestComWrappers : ComWrappers
{
protected unsafe override ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count)
{
IntPtr fpQueryInteface = default;
IntPtr fpQueryInterface = default;
IntPtr fpAddRef = default;
IntPtr fpRelease = default;
ComWrappers.GetIUnknownImpl(out fpQueryInteface, out fpAddRef, out fpRelease);
ComWrappers.GetIUnknownImpl(out fpQueryInterface, out fpAddRef, out fpRelease);

ComInterfaceEntry* entryRaw = null;
count = 0;
Expand All @@ -31,7 +31,7 @@ class TestComWrappers : ComWrappers
{
IUnknownImpl = new IUnknownVtbl()
{
QueryInterface = fpQueryInteface,
QueryInterface = fpQueryInterface,
AddRef = fpAddRef,
Release = fpRelease
},
Expand Down Expand Up @@ -70,9 +70,9 @@ public static void ValidateIUnknownImpls()
{
Console.WriteLine($"Running {nameof(ValidateIUnknownImpls)}...");

ComWrappers.GetIUnknownImpl(out IntPtr fpQueryInteface, out IntPtr fpAddRef, out IntPtr fpRelease);
ComWrappers.GetIUnknownImpl(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease);

Assert.AreNotEqual(fpQueryInteface, IntPtr.Zero);
Assert.AreNotEqual(fpQueryInterface, IntPtr.Zero);
Assert.AreNotEqual(fpAddRef, IntPtr.Zero);
Assert.AreNotEqual(fpRelease, IntPtr.Zero);
}
Expand Down Expand Up @@ -198,7 +198,7 @@ static void ValidateCreateObjectCachingScenario()

static void ValidateWrappersInstanceIsolation()
{
Console.WriteLine($"Running {nameof(ValidateWrappersInstanceIsolation)}...");
Console.WriteLine($"Running {nameof(ValidateWrappersInstanceIsolation)}...");

var cw1 = new TestComWrappers();
var cw2 = new TestComWrappers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ class GlobalComWrappers : ComWrappers
}
else if (string.Equals(ManagedServerTypeName, obj.GetType().Name))
{
IntPtr fpQueryInteface = default;
IntPtr fpQueryInterface = default;
IntPtr fpAddRef = default;
IntPtr fpRelease = default;
ComWrappers.GetIUnknownImpl(out fpQueryInteface, out fpAddRef, out fpRelease);
ComWrappers.GetIUnknownImpl(out fpQueryInterface, out fpAddRef, out fpRelease);

var vtbl = new IUnknownVtbl()
{
QueryInterface = fpQueryInteface,
QueryInterface = fpQueryInterface,
AddRef = fpAddRef,
Release = fpRelease
};
Expand Down Expand Up @@ -176,14 +176,14 @@ protected override void ReleaseObjects(IEnumerable objects)

private unsafe ComInterfaceEntry* ComputeVtablesForTestObject(Test obj, out int count)
{
IntPtr fpQueryInteface = default;
IntPtr fpQueryInterface = default;
IntPtr fpAddRef = default;
IntPtr fpRelease = default;
ComWrappers.GetIUnknownImpl(out fpQueryInteface, out fpAddRef, out fpRelease);
ComWrappers.GetIUnknownImpl(out fpQueryInterface, out fpAddRef, out fpRelease);

var iUnknownVtbl = new IUnknownVtbl()
{
QueryInterface = fpQueryInteface,
QueryInterface = fpQueryInterface,
AddRef = fpAddRef,
Release = fpRelease
};
Expand Down

0 comments on commit fc73461

Please sign in to comment.