Skip to content

Commit 8c51772

Browse files
committed
fixed bug in handle enumeration - buffer too small
1 parent 3716759 commit 8c51772

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

ConPtyShell.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ private static IntPtr NtQuerySystemInformationDynamic(int infoClass, int infoLen
401401
while (true)
402402
{
403403
uint result = (uint)NtQuerySystemInformation(infoClass, infoPtr, infoLength, ref infoLength);
404+
infoLength = infoLength * 2;
404405
if (result == NTSTATUS_SUCCESS)
405406
return infoPtr;
406407
Marshal.FreeHGlobal(infoPtr); //free pointer when not Successful
@@ -834,8 +835,6 @@ public static class ConPtyShell
834835
private const int FD_READ = (1 << 0);
835836

836837

837-
838-
839838
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
840839
private struct STARTUPINFOEX
841840
{
@@ -1029,7 +1028,6 @@ private struct SOCKADDR_IN
10291028
[DllImport("WS2_32.DLL", CharSet = CharSet.Auto, SetLastError = true)]
10301029
private static extern bool WSACloseEvent(IntPtr hEvent);
10311030

1032-
10331031
[DllImport("ntdll.dll")]
10341032
private static extern uint NtSuspendProcess(IntPtr processHandle);
10351033

0 commit comments

Comments
 (0)