mirror of
https://github.com/reactos/reactos.git
synced 2024-07-11 07:05:12 +00:00
[KERNEL32]: Use macro for CreateMailSlotA->CreateMailSlotW.
svn path=/trunk/; revision=55791
This commit is contained in:
parent
8c1ab63ced
commit
0bbab987c0
|
@ -26,32 +26,8 @@ CreateMailslotA(IN LPCSTR lpName,
|
|||
IN DWORD lReadTimeout,
|
||||
IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
|
||||
{
|
||||
PUNICODE_STRING NameU;
|
||||
ANSI_STRING NameA;
|
||||
NTSTATUS Status;
|
||||
|
||||
NameU = &NtCurrentTeb()->StaticUnicodeString;
|
||||
|
||||
RtlInitAnsiString(&NameA, (LPSTR)lpName);
|
||||
Status = RtlAnsiStringToUnicodeString(NameU, &NameA, FALSE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
if (Status == STATUS_BUFFER_OVERFLOW)
|
||||
{
|
||||
SetLastError(ERROR_FILENAME_EXCED_RANGE);
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseSetLastNTError(Status);
|
||||
}
|
||||
|
||||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
return CreateMailslotW(NameU->Buffer,
|
||||
nMaxMessageSize,
|
||||
lReadTimeout,
|
||||
lpSecurityAttributes);
|
||||
/* Call the W(ide) function */
|
||||
ConvertWin32AnsiObjectApiToUnicodeApi2(Mailslot, lpName, nMaxMessageSize, lReadTimeout, lpSecurityAttributes);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -58,6 +58,17 @@
|
|||
if (NT_SUCCESS(Status)) return Create##obj##W(__VA_ARGS__, UnicodeCache->Buffer); \
|
||||
ConvertAnsiToUnicodeEpilogue
|
||||
|
||||
//
|
||||
// This macro uses the ConvertAnsiToUnicode macros above to convert a CreateXxxA
|
||||
// Win32 API into its equivalent CreateXxxW API.
|
||||
//
|
||||
#define ConvertWin32AnsiObjectApiToUnicodeApi2(obj, name, ...) \
|
||||
ConvertAnsiToUnicodePrologue \
|
||||
if (!name) return Create##obj##W(NULL, __VA_ARGS__); \
|
||||
ConvertAnsiToUnicodeBody(name) \
|
||||
if (NT_SUCCESS(Status)) return Create##obj##W(UnicodeCache->Buffer, __VA_ARGS__); \
|
||||
ConvertAnsiToUnicodeEpilogue
|
||||
|
||||
//
|
||||
// This macro uses the ConvertAnsiToUnicode macros above to convert a FindFirst*A
|
||||
// Win32 API into its equivalent FindFirst*W API.
|
||||
|
|
Loading…
Reference in a new issue