[KERNEL32]

* Fix ConvertOpenWin32AnsiObjectApiToUnicodeApi and OpenNtObjectFromWin32Api macros always returning NULL. Spotted by Thomas Faber.

svn path=/trunk/; revision=52808
This commit is contained in:
Amine Khaldi 2011-07-23 14:07:17 +00:00
parent 7eda2f21b7
commit 5a85fe0145

View file

@ -74,7 +74,11 @@
//
#define ConvertOpenWin32AnsiObjectApiToUnicodeApi(obj, acc, inh, name) \
ConvertAnsiToUnicodePrologue \
if (!name) SetLastError(ERROR_INVALID_PARAMETER); return NULL; \
if (!name) \
{ \
SetLastError(ERROR_INVALID_PARAMETER); \
return NULL; \
} \
ConvertAnsiToUnicodeBody(name) \
if (NT_SUCCESS(Status)) return Open##obj##W(acc, inh, UnicodeCache->Buffer);\
ConvertAnsiToUnicodeEpilogue
@ -132,7 +136,11 @@
//
#define OpenNtObjectFromWin32Api(ntobj, acc, inh, name) \
CreateNtObjectFromWin32ApiPrologue \
if (!name) SetLastErrorByStatus(STATUS_INVALID_PARAMETER); return NULL; \
if (!name) \
{ \
SetLastErrorByStatus(STATUS_INVALID_PARAMETER); \
return NULL; \
} \
RtlInitUnicodeString(&ObjectName, name); \
InitializeObjectAttributes(ObjectAttributes, \
&ObjectName, \
@ -140,7 +148,11 @@
hBaseDir, \
NULL); \
Status = NtOpen##ntobj(&Handle, acc, ObjectAttributes); \
if (!NT_SUCCESS(Status)) SetLastErrorByStatus(Status); return NULL; \
if (!NT_SUCCESS(Status)) \
{ \
SetLastErrorByStatus(Status); \
return NULL; \
} \
return Handle; \
}