From 278fb2f2b6952de1a375f73b81d67b64d4a6f4ab Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Fri, 22 Jul 2011 09:50:33 +0000 Subject: [PATCH] [KERNEL32]: Fix Bug #3. Make CreateNamedPipeA use our new macro. Fixes the fact it wasn't checking for success when doing the ANSI->Unicode translation, and just assumed things would work. svn path=/trunk/; revision=52778 --- .../dll/win32/kernel32/client/file/npipe.c | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/file/npipe.c b/reactos/dll/win32/kernel32/client/file/npipe.c index 8915fb18052..7a7df9d4737 100644 --- a/reactos/dll/win32/kernel32/client/file/npipe.c +++ b/reactos/dll/win32/kernel32/client/file/npipe.c @@ -32,22 +32,16 @@ CreateNamedPipeA(LPCSTR lpName, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes) { - PUNICODE_STRING NameU = &NtCurrentTeb()->StaticUnicodeString; - ANSI_STRING NameA; - - /* Initialize the string as ANSI_STRING and convert to Unicode */ - RtlInitAnsiString(&NameA, (LPSTR)lpName); - RtlAnsiStringToUnicodeString(NameU, &NameA, FALSE); - - /* Call the Unicode API */ - return CreateNamedPipeW(NameU->Buffer, - dwOpenMode, - dwPipeMode, - nMaxInstances, - nOutBufferSize, - nInBufferSize, - nDefaultTimeOut, - lpSecurityAttributes); + /* Call the W(ide) function */ + ConvertWin32AnsiChangeApiToUnicodeApi(CreateNamedPipe, + lpName, + dwOpenMode, + dwPipeMode, + nMaxInstances, + nOutBufferSize, + nInBufferSize, + nDefaultTimeOut, + lpSecurityAttributes); }