[NTOS]: Minor fixes:
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 19 Jun 2017 14:48:59 +0000 (14:48 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 19 Jun 2017 14:48:59 +0000 (14:48 +0000)
- Use NULL instead of 'zero' for setting a handle / pointer to NULL;
- Don't hardcode an array size; fix a comment;
- Use ExFreePoolWithTag();
- Whitespace fix.

svn path=/trunk/; revision=75128

reactos/ntoskrnl/ob/oblife.c
reactos/ntoskrnl/ps/process.c
reactos/ntoskrnl/se/sd.c

index 86224ac..c37a9c2 100644 (file)
@@ -352,7 +352,7 @@ ObpFreeObjectNameBuffer(IN PUNICODE_STRING Name)
     if (Name->MaximumLength != OBP_NAME_LOOKASIDE_MAX_SIZE)
     {
         /* Free it from the pool */
-        ExFreePool(Buffer);
+        ExFreePoolWithTag(Buffer, OB_NAME_TAG);
     }
     else
     {
@@ -556,7 +556,7 @@ ObpCaptureObjectCreateInformation(IN POBJECT_ATTRIBUTES ObjectAttributes,
         /* Clear the string */
         RtlInitEmptyUnicodeString(ObjectName, NULL, 0);
 
-        /* He can't have specified a Root Directory */
+        /* It cannot have specified a Root Directory */
         if (ObjectCreateInfo->RootDirectory)
         {
             Status = STATUS_OBJECT_NAME_INVALID;
@@ -1247,7 +1247,7 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName,
 
     ASSERT(LocalObjectType->Index != 0);
 
-    if (LocalObjectType->Index < 32)
+    if (LocalObjectType->Index < RTL_NUMBER_OF(ObpObjectTypes))
     {
         /* It fits, insert it */
         ObpObjectTypes[LocalObjectType->Index - 1] = LocalObjectType;
index 71823c4..ab81ddc 100644 (file)
@@ -1290,7 +1290,7 @@ PsSetProcessWin32Process(
         if (Process->Win32Process == OldWin32Process)
         {
             /* Yes, so reset the win32 process to NULL */
-            Process->Win32Process = 0;
+            Process->Win32Process = NULL;
         }
         else
         {
index 998b2fe..a6b0829 100644 (file)
@@ -208,7 +208,7 @@ SeSetWorldSecurityDescriptor(SECURITY_INFORMATION SecurityInformation,
 
 NTSTATUS
 NTAPI
-SepCaptureSecurityQualityOfService(IN POBJECT_ATTRIBUTES ObjectAttributes  OPTIONAL,
+SepCaptureSecurityQualityOfService(IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
                                    IN KPROCESSOR_MODE AccessMode,
                                    IN POOL_TYPE PoolType,
                                    IN BOOLEAN CaptureIfKernel,