* Sync up to trunk head (r65394).
[reactos.git] / ntoskrnl / kd64 / kdinit.c
index 9fb10a8..18ea337 100644 (file)
@@ -70,7 +70,6 @@ KdRegisterDebuggerDataBlock(IN ULONG Tag,
 
 BOOLEAN
 NTAPI
-INIT_FUNCTION
 KdInitSystem(IN ULONG BootPhase,
              IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 {
@@ -79,7 +78,8 @@ KdInitSystem(IN ULONG BootPhase,
     STRING ImageName;
     PLDR_DATA_TABLE_ENTRY LdrEntry;
     PLIST_ENTRY NextEntry;
-    ULONG i, j, Length, DebugOptionLength;
+    ULONG i, j, Length;
+    SIZE_T DebugOptionLength;
     CHAR NameBuffer[256];
     PWCHAR Name;
 
@@ -193,7 +193,7 @@ KdInitSystem(IN ULONG BootPhase,
                             /* Check if this is a comma, a space or a tab */
                             if ((*DebugOptionEnd == ',') ||
                                 (*DebugOptionEnd == ' ') ||
-                                (*DebugOptionEnd == '  '))
+                                (*DebugOptionEnd == '\t'))
                             {
                                 /*
                                  * We reached the end of the option or
@@ -209,8 +209,7 @@ KdInitSystem(IN ULONG BootPhase,
                         }
 
                         /* Calculate the length of the current option */
-                        DebugOptionLength = ((ULONG_PTR)DebugOptionEnd -
-                                             (ULONG_PTR)DebugOptionStart);
+                        DebugOptionLength = (DebugOptionEnd - DebugOptionStart);
 
                        /*
                         * Break out if we reached the last option
@@ -224,7 +223,7 @@ KdInitSystem(IN ULONG BootPhase,
                         {
                             /*
                              * Disable the debugger, but
-                             * allow it to be reenabled 
+                             * allow it to be reenabled
                              */
                             DisableKdAfterInit = TRUE;
                             BlockEnable = FALSE;
@@ -246,7 +245,7 @@ KdInitSystem(IN ULONG BootPhase,
                         }
 
                         /*
-                         * If there are more options then 
+                         * If there are more options then
                          * the next character should be a comma
                          */
                         if (*DebugOptionEnd != ',')
@@ -311,9 +310,7 @@ KdInitSystem(IN ULONG BootPhase,
         KdDebuggerEnabled = TRUE;
 
         /* Let user-mode know that it's enabled as well */
-#undef KdDebuggerEnabled
         SharedUserData->KdDebuggerEnabled = TRUE;
-#define KdDebuggerEnabled _KdDebuggerEnabled
 
         /* Check if the debugger should be disabled initially */
         if (DisableKdAfterInit)
@@ -359,7 +356,7 @@ KdInitSystem(IN ULONG BootPhase,
                 RtlInitString(&ImageName, NameBuffer);
                 DbgLoadImageSymbols(&ImageName,
                                     LdrEntry->DllBase,
-                                    (ULONG_PTR)ZwCurrentProcess());
+                                    (ULONG_PTR)PsGetCurrentProcessId());
 
                 /* Go to the next entry */
                 NextEntry = NextEntry->Flink;
@@ -367,7 +364,7 @@ KdInitSystem(IN ULONG BootPhase,
             }
         }
 
-        /* Check for incoming breakin and break on symbol load if we have it*/
+        /* Check for incoming breakin and break on symbol load if we have it */
         KdBreakAfterSymbolLoad = KdPollBreakIn();
     }
     else