From a4d4d1979b816311fe4a9a440422e0dfbbce54d9 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Tue, 7 Dec 2004 14:23:03 +0000 Subject: [PATCH] Use W calls rather than A in CreatePipe. --- dlls/kernel/sync.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/kernel/sync.c b/dlls/kernel/sync.c index f7204fb6291..9d54e9dfce8 100644 --- a/dlls/kernel/sync.c +++ b/dlls/kernel/sync.c @@ -1477,7 +1477,7 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES sa, DWORD size ) { static unsigned index = 0; - char name[64]; + WCHAR name[64]; HANDLE hr, hw; unsigned in_index = index; @@ -1485,15 +1485,19 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe, /* generate a unique pipe name (system wide) */ do { - sprintf(name, "\\\\.\\pipe\\Win32.Pipes.%08lu.%08u", GetCurrentProcessId(), ++index); - hr = CreateNamedPipeA(name, PIPE_ACCESS_INBOUND, + static const WCHAR nameFmt[] = { '\\','\\','.','\\','p','i','p','e', + '\\','W','i','n','3','2','.','P','i','p','e','s','.','%','0','8','l', + 'u','.','%','0','8','u','\0' }; + snprintfW(name, sizeof(name) / sizeof(name[0]), nameFmt, + GetCurrentProcessId(), ++index); + hr = CreateNamedPipeW(name, PIPE_ACCESS_INBOUND, PIPE_TYPE_BYTE | PIPE_WAIT, 1, size, size, NMPWAIT_USE_DEFAULT_WAIT, sa); } while (hr == INVALID_HANDLE_VALUE && index != in_index); /* from completion sakeness, I think system resources might be exhausted before this happens !! */ if (hr == INVALID_HANDLE_VALUE) return FALSE; - hw = CreateFileA(name, GENERIC_WRITE, 0, sa, OPEN_EXISTING, 0, 0); + hw = CreateFileW(name, GENERIC_WRITE, 0, sa, OPEN_EXISTING, 0, 0); if (hw == INVALID_HANDLE_VALUE) { CloseHandle(hr); -- 2.11.4.GIT