mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 09:36:33 +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) \
|
||||
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; \
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue