From: olekarev Date: Tue, 14 Jun 2022 12:35:24 +0000 (+0300) Subject: Some return value types changed from HResult to int to avoid X-Git-Tag: accepted/tizen/unified/20221103.165810~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4aa9677d8b6446fc948c91da783a9020bf70573b;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Some return value types changed from HResult to int to avoid crashes on x86 architecture. Clrmd binaries have been changed for the same reason. --- diff --git a/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.Utilities.dll b/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.Utilities.dll old mode 100755 new mode 100644 index 12f228122..060f9e485 Binary files a/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.Utilities.dll and b/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.Utilities.dll differ diff --git a/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.Utilities.xml b/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.Utilities.xml old mode 100755 new mode 100644 diff --git a/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netcoreapp3.1/Microsoft.Diagnostics.Runtime.Utilities.dll b/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netcoreapp3.1/Microsoft.Diagnostics.Runtime.Utilities.dll old mode 100755 new mode 100644 index ea0603f0e..529c3b083 Binary files a/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netcoreapp3.1/Microsoft.Diagnostics.Runtime.Utilities.dll and b/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netcoreapp3.1/Microsoft.Diagnostics.Runtime.Utilities.dll differ diff --git a/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netcoreapp3.1/Microsoft.Diagnostics.Runtime.Utilities.xml b/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netcoreapp3.1/Microsoft.Diagnostics.Runtime.Utilities.xml old mode 100755 new mode 100644 diff --git a/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.Utilities.dll b/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.Utilities.dll old mode 100755 new mode 100644 index 4684718cb..315c96b3e Binary files a/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.Utilities.dll and b/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.Utilities.dll differ diff --git a/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.Utilities.xml b/.packages/microsoft.diagnostics.runtime.utilities/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.Utilities.xml old mode 100755 new mode 100644 diff --git a/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.dll b/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.dll old mode 100755 new mode 100644 index 49f91b028..e0295dcea Binary files a/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.dll and b/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.dll differ diff --git a/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.xml b/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net461/Microsoft.Diagnostics.Runtime.xml old mode 100755 new mode 100644 diff --git a/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net5.0/Microsoft.Diagnostics.Runtime.dll b/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net5.0/Microsoft.Diagnostics.Runtime.dll old mode 100755 new mode 100644 index 50111c253..9fe6256d3 Binary files a/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net5.0/Microsoft.Diagnostics.Runtime.dll and b/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net5.0/Microsoft.Diagnostics.Runtime.dll differ diff --git a/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net5.0/Microsoft.Diagnostics.Runtime.xml b/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/net5.0/Microsoft.Diagnostics.Runtime.xml old mode 100755 new mode 100644 diff --git a/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/netcoreapp3.1/Microsoft.Diagnostics.Runtime.dll b/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/netcoreapp3.1/Microsoft.Diagnostics.Runtime.dll old mode 100755 new mode 100644 index 796e2758c..f13bcb1fa Binary files a/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/netcoreapp3.1/Microsoft.Diagnostics.Runtime.dll and b/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/netcoreapp3.1/Microsoft.Diagnostics.Runtime.dll differ diff --git a/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.dll b/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.dll old mode 100755 new mode 100644 index 552f462bc..67b1d04b8 Binary files a/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.dll and b/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.dll differ diff --git a/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.xml b/.packages/microsoft.diagnostics.runtime/2.0.325901/lib/netstandard2.0/Microsoft.Diagnostics.Runtime.xml old mode 100755 new mode 100644 diff --git a/src/SOS/SOS.Hosting/DataTargetWrapper.cs b/src/SOS/SOS.Hosting/DataTargetWrapper.cs index e8106b67e..93d42b065 100644 --- a/src/SOS/SOS.Hosting/DataTargetWrapper.cs +++ b/src/SOS/SOS.Hosting/DataTargetWrapper.cs @@ -101,7 +101,7 @@ namespace SOS.Hosting #region ICLRDataTarget - private HResult GetMachineType( + private int GetMachineType( IntPtr self, out IMAGE_FILE_MACHINE machineType) { @@ -121,7 +121,7 @@ namespace SOS.Hosting return HResult.S_OK; } - private HResult GetPointerSize( + private int GetPointerSize( IntPtr self, out int pointerSize) { @@ -129,7 +129,7 @@ namespace SOS.Hosting return HResult.S_OK; } - private HResult GetImageBase( + private int GetImageBase( IntPtr self, string imagePath, out ulong baseAddress) @@ -144,7 +144,7 @@ namespace SOS.Hosting return HResult.E_FAIL; } - private HResult ReadVirtual( + private int ReadVirtual( IntPtr self, ulong address, IntPtr buffer, @@ -163,7 +163,7 @@ namespace SOS.Hosting return HResult.S_OK; } - private HResult WriteVirtual( + private int WriteVirtual( IntPtr self, ulong address, IntPtr buffer, @@ -180,7 +180,7 @@ namespace SOS.Hosting return HResult.S_OK; } - private HResult GetTLSValue( + private int GetTLSValue( IntPtr self, uint threadId, uint index, @@ -189,7 +189,7 @@ namespace SOS.Hosting return HResult.E_NOTIMPL; } - private HResult SetTLSValue( + private int SetTLSValue( IntPtr self, uint threadId, uint index, @@ -198,7 +198,7 @@ namespace SOS.Hosting return HResult.E_NOTIMPL; } - private HResult GetCurrentThreadID( + private int GetCurrentThreadID( IntPtr self, out uint threadId) { @@ -212,7 +212,7 @@ namespace SOS.Hosting return HResult.E_FAIL; } - private HResult GetThreadContext( + private int GetThreadContext( IntPtr self, uint threadId, uint contextFlags, @@ -241,7 +241,7 @@ namespace SOS.Hosting return HResult.S_OK; } - private HResult SetThreadContext( + private int SetThreadContext( IntPtr self, uint threadId, int contextSize, @@ -250,7 +250,7 @@ namespace SOS.Hosting return HResult.E_NOTIMPL; } - private HResult Request( + private int Request( IntPtr self, uint reqCode, uint inBufferSize, @@ -265,7 +265,7 @@ namespace SOS.Hosting #region ICLRDataTarget2 - private HResult AllocVirtual( + private int AllocVirtual( IntPtr self, ulong address, uint size, @@ -283,7 +283,7 @@ namespace SOS.Hosting return HResult.S_OK; } - private HResult FreeVirtual( + private int FreeVirtual( IntPtr self, ulong address, uint size, @@ -325,7 +325,7 @@ namespace SOS.Hosting #region ICLRMetadataLocator - private HResult GetMetadata( + private int GetMetadata( IntPtr self, string fileName, uint imageTimestamp, @@ -344,7 +344,7 @@ namespace SOS.Hosting #region ICLRRuntimeLocator - private HResult GetRuntimeBase( + private int GetRuntimeBase( IntPtr self, out ulong address) { @@ -357,23 +357,23 @@ namespace SOS.Hosting #region ICLRDataTarget delegates [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult GetMachineTypeDelegate( + private delegate int GetMachineTypeDelegate( [In] IntPtr self, [Out] out IMAGE_FILE_MACHINE machineType); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult GetPointerSizeDelegate( + private delegate int GetPointerSizeDelegate( [In] IntPtr self, [Out] out int pointerSize); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult GetImageBaseDelegate( + private delegate int GetImageBaseDelegate( [In] IntPtr self, [In][MarshalAs(UnmanagedType.LPWStr)] string imagePath, [Out] out ulong baseAddress); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult ReadVirtualDelegate( + private delegate int ReadVirtualDelegate( [In] IntPtr self, [In] ulong address, [In] IntPtr buffer, @@ -381,7 +381,7 @@ namespace SOS.Hosting [Out] uint* bytesRead); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult WriteVirtualDelegate( + private delegate int WriteVirtualDelegate( [In] IntPtr self, [In] ulong address, [In] IntPtr buffer, @@ -389,26 +389,26 @@ namespace SOS.Hosting [Out] uint* bytesWritten); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult GetTLSValueDelegate( + private delegate int GetTLSValueDelegate( [In] IntPtr self, [In] uint threadId, [In] uint index, [Out] ulong* value); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult SetTLSValueDelegate( + private delegate int SetTLSValueDelegate( [In] IntPtr self, [In] uint threadId, [In] uint index, [In] ulong value); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult GetCurrentThreadIDDelegate( + private delegate int GetCurrentThreadIDDelegate( [In] IntPtr self, [Out] out uint threadId); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult GetThreadContextDelegate( + private delegate int GetThreadContextDelegate( [In] IntPtr self, [In] uint threadId, [In] uint contextFlags, @@ -416,14 +416,14 @@ namespace SOS.Hosting [Out] IntPtr context); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult SetThreadContextDelegate( + private delegate int SetThreadContextDelegate( [In] IntPtr self, [In] uint threadId, [In] int contextSize, [In] IntPtr context); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult RequestDelegate( + private delegate int RequestDelegate( [In] IntPtr self, [In] uint reqCode, [In] uint inBufferSize, @@ -436,7 +436,7 @@ namespace SOS.Hosting #region ICLRDataTarget2 delegates [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult AllocVirtualDelegate( + private delegate int AllocVirtualDelegate( [In] IntPtr self, [In] ulong address, [In] uint size, @@ -445,7 +445,7 @@ namespace SOS.Hosting [Out] ulong* buffer); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult FreeVirtualDelegate( + private delegate int FreeVirtualDelegate( [In] IntPtr self, [In] ulong address, [In] uint size, @@ -467,7 +467,7 @@ namespace SOS.Hosting #region ICLRMetadataLocator delegate [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult GetMetadataDelegate( + private delegate int GetMetadataDelegate( [In] IntPtr self, [In][MarshalAs(UnmanagedType.LPWStr)] string fileName, [In] uint imageTimestamp, @@ -484,7 +484,7 @@ namespace SOS.Hosting #region ICLRRuntimeLocator delegate [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult GetRuntimeBaseDelegate( + private delegate int GetRuntimeBaseDelegate( [In] IntPtr self, [Out] out ulong address); diff --git a/src/SOS/SOS.Hosting/HostWrapper.cs b/src/SOS/SOS.Hosting/HostWrapper.cs index e1fb16bb2..5b9a2c17d 100644 --- a/src/SOS/SOS.Hosting/HostWrapper.cs +++ b/src/SOS/SOS.Hosting/HostWrapper.cs @@ -48,7 +48,7 @@ namespace SOS.Hosting /// /// target wrapper address returned /// S_OK - private HResult GetCurrentTarget(IntPtr self, out IntPtr targetWrapper) + private int GetCurrentTarget(IntPtr self, out IntPtr targetWrapper) { TargetWrapper wrapper = _getTarget(); if (wrapper == null) @@ -70,13 +70,13 @@ namespace SOS.Hosting [In] IntPtr self); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - internal delegate HResult GetServiceDelegate( + internal delegate int GetServiceDelegate( [In] IntPtr self, [In] in Guid guid, [Out] out IntPtr ptr); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult GetCurrentTargetDelegate( + private delegate int GetCurrentTargetDelegate( [In] IntPtr self, [Out] out IntPtr target); diff --git a/src/SOS/SOS.Hosting/ServiceWrapper.cs b/src/SOS/SOS.Hosting/ServiceWrapper.cs index 7dbf7dc01..43ac85e9a 100644 --- a/src/SOS/SOS.Hosting/ServiceWrapper.cs +++ b/src/SOS/SOS.Hosting/ServiceWrapper.cs @@ -87,7 +87,7 @@ namespace SOS.Hosting /// guid of the service /// pointer to return service instance /// S_OK or E_NOINTERFACE - public HResult GetService(IntPtr self, in Guid guid, out IntPtr ptr) + public int GetService(IntPtr self, in Guid guid, out IntPtr ptr) { ptr = IntPtr.Zero; diff --git a/src/SOS/SOS.Hosting/TargetWrapper.cs b/src/SOS/SOS.Hosting/TargetWrapper.cs index e20be17d9..6a5531814 100644 --- a/src/SOS/SOS.Hosting/TargetWrapper.cs +++ b/src/SOS/SOS.Hosting/TargetWrapper.cs @@ -82,7 +82,7 @@ namespace SOS.Hosting return _target.GetTempDirectory(); } - private HResult GetRuntime( + private int GetRuntime( IntPtr self, IntPtr* ppRuntime) { @@ -120,7 +120,7 @@ namespace SOS.Hosting [In] IntPtr self); [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate HResult GetRuntimeDelegate( + private delegate int GetRuntimeDelegate( [In] IntPtr self, [Out] IntPtr* ppRuntime);