Commit a4d4d197 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

Use W calls rather than A in CreatePipe.

parent d3fb100c
...@@ -1477,7 +1477,7 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe, ...@@ -1477,7 +1477,7 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe,
LPSECURITY_ATTRIBUTES sa, DWORD size ) LPSECURITY_ATTRIBUTES sa, DWORD size )
{ {
static unsigned index = 0; static unsigned index = 0;
char name[64]; WCHAR name[64];
HANDLE hr, hw; HANDLE hr, hw;
unsigned in_index = index; unsigned in_index = index;
...@@ -1485,15 +1485,19 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe, ...@@ -1485,15 +1485,19 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe,
/* generate a unique pipe name (system wide) */ /* generate a unique pipe name (system wide) */
do do
{ {
sprintf(name, "\\\\.\\pipe\\Win32.Pipes.%08lu.%08u", GetCurrentProcessId(), ++index); static const WCHAR nameFmt[] = { '\\','\\','.','\\','p','i','p','e',
hr = CreateNamedPipeA(name, PIPE_ACCESS_INBOUND, '\\','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, PIPE_TYPE_BYTE | PIPE_WAIT, 1, size, size,
NMPWAIT_USE_DEFAULT_WAIT, sa); NMPWAIT_USE_DEFAULT_WAIT, sa);
} while (hr == INVALID_HANDLE_VALUE && index != in_index); } while (hr == INVALID_HANDLE_VALUE && index != in_index);
/* from completion sakeness, I think system resources might be exhausted before this happens !! */ /* from completion sakeness, I think system resources might be exhausted before this happens !! */
if (hr == INVALID_HANDLE_VALUE) return FALSE; 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) if (hw == INVALID_HANDLE_VALUE)
{ {
CloseHandle(hr); CloseHandle(hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment