You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deadlock-dotnet-sdk/Domain/ProcessInfo.cs
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -252,7 +252,9 @@ ref returnLength
252
252
#endif
253
253
// !WARNING may throw OutOfMemoryException; ReAllocHGlobal received a null pointer, but didn't check the error code
254
254
// the native call to LocalReAlloc (via Marshal.ReAllocHGlobal) sometimes returns a null pointer. This is a Legacy function. Why does .NET not use malloc/realloc?
while((status=NtWow64QueryInformationProcess64(ProcessHandle.v,PROCESSINFOCLASS.ProcessBasicInformation,(void*)bufferPBI.DangerousGetHandle(),(uint)bufferPBI.ByteLength,&returnLength)).CodeisCode.STATUS_INFO_LENGTH_MISMATCH or Code.STATUS_BUFFER_TOO_SMALL or Code.STATUS_BUFFER_OVERFLOW)
thrownewNTStatusException(status,"NtWow64QueryInformationProcess64 failed to query a process's basic information; "+status.Message);
@@ -289,7 +295,11 @@ ref returnLength
289
295
else
290
296
{
291
297
while((status=NtQueryInformationProcess(ProcessHandle.v,PROCESSINFOCLASS.ProcessBasicInformation,(void*)bufferPBI.DangerousGetHandle(),(uint)bufferPBI.ByteLength,refreturnLength)).CodeisCode.STATUS_INFO_LENGTH_MISMATCH or Code.STATUS_BUFFER_TOO_SMALL or Code.STATUS_BUFFER_OVERFLOW)
// Something's off. Marshal.SizeOf() returns 0x68 (104) but returnLength is 0x78 (120) or sometimes 0x80 (128). Is Win32Metadata's type definition wrong?
73
-
while(status.CodeisSTATUS_BUFFER_OVERFLOW or STATUS_INFO_LENGTH_MISMATCH or STATUS_BUFFER_TOO_SMALL)
0 commit comments