Author: akhaldi
Date: Sat Jul 23 14:07:17 2011
New Revision: 52808

URL: http://svn.reactos.org/svn/reactos?rev=52808&view=rev
Log:
[KERNEL32]
* Fix ConvertOpenWin32AnsiObjectApiToUnicodeApi and OpenNtObjectFromWin32Api 
macros always returning NULL. Spotted by Thomas Faber.

Modified:
    trunk/reactos/dll/win32/kernel32/include/base_x.h

Modified: trunk/reactos/dll/win32/kernel32/include/base_x.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include/base_x.h?rev=52808&r1=52807&r2=52808&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/include/base_x.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/include/base_x.h [iso-8859-1] Sat Jul 23 
14:07:17 2011
@@ -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;                                                             
 \
 }
 


Reply via email to