Correct a few mistakes in the ComInterop code (#40234)
authorDongbo Wang <dongbow@microsoft.com>
Mon, 24 Aug 2020 23:33:04 +0000 (16:33 -0700)
committerGitHub <noreply@github.com>
Mon, 24 Aug 2020 23:33:04 +0000 (16:33 -0700)
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComHresults.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VarEnumSelector.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/Variant.Extended.cs

index 991f408..68ef4e6 100644 (file)
@@ -24,7 +24,6 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop
 
         internal const int E_NOINTERFACE = unchecked((int)0x80004002);
         internal const int E_FAIL = unchecked((int)0x80004005);
-        internal const int E_NOTIMPL = unchecked((int)0x80000001);
 
         internal const int TYPE_E_LIBNOTREGISTERED = unchecked((int)0x8002801D);
 
index 0397e0c..d8318cd 100644 (file)
@@ -97,8 +97,8 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop
                 { VarEnum.VT_UI2,       typeof(ushort) },
                 { VarEnum.VT_UI4,       typeof(uint) },
                 { VarEnum.VT_UI8,       typeof(ulong) },
-                { VarEnum.VT_INT,       typeof(IntPtr) },
-                { VarEnum.VT_UINT,      typeof(UIntPtr) },
+                { VarEnum.VT_INT,       typeof(int) },
+                { VarEnum.VT_UINT,      typeof(uint) },
                 { VarEnum.VT_BOOL,      typeof(bool) },
                 { VarEnum.VT_R4,        typeof(float) },
                 { VarEnum.VT_R8,        typeof(double) },
index 5736b36..777518d 100644 (file)
@@ -69,14 +69,14 @@ namespace System.Runtime.InteropServices
 
         // VT_INT
 
-        public void SetAsByrefInt(ref IntPtr value)
+        public void SetAsByrefInt(ref int value)
         {
             SetAsByref(ref value, VarEnum.VT_INT);
         }
 
         // VT_UINT
 
-        public void SetAsByrefUint(ref UIntPtr value)
+        public void SetAsByrefUint(ref uint value)
         {
             SetAsByref(ref value, VarEnum.VT_UINT);
         }