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
September 2014
----- 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
16 participants
413 discussions
Start a n
N
ew thread
[ekohl] 64160: [BOOTDATA] Set MaxSize and Retention for event logs.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Sep 15 12:25:45 2014 New Revision: 64160 URL:
http://svn.reactos.org/svn/reactos?rev=64160&view=rev
Log: [BOOTDATA] Set MaxSize and Retention for event logs. Modified: trunk/reactos/boot/bootdata/hivesys.inf Modified: trunk/reactos/boot/bootdata/hivesys.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys.inf?…
============================================================================== --- trunk/reactos/boot/bootdata/hivesys.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivesys.inf [iso-8859-1] Mon Sep 15 12:25:45 2014 @@ -1438,10 +1438,18 @@ HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application",,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application","File",0x00020000,"%SystemRoot%\system32\config\AppEvent.Evt" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application","MaxSize",0x00010003,524288 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Application","Retention",0x00010003,604800 + HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security",,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security","File",0x00020000,"%SystemRoot%\system32\config\SecEvent.Evt" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security","MaxSize",0x00010003,524288 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\Security","Retention",0x00010003,604800 + HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System",,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System","File",0x00020000,"%SystemRoot%\system32\config\SysEvent.Evt" +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System","MaxSize",0x00010003,524288 +HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System","Retention",0x00010003,604800 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System\EventLog","EventMessageFile",0x00020000,"%SystemRoot%\system32\netevent.dll" HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System\EventLog","TypesSupported",0x00010001,0x00000007 HKLM,"SYSTEM\CurrentControlSet\Services\EventLog\System\Service Control Manager","EventMessageFile",0x00020000,"%SystemRoot%\system32\netevent.dll"
10 years, 3 months
1
0
0
0
[ekohl] 64159: [EVENTLOG] - Read MaxSize and Retention from the Registry when a new log file is created. - Use ntdll file functions instead of their kernel32 counterparts.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Sep 15 12:16:46 2014 New Revision: 64159 URL:
http://svn.reactos.org/svn/reactos?rev=64159&view=rev
Log: [EVENTLOG] - Read MaxSize and Retention from the Registry when a new log file is created. - Use ntdll file functions instead of their kernel32 counterparts. Modified: trunk/reactos/base/services/eventlog/eventlog.c trunk/reactos/base/services/eventlog/eventlog.h trunk/reactos/base/services/eventlog/file.c trunk/reactos/base/services/eventlog/rpc.c Modified: trunk/reactos/base/services/eventlog/eventlog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/eve…
============================================================================== --- trunk/reactos/base/services/eventlog/eventlog.c [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/eventlog.c [iso-8859-1] Mon Sep 15 12:16:46 2014 @@ -106,7 +106,7 @@ UpdateServiceStatus(SERVICE_STOPPED); return ERROR_SUCCESS; - default : + default: DPRINT1(" Control %lu received\n", dwControl); return ERROR_CALL_NOT_IMPLEMENTED; } @@ -275,6 +275,7 @@ LONG Result; PLOGFILE pLogf = NULL; UNICODE_STRING FileName; + ULONG ulMaxSize, ulRetention; NTSTATUS Status; DPRINT("LoadLogFile: %S\n", LogName); @@ -333,7 +334,27 @@ DPRINT("%S -> %S\n", Buf, Expanded); - Status = LogfCreate(&pLogf, LogName, &FileName, TRUE, FALSE); + ValueLen = sizeof(ULONG); + Result = RegQueryValueEx(hKey, + L"MaxSize", + NULL, + &Type, + (LPBYTE)&ulMaxSize, + &ValueLen); + if (Result != ERROR_SUCCESS) + ulMaxSize = 512 * 1024; /* 512 kBytes */ + + ValueLen = sizeof(ULONG); + Result = RegQueryValueEx(hKey, + L"Retention", + NULL, + &Type, + (LPBYTE)&ulRetention, + &ValueLen); + if (Result != ERROR_SUCCESS) + ulRetention = 0; + + Status = LogfCreate(&pLogf, LogName, &FileName, ulMaxSize, ulRetention, TRUE, FALSE); if (!NT_SUCCESS(Status)) { DPRINT1("Failed to create %S! (Status %08lx)\n", Expanded, Status); Modified: trunk/reactos/base/services/eventlog/eventlog.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/eve…
============================================================================== --- trunk/reactos/base/services/eventlog/eventlog.h [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/eventlog.h [iso-8859-1] Mon Sep 15 12:16:46 2014 @@ -156,6 +156,8 @@ LogfCreate(PLOGFILE *Logfile, WCHAR * LogName, PUNICODE_STRING FileName, + ULONG ulMaxSize, + ULONG ulRetention, BOOL Permanent, BOOL Backup); Modified: trunk/reactos/base/services/eventlog/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/fil…
============================================================================== --- trunk/reactos/base/services/eventlog/file.c [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/file.c [iso-8859-1] Mon Sep 15 12:16:46 2014 @@ -24,62 +24,78 @@ /* FUNCTIONS ****************************************************************/ static NTSTATUS -LogfInitializeNew(PLOGFILE LogFile) -{ - DWORD dwWritten; +LogfInitializeNew(PLOGFILE LogFile, + ULONG ulMaxSize, + ULONG ulRetention) +{ + IO_STATUS_BLOCK IoStatusBlock; EVENTLOGEOF EofRec; + NTSTATUS Status; ZeroMemory(&LogFile->Header, sizeof(EVENTLOGHEADER)); SetFilePointer(LogFile->hFile, 0, NULL, FILE_BEGIN); SetEndOfFile(LogFile->hFile); LogFile->Header.HeaderSize = sizeof(EVENTLOGHEADER); - LogFile->Header.EndHeaderSize = sizeof(EVENTLOGHEADER); + LogFile->Header.Signature = LOGFILE_SIGNATURE; + LogFile->Header.MajorVersion = MAJORVER; + LogFile->Header.MinorVersion = MINORVER; LogFile->Header.StartOffset = sizeof(EVENTLOGHEADER); LogFile->Header.EndOffset = sizeof(EVENTLOGHEADER); - LogFile->Header.MajorVersion = MAJORVER; - LogFile->Header.MinorVersion = MINORVER; LogFile->Header.CurrentRecordNumber = 1; LogFile->Header.OldestRecordNumber = 1; - /* FIXME: Read MaxSize from registry for this LogFile. - But for now limit EventLog size to just under 5K. */ - LogFile->Header.MaxSize = 5000; - LogFile->Header.Signature = LOGFILE_SIGNATURE; - if (!WriteFile(LogFile->hFile, - &LogFile->Header, - sizeof(EVENTLOGHEADER), - &dwWritten, - NULL)) - { - DPRINT1("WriteFile failed:%d!\n", GetLastError()); - return STATUS_UNSUCCESSFUL; - } - + LogFile->Header.MaxSize = ulMaxSize; + LogFile->Header.Flags = 0; + LogFile->Header.Retention = ulRetention; + LogFile->Header.EndHeaderSize = sizeof(EVENTLOGHEADER); + + Status = NtWriteFile(LogFile->hFile, + NULL, + NULL, + NULL, + &IoStatusBlock, + &LogFile->Header, + sizeof(EVENTLOGHEADER), + NULL, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtWriteFile failed (Status 0x%08lx)\n", Status); + return Status; + } + + EofRec.RecordSizeBeginning = sizeof(EVENTLOGEOF); EofRec.Ones = 0x11111111; EofRec.Twos = 0x22222222; EofRec.Threes = 0x33333333; EofRec.Fours = 0x44444444; - EofRec.RecordSizeBeginning = sizeof(EVENTLOGEOF); - EofRec.RecordSizeEnd = sizeof(EVENTLOGEOF); + EofRec.BeginRecord = LogFile->Header.StartOffset; + EofRec.EndRecord = LogFile->Header.EndOffset; EofRec.CurrentRecordNumber = LogFile->Header.CurrentRecordNumber; EofRec.OldestRecordNumber = LogFile->Header.OldestRecordNumber; - EofRec.BeginRecord = LogFile->Header.StartOffset; - EofRec.EndRecord = LogFile->Header.EndOffset; - - if (!WriteFile(LogFile->hFile, - &EofRec, - sizeof(EVENTLOGEOF), - &dwWritten, - NULL)) - { - DPRINT1("WriteFile failed:%d!\n", GetLastError()); - return STATUS_UNSUCCESSFUL; - } - - if (!FlushFileBuffers(LogFile->hFile)) - { - DPRINT1("FlushFileBuffers failed:%d!\n", GetLastError()); - return STATUS_UNSUCCESSFUL; + EofRec.RecordSizeEnd = sizeof(EVENTLOGEOF); + + Status = NtWriteFile(LogFile->hFile, + NULL, + NULL, + NULL, + &IoStatusBlock, + &EofRec, + sizeof(EVENTLOGEOF), + NULL, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtWriteFile failed (Status 0x%08lx)\n", Status); + return Status; + } + + Status = NtFlushBuffersFile(LogFile->hFile, + &IoStatusBlock); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtFlushBuffersFile failed (Status 0x%08lx)\n", Status); + return Status; } return STATUS_SUCCESS; @@ -87,7 +103,8 @@ static NTSTATUS -LogfInitializeExisting(PLOGFILE LogFile, BOOL Backup) +LogfInitializeExisting(PLOGFILE LogFile, + BOOL Backup) { DWORD dwRead; DWORD dwRecordsNumber = 0; @@ -265,10 +282,6 @@ if (LogFile->Header.CurrentRecordNumber == 0) LogFile->Header.CurrentRecordNumber = 1; - /* FIXME: Read MaxSize from registry for this LogFile. - But for now limit EventLog size to just under 5K. */ - LogFile->Header.MaxSize = 5000; - if (!Backup) { if (SetFilePointer(LogFile->hFile, 0, NULL, FILE_BEGIN) == @@ -301,8 +314,10 @@ NTSTATUS LogfCreate(PLOGFILE *LogFile, - WCHAR * LogName, + WCHAR *LogName, PUNICODE_STRING FileName, + ULONG ulMaxSize, + ULONG ulRetention, BOOL Permanent, BOOL Backup) { @@ -355,7 +370,7 @@ goto fail; } - if(LogName) + if (LogName) StringCchCopy(pLogFile->LogName,lstrlenW(LogName) + 1, LogName); pLogFile->FileName = @@ -387,7 +402,7 @@ pLogFile->Permanent = Permanent; if (bCreateNew) - Status = LogfInitializeNew(pLogFile); + Status = LogfInitializeNew(pLogFile, ulMaxSize, ulRetention); else Status = LogfInitializeExisting(pLogFile, Backup); @@ -1117,7 +1132,9 @@ } } - Status = LogfInitializeNew(LogFile); + Status = LogfInitializeNew(LogFile, + LogFile->Header.MaxSize, + LogFile->Header.Retention); if (!NT_SUCCESS(Status)) { DPRINT1("LogfInitializeNew failed (Status: 0x%08lx)\n", Status); @@ -1145,7 +1162,7 @@ DWORD dwOffset, dwRead, dwRecSize; - DPRINT("LogfBackupFile(%p, %wZ)\n", LogFile, BackupFileName); + DPRINT1("LogfBackupFile(%p, %wZ)\n", LogFile, BackupFileName); /* Lock the log file shared */ RtlAcquireResourceShared(&LogFile->Lock, TRUE); @@ -1182,7 +1199,7 @@ Header.EndOffset = sizeof(EVENTLOGHEADER); Header.CurrentRecordNumber = 1; Header.OldestRecordNumber = 1; - Header.MaxSize = 0; + Header.MaxSize = LogFile->Header.MaxSize; Header.Flags = ELF_LOGFILE_HEADER_DIRTY; Header.Retention = LogFile->Header.Retention; Header.EndHeaderSize = sizeof(EVENTLOGHEADER); Modified: trunk/reactos/base/services/eventlog/rpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/rpc…
============================================================================== --- trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] (original) +++ trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] Mon Sep 15 12:16:46 2014 @@ -162,6 +162,8 @@ Status = LogfCreate(&lpLogHandle->LogFile, NULL, FileName, + 0, + 0, FALSE, TRUE); if (!NT_SUCCESS(Status))
10 years, 3 months
1
0
0
0
[tfaber] 64158: [HAL] - Don't use svn:eol-style = native for PCI ids but then have the code expect CRLF. Should fix all devices being "Unknown device" on Unix builds.
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Sep 15 10:58:53 2014 New Revision: 64158 URL:
http://svn.reactos.org/svn/reactos?rev=64158&view=rev
Log: [HAL] - Don't use svn:eol-style = native for PCI ids but then have the code expect CRLF. Should fix all devices being "Unknown device" on Unix builds. Modified: trunk/reactos/hal/halx86/legacy/bus/pci_classes.ids (contents, props changed) trunk/reactos/hal/halx86/legacy/bus/pci_vendors.ids (contents, props changed) [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/hal/halx86/legacy/bus/pci_classes.ids URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/legacy/bus/pci_…
Modified: trunk/reactos/hal/halx86/legacy/bus/pci_vendors.ids URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/legacy/bus/pci_…
10 years, 3 months
1
0
0
0
[hbelusca] 64157: [PSDK]: Fix some structure definitions.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Mon Sep 15 00:07:46 2014 New Revision: 64157 URL:
http://svn.reactos.org/svn/reactos?rev=64157&view=rev
Log: [PSDK]: Fix some structure definitions. Modified: trunk/reactos/include/psdk/wincon.h Modified: trunk/reactos/include/psdk/wincon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wincon.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/wincon.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/wincon.h [iso-8859-1] Mon Sep 15 00:07:46 2014 @@ -228,7 +228,7 @@ WORD wVirtualScanCode; union { WCHAR UnicodeChar; - CHAR AsciiChar; + CHAR AsciiChar; } uChar; DWORD dwControlKeyState; } @@ -236,18 +236,26 @@ /* gcc's alignment is not what win32 expects */ PACKED #endif -KEY_EVENT_RECORD; +KEY_EVENT_RECORD, *PKEY_EVENT_RECORD; typedef struct _MOUSE_EVENT_RECORD { COORD dwMousePosition; DWORD dwButtonState; DWORD dwControlKeyState; DWORD dwEventFlags; -} MOUSE_EVENT_RECORD; - -typedef struct _WINDOW_BUFFER_SIZE_RECORD { COORD dwSize; } WINDOW_BUFFER_SIZE_RECORD; -typedef struct _MENU_EVENT_RECORD { UINT dwCommandId; } MENU_EVENT_RECORD,*PMENU_EVENT_RECORD; -typedef struct _FOCUS_EVENT_RECORD { BOOL bSetFocus; } FOCUS_EVENT_RECORD; +} MOUSE_EVENT_RECORD, *PMOUSE_EVENT_RECORD; + +typedef struct _WINDOW_BUFFER_SIZE_RECORD { + COORD dwSize; +} WINDOW_BUFFER_SIZE_RECORD, *PWINDOW_BUFFER_SIZE_RECORD; + +typedef struct _MENU_EVENT_RECORD { + UINT dwCommandId; +} MENU_EVENT_RECORD, *PMENU_EVENT_RECORD; + +typedef struct _FOCUS_EVENT_RECORD { + BOOL bSetFocus; +} FOCUS_EVENT_RECORD, *PFOCUS_EVENT_RECORD; typedef struct _INPUT_RECORD { WORD EventType; @@ -258,7 +266,7 @@ MENU_EVENT_RECORD MenuEvent; FOCUS_EVENT_RECORD FocusEvent; } Event; -} INPUT_RECORD,*PINPUT_RECORD; +} INPUT_RECORD, *PINPUT_RECORD; #if (_WIN32_WINNT >= 0x0600) typedef struct _CONSOLE_HISTORY_INFO {
10 years, 3 months
1
0
0
0
[jgardou] 64156: [KDGDB] - Fix an embarassing works-for-me but uncommited cast. - Add support for reading registers and memory from foreign threads. Highly experimental and nearly untested, use at ...
by jgardou@svn.reactos.org
Author: jgardou Date: Sun Sep 14 22:50:10 2014 New Revision: 64156 URL:
http://svn.reactos.org/svn/reactos?rev=64156&view=rev
Log: [KDGDB] - Fix an embarassing works-for-me but uncommited cast. - Add support for reading registers and memory from foreign threads. Highly experimental and nearly untested, use at your own risk. Modified: trunk/reactos/drivers/base/kdgdb/gdb_input.c trunk/reactos/drivers/base/kdgdb/i386_sup.c trunk/reactos/drivers/base/kdgdb/kdgdb.h trunk/reactos/drivers/base/kdgdb/kdpacket.c Modified: trunk/reactos/drivers/base/kdgdb/gdb_input.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdgdb/gdb_inp…
============================================================================== --- trunk/reactos/drivers/base/kdgdb/gdb_input.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdgdb/gdb_input.c [iso-8859-1] Sun Sep 14 22:50:10 2014 @@ -11,6 +11,8 @@ /* LOCALS *********************************************************************/ static HANDLE gdb_run_thread; +/* We might have to attach to a process to read its memory */ +static PEPROCESS AttachedProcess = NULL; /* Keep track of where we are for qfThreadInfo/qsThreadInfo */ static LIST_ENTRY* CurrentProcessEntry; static LIST_ENTRY* CurrentThreadEntry; @@ -316,6 +318,13 @@ send_gdb_memory(MessageData->Buffer, MessageData->Length); KdpSendPacketHandler = NULL; KdpManipulateStateHandler = NULL; + + /* Detach if we have to */ + if (AttachedProcess != NULL) + { + KeDetachProcess(); + AttachedProcess = NULL; + } } static @@ -323,7 +332,8 @@ handle_gdb_read_mem( _Out_ DBGKD_MANIPULATE_STATE64* State, _Out_ PSTRING MessageData, - _Out_ PULONG MessageLength) + _Out_ PULONG MessageLength, + _Inout_ PKD_CONTEXT KdContext) { State->ApiNumber = DbgKdReadVirtualMemoryApi; State->ReturnStatus = STATUS_SUCCESS; /* ? */ @@ -332,6 +342,19 @@ if (MessageData) MessageData->Length = 0; *MessageLength = 0; + + /* Attach to the debug process to read its memory */ + if (gdb_dbg_process != PsGetCurrentProcessId()) + { + NTSTATUS Status = PsLookupProcessByProcessId(gdb_dbg_process, &AttachedProcess); + if (!NT_SUCCESS(Status)) + { + KDDBGPRINT("The current GDB debug thread is invalid!"); + send_gdb_packet("E03"); + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); + } + KeAttachProcess(&AttachedProcess->Pcb); + } State->u.ReadMemory.TargetBaseAddress = hex_to_address(&gdb_input[1]); State->u.ReadMemory.TransferCount = hex_to_address(strstr(&gdb_input[1], ",") + 1); @@ -416,7 +439,7 @@ handle_gdb_set_thread(); break; case 'm': - return handle_gdb_read_mem(State, MessageData, MessageLength); + return handle_gdb_read_mem(State, MessageData, MessageLength, KdContext); case 'p': return gdb_send_register(State, MessageData, MessageLength, KdContext); case 'q': Modified: trunk/reactos/drivers/base/kdgdb/i386_sup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdgdb/i386_su…
============================================================================== --- trunk/reactos/drivers/base/kdgdb/i386_sup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdgdb/i386_sup.c [iso-8859-1] Sun Sep 14 22:50:10 2014 @@ -6,6 +6,8 @@ */ #include "kdgdb.h" + +#include <pstypes.h> enum reg_name { @@ -79,6 +81,44 @@ return 0; } +static +void* +thread_to_reg(PETHREAD Thread, enum reg_name reg_name, unsigned short* size) +{ + PKTRAP_FRAME TrapFrame = Thread->Tcb.TrapFrame; + + /* See if the thread was actually scheduled */ + if (TrapFrame == NULL) + { + return NULL; + } + + *size = 4; + switch (reg_name) + { + case EAX: return &TrapFrame->Eax; + case ECX: return &TrapFrame->Ecx; + case EDX: return &TrapFrame->Edx; + case EBX: return &TrapFrame->Ebx; + case ESP: return (TrapFrame->PreviousPreviousMode == KernelMode) ? + &TrapFrame->TempEsp : &TrapFrame->HardwareEsp; + case EBP: return &TrapFrame->Ebp; + case ESI: return &TrapFrame->Esi; + case EDI: return &TrapFrame->Edi; + case EIP: return &TrapFrame->Eip; + case EFLAGS: return &TrapFrame->EFlags; + case CS: return &TrapFrame->SegCs; + case SS: return &TrapFrame->HardwareSegSs; + case DS: return &TrapFrame->SegDs; + case ES: return &TrapFrame->SegEs; + case FS: return &TrapFrame->SegFs; + case GS: return &TrapFrame->SegGs; + default: + KDDBGPRINT("Unhandled regname: %d.\n", reg_name); + } + return NULL; +} + KDSTATUS gdb_send_registers( _Out_ DBGKD_MANIPULATE_STATE64* State, @@ -86,15 +126,62 @@ _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext) { - ULONG32 Registers[16]; + CHAR Registers[16*8 + 1]; + UCHAR* RegisterPtr; unsigned i; unsigned short size; - - for(i=0; i < 16; i++) - { - Registers[i] = *(ULONG32*)ctx_to_reg(&CurrentContext, i, &size); - } - send_gdb_memory(Registers, sizeof(Registers)); + CHAR* ptr = Registers; + + if (gdb_dbg_thread == PsGetThreadId((PETHREAD)(ULONG_PTR)CurrentStateChange.Thread)) + { + for(i=0; i < 16; i++) + { + RegisterPtr = ctx_to_reg(&CurrentContext, i, &size); + *ptr++ = hex_chars[RegisterPtr[0] >> 4]; + *ptr++ = hex_chars[RegisterPtr[0] & 0xF]; + *ptr++ = hex_chars[RegisterPtr[1] >> 4]; + *ptr++ = hex_chars[RegisterPtr[1] & 0xF]; + *ptr++ = hex_chars[RegisterPtr[2] >> 4]; + *ptr++ = hex_chars[RegisterPtr[2] & 0xF]; + *ptr++ = hex_chars[RegisterPtr[3] >> 4]; + *ptr++ = hex_chars[RegisterPtr[3] & 0xF]; + } + } + else + { + PETHREAD DbgThread; + NTSTATUS Status; + + Status = PsLookupThreadByThreadId(gdb_dbg_thread, &DbgThread); + if (!NT_SUCCESS(Status)) + { + /* Thread is dead */ + send_gdb_packet("E03"); + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); + } + + for(i=0; i < 16; i++) + { + RegisterPtr = thread_to_reg(DbgThread, i, &size); + if (RegisterPtr) + { + *ptr++ = hex_chars[RegisterPtr[0] >> 4]; + *ptr++ = hex_chars[RegisterPtr[0] & 0xF]; + *ptr++ = hex_chars[RegisterPtr[1] >> 4]; + *ptr++ = hex_chars[RegisterPtr[1] & 0xF]; + *ptr++ = hex_chars[RegisterPtr[2] >> 4]; + *ptr++ = hex_chars[RegisterPtr[2] & 0xF]; + *ptr++ = hex_chars[RegisterPtr[3] >> 4]; + *ptr++ = hex_chars[RegisterPtr[3] & 0xF]; + } + else + { + ptr += sprintf(ptr, "xxxxxxxx"); + } + } + } + *ptr = '\0'; + send_gdb_packet(Registers); return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } @@ -112,7 +199,27 @@ /* Get the GDB register name (gdb_input = "pXX") */ reg_name = (hex_value(gdb_input[1]) << 4) | hex_value(gdb_input[2]); - ptr = ctx_to_reg(&CurrentContext, reg_name, &size); + if (gdb_dbg_thread == PsGetThreadId((PETHREAD)(ULONG_PTR)CurrentStateChange.Thread)) + { + /* We can get it from the context of the current exception */ + ptr = ctx_to_reg(&CurrentContext, reg_name, &size); + } + else + { + PETHREAD DbgThread; + NTSTATUS Status; + + Status = PsLookupThreadByThreadId(gdb_dbg_thread, &DbgThread); + if (!NT_SUCCESS(Status)) + { + /* Thread is dead */ + send_gdb_packet("E03"); + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); + } + + ptr = thread_to_reg(DbgThread, reg_name, &size); + } + if (!ptr) { /* Undefined. Let's assume 32 bit register */ @@ -122,5 +229,6 @@ { send_gdb_memory(ptr, size); } + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } Modified: trunk/reactos/drivers/base/kdgdb/kdgdb.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdgdb/kdgdb.h…
============================================================================== --- trunk/reactos/drivers/base/kdgdb/kdgdb.h [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdgdb/kdgdb.h [iso-8859-1] Sun Sep 14 22:50:10 2014 @@ -67,6 +67,7 @@ void gdb_send_debug_io(_In_ PSTRING String); void gdb_send_exception(void); void send_gdb_ntstatus(_In_ NTSTATUS Status); +extern const char hex_chars[]; /* kdcom.c */ KDSTATUS NTAPI KdpPollBreakIn(VOID); Modified: trunk/reactos/drivers/base/kdgdb/kdpacket.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdgdb/kdpacke…
============================================================================== --- trunk/reactos/drivers/base/kdgdb/kdpacket.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdgdb/kdpacket.c [iso-8859-1] Sun Sep 14 22:50:10 2014 @@ -14,6 +14,7 @@ _In_ ULONG PacketType, _In_ PSTRING MessageHeader, _In_ PSTRING MessageData); +static BOOLEAN CanSendData = FALSE; /* GLOBALS ********************************************************************/ DBGKD_GET_VERSION64 KdVersion; @@ -141,11 +142,13 @@ /* Save current state for later GDB queries */ CurrentStateChange = *StateChange; /* Unless GDB tells us otherwise, those are what we should have */ - gdb_dbg_thread = PsGetThreadId((PETHREAD)StateChange->Thread); - gdb_dbg_process = PsGetThreadProcessId((PETHREAD)StateChange->Thread); + gdb_dbg_thread = PsGetThreadId((PETHREAD)(ULONG_PTR)StateChange->Thread); + gdb_dbg_process = PsGetThreadProcessId((PETHREAD)(ULONG_PTR)StateChange->Thread); gdb_send_exception(); /* Next receive call will ask for the context */ KdpManipulateStateHandler = GetContextManipulateHandler; + /* We can now send data, since after this we will be connected to GDB */ + CanSendData = TRUE; break; default: /* FIXME */ @@ -159,6 +162,9 @@ _In_ DBGKD_DEBUG_IO* DebugIO, _In_ PSTRING String) { + if (!CanSendData) + return; + switch (DebugIO->ApiNumber) { case DbgKdPrintStringApi:
10 years, 3 months
1
0
0
0
[jgardou] 64155: [DDK] - Addendum to r64151 Complain on IRC, then complain on ros-dev, then steal fixes from your peers, then do as if nothing happened.
by jgardou@svn.reactos.org
Author: jgardou Date: Sun Sep 14 22:41:27 2014 New Revision: 64155 URL:
http://svn.reactos.org/svn/reactos?rev=64155&view=rev
Log: [DDK] - Addendum to r64151 Complain on IRC, then complain on ros-dev, then steal fixes from your peers, then do as if nothing happened. Modified: trunk/reactos/include/ddk/wdm.h Modified: trunk/reactos/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=6415…
============================================================================== --- trunk/reactos/include/ddk/wdm.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/wdm.h [iso-8859-1] Sun Sep 14 22:41:27 2014 @@ -15794,11 +15794,11 @@ extern BOOLEAN KdDebuggerNotPresent; #define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent #else +__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerEnabled) extern BOOLEAN *KdDebuggerEnabled; -__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerEnabled) #define KD_DEBUGGER_ENABLED (*KdDebuggerEnabled) +__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerNotPresent) extern BOOLEAN *KdDebuggerNotPresent; -__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerNotPresent) #define KD_DEBUGGER_NOT_PRESENT (*KdDebuggerNotPresent) #endif
10 years, 3 months
1
0
0
0
[jgardou] 64154: [KDGDB] - Always pass down the result of gdb_receive_packet up to KD, so that it knows when a breakin packet was received. (CTRL-C) now works! - Generalize the use of the Send <-> ...
by jgardou@svn.reactos.org
Author: jgardou Date: Sun Sep 14 20:45:30 2014 New Revision: 64154 URL:
http://svn.reactos.org/svn/reactos?rev=64154&view=rev
Log: [KDGDB] - Always pass down the result of gdb_receive_packet up to KD, so that it knows when a breakin packet was received. (CTRL-C) now works! - Generalize the use of the Send <-> ManipulateState callbacks for a better code reading. - Get the exception context as soon as it is thrown (instead of playing with the PRCB) - Improve the way we attach to GDB: on the first KD call, we set KdContext->ControlCPending so that KD throws an exception. That way we can first initialize our KD stuff, and then quietly attach to GDB - Implement the 'p' (get one register) GDB request. GDB is now much more reliable. Modified: trunk/reactos/drivers/base/kdgdb/gdb_input.c trunk/reactos/drivers/base/kdgdb/gdb_send.c trunk/reactos/drivers/base/kdgdb/i386_sup.c trunk/reactos/drivers/base/kdgdb/kdgdb.h trunk/reactos/drivers/base/kdgdb/kdpacket.c Modified: trunk/reactos/drivers/base/kdgdb/gdb_input.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdgdb/gdb_inp…
============================================================================== --- trunk/reactos/drivers/base/kdgdb/gdb_input.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdgdb/gdb_input.c [iso-8859-1] Sun Sep 14 20:45:30 2014 @@ -11,12 +11,13 @@ /* LOCALS *********************************************************************/ static HANDLE gdb_run_thread; -static HANDLE gdb_dbg_process; -HANDLE gdb_dbg_thread; -CONTEXT CurrentContext; /* Keep track of where we are for qfThreadInfo/qsThreadInfo */ static LIST_ENTRY* CurrentProcessEntry; static LIST_ENTRY* CurrentThreadEntry; + +/* GLOBALS ********************************************************************/ +HANDLE gdb_dbg_process; +HANDLE gdb_dbg_thread; /* PRIVATE FUNCTIONS **********************************************************/ static @@ -68,6 +69,7 @@ send_gdb_packet("OK"); break; case 'g': + KDDBGPRINT("Setting debug thread: %s.\n", gdb_input); if (strncmp(&gdb_input[2], "p-1", 3) == 0) { gdb_dbg_process = (HANDLE)-1; @@ -90,6 +92,20 @@ } } +KDSTATUS +gdb_receive_and_interpret_packet( + _Out_ DBGKD_MANIPULATE_STATE64* State, + _Out_ PSTRING MessageData, + _Out_ PULONG MessageLength, + _Inout_ PKD_CONTEXT KdContext) +{ + KDSTATUS Status = gdb_receive_packet(KdContext); + + if (Status != KdPacketReceived) + return Status; + return gdb_interpret_input(State, MessageData, MessageLength, KdContext); +} + static void handle_gdb_thread_alive(void) @@ -118,7 +134,7 @@ /* q* packets */ static -void +KDSTATUS handle_gdb_query( _Out_ DBGKD_MANIPULATE_STATE64* State, _Out_ PSTRING MessageData, @@ -128,20 +144,20 @@ if (strncmp(gdb_input, "qSupported:", 11) == 0) { send_gdb_packet("PacketSize=4096;multiprocess+;"); - return; + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } if (strncmp(gdb_input, "qAttached", 9) == 0) { - /* Say yes: the remote server didn't create the process, ReactOS did! */ + /* Say no: We didn't attach, we create the process! */ send_gdb_packet("0"); - return; + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } if (strncmp(gdb_input, "qRcmd,", 6) == 0) { send_gdb_packet("OK"); - return; + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } if (strcmp(gdb_input, "qC") == 0) @@ -151,7 +167,7 @@ PsGetThreadProcessId((PETHREAD)(ULONG_PTR)CurrentStateChange.Thread), PsGetThreadId((PETHREAD)(ULONG_PTR)CurrentStateChange.Thread)); send_gdb_packet(gdb_out); - return; + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } if ((strncmp(gdb_input, "qfThreadInfo", 12) == 0) @@ -174,15 +190,13 @@ { /* there is only one thread to tell about */ send_gdb_packet("l"); - return; + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } /* Just tell GDB about the current thread */ sprintf(gdb_out, "mp%p.%p", PsGetCurrentProcessId(), PsGetCurrentThreadId()); send_gdb_packet(gdb_out); /* GDB can ask anything at this point, it isn't necessarily a qsThreadInfo packet */ - gdb_receive_packet(KdContext); - gdb_interpret_input(State, MessageData, MessageLength, KdContext); - return; + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } if (Resuming) @@ -197,7 +211,7 @@ { /* We're done */ send_gdb_packet("l"); - return; + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } Process = CONTAINING_RECORD(CurrentProcessEntry, EPROCESS, ActiveProcessLinks); @@ -234,9 +248,7 @@ /* send what we got */ send_gdb_packet(gdb_out); /* GDB can ask anything at this point, it isn't necessarily a qsThreadInfo packet */ - gdb_receive_packet(KdContext); - gdb_interpret_input(State, MessageData, MessageLength, KdContext); - return; + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } } @@ -244,13 +256,12 @@ send_gdb_packet(gdb_out); CurrentThreadEntry = NULL; /* GDB can ask anything at this point, it isn't necessarily a qsThreadInfo packet */ - gdb_receive_packet(KdContext); - gdb_interpret_input(State, MessageData, MessageLength, KdContext); - return; + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } KDDBGPRINT("KDGDB: Unknown query: %s\n", gdb_input); send_gdb_packet(""); + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } #if 0 @@ -304,6 +315,7 @@ else send_gdb_memory(MessageData->Buffer, MessageData->Length); KdpSendPacketHandler = NULL; + KdpManipulateStateHandler = NULL; } static @@ -331,150 +343,6 @@ } static -VOID -GetCurrentContextSendHandler( - _In_ ULONG PacketType, - _In_ PSTRING MessageHeader, - _In_ PSTRING MessageData -) -{ - DBGKD_MANIPULATE_STATE64* State = (DBGKD_MANIPULATE_STATE64*)MessageHeader->Buffer; - const CONTEXT* Context = (const CONTEXT*)MessageData->Buffer; - - if ((PacketType != PACKET_TYPE_KD_STATE_MANIPULATE) - || (State->ApiNumber != DbgKdGetContextApi) - || (MessageData->Length < sizeof(*Context))) - { - /* Should we bugcheck ? */ - while (1); - } - - /* Just copy it */ - RtlCopyMemory(&CurrentContext, Context, sizeof(*Context)); - KdpSendPacketHandler = NULL; -} - -static -VOID -GetCurrentContext( - _Out_ DBGKD_MANIPULATE_STATE64* State, - _Out_ PSTRING MessageData, - _Out_ PULONG MessageLength, - _Inout_ PKD_CONTEXT KdContext, - _In_opt_ KDP_MANIPULATESTATE_HANDLER ManipulateStateHandler -) -{ - State->ApiNumber = DbgKdGetContextApi; - State->Processor = CurrentStateChange.Processor; - State->ReturnStatus = STATUS_SUCCESS; - State->ProcessorLevel = CurrentStateChange.ProcessorLevel; - MessageData->Length = 0; - - /* Update the send <-> receive loop handler */ - KdpSendPacketHandler = GetCurrentContextSendHandler; - KdpManipulateStateHandler = ManipulateStateHandler; -} - -static -VOID -SetContextSendHandler( - _In_ ULONG PacketType, - _In_ PSTRING MessageHeader, - _In_ PSTRING MessageData -) -{ - DBGKD_MANIPULATE_STATE64* State = (DBGKD_MANIPULATE_STATE64*)MessageHeader->Buffer; - - /* We just confirm that all went well */ - if ((PacketType != PACKET_TYPE_KD_STATE_MANIPULATE) - || (State->ApiNumber != DbgKdSetContextApi) - || (State->ReturnStatus != STATUS_SUCCESS)) - { - /* Should we bugcheck ? */ - while (1); - } - - KdpSendPacketHandler = NULL; -} - -static -KDSTATUS -SetContext( - _Out_ DBGKD_MANIPULATE_STATE64* State, - _Out_ PSTRING MessageData, - _Out_ PULONG MessageLength, - _Inout_ PKD_CONTEXT KdContext, - _In_opt_ KDP_MANIPULATESTATE_HANDLER ManipulateStateHandler -) -{ - State->ApiNumber = DbgKdSetContextApi; - State->Processor = CurrentStateChange.Processor; - State->ReturnStatus = STATUS_SUCCESS; - State->ProcessorLevel = CurrentStateChange.ProcessorLevel; - MessageData->Length = sizeof(CurrentContext); - - if (MessageData->MaximumLength < sizeof(CurrentContext)) - { - while (1); - } - - RtlCopyMemory(MessageData->Buffer, &CurrentContext, sizeof(CurrentContext)); - - /* Update the send <-> receive loop handlers */ - KdpSendPacketHandler = SetContextSendHandler; - KdpManipulateStateHandler = ManipulateStateHandler; - - return KdPacketReceived; -} - -static -KDSTATUS -SendContinue( - _Out_ DBGKD_MANIPULATE_STATE64* State, - _Out_ PSTRING MessageData, - _Out_ PULONG MessageLength, - _Inout_ PKD_CONTEXT KdContext -) -{ - /* Let's go on */ - State->ApiNumber = DbgKdContinueApi; - State->ReturnStatus = STATUS_SUCCESS; /* ? */ - State->Processor = CurrentStateChange.Processor; - State->ProcessorLevel = CurrentStateChange.ProcessorLevel; - if (MessageData) - MessageData->Length = 0; - *MessageLength = 0; - State->u.Continue.ContinueStatus = STATUS_SUCCESS; - - /* We definitely are at the end of the send <-> receive loop, if any */ - KdpSendPacketHandler = NULL; - KdpManipulateStateHandler = NULL; - - /* Tell GDB we are fine */ - send_gdb_packet("OK"); - return KdPacketReceived; -} - -static -KDSTATUS -UpdateProgramCounterSendContinue( - _Out_ DBGKD_MANIPULATE_STATE64* State, - _Out_ PSTRING MessageData, - _Out_ PULONG MessageLength, - _Inout_ PKD_CONTEXT KdContext) -{ - ULONG_PTR ProgramCounter; - - /* So we must get past the breakpoint instruction */ - ProgramCounter = KdpGetContextPc(&CurrentContext); - KdpSetContextPc(&CurrentContext, ProgramCounter + KD_BREAKPOINT_SIZE); - - /* Set the context and continue */ - SetContext(State, MessageData, MessageLength, KdContext, SendContinue); - return KdPacketReceived; -} - -static KDSTATUS handle_gdb_v( _Out_ DBGKD_MANIPULATE_STATE64* State, @@ -499,6 +367,9 @@ { DBGKM_EXCEPTION64* Exception = NULL; + /* Tell GDB everything is fine, we will handle it */ + send_gdb_packet("OK"); + if (CurrentStateChange.NewState == DbgKdExceptionStateChange) Exception = &CurrentStateChange.u.Exception; @@ -506,15 +377,22 @@ if (Exception && (Exception->ExceptionRecord.ExceptionCode == STATUS_BREAKPOINT) && (Exception->ExceptionRecord.ExceptionInformation[0] == 0)) { - /* So we get the context, update it and send it back */ - GetCurrentContext(State, MessageData, MessageLength, KdContext, UpdateProgramCounterSendContinue); + ULONG_PTR ProgramCounter; + + /* So we must get past the breakpoint instruction */ + ProgramCounter = KdpGetContextPc(&CurrentContext); + KdpSetContextPc(&CurrentContext, ProgramCounter + KD_BREAKPOINT_SIZE); + + SetContextManipulateHandler(State, MessageData, MessageLength, KdContext); + KdpManipulateStateHandler = ContinueManipulateStateHandler; return KdPacketReceived; } - return SendContinue(State, MessageData, MessageLength, KdContext); - } - } - + return ContinueManipulateStateHandler(State, MessageData, MessageLength, KdContext); + } + } + + KDDBGPRINT("Unhandled 'v' packet: %s\n", gdb_input); return KdPacketReceived; } @@ -526,7 +404,6 @@ _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext) { - KDSTATUS Status; switch (gdb_input[0]) { case '?': @@ -534,16 +411,16 @@ gdb_send_exception(); break; case 'g': - gdb_send_registers(); - break; + return gdb_send_registers(State, MessageData, MessageLength, KdContext); case 'H': handle_gdb_set_thread(); break; case 'm': return handle_gdb_read_mem(State, MessageData, MessageLength); + case 'p': + return gdb_send_register(State, MessageData, MessageLength, KdContext); case 'q': - handle_gdb_query(State, MessageData, MessageLength, KdContext); - break; + return handle_gdb_query(State, MessageData, MessageLength, KdContext); case 'T': handle_gdb_thread_alive(); break; @@ -552,12 +429,8 @@ default: /* We don't know how to handle this request. Maybe this is something for KD */ State->ReturnStatus = STATUS_NOT_SUPPORTED; + KDDBGPRINT("Unsupported GDB command: %s.\n", gdb_input); return KdPacketReceived; } - /* Get the answer from GDB */ - Status = gdb_receive_packet(KdContext); - if (Status != KdPacketReceived) - return Status; - /* Try interpreting this new packet */ - return gdb_interpret_input(State, MessageData, MessageLength, KdContext); -} + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); +} Modified: trunk/reactos/drivers/base/kdgdb/gdb_send.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdgdb/gdb_sen…
============================================================================== --- trunk/reactos/drivers/base/kdgdb/gdb_send.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdgdb/gdb_send.c [iso-8859-1] Sun Sep 14 20:45:30 2014 @@ -168,17 +168,12 @@ { char gdb_out[1024]; char* ptr = gdb_out; - DBGKM_EXCEPTION64* Exception = NULL; - - if (CurrentStateChange.NewState == DbgKdExceptionStateChange) - Exception = &CurrentStateChange.u.Exception; + DBGKM_EXCEPTION64* Exception = &CurrentStateChange.u.Exception; /* Report to GDB */ *ptr++ = 'T'; - if (Exception) - ptr = exception_code_to_gdb(Exception->ExceptionRecord.ExceptionCode, ptr); - else - ptr += sprintf(ptr, "05"); + + ptr = exception_code_to_gdb(Exception->ExceptionRecord.ExceptionCode, ptr); ptr += sprintf(ptr, "thread:p%p.%p;", PsGetThreadProcessId((PETHREAD)(ULONG_PTR)CurrentStateChange.Thread), PsGetThreadId((PETHREAD)(ULONG_PTR)CurrentStateChange.Thread)); Modified: trunk/reactos/drivers/base/kdgdb/i386_sup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdgdb/i386_su…
============================================================================== --- trunk/reactos/drivers/base/kdgdb/i386_sup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdgdb/i386_sup.c [iso-8859-1] Sun Sep 14 20:45:30 2014 @@ -79,21 +79,48 @@ return 0; } -void -gdb_send_registers(void) +KDSTATUS +gdb_send_registers( + _Out_ DBGKD_MANIPULATE_STATE64* State, + _Out_ PSTRING MessageData, + _Out_ PULONG MessageLength, + _Inout_ PKD_CONTEXT KdContext) { - CONTEXT* ctx; - PKPRCB* ProcessorBlockLists; ULONG32 Registers[16]; unsigned i; unsigned short size; - ProcessorBlockLists = (PKPRCB*)KdDebuggerDataBlock->KiProcessorBlock.Pointer; - ctx = (CONTEXT*)((char*)ProcessorBlockLists[CurrentStateChange.Processor] + KdDebuggerDataBlock->OffsetPrcbProcStateContext); - for(i=0; i < 16; i++) { - Registers[i] = *(ULONG32*)ctx_to_reg(ctx, i, &size); + Registers[i] = *(ULONG32*)ctx_to_reg(&CurrentContext, i, &size); } send_gdb_memory(Registers, sizeof(Registers)); + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); } + +KDSTATUS +gdb_send_register( + _Out_ DBGKD_MANIPULATE_STATE64* State, + _Out_ PSTRING MessageData, + _Out_ PULONG MessageLength, + _Inout_ PKD_CONTEXT KdContext) +{ + enum reg_name reg_name; + void *ptr; + unsigned short size; + + /* Get the GDB register name (gdb_input = "pXX") */ + reg_name = (hex_value(gdb_input[1]) << 4) | hex_value(gdb_input[2]); + + ptr = ctx_to_reg(&CurrentContext, reg_name, &size); + if (!ptr) + { + /* Undefined. Let's assume 32 bit register */ + send_gdb_packet("xxxxxxxx"); + } + else + { + send_gdb_memory(ptr, size); + } + return gdb_receive_and_interpret_packet(State, MessageData, MessageLength, KdContext); +} Modified: trunk/reactos/drivers/base/kdgdb/kdgdb.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdgdb/kdgdb.h…
============================================================================== --- trunk/reactos/drivers/base/kdgdb/kdgdb.h [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdgdb/kdgdb.h [iso-8859-1] Sun Sep 14 20:45:30 2014 @@ -25,6 +25,18 @@ #define KDDBGPRINT KdpDbgPrint #endif +FORCEINLINE +VOID +InitManipulateFromStateChange( + _In_ ULONG ApiNumber, + _In_ const DBGKD_ANY_WAIT_STATE_CHANGE* StateChange, + _Out_ DBGKD_MANIPULATE_STATE64* Manipulate) +{ + Manipulate->ApiNumber = ApiNumber; + Manipulate->Processor = StateChange->Processor; + Manipulate->ProcessorLevel = StateChange->ProcessorLevel; +} + /* Callbacks to simulate a KdReceive <-> KdSend loop without GDB being aware of it */ typedef VOID (*KDP_SEND_HANDLER)( _In_ ULONG PacketType, @@ -40,7 +52,9 @@ /* gdb_input.c */ extern HANDLE gdb_dbg_thread; -KDSTATUS gdb_interpret_input(_Out_ DBGKD_MANIPULATE_STATE64* State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext); +extern HANDLE gdb_dbg_process; +extern KDSTATUS gdb_interpret_input(_Out_ DBGKD_MANIPULATE_STATE64* State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext); +extern KDSTATUS gdb_receive_and_interpret_packet(_Out_ DBGKD_MANIPULATE_STATE64* State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext); /* gdb_receive.c */ extern CHAR gdb_input[]; @@ -61,14 +75,18 @@ /* kdpacket.c */ extern DBGKD_ANY_WAIT_STATE_CHANGE CurrentStateChange; +extern CONTEXT CurrentContext; extern DBGKD_GET_VERSION64 KdVersion; extern KDDEBUGGER_DATA64* KdDebuggerDataBlock; extern KDP_SEND_HANDLER KdpSendPacketHandler; extern KDP_MANIPULATESTATE_HANDLER KdpManipulateStateHandler; - +/* Commone ManipulateState handlers */ +extern KDSTATUS ContinueManipulateStateHandler(_Out_ DBGKD_MANIPULATE_STATE64* State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext); +extern KDSTATUS SetContextManipulateHandler(_Out_ DBGKD_MANIPULATE_STATE64* State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext); /* arch_sup.c */ -void gdb_send_registers(void); +extern KDSTATUS gdb_send_register(_Out_ DBGKD_MANIPULATE_STATE64* State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext); +extern KDSTATUS gdb_send_registers(_Out_ DBGKD_MANIPULATE_STATE64* State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext); /* Architecture specific defines. See ntoskrnl/include/internal/arch/ke.h */ #ifdef _M_IX86 Modified: trunk/reactos/drivers/base/kdgdb/kdpacket.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdgdb/kdpacke…
============================================================================== --- trunk/reactos/drivers/base/kdgdb/kdpacket.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kdgdb/kdpacket.c [iso-8859-1] Sun Sep 14 20:45:30 2014 @@ -7,61 +7,145 @@ #include "kdgdb.h" +/* LOCALS *********************************************************************/ +static +VOID +FirstSendHandler( + _In_ ULONG PacketType, + _In_ PSTRING MessageHeader, + _In_ PSTRING MessageData); + /* GLOBALS ********************************************************************/ - -DBGKD_ANY_WAIT_STATE_CHANGE CurrentStateChange; DBGKD_GET_VERSION64 KdVersion; KDDEBUGGER_DATA64* KdDebuggerDataBlock; +BOOLEAN InException = FALSE; /* Callbacks used to communicate with KD aside from GDB */ -KDP_SEND_HANDLER KdpSendPacketHandler = NULL; +KDP_SEND_HANDLER KdpSendPacketHandler = FirstSendHandler; KDP_MANIPULATESTATE_HANDLER KdpManipulateStateHandler = NULL; - -/* LOCALS *********************************************************************/ -static BOOLEAN FakeNextManipulatePacket = FALSE; -static DBGKD_MANIPULATE_STATE64 FakeManipulateState = {0}; +/* Data describing the current exception */ +DBGKD_ANY_WAIT_STATE_CHANGE CurrentStateChange; +CONTEXT CurrentContext; /* PRIVATE FUNCTIONS **********************************************************/ + +static +VOID +GetContextSendHandler( + _In_ ULONG PacketType, + _In_ PSTRING MessageHeader, + _In_ PSTRING MessageData +) +{ + DBGKD_MANIPULATE_STATE64* State = (DBGKD_MANIPULATE_STATE64*)MessageHeader->Buffer; + const CONTEXT* Context = (const CONTEXT*)MessageData->Buffer; + + if ((PacketType != PACKET_TYPE_KD_STATE_MANIPULATE) + || (State->ApiNumber != DbgKdGetContextApi) + || (MessageData->Length < sizeof(*Context))) + { + /* Should we bugcheck ? */ + KDDBGPRINT("ERROR: Received wrong packet from KD.\n"); + while (1); + } + + /* Just copy it */ + RtlCopyMemory(&CurrentContext, Context, sizeof(*Context)); + KdpSendPacketHandler = NULL; +} + +static +KDSTATUS +GetContextManipulateHandler( + _Out_ DBGKD_MANIPULATE_STATE64* State, + _Out_ PSTRING MessageData, + _Out_ PULONG MessageLength, + _Inout_ PKD_CONTEXT KdContext +) +{ + State->ApiNumber = DbgKdGetContextApi; + State->Processor = CurrentStateChange.Processor; + State->ReturnStatus = STATUS_SUCCESS; + State->ProcessorLevel = CurrentStateChange.ProcessorLevel; + MessageData->Length = 0; + + /* Update the send <-> receive loop handler */ + KdpSendPacketHandler = GetContextSendHandler; + KdpManipulateStateHandler = NULL; + + return KdPacketReceived; +} + +static +VOID +SetContextSendHandler( + _In_ ULONG PacketType, + _In_ PSTRING MessageHeader, + _In_ PSTRING MessageData +) +{ + DBGKD_MANIPULATE_STATE64* State = (DBGKD_MANIPULATE_STATE64*)MessageHeader->Buffer; + + /* We just confirm that all went well */ + if ((PacketType != PACKET_TYPE_KD_STATE_MANIPULATE) + || (State->ApiNumber != DbgKdSetContextApi) + || (State->ReturnStatus != STATUS_SUCCESS)) + { + /* Should we bugcheck ? */ + while (1); + } + + KdpSendPacketHandler = NULL; +} + +KDSTATUS +SetContextManipulateHandler( + _Out_ DBGKD_MANIPULATE_STATE64* State, + _Out_ PSTRING MessageData, + _Out_ PULONG MessageLength, + _Inout_ PKD_CONTEXT KdContext +) +{ + State->ApiNumber = DbgKdSetContextApi; + State->Processor = CurrentStateChange.Processor; + State->ReturnStatus = STATUS_SUCCESS; + State->ProcessorLevel = CurrentStateChange.ProcessorLevel; + MessageData->Length = sizeof(CurrentContext); + + if (MessageData->MaximumLength < sizeof(CurrentContext)) + { + while (1); + } + + RtlCopyMemory(MessageData->Buffer, &CurrentContext, sizeof(CurrentContext)); + + /* Update the send <-> receive loop handlers */ + KdpSendPacketHandler = SetContextSendHandler; + KdpManipulateStateHandler = NULL; + + return KdPacketReceived; +} + static void send_kd_state_change(DBGKD_ANY_WAIT_STATE_CHANGE* StateChange) { - static BOOLEAN first = TRUE; - - /* Save current state for later GDB queries */ - CurrentStateChange = *StateChange; - - if (first) - { - /* - * This is the first packet we receive. - * We take this as an opportunity to connect with GDB and to - * get the KD version block - */ - FakeNextManipulatePacket = TRUE; - FakeManipulateState.ApiNumber = DbgKdGetVersionApi; - FakeManipulateState.Processor = StateChange->Processor; - FakeManipulateState.ProcessorLevel = StateChange->ProcessorLevel; - FakeManipulateState.ReturnStatus = STATUS_SUCCESS; - - first = FALSE; - return; - } - switch (StateChange->NewState) { case DbgKdLoadSymbolsStateChange: { /* We don't care about symbols loading */ - FakeNextManipulatePacket = TRUE; - FakeManipulateState.ApiNumber = DbgKdContinueApi; - FakeManipulateState.Processor = StateChange->Processor; - FakeManipulateState.ProcessorLevel = StateChange->ProcessorLevel; - FakeManipulateState.ReturnStatus = STATUS_SUCCESS; - FakeManipulateState.u.Continue.ContinueStatus = STATUS_SUCCESS; + KdpManipulateStateHandler = ContinueManipulateStateHandler; break; } case DbgKdExceptionStateChange: + /* Save current state for later GDB queries */ + CurrentStateChange = *StateChange; + /* Unless GDB tells us otherwise, those are what we should have */ + gdb_dbg_thread = PsGetThreadId((PETHREAD)StateChange->Thread); + gdb_dbg_process = PsGetThreadProcessId((PETHREAD)StateChange->Thread); gdb_send_exception(); + /* Next receive call will ask for the context */ + KdpManipulateStateHandler = GetContextManipulateHandler; break; default: /* FIXME */ @@ -100,19 +184,117 @@ gdb_send_registers((CONTEXT*)MessageData->Buffer); return; #endif - case DbgKdGetVersionApi: - { - LIST_ENTRY* DebuggerDataList; - /* Simply get a copy */ - RtlCopyMemory(&KdVersion, &State->u.GetVersion64, sizeof(KdVersion)); - DebuggerDataList = (LIST_ENTRY*)(ULONG_PTR)KdVersion.DebuggerDataList; - KdDebuggerDataBlock = CONTAINING_RECORD(DebuggerDataList->Flink, KDDEBUGGER_DATA64, Header.List); - return; - } default: /* FIXME */ while (1); } +} + +KDSTATUS +ContinueManipulateStateHandler( + _Out_ DBGKD_MANIPULATE_STATE64* State, + _Out_ PSTRING MessageData, + _Out_ PULONG MessageLength, + _Inout_ PKD_CONTEXT KdContext +) +{ + /* Let's go on */ + State->ApiNumber = DbgKdContinueApi; + State->ReturnStatus = STATUS_SUCCESS; /* ? */ + State->Processor = CurrentStateChange.Processor; + State->ProcessorLevel = CurrentStateChange.ProcessorLevel; + if (MessageData) + MessageData->Length = 0; + *MessageLength = 0; + State->u.Continue.ContinueStatus = STATUS_SUCCESS; + + /* We definitely are at the end of the send <-> receive loop, if any */ + KdpSendPacketHandler = NULL; + KdpManipulateStateHandler = NULL; + return KdPacketReceived; +} + +static +VOID +GetVersionSendHandler( + _In_ ULONG PacketType, + _In_ PSTRING MessageHeader, + _In_ PSTRING MessageData) +{ + DBGKD_MANIPULATE_STATE64* State = (DBGKD_MANIPULATE_STATE64*)MessageHeader->Buffer; + LIST_ENTRY* DebuggerDataList; + + /* Confirm that all went well */ + if ((PacketType != PACKET_TYPE_KD_STATE_MANIPULATE) + || (State->ApiNumber != DbgKdGetVersionApi) + || !NT_SUCCESS(State->ReturnStatus)) + { + /* FIXME: should detach from KD and go along without debugging */ + KDDBGPRINT("Wrong packet received after asking for data.\n"); + while(1); + } + + /* Copy the relevant data */ + RtlCopyMemory(&KdVersion, &State->u.GetVersion64, sizeof(KdVersion)); + DebuggerDataList = (LIST_ENTRY*)(ULONG_PTR)KdVersion.DebuggerDataList; + KdDebuggerDataBlock = CONTAINING_RECORD(DebuggerDataList->Flink, KDDEBUGGER_DATA64, Header.List); + + /* We can tell KD to continue */ + KdpSendPacketHandler = NULL; + KdpManipulateStateHandler = ContinueManipulateStateHandler; +} + +static +KDSTATUS +GetVersionManipulateStateHandler( + _Out_ DBGKD_MANIPULATE_STATE64* State, + _Out_ PSTRING MessageData, + _Out_ PULONG MessageLength, + _Inout_ PKD_CONTEXT KdContext) +{ + /* Ask for the version data */ + State->ApiNumber = DbgKdGetVersionApi; + State->Processor = CurrentStateChange.Processor; + State->ProcessorLevel = CurrentStateChange.ProcessorLevel; + + /* The next send call will serve this query */ + KdpSendPacketHandler = GetVersionSendHandler; + KdpManipulateStateHandler = NULL; + + /* This will make KD breakin and we will be able to properly attach to GDB */ + KdContext->KdpControlCPending = TRUE; + + return KdPacketReceived; +} + +static +VOID +FirstSendHandler( + _In_ ULONG PacketType, + _In_ PSTRING MessageHeader, + _In_ PSTRING MessageData) +{ + DBGKD_ANY_WAIT_STATE_CHANGE* StateChange = (DBGKD_ANY_WAIT_STATE_CHANGE*)MessageHeader->Buffer; + + if (PacketType == PACKET_TYPE_KD_DEBUG_IO) + { + /* This is not the packet we are waiting for */ + send_kd_debug_io((DBGKD_DEBUG_IO*)MessageHeader->Buffer, MessageData); + return; + } + + if (PacketType != PACKET_TYPE_KD_STATE_CHANGE64) + { + KDDBGPRINT("First KD packet is not a state change!\n"); + /* FIXME: What should we send back to KD ? */ + while(1); + } + + CurrentStateChange = *StateChange; + + /* The next receive call will be asking for the version data */ + KdpSendPacketHandler = NULL; + KdpManipulateStateHandler = GetVersionManipulateStateHandler; } /* PUBLIC FUNCTIONS ***********************************************************/ @@ -162,13 +344,6 @@ if (KdpManipulateStateHandler != NULL) return KdpManipulateStateHandler(State, MessageData, DataLength, KdContext); - if (FakeNextManipulatePacket) - { - FakeNextManipulatePacket = FALSE; - *State = FakeManipulateState; - return KdPacketReceived; - } - /* Receive data from GDB */ Status = gdb_receive_packet(KdContext); if (Status != KdPacketReceived)
10 years, 3 months
1
0
0
0
[tkreuzer] 64153: [KSECDD] - Fix a typo in KsecQueryFileInformation - Implement missing ioctls in KsecDeviceControl - Support METHOD_OUT_DIRECT for IRP_MJ_DEVICE_CONTROL - Add stubs for KsecEn/Decr...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Sep 14 19:40:15 2014 New Revision: 64153 URL:
http://svn.reactos.org/svn/reactos?rev=64153&view=rev
Log: [KSECDD] - Fix a typo in KsecQueryFileInformation - Implement missing ioctls in KsecDeviceControl - Support METHOD_OUT_DIRECT for IRP_MJ_DEVICE_CONTROL - Add stubs for KsecEn/DecryptMemory [ADVAPI32] - Use ksecdd to handle SystemFunction040 (RtlEncryptMemory) and SystemFunction041 (RtlDecryptMemory) (they still do nothing, but at least they do it in kenrnel mode now ;-)) Added: trunk/reactos/drivers/crypto/ksecdd/crypt.c (with props) Modified: trunk/reactos/dll/win32/advapi32/CMakeLists.txt trunk/reactos/dll/win32/advapi32/misc/dllmain.c trunk/reactos/dll/win32/advapi32/misc/sysfunc.c trunk/reactos/drivers/crypto/ksecdd/CMakeLists.txt trunk/reactos/drivers/crypto/ksecdd/dispatch.c trunk/reactos/drivers/crypto/ksecdd/ksecdd.h trunk/reactos/include/reactos/drivers/ksecdd/ksecioctl.h Modified: trunk/reactos/dll/win32/advapi32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/advapi32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/CMakeLists.txt [iso-8859-1] Sun Sep 14 19:40:15 2014 @@ -8,6 +8,7 @@ include_directories( ${REACTOS_SOURCE_DIR}/include/reactos/idl + ${REACTOS_SOURCE_DIR}/include/reactos/drivers/ksecdd ${REACTOS_SOURCE_DIR}/lib/cryptlib ${CMAKE_CURRENT_BINARY_DIR}) Modified: trunk/reactos/dll/win32/advapi32/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/dl…
============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/dllmain.c [iso-8859-1] Sun Sep 14 19:40:15 2014 @@ -14,6 +14,7 @@ extern BOOL RegInitialize(VOID); extern BOOL RegCleanup(VOID); extern VOID UnloadNtMarta(VOID); +extern VOID CloseKsecDdHandle(VOID); BOOL WINAPI @@ -33,6 +34,7 @@ CloseLogonLsaHandle(); RegCleanup(); UnloadNtMarta(); + CloseKsecDdHandle(); break; } Modified: trunk/reactos/dll/win32/advapi32/misc/sysfunc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/sy…
============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/sysfunc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/sysfunc.c [iso-8859-1] Sun Sep 14 19:40:15 2014 @@ -12,9 +12,15 @@ */ #include <advapi32.h> +#include <ksecioctl.h> #include <md4.h> #include <md5.h> #include <rc4.h> + +/* FIXME: this should be in some shared header */ +#define RTL_ENCRYPT_OPTION_SAME_PROCESS 0 +#define RTL_ENCRYPT_OPTION_CROSS_PROCESS 1 +#define RTL_ENCRYPT_OPTION_SAME_LOGON 2 static const unsigned char CRYPT_LMhash_Magic[8] = { 'K', 'G', 'S', '!', '@', '#', '$', '%' }; @@ -615,6 +621,93 @@ return TRUE; } +HANDLE KsecDeviceHandle; + +static +NTSTATUS +KsecOpenDevice() +{ + UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\KsecDD"); + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK IoStatusBlock; + HANDLE DeviceHandle; + NTSTATUS Status; + + InitializeObjectAttributes(&ObjectAttributes, + &DeviceName, + 0x18, + NULL, + NULL); + Status = NtOpenFile(&DeviceHandle, + 0x100001, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_SYNCHRONOUS_IO_NONALERT); + if (!NT_SUCCESS(Status)) + { + return Status; + } + + if (InterlockedCompareExchangePointer(&KsecDeviceHandle, DeviceHandle, NULL) != NULL) + { + NtClose(DeviceHandle); + } + + return STATUS_SUCCESS; +} + +VOID +CloseKsecDdHandle(VOID) +{ + /* Check if we already opened a handle to ksecdd */ + if (KsecDeviceHandle != NULL) + { + /* Close it */ + CloseHandle(KsecDeviceHandle); + KsecDeviceHandle = NULL; + } +} + +static +NTSTATUS +KsecDeviceIoControl( + ULONG IoControlCode, + PVOID InputBuffer, + SIZE_T InputBufferLength, + PVOID OutputBuffer, + SIZE_T OutputBufferLength) +{ + IO_STATUS_BLOCK IoStatusBlock; + NTSTATUS Status; + + /* Check if we already have a handle */ + if (KsecDeviceHandle == NULL) + { + /* Try to open the device */ + Status = KsecOpenDevice(); + if (!NT_SUCCESS(Status)) + { + //ERR("Failed to open handle to KsecDd driver!\n"); + return Status; + } + } + + /* Call the driver */ + Status = NtDeviceIoControlFile(KsecDeviceHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + IoControlCode, + InputBuffer, + InputBufferLength, + OutputBuffer, + OutputBufferLength); + + return Status; +} + /* These functions have nearly identical prototypes to CryptProtectMemory and CryptUnprotectMemory, in crypt32.dll. @@ -642,10 +735,36 @@ * If flags are specified when encrypting, the same flag value must be given * when decrypting the memory. */ -NTSTATUS WINAPI SystemFunction040(PVOID memory, ULONG length, ULONG flags) -{ +NTSTATUS +WINAPI +SystemFunction040( + _Inout_ PVOID Memory, + _In_ ULONG MemoryLength, + _In_ ULONG OptionFlags) +{ + ULONG IoControlCode; + //FIXME("(%p, %x, %x): stub [RtlEncryptMemory]\n", memory, length, flags); return STATUS_SUCCESS; + + if (OptionFlags == RTL_ENCRYPT_OPTION_SAME_PROCESS) + { + IoControlCode = IOCTL_KSEC_ENCRYPT_SAME_PROCESS; + } + else if (OptionFlags == RTL_ENCRYPT_OPTION_CROSS_PROCESS) + { + IoControlCode = IOCTL_KSEC_ENCRYPT_CROSS_PROCESS; + } + else if (OptionFlags == RTL_ENCRYPT_OPTION_SAME_LOGON) + { + IoControlCode = IOCTL_KSEC_ENCRYPT_SAME_LOGON; + } + else + { + return STATUS_INVALID_PARAMETER; + } + + return KsecDeviceIoControl(IoControlCode, Memory, MemoryLength, Memory, MemoryLength); } /****************************************************************************** @@ -670,10 +789,36 @@ * If flags are specified when encrypting, the same flag value must be given * when decrypting the memory. */ -NTSTATUS WINAPI SystemFunction041(PVOID memory, ULONG length, ULONG flags) -{ +NTSTATUS +WINAPI +SystemFunction041( + _Inout_ PVOID Memory, + _In_ ULONG MemoryLength, + _In_ ULONG OptionFlags) +{ + ULONG IoControlCode; + //FIXME("(%p, %x, %x): stub [RtlDecryptMemory]\n", memory, length, flags); return STATUS_SUCCESS; + + if (OptionFlags == RTL_ENCRYPT_OPTION_SAME_PROCESS) + { + IoControlCode = IOCTL_KSEC_DECRYPT_SAME_PROCESS; + } + else if (OptionFlags == RTL_ENCRYPT_OPTION_CROSS_PROCESS) + { + IoControlCode = IOCTL_KSEC_DECRYPT_CROSS_PROCESS; + } + else if (OptionFlags == RTL_ENCRYPT_OPTION_SAME_LOGON) + { + IoControlCode = IOCTL_KSEC_DECRYPT_SAME_LOGON; + } + else + { + return STATUS_INVALID_PARAMETER; + } + + return KsecDeviceIoControl(IoControlCode, Memory, MemoryLength, Memory, MemoryLength); } /* EOF */ Modified: trunk/reactos/drivers/crypto/ksecdd/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/crypto/ksecdd/CMak…
============================================================================== --- trunk/reactos/drivers/crypto/ksecdd/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/drivers/crypto/ksecdd/CMakeLists.txt [iso-8859-1] Sun Sep 14 19:40:15 2014 @@ -8,6 +8,7 @@ list(APPEND SOURCE ksecdd.c dispatch.c + crypt.c random.c stubs.c ksecdd.rc Added: trunk/reactos/drivers/crypto/ksecdd/crypt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/crypto/ksecdd/cryp…
============================================================================== --- trunk/reactos/drivers/crypto/ksecdd/crypt.c (added) +++ trunk/reactos/drivers/crypto/ksecdd/crypt.c [iso-8859-1] Sun Sep 14 19:40:15 2014 @@ -0,0 +1,31 @@ +/* + * PROJECT: ReactOS Drivers + * COPYRIGHT: See COPYING in the top level directory + * PURPOSE: Kernel Security Support Provider Interface Driver + * + * PROGRAMMERS: Timo Kreuzer (timo.kreuzer(a)reactos.org) + */ + +/* INCLUDES *******************************************************************/ + +#include "ksecdd.h" + +NTSTATUS +NTAPI +KsecEncryptMemory ( + _Inout_ PVOID Buffer, + _In_ ULONG Length, + _In_ ULONG OptionFlags) +{ + return STATUS_SUCCESS; +} + +NTSTATUS +NTAPI +KsecDecryptMemory ( + _Inout_ PVOID Buffer, + _In_ ULONG Length, + _In_ ULONG OptionFlags) +{ + return STATUS_SUCCESS; +} Propchange: trunk/reactos/drivers/crypto/ksecdd/crypt.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/drivers/crypto/ksecdd/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/crypto/ksecdd/disp…
============================================================================== --- trunk/reactos/drivers/crypto/ksecdd/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/crypto/ksecdd/dispatch.c [iso-8859-1] Sun Sep 14 19:40:15 2014 @@ -33,7 +33,7 @@ } /* Validate buffer size */ - if (*BufferLength >= sizeof(FILE_STANDARD_INFORMATION)) + if (*BufferLength < sizeof(FILE_STANDARD_INFORMATION)) { *BufferLength = sizeof(FILE_STANDARD_INFORMATION); return STATUS_INFO_LENGTH_MISMATCH; @@ -92,7 +92,28 @@ { NTSTATUS Status; - Status = STATUS_SUCCESS; + if ((IoControlCode == IOCTL_KSEC_RANDOM_FILL_BUFFER) || + (IoControlCode == IOCTL_KSEC_ENCRYPT_SAME_PROCESS) || + (IoControlCode == IOCTL_KSEC_DECRYPT_SAME_PROCESS) || + (IoControlCode == IOCTL_KSEC_ENCRYPT_CROSS_PROCESS) || + (IoControlCode == IOCTL_KSEC_DECRYPT_CROSS_PROCESS) || + (IoControlCode == IOCTL_KSEC_ENCRYPT_SAME_LOGON) || + (IoControlCode == IOCTL_KSEC_DECRYPT_SAME_LOGON)) + { + /* Make sure we have a valid output buffer */ + if ((Buffer == NULL) || (OutputLength == NULL)) + { + return STATUS_INVALID_PARAMETER; + } + + /* Check if the input is smaller than the output */ + if (InputLength < *OutputLength) + { + /* We might have uninitialized memory, zero it out */ + RtlSecureZeroMemory((PUCHAR)Buffer + InputLength, + *OutputLength - InputLength); + } + } /* Check ioctl code */ switch (IoControlCode) @@ -105,6 +126,48 @@ case IOCTL_KSEC_RANDOM_FILL_BUFFER: Status = KsecGenRandom(Buffer, *OutputLength); + break; + + case IOCTL_KSEC_ENCRYPT_SAME_PROCESS: + + Status = KsecEncryptMemory(Buffer, + *OutputLength, + RTL_ENCRYPT_OPTION_SAME_PROCESS); + break; + + case IOCTL_KSEC_DECRYPT_SAME_PROCESS: + + Status = KsecDecryptMemory(Buffer, + *OutputLength, + RTL_ENCRYPT_OPTION_SAME_PROCESS); + break; + + case IOCTL_KSEC_ENCRYPT_CROSS_PROCESS: + + Status = KsecEncryptMemory(Buffer, + *OutputLength, + RTL_ENCRYPT_OPTION_CROSS_PROCESS); + break; + + case IOCTL_KSEC_DECRYPT_CROSS_PROCESS: + + Status = KsecDecryptMemory(Buffer, + *OutputLength, + RTL_ENCRYPT_OPTION_CROSS_PROCESS); + break; + + case IOCTL_KSEC_ENCRYPT_SAME_LOGON: + + Status = KsecEncryptMemory(Buffer, + *OutputLength, + RTL_ENCRYPT_OPTION_SAME_LOGON); + break; + + case IOCTL_KSEC_DECRYPT_SAME_LOGON: + + Status = KsecDecryptMemory(Buffer, + *OutputLength, + RTL_ENCRYPT_OPTION_SAME_LOGON); break; default: @@ -188,10 +251,30 @@ case IRP_MJ_DEVICE_CONTROL: /* Extract the parameters */ - Buffer = Irp->AssociatedIrp.SystemBuffer; InputLength = IoStackLocation->Parameters.DeviceIoControl.InputBufferLength; OutputLength = IoStackLocation->Parameters.DeviceIoControl.OutputBufferLength; IoControlCode = IoStackLocation->Parameters.DeviceIoControl.IoControlCode; + + /* Check for METHOD_OUT_DIRECT method */ + if ((METHOD_FROM_CTL_CODE(IoControlCode) == METHOD_OUT_DIRECT) && + (OutputLength != 0)) + { + /* Use the provided MDL */ + OutputLength = Irp->MdlAddress->ByteCount; + Buffer = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, + NormalPagePriority); + if (Buffer == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + Information = 0; + break; + } + } + else + { + /* Otherwise this is METHOD_BUFFERED, use the SystemBuffer */ + Buffer = Irp->AssociatedIrp.SystemBuffer; + } /* Call the internal function */ Status = KsecDeviceControl(IoControlCode, @@ -205,6 +288,7 @@ DPRINT1("Unhandled major function %lu!\n", IoStackLocation->MajorFunction); ASSERT(FALSE); + return STATUS_INVALID_DEVICE_REQUEST; } /* Return the information */ Modified: trunk/reactos/drivers/crypto/ksecdd/ksecdd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/crypto/ksecdd/ksec…
============================================================================== --- trunk/reactos/drivers/crypto/ksecdd/ksecdd.h [iso-8859-1] (original) +++ trunk/reactos/drivers/crypto/ksecdd/ksecdd.h [iso-8859-1] Sun Sep 14 19:40:15 2014 @@ -9,6 +9,26 @@ #define _NO_KSECDD_IMPORT_ #include <ntifs.h> #include <ndk/extypes.h> +#include <ndk/rtlfuncs.h> +#include <ndk/lpcfuncs.h> +#include <ndk/obfuncs.h> +#include <ntstrsafe.h> + +#define STATUS_KSEC_INTERNAL_ERROR ((NTSTATUS)0x80090304) + +/* FIXME: this should be in some shared header */ +#define RTL_ENCRYPT_OPTION_SAME_PROCESS 0 +#define RTL_ENCRYPT_OPTION_CROSS_PROCESS 1 +#define RTL_ENCRYPT_OPTION_SAME_LOGON 2 + +typedef struct _KSEC_CONNECTION_INFO +{ + ULONG Unknown0; + NTSTATUS Status; + ULONG_PTR Information; + CHAR ConnectionString[128]; + ULONG Flags; +} KSEC_CONNECTION_INFO; #if defined(_M_IX86) || defined(_M_AMD64) typedef struct _KSEC_MACHINE_SPECIFIC_COUNTERS @@ -41,6 +61,9 @@ SYSTEM_PROCESS_INFORMATION SystemProcessInformation; } KSEC_ENTROPY_DATA, *PKSEC_ENTROPY_DATA; +extern PEPROCESS KsecLsaProcess;; +extern HANDLE KsecLsaProcessHandle; + NTSTATUS NTAPI KsecDdDispatch( @@ -54,3 +77,37 @@ PVOID Buffer, SIZE_T Length); +NTSTATUS +NTAPI +KsecEncryptMemory ( + _Inout_ PVOID Buffer, + _In_ ULONG Length, + _In_ ULONG OptionFlags); + +NTSTATUS +NTAPI +KsecDecryptMemory ( + _Inout_ PVOID Buffer, + _In_ ULONG Length, + _In_ ULONG OptionFlags); + +NTSTATUS +NTAPI +KsecInitLsaMemory(VOID); + +/// +PVOID +NTAPI +PsGetProcessSecurityPort( + PEPROCESS Process); + +NTSTATUS +NTAPI +PsSetProcessSecurityPort( + PEPROCESS Process, + PVOID SecurityPort); + +HANDLE +NTAPI +PsGetCurrentThreadProcessId(VOID); + Modified: trunk/reactos/include/reactos/drivers/ksecdd/ksecioctl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/ks…
============================================================================== --- trunk/reactos/include/reactos/drivers/ksecdd/ksecioctl.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/drivers/ksecdd/ksecioctl.h [iso-8859-1] Sun Sep 14 19:40:15 2014 @@ -15,11 +15,11 @@ CTL_CODE(FILE_DEVICE_KSEC, 0x02, METHOD_BUFFERED, FILE_ANY_ACCESS) // 3: 0x39000E - called from SystemFunction040 aka RtlEncryptMemory with OptionFlags == 0 -#define IOCTL_KSEC_ENCRYPT_PROCESS \ +#define IOCTL_KSEC_ENCRYPT_SAME_PROCESS \ CTL_CODE(FILE_DEVICE_KSEC, 0x03, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) // 4: 0x390012 - called from SystemFunction041 aka RtlDecryptMemory with OptionFlags == 0 -#define IOCTL_KSEC_DECRYPT_PROCESS \ +#define IOCTL_KSEC_DECRYPT_SAME_PROCESS \ CTL_CODE(FILE_DEVICE_KSEC, 0x04, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) // 5: 0x390016 - called from SystemFunction040 aka RtlEncryptMemory with OptionFlags == 1
10 years, 3 months
1
0
0
0
[tkreuzer] 64152: [NTOSKRNL] Implement a fake NtLockProductActivationKeys
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Sep 14 16:05:00 2014 New Revision: 64152 URL:
http://svn.reactos.org/svn/reactos?rev=64152&view=rev
Log: [NTOSKRNL] Implement a fake NtLockProductActivationKeys Modified: branches/kernel-fun/reactos/ntoskrnl/config/ntapi.c Modified: branches/kernel-fun/reactos/ntoskrnl/config/ntapi.c URL:
http://svn.reactos.org/svn/reactos/branches/kernel-fun/reactos/ntoskrnl/con…
============================================================================== --- branches/kernel-fun/reactos/ntoskrnl/config/ntapi.c [iso-8859-1] (original) +++ branches/kernel-fun/reactos/ntoskrnl/config/ntapi.c [iso-8859-1] Sun Sep 14 16:05:00 2014 @@ -15,6 +15,7 @@ BOOLEAN CmBootAcceptFirstTime = TRUE; BOOLEAN CmFirstTime = TRUE; +extern ULONG InitSafeBootMode; /* FUNCTIONS *****************************************************************/ @@ -893,7 +894,7 @@ /* Enough of the system has booted by now */ Ki386PerfEnd(); - + /* Validate flag */ if (Flag > CM_BOOT_FLAG_MAX) return STATUS_INVALID_PARAMETER; @@ -962,13 +963,52 @@ return STATUS_NOT_IMPLEMENTED; } +// FIXME: different for different windows versions! +#define PRODUCT_ACTIVATION_VERSION 7749 + NTSTATUS NTAPI NtLockProductActivationKeys(IN PULONG pPrivateVer, IN PULONG pSafeMode) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + KPROCESSOR_MODE PreviousMode; + + PreviousMode = ExGetPreviousMode(); + _SEH2_TRY + { + /* Check if the caller asked for the version */ + if (pPrivateVer != NULL) + { + /* For user mode, probe it */ + if (PreviousMode != KernelMode) + { + ProbeForRead(pPrivateVer, sizeof(ULONG), sizeof(ULONG)); + } + + /* Return the expected version */ + *pPrivateVer = PRODUCT_ACTIVATION_VERSION; + } + + /* Check if the caller asked for safe mode mode state */ + if (pSafeMode != NULL) + { + /* For user mode, probe it */ + if (PreviousMode != KernelMode) + { + ProbeForRead(pSafeMode, sizeof(ULONG), sizeof(ULONG)); + } + + /* Return the safe boot mode state */ + *pSafeMode = InitSafeBootMode; + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + return _SEH2_GetExceptionCode(); + } + _SEH2_END; + + return STATUS_SUCCESS; } NTSTATUS
10 years, 3 months
1
0
0
0
[akhaldi] 64151: [XDK][DDK] * Handle the rest of cases about the order of pragma and symbol declaration.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Sep 14 15:49:35 2014 New Revision: 64151 URL:
http://svn.reactos.org/svn/reactos?rev=64151&view=rev
Log: [XDK][DDK] * Handle the rest of cases about the order of pragma and symbol declaration. Modified: trunk/reactos/include/ddk/ntddk.h trunk/reactos/include/ddk/ntifs.h trunk/reactos/include/ddk/wdm.h trunk/reactos/include/xdk/fsrtlfuncs.h trunk/reactos/include/xdk/haltypes.h trunk/reactos/include/xdk/kdfuncs.h trunk/reactos/include/xdk/ketypes.h trunk/reactos/include/xdk/mmtypes.h trunk/reactos/include/xdk/ntifs.template.h Modified: trunk/reactos/include/ddk/ntddk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntddk.h?rev=64…
============================================================================== --- trunk/reactos/include/ddk/ntddk.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntddk.h [iso-8859-1] Sun Sep 14 15:49:35 2014 @@ -1670,8 +1670,8 @@ extern HAL_DISPATCH HalDispatchTable; #define HALDISPATCH (&HalDispatchTable) #else +__CREATE_NTOS_DATA_IMPORT_ALIAS(HalDispatchTable) extern PHAL_DISPATCH HalDispatchTable; -__CREATE_NTOS_DATA_IMPORT_ALIAS(HalDispatchTable) #define HALDISPATCH HalDispatchTable #endif Modified: trunk/reactos/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntifs.h?rev=64…
============================================================================== --- trunk/reactos/include/ddk/ntifs.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntifs.h [iso-8859-1] Sun Sep 14 15:49:35 2014 @@ -8396,8 +8396,8 @@ extern const UCHAR * const FsRtlLegalAnsiCharacterArray; #define LEGAL_ANSI_CHARACTER_ARRAY FsRtlLegalAnsiCharacterArray #else +__CREATE_NTOS_DATA_IMPORT_ALIAS(FsRtlLegalAnsiCharacterArray) extern const UCHAR * const *FsRtlLegalAnsiCharacterArray; -__CREATE_NTOS_DATA_IMPORT_ALIAS(FsRtlLegalAnsiCharacterArray) #define LEGAL_ANSI_CHARACTER_ARRAY (*FsRtlLegalAnsiCharacterArray) #endif @@ -10993,8 +10993,8 @@ extern PUSHORT NlsOemLeadByteInfo; #define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo #else +__CREATE_NTOS_DATA_IMPORT_ALIAS(NlsOemLeadByteInfo) extern PUSHORT *NlsOemLeadByteInfo; -__CREATE_NTOS_DATA_IMPORT_ALIAS(NlsOemLeadByteInfo) #define NLS_OEM_LEAD_BYTE_INFO (*NlsOemLeadByteInfo) #endif Modified: trunk/reactos/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=6415…
============================================================================== --- trunk/reactos/include/ddk/wdm.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/wdm.h [iso-8859-1] Sun Sep 14 15:49:35 2014 @@ -1661,8 +1661,8 @@ #elif (NTDDI_VERSION >= NTDDI_WINXP) extern NTSYSAPI CCHAR KeNumberProcessors; #else +__CREATE_NTOS_DATA_IMPORT_ALIAS(KeNumberProcessors) extern PCCHAR KeNumberProcessors; -__CREATE_NTOS_DATA_IMPORT_ALIAS(KeNumberProcessors) #endif @@ -1815,8 +1815,8 @@ } MM_SYSTEMSIZE; #ifndef _NTSYSTEM_ +__CREATE_NTOS_DATA_IMPORT_ALIAS(Mm64BitPhysicalAddress) extern PBOOLEAN Mm64BitPhysicalAddress; -__CREATE_NTOS_DATA_IMPORT_ALIAS(Mm64BitPhysicalAddress) #endif extern NTKERNELAPI PVOID MmBadPointer; Modified: trunk/reactos/include/xdk/fsrtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/fsrtlfuncs.h?r…
============================================================================== --- trunk/reactos/include/xdk/fsrtlfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/fsrtlfuncs.h [iso-8859-1] Sun Sep 14 15:49:35 2014 @@ -1584,8 +1584,8 @@ extern const UCHAR * const FsRtlLegalAnsiCharacterArray; #define LEGAL_ANSI_CHARACTER_ARRAY FsRtlLegalAnsiCharacterArray #else +__CREATE_NTOS_DATA_IMPORT_ALIAS(FsRtlLegalAnsiCharacterArray) extern const UCHAR * const *FsRtlLegalAnsiCharacterArray; -__CREATE_NTOS_DATA_IMPORT_ALIAS(FsRtlLegalAnsiCharacterArray) #define LEGAL_ANSI_CHARACTER_ARRAY (*FsRtlLegalAnsiCharacterArray) #endif Modified: trunk/reactos/include/xdk/haltypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/haltypes.h?rev…
============================================================================== --- trunk/reactos/include/xdk/haltypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/haltypes.h [iso-8859-1] Sun Sep 14 15:49:35 2014 @@ -273,8 +273,8 @@ extern HAL_DISPATCH HalDispatchTable; #define HALDISPATCH (&HalDispatchTable) #else +__CREATE_NTOS_DATA_IMPORT_ALIAS(HalDispatchTable) extern PHAL_DISPATCH HalDispatchTable; -__CREATE_NTOS_DATA_IMPORT_ALIAS(HalDispatchTable) #define HALDISPATCH HalDispatchTable #endif Modified: trunk/reactos/include/xdk/kdfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/kdfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/kdfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/kdfuncs.h [iso-8859-1] Sun Sep 14 15:49:35 2014 @@ -125,11 +125,11 @@ extern BOOLEAN KdDebuggerNotPresent; #define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent #else +__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerEnabled) extern BOOLEAN *KdDebuggerEnabled; -__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerEnabled) #define KD_DEBUGGER_ENABLED (*KdDebuggerEnabled) +__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerNotPresent) extern BOOLEAN *KdDebuggerNotPresent; -__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerNotPresent) #define KD_DEBUGGER_NOT_PRESENT (*KdDebuggerNotPresent) #endif Modified: trunk/reactos/include/xdk/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/ketypes.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/ketypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/ketypes.h [iso-8859-1] Sun Sep 14 15:49:35 2014 @@ -986,8 +986,8 @@ #elif (NTDDI_VERSION >= NTDDI_WINXP) extern NTSYSAPI CCHAR KeNumberProcessors; #else +__CREATE_NTOS_DATA_IMPORT_ALIAS(KeNumberProcessors) extern PCCHAR KeNumberProcessors; -__CREATE_NTOS_DATA_IMPORT_ALIAS(KeNumberProcessors) #endif $endif (_WDMDDK_) Modified: trunk/reactos/include/xdk/mmtypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/mmtypes.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/mmtypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/mmtypes.h [iso-8859-1] Sun Sep 14 15:49:35 2014 @@ -148,8 +148,8 @@ } MM_SYSTEMSIZE; #ifndef _NTSYSTEM_ +__CREATE_NTOS_DATA_IMPORT_ALIAS(Mm64BitPhysicalAddress) extern PBOOLEAN Mm64BitPhysicalAddress; -__CREATE_NTOS_DATA_IMPORT_ALIAS(Mm64BitPhysicalAddress) #endif extern NTKERNELAPI PVOID MmBadPointer; Modified: trunk/reactos/include/xdk/ntifs.template.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/ntifs.template…
============================================================================== --- trunk/reactos/include/xdk/ntifs.template.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/ntifs.template.h [iso-8859-1] Sun Sep 14 15:49:35 2014 @@ -1128,8 +1128,8 @@ extern PUSHORT NlsOemLeadByteInfo; #define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo #else +__CREATE_NTOS_DATA_IMPORT_ALIAS(NlsOemLeadByteInfo) extern PUSHORT *NlsOemLeadByteInfo; -__CREATE_NTOS_DATA_IMPORT_ALIAS(NlsOemLeadByteInfo) #define NLS_OEM_LEAD_BYTE_INFO (*NlsOemLeadByteInfo) #endif
10 years, 3 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
42
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
37
38
39
40
41
42
Results per page:
10
25
50
100
200