From 7fce92ea54a60e11c22f1864fadb620e75fc92ec Mon Sep 17 00:00:00 2001 From: Jason Edmeades Date: Sun, 12 Aug 2007 22:29:03 +0100 Subject: [PATCH] cmd.exe: Redirection for external programs was broken by the conversion to unicode. --- programs/cmd/wcmdmain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 775a5539f03..83185908e08 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -839,13 +839,13 @@ static void init_msvcrt_io_block(STARTUPINFO* st) * to change those std handles (this depends on the way wcmd sets * it's new input & output handles) */ - size_t sz = max(sizeof(unsigned) + (sizeof(WCHAR) + sizeof(HANDLE)) * 3, st_p.cbReserved2); + size_t sz = max(sizeof(unsigned) + (sizeof(char) + sizeof(HANDLE)) * 3, st_p.cbReserved2); BYTE* ptr = HeapAlloc(GetProcessHeap(), 0, sz); if (ptr) { unsigned num = *(unsigned*)st_p.lpReserved2; - WCHAR* flags = (WCHAR*)(ptr + sizeof(unsigned)); - HANDLE* handles = (HANDLE*)(flags + num * sizeof(WCHAR)); + char* flags = (char*)(ptr + sizeof(unsigned)); + HANDLE* handles = (HANDLE*)(flags + num * sizeof(char)); memcpy(ptr, st_p.lpReserved2, st_p.cbReserved2); st->cbReserved2 = sz;