mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Attache the process if we are running in the context of an other process (in KdbFreeSymbols).
svn path=/trunk/; revision=4044
This commit is contained in:
parent
14fc3556c8
commit
25f4f4f91c
3 changed files with 24 additions and 6 deletions
|
@ -210,12 +210,20 @@ KdbPrintAddress(PVOID address)
|
|||
}
|
||||
|
||||
VOID
|
||||
KdbFreeSymbolsProcess(PPEB Peb)
|
||||
KdbFreeSymbolsProcess(PEPROCESS Process)
|
||||
{
|
||||
PLIST_ENTRY CurrentEntry;
|
||||
PLDR_MODULE Current;
|
||||
PIMAGE_SYMBOL_INFO SymbolInfo;
|
||||
PEPROCESS CurrentProcess;
|
||||
PPEB Peb;
|
||||
|
||||
CurrentProcess = PsGetCurrentProcess();
|
||||
if (CurrentProcess != Process)
|
||||
{
|
||||
KeAttachProcess(Process);
|
||||
}
|
||||
Peb = Process->Peb;
|
||||
assert (Peb);
|
||||
assert (Peb->Ldr);
|
||||
|
||||
|
@ -231,6 +239,10 @@ KdbFreeSymbolsProcess(PPEB Peb)
|
|||
|
||||
CurrentEntry = CurrentEntry->Flink;
|
||||
}
|
||||
if (CurrentProcess != Process)
|
||||
{
|
||||
KeDetachProcess();
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
|
@ -456,6 +468,7 @@ LdrpGetFunctionName(IN PIMAGE_SYMBOL_INFO SymbolInfo,
|
|||
Length = strlen(Symbol->Name.Buffer);
|
||||
|
||||
strncpy(FunctionName, Symbol->Name.Buffer, Length);
|
||||
FunctionName[Length]=0;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
Symbol = NextSymbol;
|
||||
|
@ -783,6 +796,11 @@ KdbLdrLoadUserModuleSymbols(PLDR_MODULE LdrModule)
|
|||
RtlCreateUnicodeString(&CacheEntry->FullName, LdrModule->FullDllName.Buffer);
|
||||
assert(CacheEntry->FullName.Buffer);
|
||||
LdrpLoadModuleSymbols(&LdrModule->FullDllName, &LdrModule->SymbolInfo);
|
||||
CacheEntry->FileBuffer = LdrModule->SymbolInfo.FileBuffer;
|
||||
CacheEntry->SymbolsBase = LdrModule->SymbolInfo.SymbolsBase;
|
||||
CacheEntry->SymbolsLength = LdrModule->SymbolInfo.SymbolsLength;
|
||||
CacheEntry->SymbolStringsBase = LdrModule->SymbolInfo.SymbolStringsBase;
|
||||
CacheEntry->SymbolStringsLength = LdrModule->SymbolInfo.SymbolStringsLength;
|
||||
InsertTailList(&SymbolListHead, &CacheEntry->ListEntry);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: kd.h,v 1.16 2002/09/08 10:23:21 chorns Exp $
|
||||
/* $Id: kd.h,v 1.17 2003/01/19 01:46:33 hbirr Exp $
|
||||
*
|
||||
* kernel debugger prototypes
|
||||
*/
|
||||
|
@ -96,7 +96,7 @@ KdbUnloadDriver(PMODULE_OBJECT ModuleObject);
|
|||
VOID
|
||||
KdbLoadDriver(PUNICODE_STRING Filename, PMODULE_OBJECT Module);
|
||||
VOID
|
||||
KdbFreeSymbolsProcess(PPEB Peb);
|
||||
KdbFreeSymbolsProcess(PEPROCESS Process);
|
||||
BOOLEAN
|
||||
KdbPrintAddress(PVOID address);
|
||||
KD_CONTINUE_TYPE
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: process.c,v 1.94 2002/11/03 20:01:07 chorns Exp $
|
||||
/* $Id: process.c,v 1.95 2003/01/19 01:46:32 hbirr Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -299,12 +299,12 @@ PiDeleteProcess(PVOID ObjectBody)
|
|||
KeReleaseSpinLock(&PsProcessListLock, oldIrql);
|
||||
|
||||
/* KDB hook */
|
||||
KDB_DELETEPROCESS_HOOK(Process->Peb);
|
||||
KDB_DELETEPROCESS_HOOK(Process);
|
||||
|
||||
ObDereferenceObject(Process->Token);
|
||||
ObDeleteHandleTable(Process);
|
||||
|
||||
(VOID)MmReleaseMmInfo(Process);
|
||||
ObDeleteHandleTable(Process);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue