ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 2006
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
357 discussions
Start a n
N
ew thread
[janderwald] 24623: - really fix build
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Oct 23 12:54:19 2006 New Revision: 24623 URL:
http://svn.reactos.org/svn/reactos?rev=24623&view=rev
Log: - really fix build Modified: trunk/reactos/ntoskrnl/ntoskrnl.def Modified: trunk/reactos/ntoskrnl/ntoskrnl.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.def?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.def (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.def Mon Oct 23 12:54:19 2006 @@ -777,6 +777,7 @@ NtCreateFile@44 NtCreateSection@28 NtDeleteAtom@4 +NtDeleteBootEntry@4 NtDeleteFile@4 NtDeviceIoControlFile@40 NtDuplicateObject@28 @@ -1327,7 +1328,6 @@ ZwCreateSection@28 ZwCreateSymbolicLinkObject@16 ZwCreateTimer@16 -ZwDeleteBootEntry@4 ZwDeleteFile@4 ZwDeleteKey@4 ZwDeleteValueKey@8
18 years, 2 months
1
0
0
0
[janderwald] 24622: - fix build
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Oct 23 12:42:27 2006 New Revision: 24622 URL:
http://svn.reactos.org/svn/reactos?rev=24622&view=rev
Log: - fix build Modified: trunk/reactos/ntoskrnl/dbgk/debug.c Modified: trunk/reactos/ntoskrnl/dbgk/debug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/dbgk/debug.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/dbgk/debug.c (original) +++ trunk/reactos/ntoskrnl/dbgk/debug.c Mon Oct 23 12:42:27 2006 @@ -874,7 +874,7 @@ VOID NTAPI -DbgkpDeleteObject(IN PVOID Object) +DbgkpDeleteObject(IN PVOID DebugObject) { PAGED_CODE();
18 years, 2 months
1
0
0
0
[ion] 24621: - Fix another build break... sorry for the SVN Server is fucked due to the CIA post-commit hook and is being unusable.
by ion@svn.reactos.org
Author: ion Date: Mon Oct 23 09:55:06 2006 New Revision: 24621 URL:
http://svn.reactos.org/svn/reactos?rev=24621&view=rev
Log: - Fix another build break... sorry for the SVN Server is fucked due to the CIA post-commit hook and is being unusable. Modified: trunk/reactos/dll/ntdll/dbg/dbgui.c trunk/reactos/dll/ntdll/def/ntdll.def Modified: trunk/reactos/dll/ntdll/dbg/dbgui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/dbg/dbgui.c?rev=…
============================================================================== --- trunk/reactos/dll/ntdll/dbg/dbgui.c (original) +++ trunk/reactos/dll/ntdll/dbg/dbgui.c Mon Oct 23 09:55:06 2006 @@ -78,11 +78,12 @@ NTSTATUS NTAPI DbgUiConvertStateChangeStructure(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, - OUT LPDEBUG_EVENT DebugEvent) + OUT PVOID Win32DebugEvent) { NTSTATUS Status; OBJECT_ATTRIBUTES ObjectAttributes; THREAD_BASIC_INFORMATION ThreadBasicInfo; + LPDEBUG_EVENT DebugEvent = Win32DebugEvent; HANDLE ThreadHandle; /* Write common data */ Modified: trunk/reactos/dll/ntdll/def/ntdll.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.def?re…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll.def (original) +++ trunk/reactos/dll/ntdll/def/ntdll.def Mon Oct 23 09:55:06 2006 @@ -132,7 +132,6 @@ NtFsControlFile@40 NtGetContextThread@8 NtGetPlugPlayEvent@16 -NtGetTickCount@0 NtImpersonateAnonymousToken@4 NtImpersonateClientOfPort@8 NtImpersonateThread@12 @@ -290,7 +289,6 @@ NtWriteFileGather@36 NtWriteRequestData@24 NtWriteVirtualMemory@20 -NtW32Call@20 NtYieldExecution@0 ;PfxFindPrefix ;PfxInitialize @@ -803,7 +801,6 @@ ZwFsControlFile@40 ZwGetContextThread@8 ZwGetPlugPlayEvent@16 -ZwGetTickCount@0 ZwImpersonateAnonymousToken@4 ZwImpersonateClientOfPort@8 ZwImpersonateThread@12 @@ -961,7 +958,6 @@ ZwWriteFileGather@36 ZwWriteRequestData@24 ZwWriteVirtualMemory@20 -ZwW32Call@20 ZwYieldExecution@0 __isascii __iscsym
18 years, 2 months
1
0
0
0
[ion] 24620: - Fix some EFI prototypes and exports. - Add BOOT_ENTRY definition. - Fix build breakage from earlier commit.
by ion@svn.reactos.org
Author: ion Date: Mon Oct 23 09:49:07 2006 New Revision: 24620 URL:
http://svn.reactos.org/svn/reactos?rev=24620&view=rev
Log: - Fix some EFI prototypes and exports. - Add BOOT_ENTRY definition. - Fix build breakage from earlier commit. Modified: trunk/reactos/include/ndk/iofuncs.h trunk/reactos/include/ndk/iotypes.h trunk/reactos/include/ndk/umfuncs.h trunk/reactos/ntoskrnl/ex/efi.c trunk/reactos/ntoskrnl/ntoskrnl.def Modified: trunk/reactos/include/ndk/iofuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/iofuncs.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/iofuncs.h (original) +++ trunk/reactos/include/ndk/iofuncs.h Mon Oct 23 09:49:07 2006 @@ -32,8 +32,8 @@ NTSTATUS NTAPI NtAddBootEntry( - IN PUNICODE_STRING EntryName, - IN PUNICODE_STRING EntryValue + IN PBOOT_ENTRY BootEntry, + IN ULONG Id ); NTSYSCALLAPI @@ -109,8 +109,7 @@ NTSTATUS NTAPI NtDeleteBootEntry( - IN PUNICODE_STRING EntryName, - IN PUNICODE_STRING EntryValue + IN ULONG Id ); NTSYSCALLAPI Modified: trunk/reactos/include/ndk/iotypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/iotypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/iotypes.h (original) +++ trunk/reactos/include/ndk/iotypes.h Mon Oct 23 09:49:07 2006 @@ -1102,6 +1102,21 @@ } BOOT_OPTIONS, *PBOOT_OPTIONS; // +// Firmware Boot Entry +// +typedef struct _BOOT_ENTRY +{ + ULONG Version; + ULONG Length; + ULONG Id; + ULONG Attributes; + ULONG FriendlyNameOffset; + ULONG BootFilePathOffset; + ULONG OsOptionsLength; + CHAR OsOptions[1]; +} BOOT_ENTRY, *PBOOT_ENTRY; + +// // APC Callback for NtCreateFile // typedef VOID Modified: trunk/reactos/include/ndk/umfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/umfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/umfuncs.h (original) +++ trunk/reactos/include/ndk/umfuncs.h Mon Oct 23 09:49:07 2006 @@ -168,7 +168,7 @@ NTAPI DbgUiConvertStateChangeStructure( IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, - IN LPDEBUG_EVENT DebugEvent + IN PVOID DebugEvent ); VOID Modified: trunk/reactos/ntoskrnl/ex/efi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/efi.c?rev=2462…
============================================================================== --- trunk/reactos/ntoskrnl/ex/efi.c (original) +++ trunk/reactos/ntoskrnl/ex/efi.c Mon Oct 23 09:49:07 2006 @@ -16,8 +16,8 @@ NTSTATUS NTAPI -NtAddBootEntry(IN PUNICODE_STRING EntryName, - IN PUNICODE_STRING EntryValue) +NtAddBootEntry(IN PBOOT_ENTRY Entry, + IN ULONG Id) { UNIMPLEMENTED; return STATUS_NOT_IMPLEMENTED; @@ -25,8 +25,7 @@ NTSTATUS NTAPI -NtDeleteBootEntry(IN PUNICODE_STRING EntryName, - IN PUNICODE_STRING EntryValue) +NtDeleteBootEntry(IN ULONG Id) { UNIMPLEMENTED; return STATUS_NOT_IMPLEMENTED; Modified: trunk/reactos/ntoskrnl/ntoskrnl.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.def?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.def (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.def Mon Oct 23 09:49:07 2006 @@ -1327,7 +1327,7 @@ ZwCreateSection@28 ZwCreateSymbolicLinkObject@16 ZwCreateTimer@16 -ZwDeleteBootEntry@8 +ZwDeleteBootEntry@4 ZwDeleteFile@4 ZwDeleteKey@4 ZwDeleteValueKey@8
18 years, 2 months
1
0
0
0
[ion] 24619: - Implement DbgUiConvertStateChangeStructure. Win32/Native Debugging should be fully implemented now (and waiting on the kernel to support it.)
by ion@svn.reactos.org
Author: ion Date: Mon Oct 23 09:08:19 2006 New Revision: 24619 URL:
http://svn.reactos.org/svn/reactos?rev=24619&view=rev
Log: - Implement DbgUiConvertStateChangeStructure. Win32/Native Debugging should be fully implemented now (and waiting on the kernel to support it.) Modified: trunk/reactos/dll/ntdll/dbg/dbgui.c Modified: trunk/reactos/dll/ntdll/dbg/dbgui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/dbg/dbgui.c?rev=…
============================================================================== --- trunk/reactos/dll/ntdll/dbg/dbgui.c (original) +++ trunk/reactos/dll/ntdll/dbg/dbgui.c Mon Oct 23 09:08:19 2006 @@ -73,15 +73,240 @@ } /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI DbgUiConvertStateChangeStructure(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, OUT LPDEBUG_EVENT DebugEvent) { - /* FIXME: UNIMPLEMENTED */ - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + THREAD_BASIC_INFORMATION ThreadBasicInfo; + HANDLE ThreadHandle; + + /* Write common data */ + DebugEvent->dwProcessId = (DWORD)WaitStateChange-> + AppClientId.UniqueProcess; + DebugEvent->dwThreadId = (DWORD)WaitStateChange->AppClientId.UniqueThread; + + /* Check what kind of even this is */ + switch (WaitStateChange->NewState) + { + /* New thread */ + case DbgCreateThreadStateChange: + + /* Setup Win32 code */ + DebugEvent->dwDebugEventCode = CREATE_THREAD_DEBUG_EVENT; + + /* Copy data over */ + DebugEvent->u.CreateThread.hThread = + WaitStateChange->StateInfo.CreateThread.HandleToThread; + DebugEvent->u.CreateThread.lpStartAddress = + WaitStateChange->StateInfo.CreateThread.NewThread.StartAddress; + + /* Query the TEB */ + Status = NtQueryInformationThread(WaitStateChange->StateInfo. + CreateThread.HandleToThread, + ThreadBasicInformation, + &ThreadBasicInfo, + sizeof(ThreadBasicInfo), + NULL); + if (!NT_SUCCESS(Status)) + { + /* Failed to get PEB address */ + DebugEvent->u.CreateThread.lpThreadLocalBase = NULL; + } + else + { + /* Write PEB Address */ + DebugEvent->u.CreateThread.lpThreadLocalBase = + ThreadBasicInfo.TebBaseAddress; + } + break; + + /* New process */ + case DbgCreateProcessStateChange: + + /* Write Win32 debug code */ + DebugEvent->dwDebugEventCode = CREATE_PROCESS_DEBUG_EVENT; + + /* Copy data over */ + DebugEvent->u.CreateProcessInfo.hProcess = + WaitStateChange->StateInfo.CreateProcessInfo.HandleToProcess; + DebugEvent->u.CreateProcessInfo.hThread = + WaitStateChange->StateInfo.CreateProcessInfo.HandleToThread; + DebugEvent->u.CreateProcessInfo.hFile = + WaitStateChange->StateInfo.CreateProcessInfo.NewProcess. + FileHandle; + DebugEvent->u.CreateProcessInfo.lpBaseOfImage = + WaitStateChange->StateInfo.CreateProcessInfo.NewProcess. + BaseOfImage; + DebugEvent->u.CreateProcessInfo.dwDebugInfoFileOffset = + WaitStateChange->StateInfo.CreateProcessInfo.NewProcess. + DebugInfoFileOffset; + DebugEvent->u.CreateProcessInfo.nDebugInfoSize = + WaitStateChange->StateInfo.CreateProcessInfo.NewProcess. + DebugInfoSize; + DebugEvent->u.CreateProcessInfo.lpStartAddress = + WaitStateChange->StateInfo.CreateProcessInfo.NewProcess. + InitialThread.StartAddress; + + /* Query TEB address */ + Status = NtQueryInformationThread(WaitStateChange->StateInfo. + CreateProcessInfo.HandleToThread, + ThreadBasicInformation, + &ThreadBasicInfo, + sizeof(ThreadBasicInfo), + NULL); + if (!NT_SUCCESS(Status)) + { + /* Failed to get PEB address */ + DebugEvent->u.CreateThread.lpThreadLocalBase = NULL; + } + else + { + /* Write PEB Address */ + DebugEvent->u.CreateThread.lpThreadLocalBase = + ThreadBasicInfo.TebBaseAddress; + } + + /* Clear image name */ + DebugEvent->u.CreateProcessInfo.lpImageName = NULL; + DebugEvent->u.CreateProcessInfo.fUnicode = TRUE; + break; + + /* Thread exited */ + case DbgExitThreadStateChange: + + /* Write the Win32 debug code and the exit status */ + DebugEvent->dwDebugEventCode = EXIT_THREAD_DEBUG_EVENT; + DebugEvent->u.ExitThread.dwExitCode = + WaitStateChange->StateInfo.ExitThread.ExitStatus; + break; + + /* Process exited */ + case DbgExitProcessStateChange: + + /* Write the Win32 debug code and the exit status */ + DebugEvent->dwDebugEventCode = EXIT_PROCESS_DEBUG_EVENT; + DebugEvent->u.ExitProcess.dwExitCode = + WaitStateChange->StateInfo.ExitProcess.ExitStatus; + break; + + /* Any sort of exception */ + case DbgExceptionStateChange: + case DbgBreakpointStateChange: + case DbgSingleStepStateChange: + + /* Check if this was a debug print */ + if (WaitStateChange->StateInfo.Exception.ExceptionRecord. + ExceptionCode == DBG_PRINTEXCEPTION_C) + { + /* Set the Win32 code */ + DebugEvent->dwDebugEventCode = OUTPUT_DEBUG_STRING_EVENT; + + /* Copy debug string information */ + DebugEvent->u.DebugString.lpDebugStringData = + (PVOID)WaitStateChange-> + StateInfo.Exception.ExceptionRecord. + ExceptionInformation[1]; + DebugEvent->u.DebugString.nDebugStringLength = + WaitStateChange->StateInfo.Exception.ExceptionRecord. + ExceptionInformation[0]; + DebugEvent->u.DebugString.fUnicode = FALSE; + } + else if (WaitStateChange->StateInfo.Exception.ExceptionRecord. + ExceptionCode == DBG_RIPEXCEPTION) + { + /* Set the Win32 code */ + DebugEvent->dwDebugEventCode = RIP_EVENT; + + /* Set exception information */ + DebugEvent->u.RipInfo.dwType = + WaitStateChange->StateInfo.Exception.ExceptionRecord. + ExceptionInformation[1]; + DebugEvent->u.RipInfo.dwError = + WaitStateChange->StateInfo.Exception.ExceptionRecord. + ExceptionInformation[0]; + } + else + { + /* Otherwise, this is a debug event, copy info over */ + DebugEvent->dwDebugEventCode = EXCEPTION_DEBUG_EVENT; + DebugEvent->u.Exception.ExceptionRecord = + WaitStateChange->StateInfo.Exception.ExceptionRecord; + DebugEvent->u.Exception.dwFirstChance = + WaitStateChange->StateInfo.Exception.FirstChance; + } + break; + + /* DLL Load */ + case DbgLoadDllStateChange : + + /* Set the Win32 debug code */ + DebugEvent->dwDebugEventCode = LOAD_DLL_DEBUG_EVENT; + + /* Copy the rest of the data */ + DebugEvent->u.LoadDll.lpBaseOfDll = + WaitStateChange->StateInfo.LoadDll.BaseOfDll; + DebugEvent->u.LoadDll.hFile = + WaitStateChange->StateInfo.LoadDll.FileHandle; + DebugEvent->u.LoadDll.dwDebugInfoFileOffset = + WaitStateChange->StateInfo.LoadDll.DebugInfoFileOffset; + DebugEvent->u.LoadDll.nDebugInfoSize = + WaitStateChange->StateInfo.LoadDll.DebugInfoSize; + + /* Open the thread */ + InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL); + Status = NtOpenThread(&ThreadHandle, + THREAD_QUERY_INFORMATION, + &ObjectAttributes, + &WaitStateChange->AppClientId); + if (NT_SUCCESS(Status)) + { + /* Query thread information */ + Status = NtQueryInformationThread(ThreadHandle, + ThreadBasicInformation, + &ThreadBasicInfo, + sizeof(ThreadBasicInfo), + NULL); + NtClose(ThreadHandle); + } + + /* Check if we got thread information */ + if (NT_SUCCESS(Status)) + { + /* Save the image name from the TIB */ + DebugEvent->u.LoadDll.lpImageName = + &((PTEB)ThreadBasicInfo.TebBaseAddress)-> + Tib.ArbitraryUserPointer; + } + else + { + /* Otherwise, no name */ + DebugEvent->u.LoadDll.lpImageName = NULL; + } + + /* It's Unicode */ + DebugEvent->u.LoadDll.fUnicode = TRUE; + break; + + /* DLL Unload */ + case DbgUnloadDllStateChange: + + /* Set Win32 code and DLL Base */ + DebugEvent->dwDebugEventCode = UNLOAD_DLL_DEBUG_EVENT; + DebugEvent->u.UnloadDll.lpBaseOfDll = + WaitStateChange->StateInfo.UnloadDll.BaseAddress; + break; + + /* Anything else, fail */ + default: return STATUS_UNSUCCESSFUL; + } + + /* Return success */ + return STATUS_SUCCESS; } /*
18 years, 2 months
1
0
0
0
[ion] 24618: - Implement WaitForDebugEvent. Calls out to DbgUiConvertWaitStateStructure which is still unimplemented.
by ion@svn.reactos.org
Author: ion Date: Mon Oct 23 03:47:12 2006 New Revision: 24618 URL:
http://svn.reactos.org/svn/reactos?rev=24618&view=rev
Log: - Implement WaitForDebugEvent. Calls out to DbgUiConvertWaitStateStructure which is still unimplemented. Modified: trunk/reactos/dll/win32/kernel32/debug/debugger.c trunk/reactos/include/psdk/ntstatus.h Modified: trunk/reactos/dll/win32/kernel32/debug/debugger.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/debug/d…
============================================================================== --- trunk/reactos/dll/win32/kernel32/debug/debugger.c (original) +++ trunk/reactos/dll/win32/kernel32/debug/debugger.c Mon Oct 23 03:47:12 2006 @@ -465,16 +465,109 @@ } /* - * @unimplemented + * @implemented */ BOOL WINAPI WaitForDebugEvent(IN LPDEBUG_EVENT lpDebugEvent, IN DWORD dwMilliseconds) { - /* FIXME: TODO */ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + LARGE_INTEGER WaitTime; + PLARGE_INTEGER Timeout; + DBGUI_WAIT_STATE_CHANGE WaitStateChange; + NTSTATUS Status; + + /* Check if this is an infinite wait */ + if (dwMilliseconds == INFINITE) + { + /* Under NT, this means no timer argument */ + Timeout = NULL; + } + else + { + /* Otherwise, convert the time to NT Format */ + WaitTime.QuadPart = UInt32x32To64(-10000, dwMilliseconds); + Timeout = &WaitTime; + } + + /* Loop while we keep getting interrupted */ + do + { + /* Call the native API */ + Status = DbgUiWaitStateChange(&WaitStateChange, Timeout); + } while ((Status == STATUS_ALERTED) || (Status == STATUS_USER_APC)); + + /* Check if the wait failed */ + if (!(NT_SUCCESS(Status)) || (Status != DBG_UNABLE_TO_PROVIDE_HANDLE)) + { + /* Set the error code and quit */ + SetLastErrorByStatus(Status); + return FALSE; + } + + /* Check if we timed out */ + if (Status == STATUS_TIMEOUT) + { + /* Fail with a timeout error */ + SetLastError(ERROR_SEM_TIMEOUT); + return FALSE; + } + + /* Convert the structure */ + Status = DbgUiConvertStateChangeStructure(&WaitStateChange, lpDebugEvent); + if (!NT_SUCCESS(Status)) + { + /* Set the error code and quit */ + SetLastErrorByStatus(Status); + return FALSE; + } + + /* Check what kind of event this was */ + switch (lpDebugEvent->dwDebugEventCode) + { + /* New thread was created */ + case CREATE_THREAD_DEBUG_EVENT: + + /* Setup the thread data */ + SaveThreadHandle(lpDebugEvent->dwProcessId, + lpDebugEvent->dwThreadId, + lpDebugEvent->u.CreateThread.hThread); + break; + + /* New process was created */ + case CREATE_PROCESS_DEBUG_EVENT: + + /* Setup the process data */ + SaveProcessHandle(lpDebugEvent->dwProcessId, + lpDebugEvent->u.CreateProcessInfo.hProcess); + + /* Setup the thread data */ + SaveThreadHandle(lpDebugEvent->dwProcessId, + lpDebugEvent->dwThreadId, + lpDebugEvent->u.CreateThread.hThread); + break; + + /* Process was exited */ + case EXIT_PROCESS_DEBUG_EVENT: + + /* Mark the thread data as such */ + MarkProcessHandle(lpDebugEvent->dwProcessId); + break; + + /* Thread was exited */ + case EXIT_THREAD_DEBUG_EVENT: + + /* Mark the thread data */ + MarkThreadHandle(lpDebugEvent->dwThreadId); + break; + + /* Nothing to do for anything else */ + default: + break; + } + + /* Return success */ + return TRUE; } /* EOF */ Modified: trunk/reactos/include/psdk/ntstatus.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntstatus.h?re…
============================================================================== --- trunk/reactos/include/psdk/ntstatus.h (original) +++ trunk/reactos/include/psdk/ntstatus.h Mon Oct 23 03:47:12 2006 @@ -58,6 +58,7 @@ #define STATUS_WAIT_63 ((NTSTATUS)0x0000003f) #define STATUS_ABANDONED ((NTSTATUS)0x00000080) #define STATUS_ABANDONED_WAIT_63 ((NTSTATUS)0x000000BF) +#define STATUS_USER_APC ((NTSTATUS)0x000000C0) #define STATUS_KERNEL_APC ((NTSTATUS)0x00000100) #define STATUS_ALERTED ((NTSTATUS)0x00000101) #define STATUS_TIMEOUT ((NTSTATUS)0x00000102)
18 years, 2 months
1
0
0
0
[ion] 24617: - Define DBGSS_THREAD_DATA and DbgSsGet/SetThreadData. This is what is located in DbgSsReserved[0] (an internal high-level structure that subsystem debuggers can use for whatever purposes they need). DbgSsReserved[1] is the actual native debug object used only by DbgUi in ntdll. - Implement SaveThreadHandle, SaveProcesHandle, MarkThreadHandle, MarkProcessHandle, RemoveHandles and CloseAllProcessHandles to deal with this structure. - Call these functions when required, except for Wai
by ion@svn.reactos.org
Author: ion Date: Mon Oct 23 03:28:33 2006 New Revision: 24617 URL:
http://svn.reactos.org/svn/reactos?rev=24617&view=rev
Log: - Define DBGSS_THREAD_DATA and DbgSsGet/SetThreadData. This is what is located in DbgSsReserved[0] (an internal high-level structure that subsystem debuggers can use for whatever purposes they need). DbgSsReserved[1] is the actual native debug object used only by DbgUi in ntdll. - Implement SaveThreadHandle, SaveProcesHandle, MarkThreadHandle, MarkProcessHandle, RemoveHandles and CloseAllProcessHandles to deal with this structure. - Call these functions when required, except for WaitForDebugEvent which will set them up once implemented. Modified: trunk/reactos/dll/ntdll/dbg/dbgui.c trunk/reactos/dll/win32/kernel32/debug/debugger.c Modified: trunk/reactos/dll/ntdll/dbg/dbgui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/dbg/dbgui.c?rev=…
============================================================================== --- trunk/reactos/dll/ntdll/dbg/dbgui.c (original) +++ trunk/reactos/dll/ntdll/dbg/dbgui.c Mon Oct 23 03:28:33 2006 @@ -78,7 +78,7 @@ NTSTATUS NTAPI DbgUiConvertStateChangeStructure(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, - IN LPDEBUG_EVENT DebugEvent) + OUT LPDEBUG_EVENT DebugEvent) { /* FIXME: UNIMPLEMENTED */ return STATUS_NOT_IMPLEMENTED; Modified: trunk/reactos/dll/win32/kernel32/debug/debugger.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/debug/d…
============================================================================== --- trunk/reactos/dll/win32/kernel32/debug/debugger.c (original) +++ trunk/reactos/dll/win32/kernel32/debug/debugger.c Mon Oct 23 03:28:33 2006 @@ -9,11 +9,250 @@ /* INCLUDES *****************************************************************/ #include <k32.h> - #define NDEBUG #include "debug.h" -/* FUNCTIONS *****************************************************************/ +typedef struct _DBGSS_THREAD_DATA +{ + struct _DBGSS_THREAD_DATA *Next; + HANDLE ThreadHandle; + HANDLE ProcessHandle; + DWORD ProcessId; + DWORD ThreadId; + BOOLEAN HandleMarked; +} DBGSS_THREAD_DATA, *PDBGSS_THREAD_DATA; + +#define DbgSsSetThreadData(d) \ + NtCurrentTeb()->DbgSsReserved[0] = d + +#define DbgSsGetThreadData() \ + ((PDBGSS_THREAD_DATA)NtCurrentTeb()->DbgSsReserved[0]) + +/* PRIVATE FUNCTIONS *********************************************************/ + +VOID +WINAPI +SaveThreadHandle(IN DWORD dwProcessId, + IN DWORD dwThreadId, + IN HANDLE hThread) +{ + PDBGSS_THREAD_DATA ThreadData; + + /* Allocate a thread structure */ + ThreadData = RtlAllocateHeap(RtlGetProcessHeap(), + 0, + sizeof(DBGSS_THREAD_DATA)); + if (!ThreadData) return; + + /* Fill it out */ + ThreadData->ThreadHandle = hThread; + ThreadData->ProcessId = dwProcessId; + ThreadData->ThreadId = dwThreadId; + ThreadData->ProcessHandle = NULL; + ThreadData->HandleMarked = FALSE; + + /* Link it */ + ThreadData->Next = DbgSsGetThreadData(); + DbgSsSetThreadData(ThreadData); +} + +VOID +WINAPI +SaveProcessHandle(IN DWORD dwProcessId, + IN HANDLE hProcess) +{ + PDBGSS_THREAD_DATA ThreadData; + + /* Allocate a thread structure */ + ThreadData = RtlAllocateHeap(RtlGetProcessHeap(), + 0, + sizeof(DBGSS_THREAD_DATA)); + if (!ThreadData) return; + + /* Fill it out */ + ThreadData->ProcessHandle = hProcess; + ThreadData->ProcessId = dwProcessId; + ThreadData->ThreadId = 0; + ThreadData->ThreadHandle = NULL; + ThreadData->HandleMarked = FALSE; + + /* Link it */ + ThreadData->Next = DbgSsGetThreadData(); + DbgSsSetThreadData(ThreadData); +} + +VOID +WINAPI +MarkThreadHandle(IN DWORD dwThreadId) +{ + PDBGSS_THREAD_DATA ThreadData; + + /* Loop all thread data events */ + ThreadData = DbgSsGetThreadData(); + while (ThreadData) + { + /* Check if this one matches */ + if (ThreadData->ThreadId == dwThreadId) + { + /* Mark the structure and break out */ + ThreadData->HandleMarked = TRUE; + break; + } + + /* Move to the next one */ + ThreadData = ThreadData->Next; + } +} + +VOID +WINAPI +MarkProcessHandle(IN DWORD dwProcessId) +{ + PDBGSS_THREAD_DATA ThreadData; + + /* Loop all thread data events */ + ThreadData = DbgSsGetThreadData(); + while (ThreadData) + { + /* Check if this one matches */ + if (ThreadData->ProcessId == dwProcessId) + { + /* Make sure the thread ID is empty */ + if (!ThreadData->ThreadId) + { + /* Mark the structure and break out */ + ThreadData->HandleMarked = TRUE; + break; + } + } + + /* Move to the next one */ + ThreadData = ThreadData->Next; + } +} + +VOID +WINAPI +RemoveHandles(IN DWORD dwProcessId, + IN DWORD dwThreadId) +{ + PDBGSS_THREAD_DATA ThreadData; + + /* Loop all thread data events */ + ThreadData = DbgSsGetThreadData(); + while (ThreadData) + { + /* Check if this one matches */ + if (ThreadData->ProcessId == dwProcessId) + { + /* Make sure the thread ID matches too */ + if (ThreadData->ThreadId == dwThreadId) + { + /* Check if we have a thread handle */ + if (ThreadData->ThreadHandle) + { + /* Close it */ + CloseHandle(ThreadData->ThreadHandle); + } + + /* Check if we have a process handle */ + if (ThreadData->ProcessHandle) + { + /* Close it */ + CloseHandle(ThreadData->ProcessHandle); + } + + /* Unlink the thread data */ + DbgSsSetThreadData(ThreadData->Next); + + /* Free it*/ + RtlFreeHeap(RtlGetProcessHeap(), 0, ThreadData); + + /* Move to the next structure */ + ThreadData = DbgSsGetThreadData(); + continue; + } + } + + /* Move to the next one */ + ThreadData = ThreadData->Next; + } +} + +VOID +WINAPI +CloseAllProcessHandles(IN DWORD dwProcessId) +{ + PDBGSS_THREAD_DATA ThreadData; + + /* Loop all thread data events */ + ThreadData = DbgSsGetThreadData(); + while (ThreadData) + { + /* Check if this one matches */ + if (ThreadData->ProcessId == dwProcessId) + { + /* Check if we have a thread handle */ + if (ThreadData->ThreadHandle) + { + /* Close it */ + CloseHandle(ThreadData->ThreadHandle); + } + + /* Check if we have a process handle */ + if (ThreadData->ProcessHandle) + { + /* Close it */ + CloseHandle(ThreadData->ProcessHandle); + } + + /* Unlink the thread data */ + DbgSsSetThreadData(ThreadData->Next); + + /* Free it*/ + RtlFreeHeap(RtlGetProcessHeap(), 0, ThreadData); + + /* Move to the next structure */ + ThreadData = DbgSsGetThreadData(); + continue; + } + + /* Move to the next one */ + ThreadData = ThreadData->Next; + } +} + +HANDLE +WINAPI +ProcessIdToHandle(IN DWORD dwProcessId) +{ + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE Handle; + CLIENT_ID ClientId; + + /* If we don't have a PID, look it up */ + if (dwProcessId == -1) dwProcessId = (DWORD)CsrGetProcessId(); + + /* Open a handle to the process */ + ClientId.UniqueProcess = (HANDLE)dwProcessId; + InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL); + Status = NtOpenProcess(&Handle, + PROCESS_ALL_ACCESS, + &ObjectAttributes, + &ClientId); + if (!NT_SUCCESS(Status)) + { + /* Fail */ + SetLastErrorByStatus(Status); + return 0; + } + + /* Return the handle */ + return Handle; +} + +/* PUBLIC FUNCTIONS **********************************************************/ /* * @implemented @@ -77,37 +316,11 @@ return FALSE; } - /* Succes */ + /* Remove the process/thread handles */ + RemoveHandles(dwProcessId, dwThreadId); + + /* Success */ return TRUE; -} - -HANDLE -ProcessIdToHandle(IN DWORD dwProcessId) -{ - NTSTATUS Status; - OBJECT_ATTRIBUTES ObjectAttributes; - HANDLE Handle; - CLIENT_ID ClientId; - - /* If we don't have a PID, look it up */ - if (dwProcessId == 0xFFFFFFFF) dwProcessId = (DWORD)CsrGetProcessId(); - - /* Open a handle to the process */ - ClientId.UniqueProcess = (HANDLE)dwProcessId; - InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL); - Status = NtOpenProcess(&Handle, - PROCESS_ALL_ACCESS, - &ObjectAttributes, - &ClientId); - if (!NT_SUCCESS(Status)) - { - /* Fail */ - SetLastErrorByStatus(Status); - return 0; - } - - /* Return the handle */ - return Handle; } /* @@ -134,6 +347,9 @@ /* Now debug the process */ Status = DbgUiDebugActiveProcess(Handle); + NtClose(Handle); + + /* Check if debugging worked */ if (!NT_SUCCESS(Status)) { /* Fail */ @@ -158,6 +374,9 @@ /* Get the process handle */ Handle = ProcessIdToHandle(dwProcessId); if (!Handle) return FALSE; + + /* Close all the process handles */ + CloseAllProcessHandles(dwProcessId); /* Now stop debgging the process */ Status = DbgUiStopDebugging(Handle); @@ -240,7 +459,7 @@ */ BOOL WINAPI -IsDebuggerPresent (VOID) +IsDebuggerPresent(VOID) { return (BOOL)NtCurrentPeb()->BeingDebugged; } @@ -251,7 +470,7 @@ BOOL WINAPI WaitForDebugEvent(IN LPDEBUG_EVENT lpDebugEvent, - DWORD dwMilliseconds) + IN DWORD dwMilliseconds) { /* FIXME: TODO */ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
18 years, 2 months
1
0
0
0
[hpoussin] 24616: Fix compilation in release mode
by hpoussin@svn.reactos.org
Author: hpoussin Date: Mon Oct 23 01:22:46 2006 New Revision: 24616 URL:
http://svn.reactos.org/svn/reactos?rev=24616&view=rev
Log: Fix compilation in release mode Modified: trunk/reactos/ntoskrnl/dbgk/debug.c trunk/reactos/ntoskrnl/io/iomgr/driver.c Modified: trunk/reactos/ntoskrnl/dbgk/debug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/dbgk/debug.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/dbgk/debug.c (original) +++ trunk/reactos/ntoskrnl/dbgk/debug.c Mon Oct 23 01:22:46 2006 @@ -876,11 +876,10 @@ NTAPI DbgkpDeleteObject(IN PVOID Object) { - PDEBUG_OBJECT DebugObject = Object; PAGED_CODE(); /* Sanity check */ - ASSERT(IsListEmpty(&DebugObject->EventList)); + ASSERT(IsListEmpty(&((PDEBUG_OBJECT)DebugObject)->EventList)); } VOID Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/driver.c (original) +++ trunk/reactos/ntoskrnl/io/iomgr/driver.c Mon Oct 23 01:22:46 2006 @@ -924,7 +924,9 @@ { PLIST_ENTRY ListHead, NextEntry; PLDR_DATA_TABLE_ENTRY LdrEntry; +#ifdef DBG UNICODE_STRING NtosSymName = RTL_CONSTANT_STRING(L"ntoskrnl.sym"); +#endif PDEVICE_NODE DeviceNode; PDRIVER_OBJECT DriverObject; LDR_DATA_TABLE_ENTRY ModuleObject;
18 years, 2 months
1
0
0
0
[ion] 24615: - Stub DbgUiConvertStateChangeStructure (this isn't done in kernel32 anymore) and export it. - Implement and export DbgUiSetThreadDebugObject. - Fix DbgUi* APIs to use DbgSsReserved[1], and not [0]. Still trying to figure out what [0] is for.
by ion@svn.reactos.org
Author: ion Date: Mon Oct 23 01:19:34 2006 New Revision: 24615 URL:
http://svn.reactos.org/svn/reactos?rev=24615&view=rev
Log: - Stub DbgUiConvertStateChangeStructure (this isn't done in kernel32 anymore) and export it. - Implement and export DbgUiSetThreadDebugObject. - Fix DbgUi* APIs to use DbgSsReserved[1], and not [0]. Still trying to figure out what [0] is for. Modified: trunk/reactos/dll/ntdll/dbg/dbgui.c trunk/reactos/dll/ntdll/def/ntdll.def trunk/reactos/include/ndk/umfuncs.h Modified: trunk/reactos/dll/ntdll/dbg/dbgui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/dbg/dbgui.c?rev=…
============================================================================== --- trunk/reactos/dll/ntdll/dbg/dbgui.c (original) +++ trunk/reactos/dll/ntdll/dbg/dbgui.c Mon Oct 23 01:19:34 2006 @@ -46,17 +46,13 @@ OBJECT_ATTRIBUTES ObjectAttributes; /* Don't connect twice */ - if (NtCurrentTeb()->DbgSsReserved[0]) return STATUS_SUCCESS; + if (NtCurrentTeb()->DbgSsReserved[1]) return STATUS_SUCCESS; /* Setup the Attributes */ - InitializeObjectAttributes(&ObjectAttributes, - 0, - 0, - 0, - 0); + InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, 0); /* Create the object */ - return ZwCreateDebugObject(&NtCurrentTeb()->DbgSsReserved[0], + return ZwCreateDebugObject(&NtCurrentTeb()->DbgSsReserved[1], DEBUG_OBJECT_ALL_ACCESS, &ObjectAttributes, TRUE); @@ -67,25 +63,37 @@ */ NTSTATUS NTAPI -DbgUiContinue(PCLIENT_ID ClientId, - ULONG ContinueStatus) +DbgUiContinue(IN PCLIENT_ID ClientId, + IN NTSTATUS ContinueStatus) { /* Tell the kernel object to continue */ - return ZwDebugContinue(NtCurrentTeb()->DbgSsReserved[0], + return ZwDebugContinue(NtCurrentTeb()->DbgSsReserved[1], ClientId, ContinueStatus); } /* - * @implemented - */ -NTSTATUS -NTAPI -DbgUiWaitStateChange(PDBGUI_WAIT_STATE_CHANGE DbgUiWaitStateCange, - PLARGE_INTEGER TimeOut) + * @unimplemented + */ +NTSTATUS +NTAPI +DbgUiConvertStateChangeStructure(IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, + IN LPDEBUG_EVENT DebugEvent) +{ + /* FIXME: UNIMPLEMENTED */ + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +DbgUiWaitStateChange(OUT PDBGUI_WAIT_STATE_CHANGE DbgUiWaitStateCange, + IN PLARGE_INTEGER TimeOut OPTIONAL) { /* Tell the kernel to wait */ - return NtWaitForDebugEvent(NtCurrentTeb()->DbgSsReserved[0], + return NtWaitForDebugEvent(NtCurrentTeb()->DbgSsReserved[1], TRUE, TimeOut, DbgUiWaitStateCange); @@ -110,7 +118,7 @@ */ NTSTATUS NTAPI -DbgUiIssueRemoteBreakin(HANDLE Process) +DbgUiIssueRemoteBreakin(IN HANDLE Process) { HANDLE hThread; CLIENT_ID ClientId; @@ -143,7 +151,18 @@ DbgUiGetThreadDebugObject(VOID) { /* Just return the handle from the TEB */ - return NtCurrentTeb()->DbgSsReserved[0]; + return NtCurrentTeb()->DbgSsReserved[1]; +} + +/* +* @implemented +*/ +VOID +NTAPI +DbgUiSetThreadDebugObject(HANDLE DebugObject) +{ + /* Just set the handle in the TEB */ + NtCurrentTeb()->DbgSsReserved[1] = DebugObject; } /* @@ -156,7 +175,7 @@ NTSTATUS Status; /* Tell the kernel to start debugging */ - Status = NtDebugActiveProcess(Process, NtCurrentTeb()->DbgSsReserved[0]); + Status = NtDebugActiveProcess(Process, NtCurrentTeb()->DbgSsReserved[1]); if (NT_SUCCESS(Status)) { /* Now break-in the process */ @@ -180,7 +199,7 @@ DbgUiStopDebugging(IN HANDLE Process) { /* Call the kernel to remove the debug object */ - return NtRemoveProcessDebug(Process, NtCurrentTeb()->DbgSsReserved[0]); + return NtRemoveProcessDebug(Process, NtCurrentTeb()->DbgSsReserved[1]); } /* EOF */ Modified: trunk/reactos/dll/ntdll/def/ntdll.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.def?re…
============================================================================== --- trunk/reactos/dll/ntdll/def/ntdll.def (original) +++ trunk/reactos/dll/ntdll/def/ntdll.def Mon Oct 23 01:19:34 2006 @@ -24,12 +24,14 @@ DbgPrint DbgPrintEx DbgPrompt@12 +DbgUiConvertStateChangeStructure@8 DbgUiDebugActiveProcess@4 DbgUiConnectToDbg@0 DbgUiContinue@8 DbgUiGetThreadDebugObject@0 DbgUiIssueRemoteBreakin@4 DbgUiRemoteBreakin@0 +DbgUiSetThreadDebugObject@4 DbgUiStopDebugging@4 DbgUiWaitStateChange@8 DbgUserBreakPoint@0 Modified: trunk/reactos/include/ndk/umfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/umfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/umfuncs.h (original) +++ trunk/reactos/include/ndk/umfuncs.h Mon Oct 23 01:19:34 2006 @@ -142,7 +142,7 @@ NTAPI DbgUiContinue( IN PCLIENT_ID ClientId, - IN ULONG ContinueStatus + IN NTSTATUS ContinueStatus ); NTSTATUS @@ -162,6 +162,13 @@ DbgUiWaitStateChange( IN PDBGUI_WAIT_STATE_CHANGE DbgUiWaitStateCange, IN PLARGE_INTEGER TimeOut +); + +NTSTATUS +NTAPI +DbgUiConvertStateChangeStructure( + IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange, + IN LPDEBUG_EVENT DebugEvent ); VOID
18 years, 2 months
1
0
0
0
[ion] 24614: - Implement helper routine DbgkpSectionToFileHandle and stub MmGetFileNameForSection (easy ObQueryNameString-based implementation to do later). - Implement helpers DbgkpSuspendProcess and DbgkpResumeProcess based on KeFreeze/ThawAllThreads. - Implement DbgkExitProcess, DbgkExitThread, DbgkMapViewOfSection, DbgkUnmapViewOfSection. Apart from DbgkCreateThread, these are the main notification APIs that Dbgk uses for user-mode debug events. (Mm code needs to be changed to call the map/u
by ion@svn.reactos.org
Author: ion Date: Mon Oct 23 00:56:24 2006 New Revision: 24614 URL:
http://svn.reactos.org/svn/reactos?rev=24614&view=rev
Log: - Implement helper routine DbgkpSectionToFileHandle and stub MmGetFileNameForSection (easy ObQueryNameString-based implementation to do later). - Implement helpers DbgkpSuspendProcess and DbgkpResumeProcess based on KeFreeze/ThawAllThreads. - Implement DbgkExitProcess, DbgkExitThread, DbgkMapViewOfSection, DbgkUnmapViewOfSection. Apart from DbgkCreateThread, these are the main notification APIs that Dbgk uses for user-mode debug events. (Mm code needs to be changed to call the map/unmap notifications. Ps already calls the exit/create ones). Modified: trunk/reactos/ntoskrnl/dbgk/dbgkutil.c trunk/reactos/ntoskrnl/include/internal/dbgk.h trunk/reactos/ntoskrnl/include/internal/mm.h trunk/reactos/ntoskrnl/mm/section.c Modified: trunk/reactos/ntoskrnl/dbgk/dbgkutil.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/dbgk/dbgkutil.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/dbgk/dbgkutil.c (original) +++ trunk/reactos/ntoskrnl/dbgk/dbgkutil.c Mon Oct 23 00:56:24 2006 @@ -14,6 +14,72 @@ /* FUNCTIONS *****************************************************************/ +HANDLE +NTAPI +DbgkpSectionToFileHandle(IN PVOID Section) +{ + NTSTATUS Status; + UNICODE_STRING FileName; + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK IoStatusBlock; + HANDLE Handle; + PAGED_CODE(); + + /* Get the filename of the section */ + Status = MmGetFileNameForSection(Section, &FileName); + if (!NT_SUCCESS(Status)) return NULL; + + /* Initialize object attributes */ + InitializeObjectAttributes(&ObjectAttributes, + &FileName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + /* Open the file */ + Status = ZwOpenFile(&Handle, + GENERIC_READ | SYNCHRONIZE, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_SYNCHRONOUS_IO_NONALERT); + + /* Free the name and return the handle if we succeeded */ + ExFreePool(FileName.Buffer); + if (!NT_SUCCESS(Status)) return NULL; + return Handle; +} + +BOOLEAN +NTAPI +DbgkpSuspendProcess(VOID) +{ + PAGED_CODE(); + + /* Make sure this isn't a deleted process */ + if (PsGetCurrentProcess()->ProcessDelete) + { + /* Freeze all the threads */ + KeFreezeAllThreads(); + return TRUE; + } + else + { + /* No suspend was done */ + return FALSE; + } +} + +VOID +NTAPI +DbgkpResumeProcess(VOID) +{ + PAGED_CODE(); + + /* Thaw all the threads */ + KeThawAllThreads(); +} + VOID NTAPI DbgkCreateThread(PVOID StartAddress) @@ -25,28 +91,160 @@ NTAPI DbgkExitProcess(IN NTSTATUS ExitStatus) { - /* FIXME */ + DBGKM_MSG ApiMessage; + PDBGKM_EXIT_PROCESS ExitProcess = &ApiMessage.ExitProcess; + PEPROCESS Process = PsGetCurrentProcess(); + PETHREAD Thread = PsGetCurrentThread(); + PAGED_CODE(); + + /* Check if this thread is hidden, doesn't have a debug port, or died */ + if ((Thread->HideFromDebugger) || + !(Process->DebugPort) || + (Thread->DeadThread)) + { + /* Don't notify the debugger */ + return; + } + + /* Set the exit status */ + ExitProcess->ExitStatus = ExitStatus; + + /* Setup the API Message */ + ApiMessage.h.u1.Length = sizeof(DBGKM_MSG) << 16 | + (8 + sizeof(DBGKM_EXIT_PROCESS)); + ApiMessage.h.u2.ZeroInit = LPC_DEBUG_EVENT; + ApiMessage.ApiNumber = DbgKmExitProcessApi; + + /* Set the current exit time */ + KeQuerySystemTime(&Process->ExitTime); + + /* Send the message */ + DbgkpSendApiMessage(&ApiMessage, FALSE); } VOID NTAPI DbgkExitThread(IN NTSTATUS ExitStatus) { - /* FIXME */ -} - -VOID -NTAPI -DbgkpSuspendProcess(VOID) -{ - -} - -VOID -NTAPI -DbgkpResumeProcess(VOID) -{ - + DBGKM_MSG ApiMessage; + PDBGKM_EXIT_THREAD ExitThread = &ApiMessage.ExitThread; + PEPROCESS Process = PsGetCurrentProcess(); + PETHREAD Thread = PsGetCurrentThread(); + BOOLEAN Suspended; + PAGED_CODE(); + + /* Check if this thread is hidden, doesn't have a debug port, or died */ + if ((Thread->HideFromDebugger) || + !(Process->DebugPort) || + (Thread->DeadThread)) + { + /* Don't notify the debugger */ + return; + } + + /* Set the exit status */ + ExitThread->ExitStatus = ExitStatus; + + /* Setup the API Message */ + ApiMessage.h.u1.Length = sizeof(DBGKM_MSG) << 16 | + (8 + sizeof(DBGKM_EXIT_THREAD)); + ApiMessage.h.u2.ZeroInit = LPC_DEBUG_EVENT; + ApiMessage.ApiNumber = DbgKmExitThreadApi; + + /* Suspend the process */ + Suspended = DbgkpSuspendProcess(); + + /* Send the message */ + DbgkpSendApiMessage(&ApiMessage, FALSE); + + /* Resume the process if needed */ + if (Suspended) DbgkpResumeProcess(); +} + +VOID +NTAPI +DbgkMapViewOfSection(IN HANDLE SectionHandle, + IN PVOID BaseAddress, + IN ULONG SectionOffset, + IN ULONG_PTR ViewSize) +{ + DBGKM_MSG ApiMessage; + PDBGKM_LOAD_DLL LoadDll = &ApiMessage.LoadDll; + PEPROCESS Process = PsGetCurrentProcess(); + PETHREAD Thread = PsGetCurrentThread(); + PIMAGE_NT_HEADERS NtHeader; + PAGED_CODE(); + + /* Check if this thread is hidden, doesn't have a debug port, or died */ + if ((Thread->HideFromDebugger) || + !(Process->DebugPort) || + (Thread->DeadThread) || + (KeGetPreviousMode() == KernelMode)) + { + /* Don't notify the debugger */ + return; + } + + /* Setup the parameters */ + LoadDll->FileHandle = DbgkpSectionToFileHandle(SectionHandle); + LoadDll->BaseOfDll = BaseAddress; + LoadDll->DebugInfoFileOffset = 0; + LoadDll->DebugInfoSize = 0; + + /* Get the NT Headers */ + NtHeader = RtlImageNtHeader(BaseAddress); + if (NtHeader) + { + /* Fill out debug information */ + LoadDll->DebugInfoFileOffset = NtHeader->FileHeader. + PointerToSymbolTable; + LoadDll->DebugInfoSize = NtHeader->FileHeader.NumberOfSymbols; + } + + /* Setup the API Message */ + ApiMessage.h.u1.Length = sizeof(DBGKM_MSG) << 16 | + (8 + sizeof(DBGKM_LOAD_DLL)); + ApiMessage.h.u2.ZeroInit = LPC_DEBUG_EVENT; + ApiMessage.ApiNumber = DbgKmLoadDllApi; + + /* Send the message */ + DbgkpSendApiMessage(&ApiMessage, TRUE); + + /* Close the handle */ + ObCloseHandle(LoadDll->FileHandle, KernelMode); +} + +VOID +NTAPI +DbgkUnMapViewOfSection(IN PVOID BaseAddress) +{ + DBGKM_MSG ApiMessage; + PDBGKM_UNLOAD_DLL UnloadDll = &ApiMessage.UnloadDll; + PEPROCESS Process = PsGetCurrentProcess(); + PETHREAD Thread = PsGetCurrentThread(); + PAGED_CODE(); + + /* Check if this thread is hidden, doesn't have a debug port, or died */ + if ((Thread->HideFromDebugger) || + !(Process->DebugPort) || + (Thread->DeadThread) || + (KeGetPreviousMode() == KernelMode)) + { + /* Don't notify the debugger */ + return; + } + + /* Set the DLL Base */ + UnloadDll->BaseAddress = BaseAddress; + + /* Setup the API Message */ + ApiMessage.h.u1.Length = sizeof(DBGKM_MSG) << 16 | + (8 + sizeof(DBGKM_UNLOAD_DLL)); + ApiMessage.h.u2.ZeroInit = LPC_DEBUG_EVENT; + ApiMessage.ApiNumber = DbgKmUnloadDllApi; + + /* Send the message */ + DbgkpSendApiMessage(&ApiMessage, TRUE); } /* EOF */ Modified: trunk/reactos/ntoskrnl/include/internal/dbgk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/dbgk.h (original) +++ trunk/reactos/ntoskrnl/include/internal/dbgk.h Mon Oct 23 00:56:24 2006 @@ -19,7 +19,7 @@ IN NTSTATUS ExitStatus ); -VOID +BOOLEAN NTAPI DbgkpSuspendProcess( VOID @@ -29,6 +29,13 @@ NTAPI DbgkpResumeProcess( VOID +); + +NTSTATUS +NTAPI +DbgkpSendApiMessage( + IN OUT PDBGKM_MSG ApiMsg, + IN ULONG Flags ); VOID Modified: trunk/reactos/ntoskrnl/include/internal/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/mm.h (original) +++ trunk/reactos/ntoskrnl/include/internal/mm.h Mon Oct 23 00:56:24 2006 @@ -1322,6 +1322,13 @@ OUT PUNICODE_STRING ModuleName ); +NTSTATUS +NTAPI +MmGetFileNameForSection( + IN PROS_SECTION_OBJECT Section, + OUT PUNICODE_STRING ModuleName +); + PVOID NTAPI MmAllocateSection( Modified: trunk/reactos/ntoskrnl/mm/section.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/mm/section.c (original) +++ trunk/reactos/ntoskrnl/mm/section.c Mon Oct 23 00:56:24 2006 @@ -108,6 +108,16 @@ NTSTATUS NTAPI +MmGetFileNameForSection(IN PROS_SECTION_OBJECT Section, + OUT PUNICODE_STRING ModuleName) +{ + /* FIXME: TODO. ObQueryNameString on the FileObject */ + RtlCreateUnicodeString(ModuleName, L"C:\\ReactOS\\system32\\ntdll.dll"); + return STATUS_SUCCESS; +} + +NTSTATUS +NTAPI MmGetFileNameForAddress(IN PVOID Address, OUT PUNICODE_STRING ModuleName) { @@ -118,10 +128,8 @@ * corresponds to the address. Then make sure it's a section * view type (MEMORY_AREA_SECTION_VIEW) and use the marea's * per-type union to get the .u.SectionView.Section pointer to - * the SECTION_OBJECT. Then we can use MmGetFileObjectForSection - * to get the FILE_OBJECT, from which we can then query the name - * to get the full filename (much like we do for creating the - * SeAuditName in EPROCESS. + * the SECTION_OBJECT. Then we can use MmGetFileNameForSection + * to get the full filename. */ RtlCreateUnicodeString(ModuleName, L"C:\\ReactOS\\system32\\ntdll.dll"); return STATUS_SUCCESS;
18 years, 2 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
36
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Results per page:
10
25
50
100
200