[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
This commit is contained in:
Alex Ionescu 2011-07-22 09:50:33 +00:00
parent 45f4cd3964
commit 278fb2f2b6

View file

@ -32,22 +32,16 @@ CreateNamedPipeA(LPCSTR lpName,
DWORD nDefaultTimeOut, DWORD nDefaultTimeOut,
LPSECURITY_ATTRIBUTES lpSecurityAttributes) LPSECURITY_ATTRIBUTES lpSecurityAttributes)
{ {
PUNICODE_STRING NameU = &NtCurrentTeb()->StaticUnicodeString; /* Call the W(ide) function */
ANSI_STRING NameA; ConvertWin32AnsiChangeApiToUnicodeApi(CreateNamedPipe,
lpName,
/* Initialize the string as ANSI_STRING and convert to Unicode */ dwOpenMode,
RtlInitAnsiString(&NameA, (LPSTR)lpName); dwPipeMode,
RtlAnsiStringToUnicodeString(NameU, &NameA, FALSE); nMaxInstances,
nOutBufferSize,
/* Call the Unicode API */ nInBufferSize,
return CreateNamedPipeW(NameU->Buffer, nDefaultTimeOut,
dwOpenMode, lpSecurityAttributes);
dwPipeMode,
nMaxInstances,
nOutBufferSize,
nInBufferSize,
nDefaultTimeOut,
lpSecurityAttributes);
} }