PsInitProcessManagment(): Hack-fake process name "System"
authorshort <>
Tue, 4 Feb 2003 17:57:57 +0000 (17:57 +0000)
committershort <>
Tue, 4 Feb 2003 17:57:57 +0000 (17:57 +0000)
 - needed for hacked debug mode of ext2fsd.sys V0.10A

ntoskrnl/ps/process.c

index e88ece4..c0d0cab 100644 (file)
@@ -215,7 +215,15 @@ PsInitProcessManagment(VOID)
    PsProcessType->MaxObjects = ULONG_MAX;
    PsProcessType->MaxHandles = ULONG_MAX;
    PsProcessType->PagedPoolCharge = 0;
-   PsProcessType->NonpagedPoolCharge = sizeof(EPROCESS);
+   PsProcessType->NonpagedPoolCharge = sizeof(EPROCESS)
+#ifdef LIBCAPTIVE
+        /* Need to present 0-terminated string "System"
+         * from KPROCESS up to PAGE_SIZE offset
+         * for ext2fsd.sys V0.10A debug.c/Ext2GetProcessNameOffset()
+         */
+        +strlen("System")+1/* 0-terminator */;
+#endif /* LIBCAPTIVE */
+        ;
    PsProcessType->Mapping = &PiProcessMapping;
    PsProcessType->Dump = NULL;
    PsProcessType->Open = NULL;
@@ -250,6 +258,14 @@ PsInitProcessManagment(VOID)
        return;
      }
    
+#ifdef LIBCAPTIVE
+   /* Need to present 0-terminated string "System"
+    * from KPROCESS up to PAGE_SIZE offset
+    * for ext2fsd.sys V0.10A debug.c/Ext2GetProcessNameOffset()
+    */
+   strcpy(((char *)PsInitialSystemProcess) +strlen("System")+1/* 0-terminator */,"System");
+#endif /* LIBCAPTIVE */
+
    /* System threads may run on any processor. */
    PsInitialSystemProcess->Pcb.Affinity = 0xFFFFFFFF;
    PsInitialSystemProcess->Pcb.BasePriority = PROCESS_PRIO_NORMAL;