Cygwin: pty: Reduce buffer size in get_console_process_id().

- The buffer used in get_console_process_id(), introduced by commit
  72770148, is too large and ERROR_NOT_ENOUGH_MEMORY occurs in Win7.
  Therefore, the buffer size has been reduced.
This commit is contained in:
Takashi Yano via Cygwin-patches 2021-01-20 09:57:00 +09:00 committed by Corinna Vinschen
parent 62e739b51b
commit 5755870f7c
1 changed files with 2 additions and 2 deletions

View File

@ -65,8 +65,8 @@ static DWORD
get_console_process_id (DWORD pid, bool match)
{
tmp_pathbuf tp;
DWORD *list = (DWORD *) tp.w_get ();
const DWORD buf_size = NT_MAX_PATH * sizeof (WCHAR) / sizeof (DWORD);
DWORD *list = (DWORD *) tp.c_get ();
const DWORD buf_size = NT_MAX_PATH / sizeof (DWORD);
DWORD num = GetConsoleProcessList (list, buf_size);
if (num == 0 || num > buf_size)