mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 09:23:06 +00:00
[KERNEL32]
* Fix ConvertOpenWin32AnsiObjectApiToUnicodeApi and OpenNtObjectFromWin32Api macros always returning NULL. Spotted by Thomas Faber. svn path=/trunk/; revision=52808
This commit is contained in:
parent
7eda2f21b7
commit
5a85fe0145
1 changed files with 15 additions and 3 deletions
|
@ -74,7 +74,11 @@
|
||||||
//
|
//
|
||||||
#define ConvertOpenWin32AnsiObjectApiToUnicodeApi(obj, acc, inh, name) \
|
#define ConvertOpenWin32AnsiObjectApiToUnicodeApi(obj, acc, inh, name) \
|
||||||
ConvertAnsiToUnicodePrologue \
|
ConvertAnsiToUnicodePrologue \
|
||||||
if (!name) SetLastError(ERROR_INVALID_PARAMETER); return NULL; \
|
if (!name) \
|
||||||
|
{ \
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER); \
|
||||||
|
return NULL; \
|
||||||
|
} \
|
||||||
ConvertAnsiToUnicodeBody(name) \
|
ConvertAnsiToUnicodeBody(name) \
|
||||||
if (NT_SUCCESS(Status)) return Open##obj##W(acc, inh, UnicodeCache->Buffer);\
|
if (NT_SUCCESS(Status)) return Open##obj##W(acc, inh, UnicodeCache->Buffer);\
|
||||||
ConvertAnsiToUnicodeEpilogue
|
ConvertAnsiToUnicodeEpilogue
|
||||||
|
@ -132,7 +136,11 @@
|
||||||
//
|
//
|
||||||
#define OpenNtObjectFromWin32Api(ntobj, acc, inh, name) \
|
#define OpenNtObjectFromWin32Api(ntobj, acc, inh, name) \
|
||||||
CreateNtObjectFromWin32ApiPrologue \
|
CreateNtObjectFromWin32ApiPrologue \
|
||||||
if (!name) SetLastErrorByStatus(STATUS_INVALID_PARAMETER); return NULL; \
|
if (!name) \
|
||||||
|
{ \
|
||||||
|
SetLastErrorByStatus(STATUS_INVALID_PARAMETER); \
|
||||||
|
return NULL; \
|
||||||
|
} \
|
||||||
RtlInitUnicodeString(&ObjectName, name); \
|
RtlInitUnicodeString(&ObjectName, name); \
|
||||||
InitializeObjectAttributes(ObjectAttributes, \
|
InitializeObjectAttributes(ObjectAttributes, \
|
||||||
&ObjectName, \
|
&ObjectName, \
|
||||||
|
@ -140,7 +148,11 @@
|
||||||
hBaseDir, \
|
hBaseDir, \
|
||||||
NULL); \
|
NULL); \
|
||||||
Status = NtOpen##ntobj(&Handle, acc, ObjectAttributes); \
|
Status = NtOpen##ntobj(&Handle, acc, ObjectAttributes); \
|
||||||
if (!NT_SUCCESS(Status)) SetLastErrorByStatus(Status); return NULL; \
|
if (!NT_SUCCESS(Status)) \
|
||||||
|
{ \
|
||||||
|
SetLastErrorByStatus(Status); \
|
||||||
|
return NULL; \
|
||||||
|
} \
|
||||||
return Handle; \
|
return Handle; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue