IntPtr self,
uint threadId,
uint contextFlags,
- uint contextSize,
+ int contextSize,
IntPtr context)
{
byte[] registerContext;
}
try
{
- Marshal.Copy(registerContext, 0, context, (int)contextSize);
+ Marshal.Copy(registerContext, 0, context, Math.Min(registerContext.Length, contextSize));
}
catch (Exception ex) when (ex is ArgumentOutOfRangeException or ArgumentNullException)
{
[In] IntPtr self,
[In] uint threadId,
[In] uint contextFlags,
- [In] uint contextSize,
+ [In] int contextSize,
[Out] IntPtr context);
#endregion
}
try
{
- Marshal.Copy(registerContext, 0, context, contextSize);
+ Marshal.Copy(registerContext, 0, context, Math.Min(registerContext.Length, contextSize));
}
catch (Exception ex) when (ex is ArgumentOutOfRangeException or ArgumentNullException)
{
private delegate int GetThreadContextDelegate(
[In] IntPtr self,
[In] IntPtr context,
- [In] uint contextSize);
+ [In] int contextSize);
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
private delegate int SetThreadContextDelegate(
[In] IntPtr self,
[In] IntPtr context,
- [In] uint contextSize);
+ [In] int contextSize);
#endregion
}
IntPtr self,
uint threadId,
uint contextFlags,
- uint contextSize,
+ int contextSize,
IntPtr context);
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
internal int GetThreadContext(
IntPtr self,
IntPtr context,
- uint contextSize)
+ int contextSize)
{
IThread thread = ContextService.GetCurrentThread();
if (thread is not null)
IntPtr self,
uint threadId,
uint contextFlags,
- uint contextSize,
+ int contextSize,
IntPtr context)
{
byte[] registerContext;
}
try
{
- Marshal.Copy(registerContext, 0, context, (int)contextSize);
+ Marshal.Copy(registerContext, 0, context, Math.Min(registerContext.Length, contextSize));
}
catch (Exception ex) when (ex is ArgumentOutOfRangeException or ArgumentNullException)
{
internal static int SetThreadContext(
IntPtr self,
IntPtr context,
- uint contextSize)
+ int contextSize)
{
return DebugClient.NotImplemented;
}