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
March 2023
----- 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
18 participants
139 discussions
Start a n
N
ew thread
[reactos] 01/01: [NTOSKRNL] Fix build in Release; #include 'kd.h'
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3b82b8370dd9c106473cb…
commit 3b82b8370dd9c106473cb83a2c134c8e73147122 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Mar 28 17:20:20 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Tue Mar 28 17:20:42 2023 +0900 [NTOSKRNL] Fix build in Release; #include 'kd.h' --- ntoskrnl/kd/kdio.c | 1 + ntoskrnl/kd/kdmain.c | 1 + ntoskrnl/kd/kdserial.c | 1 + 3 files changed, 3 insertions(+) diff --git a/ntoskrnl/kd/kdio.c b/ntoskrnl/kd/kdio.c index c8087e991ae..f9e7b38abe1 100644 --- a/ntoskrnl/kd/kdio.c +++ b/ntoskrnl/kd/kdio.c @@ -11,6 +11,7 @@ #include <ntoskrnl.h> #include <reactos/buildno.h> +#include "kd.h" #define NDEBUG #include <debug.h> diff --git a/ntoskrnl/kd/kdmain.c b/ntoskrnl/kd/kdmain.c index 77515b0bf3c..de341bad204 100644 --- a/ntoskrnl/kd/kdmain.c +++ b/ntoskrnl/kd/kdmain.c @@ -8,6 +8,7 @@ */ #include <ntoskrnl.h> +#include "kd.h" #define NDEBUG #include <debug.h> diff --git a/ntoskrnl/kd/kdserial.c b/ntoskrnl/kd/kdserial.c index ff3ecf05274..bedfcde159c 100644 --- a/ntoskrnl/kd/kdserial.c +++ b/ntoskrnl/kd/kdserial.c @@ -9,6 +9,7 @@ /* INCLUDES ******************************************************************/ #include <ntoskrnl.h> +#include "kd.h" /* FUNCTIONS *****************************************************************/
1 year, 9 months
1
0
0
0
[reactos] 01/01: [KERNEL32] Follow-up of #5200 (5d1ae45)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ab5aff5948f6f7a8d85cf…
commit ab5aff5948f6f7a8d85cf02d975217b44fdf89b8 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Mar 28 10:00:22 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Tue Mar 28 10:00:22 2023 +0900 [KERNEL32] Follow-up of #5200 (5d1ae45) Add "Voiced Iteration Marks" to convert. CORE-11700 --- dll/win32/kernel32/winnls/string/lang.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dll/win32/kernel32/winnls/string/lang.c b/dll/win32/kernel32/winnls/string/lang.c index c976310596a..a22eacf8cff 100644 --- a/dll/win32/kernel32/winnls/string/lang.c +++ b/dll/win32/kernel32/winnls/string/lang.c @@ -2018,9 +2018,10 @@ INT WINAPI LCMapStringEx(LPCWSTR name, DWORD flags, LPCWSTR src, INT srclen, LPW * U+3041 ... U+3093: Hiragana * U+3095: Hiragana Letter Small KA * U+309D: Hiragana Iteration Mark + * U+309E: Hiragana Voiced Iteration Mark */ WCHAR wch = *dst_ptr; - if ((0x3041 <= wch && wch <= 0x3093) || wch == 0x3095 || wch == 0x309D) + if ((0x3041 <= wch && wch <= 0x3093) || wch == 0x3095 || wch == 0x309D || wch == 0x309E) *dst_ptr = wch + 0x60; /* Hiragana to Katanaka */ } } @@ -2033,9 +2034,10 @@ INT WINAPI LCMapStringEx(LPCWSTR name, DWORD flags, LPCWSTR src, INT srclen, LPW * U+30A1 ... U+30F3: Katakana * U+30F5: Katakana Letter Small KA * U+30FD: Katakana Iteration Mark + * U+30FE: Katakana Voiced Iteration Mark */ WCHAR wch = *dst_ptr; - if ((0x30A1 <= wch && wch <= 0x30F3) || wch == 0x30F5 || wch == 0x30FD) + if ((0x30A1 <= wch && wch <= 0x30F3) || wch == 0x30F5 || wch == 0x30FD || wch == 0x30FE) *dst_ptr = wch - 0x60; /* Katanaka to Hiragana */ } }
1 year, 9 months
1
0
0
0
[reactos] 01/01: [NTOS:KD] Use local print-like functions for output, instead of the kernel-internal KdpDprintf.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=412037a2e286585f36db2…
commit 412037a2e286585f36db223ed6523d8035cca2d3 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Tue Mar 28 01:33:55 2023 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Tue Mar 28 02:42:53 2023 +0200 [NTOS:KD] Use local print-like functions for output, instead of the kernel-internal KdpDprintf. Indeed, the latter won't be accessible once those KD IO functions get moved out into a separate KDTERM.DLL. --- ntoskrnl/kd/kd.h | 16 +++++++-- ntoskrnl/kd/kdio.c | 87 ++++++++++++++++++++++++++++++++++++------------- ntoskrnl/kdbg/kdb_cli.c | 2 +- 3 files changed, 79 insertions(+), 26 deletions(-) diff --git a/ntoskrnl/kd/kd.h b/ntoskrnl/kd/kd.h index 5672408d4c6..4440b183626 100644 --- a/ntoskrnl/kd/kd.h +++ b/ntoskrnl/kd/kd.h @@ -13,9 +13,19 @@ NTSTATUS typedef VOID (NTAPI *PKDP_PRINT_ROUTINE)( - PCHAR String, - ULONG Length -); + _In_ PCCH String, + _In_ ULONG Length); + +VOID +KdIoPuts( + _In_ PCSTR String); + +VOID +__cdecl +KdIoPrintf( + _In_ PCSTR Format, + ...); + /* INIT ROUTINES *************************************************************/ diff --git a/ntoskrnl/kd/kdio.c b/ntoskrnl/kd/kdio.c index f74106049a7..c8087e991ae 100644 --- a/ntoskrnl/kd/kdio.c +++ b/ntoskrnl/kd/kdio.c @@ -151,8 +151,9 @@ KdpLoggerThread(PVOID Context) static VOID NTAPI -KdpPrintToLogFile(PCHAR String, - ULONG Length) +KdpPrintToLogFile( + _In_ PCCH String, + _In_ ULONG Length) { KIRQL OldIrql; ULONG beg, end, num; @@ -359,10 +360,11 @@ Failure: static VOID NTAPI -KdpSerialPrint(PCHAR String, - ULONG Length) +KdpSerialPrint( + _In_ PCCH String, + _In_ ULONG Length) { - PCHAR pch = String; + PCCH pch = String; KIRQL OldIrql; /* Acquire the printing spinlock without waiting at raised IRQL */ @@ -376,7 +378,7 @@ KdpSerialPrint(PCHAR String, KdPortPutByteEx(&SerialPortInfo, '\r'); } KdPortPutByteEx(&SerialPortInfo, *pch); - pch++; + ++pch; } /* Release the spinlock */ @@ -456,10 +458,11 @@ KdpScreenRelease(VOID) static VOID NTAPI -KdpScreenPrint(PCHAR String, - ULONG Length) +KdpScreenPrint( + _In_ PCCH String, + _In_ ULONG Length) { - PCHAR pch = String; + PCCH pch = String; while (pch < String + Length && *pch) { @@ -538,6 +541,57 @@ KdpScreenInit( /* GENERAL FUNCTIONS *********************************************************/ +static VOID +KdIoPrintString( + _In_ PCCH String, + _In_ ULONG Length) +{ + PLIST_ENTRY CurrentEntry; + PKD_DISPATCH_TABLE CurrentTable; + + /* Call the registered providers */ + for (CurrentEntry = KdProviders.Flink; + CurrentEntry != &KdProviders; + CurrentEntry = CurrentEntry->Flink) + { + CurrentTable = CONTAINING_RECORD(CurrentEntry, + KD_DISPATCH_TABLE, + KdProvidersList); + + CurrentTable->KdpPrintRoutine(String, Length); + } +} + +VOID +KdIoPuts( + _In_ PCSTR String) +{ + KdIoPrintString(String, (ULONG)strlen(String)); +} + +VOID +__cdecl +KdIoPrintf( + _In_ PCSTR Format, + ...) +{ + va_list ap; + ULONG Length; + CHAR Buffer[512]; + + /* Format the string */ + va_start(ap, Format); + Length = (ULONG)_vsnprintf(Buffer, + sizeof(Buffer), + Format, + ap); + va_end(ap); + + /* Send it to the display providers */ + KdIoPrintString(Buffer, Length); +} + + extern STRING KdbPromptString; VOID @@ -551,8 +605,6 @@ KdSendPacket( if (PacketType == PACKET_TYPE_KD_DEBUG_IO) { ULONG ApiNumber = ((PDBGKD_DEBUG_IO)MessageHeader->Buffer)->ApiNumber; - PLIST_ENTRY CurrentEntry; - PKD_DISPATCH_TABLE CurrentTable; /* Validate API call */ if (MessageHeader->Length != sizeof(DBGKD_DEBUG_IO)) @@ -572,17 +624,8 @@ KdSendPacket( if (!KdpDebugMode.Value) return; - /* Call the registered providers */ - for (CurrentEntry = KdProviders.Flink; - CurrentEntry != &KdProviders; - CurrentEntry = CurrentEntry->Flink) - { - CurrentTable = CONTAINING_RECORD(CurrentEntry, - KD_DISPATCH_TABLE, - KdProvidersList); - - CurrentTable->KdpPrintRoutine(MessageData->Buffer, MessageData->Length); - } + /* Print the string proper */ + KdIoPrintString(MessageData->Buffer, MessageData->Length); return; } else if (PacketType == PACKET_TYPE_KD_STATE_CHANGE64) diff --git a/ntoskrnl/kdbg/kdb_cli.c b/ntoskrnl/kdbg/kdb_cli.c index b50d18b692f..bbfca348fe2 100644 --- a/ntoskrnl/kdbg/kdb_cli.c +++ b/ntoskrnl/kdbg/kdb_cli.c @@ -3781,7 +3781,7 @@ KdbpCliInit(VOID) static VOID NTAPI KdbDebugPrint( - _In_ PCHAR String, + _In_ PCCH String, _In_ ULONG Length) { KIRQL OldIrql;
1 year, 9 months
1
0
0
0
[reactos] 01/01: [KERNEL32] LCMapString: Hiragana/Katakana conversion (#5200)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5d1ae45b83642312c4624…
commit 5d1ae45b83642312c4624198d1baeaac914eb848 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Mar 28 08:37:17 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Mar 28 08:37:17 2023 +0900 [KERNEL32] LCMapString: Hiragana/Katakana conversion (#5200) Implement LCMAP_KATAKANA and LCMAP_HIRAGANA flags. CORE-11700 --- dll/win32/kernel32/winnls/string/lang.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/dll/win32/kernel32/winnls/string/lang.c b/dll/win32/kernel32/winnls/string/lang.c index 4841e7a9d57..c976310596a 100644 --- a/dll/win32/kernel32/winnls/string/lang.c +++ b/dll/win32/kernel32/winnls/string/lang.c @@ -2008,6 +2008,39 @@ INT WINAPI LCMapStringEx(LPCWSTR name, DWORD flags, LPCWSTR src, INT srclen, LPW } } +#ifdef __REACTOS__ + if (flags & LCMAP_KATAKANA) + { + INT convlen = dst_ptr - dst; + for (dst_ptr = dst; convlen; --convlen, ++dst_ptr) + { + /* + * U+3041 ... U+3093: Hiragana + * U+3095: Hiragana Letter Small KA + * U+309D: Hiragana Iteration Mark + */ + WCHAR wch = *dst_ptr; + if ((0x3041 <= wch && wch <= 0x3093) || wch == 0x3095 || wch == 0x309D) + *dst_ptr = wch + 0x60; /* Hiragana to Katanaka */ + } + } + else if (flags & LCMAP_HIRAGANA) + { + INT convlen = dst_ptr - dst; + for (dst_ptr = dst; convlen; --convlen, ++dst_ptr) + { + /* + * U+30A1 ... U+30F3: Katakana + * U+30F5: Katakana Letter Small KA + * U+30FD: Katakana Iteration Mark + */ + WCHAR wch = *dst_ptr; + if ((0x30A1 <= wch && wch <= 0x30F3) || wch == 0x30F5 || wch == 0x30FD) + *dst_ptr = wch - 0x60; /* Katanaka to Hiragana */ + } + } +#endif + if (srclen) { SetLastError(ERROR_INSUFFICIENT_BUFFER);
1 year, 9 months
1
0
0
0
[reactos] 01/01: [BLUE] Optimize ScrIoControl for speed (#5185)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3526ffc094277e03d1a01…
commit 3526ffc094277e03d1a01435036bfb089806b88d Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Mar 28 08:12:38 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Mar 28 08:12:38 2023 +0900 [BLUE] Optimize ScrIoControl for speed (#5185) Optimize IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE and IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER for speed by using cache. CORE-18838 --- drivers/setup/blue/blue.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/setup/blue/blue.c b/drivers/setup/blue/blue.c index 81011fe10cc..06e498d8208 100644 --- a/drivers/setup/blue/blue.c +++ b/drivers/setup/blue/blue.c @@ -1073,6 +1073,8 @@ ScrIoControl( if (DeviceExtension->Enabled && DeviceExtension->VideoMemory) { + UCHAR attr = Buf->wAttribute; + vidmem = DeviceExtension->VideoMemory; offset = (Buf->dwCoord.X + Buf->dwCoord.Y * DeviceExtension->Columns) * 2 + 1; @@ -1082,7 +1084,7 @@ ScrIoControl( for (dwCount = 0; dwCount < nMaxLength; dwCount++) { - vidmem[offset + (dwCount * 2)] = (char)Buf->wAttribute; + vidmem[offset + (dwCount * 2)] = attr; } Buf->dwTransfered = dwCount; } @@ -1271,6 +1273,8 @@ ScrIoControl( if (DeviceExtension->Enabled && DeviceExtension->VideoMemory) { + UCHAR ch = Buf->cCharacter; + vidmem = DeviceExtension->VideoMemory; offset = (Buf->dwCoord.X + Buf->dwCoord.Y * DeviceExtension->Columns) * 2; @@ -1280,7 +1284,7 @@ ScrIoControl( for (dwCount = 0; dwCount < nMaxLength; dwCount++) { - vidmem[offset + (dwCount * 2)] = (char)Buf->cCharacter; + vidmem[offset + (dwCount * 2)] = ch; } Buf->dwTransfered = dwCount; }
1 year, 9 months
1
0
0
0
[reactos] 04/04: [NTOS:KDBG] Move command history management in a separate file. Simplify duplicated code in KdbpReadCommand.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6084da8c848839a1dc1a7…
commit 6084da8c848839a1dc1a7384d02672c687b55429 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Mon Mar 27 22:40:09 2023 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Mar 27 23:31:34 2023 +0200 [NTOS:KDBG] Move command history management in a separate file. Simplify duplicated code in KdbpReadCommand. --- ntoskrnl/kdbg/kdb.h | 9 +++ ntoskrnl/kdbg/kdb_cli.c | 140 +++----------------------------------- ntoskrnl/kdbg/kdb_cmdhist.c | 162 ++++++++++++++++++++++++++++++++++++++++++++ ntoskrnl/ntos.cmake | 1 + 4 files changed, 182 insertions(+), 130 deletions(-) diff --git a/ntoskrnl/kdbg/kdb.h b/ntoskrnl/kdbg/kdb.h index cd7a0b5bec6..ac3f8b13004 100644 --- a/ntoskrnl/kdbg/kdb.h +++ b/ntoskrnl/kdbg/kdb.h @@ -104,6 +104,15 @@ KdbpCliMainLoop( VOID KdbpCliInterpretInitFile(VOID); +VOID +KdbpCommandHistoryAppend( + _In_ PCSTR Command); + +PCSTR +KdbGetHistoryEntry( + _Inout_ PLONG NextIndex, + _In_ BOOLEAN Next); + SIZE_T KdbpReadCommand( _Out_ PCHAR Buffer, diff --git a/ntoskrnl/kdbg/kdb_cli.c b/ntoskrnl/kdbg/kdb_cli.c index f114a862958..b50d18b692f 100644 --- a/ntoskrnl/kdbg/kdb_cli.c +++ b/ntoskrnl/kdbg/kdb_cli.c @@ -140,11 +140,6 @@ static PKDBG_CLI_ROUTINE KdbCliCallbacks[10]; static BOOLEAN KdbUseIntelSyntax = FALSE; /* Set to TRUE for intel syntax */ static BOOLEAN KdbBreakOnModuleLoad = FALSE; /* Set to TRUE to break into KDB when a module is loaded */ -static CHAR KdbCommandHistoryBuffer[2048]; /* Command history string ringbuffer */ -static PCHAR KdbCommandHistory[sizeof(KdbCommandHistoryBuffer) / 8] = { NULL }; /* Command history ringbuffer */ -static LONG KdbCommandHistoryBufferIndex = 0; -static LONG KdbCommandHistoryIndex = 0; - static ULONG KdbNumberOfRowsPrinted = 0; static ULONG KdbNumberOfColsPrinted = 0; static BOOLEAN KdbOutputAborted = FALSE; @@ -3262,77 +3257,6 @@ KdbpPrintUnicodeString( } -/*!\brief Appends a command to the command history - * - * \param Command Pointer to the command to append to the history. - */ -static VOID -KdbpCommandHistoryAppend( - IN PCHAR Command) -{ - SIZE_T Length1 = strlen(Command) + 1; - SIZE_T Length2 = 0; - INT i; - PCHAR Buffer; - - ASSERT(Length1 <= RTL_NUMBER_OF(KdbCommandHistoryBuffer)); - - if (Length1 <= 1 || - (KdbCommandHistory[KdbCommandHistoryIndex] && - strcmp(KdbCommandHistory[KdbCommandHistoryIndex], Command) == 0)) - { - return; - } - - /* Calculate Length1 and Length2 */ - Buffer = KdbCommandHistoryBuffer + KdbCommandHistoryBufferIndex; - KdbCommandHistoryBufferIndex += Length1; - if (KdbCommandHistoryBufferIndex >= (LONG)RTL_NUMBER_OF(KdbCommandHistoryBuffer)) - { - KdbCommandHistoryBufferIndex -= RTL_NUMBER_OF(KdbCommandHistoryBuffer); - Length2 = KdbCommandHistoryBufferIndex; - Length1 -= Length2; - } - - /* Remove previous commands until there is enough space to append the new command */ - for (i = KdbCommandHistoryIndex; KdbCommandHistory[i];) - { - if ((Length2 > 0 && - (KdbCommandHistory[i] >= Buffer || - KdbCommandHistory[i] < (KdbCommandHistoryBuffer + KdbCommandHistoryBufferIndex))) || - (Length2 <= 0 && - (KdbCommandHistory[i] >= Buffer && - KdbCommandHistory[i] < (KdbCommandHistoryBuffer + KdbCommandHistoryBufferIndex)))) - { - KdbCommandHistory[i] = NULL; - } - - i--; - if (i < 0) - i = RTL_NUMBER_OF(KdbCommandHistory) - 1; - - if (i == KdbCommandHistoryIndex) - break; - } - - /* Make sure the new command history entry is free */ - KdbCommandHistoryIndex++; - KdbCommandHistoryIndex %= RTL_NUMBER_OF(KdbCommandHistory); - if (KdbCommandHistory[KdbCommandHistoryIndex]) - { - KdbCommandHistory[KdbCommandHistoryIndex] = NULL; - } - - /* Append command */ - KdbCommandHistory[KdbCommandHistoryIndex] = Buffer; - ASSERT((KdbCommandHistory[KdbCommandHistoryIndex] + Length1) <= KdbCommandHistoryBuffer + RTL_NUMBER_OF(KdbCommandHistoryBuffer)); - memcpy(KdbCommandHistory[KdbCommandHistoryIndex], Command, Length1); - if (Length2 > 0) - { - memcpy(KdbCommandHistoryBuffer, Command + Length1, Length2); - } -} - /** * @brief Reads a line of user input from the terminal. * @@ -3358,8 +3282,7 @@ KdbpReadCommand( BOOLEAN EchoOn; static CHAR LastCommand[1024]; static CHAR NextKey = '\0'; - INT CmdHistIndex = -1; - INT_PTR i; + LONG CmdHistIndex = -1; // Start at end of history. /* Bail out if the buffer is zero-sized */ if (Size == 0) @@ -3445,6 +3368,7 @@ KdbpReadCommand( } else if (Key == KEY_BS || Key == KEY_DEL) { + /* Erase the last character */ if (Buffer > Orig) { Buffer--; @@ -3456,29 +3380,15 @@ KdbpReadCommand( KdpDprintf(" %c", KEY_BS); } } - else if (ScanCode == KEY_SCAN_UP) + else if (ScanCode == KEY_SCAN_UP || ScanCode == KEY_SCAN_DOWN) { - BOOLEAN Print = TRUE; - - if (CmdHistIndex < 0) + PCSTR CmdHistory = KdbGetHistoryEntry(&CmdHistIndex, + (ScanCode == KEY_SCAN_DOWN)); + if (CmdHistory) { - CmdHistIndex = KdbCommandHistoryIndex; - } - else - { - i = CmdHistIndex - 1; - - if (i < 0) - CmdHistIndex = RTL_NUMBER_OF(KdbCommandHistory) - 1; - - if (KdbCommandHistory[i] && i != KdbCommandHistoryIndex) - CmdHistIndex = i; - else - Print = FALSE; - } + SIZE_T i; - if (Print && KdbCommandHistory[CmdHistIndex]) - { + /* Erase the whole line */ while (Buffer > Orig) { Buffer--; @@ -3490,43 +3400,13 @@ KdbpReadCommand( KdpDprintf(" %c", KEY_BS); } - i = min(strlen(KdbCommandHistory[CmdHistIndex]), Size - 1); - memcpy(Orig, KdbCommandHistory[CmdHistIndex], i); + i = min(strlen(CmdHistory), Size - 1); + memcpy(Orig, CmdHistory, i); Orig[i] = '\0'; Buffer = Orig + i; KdpDprintf("%s", Orig); } } - else if (ScanCode == KEY_SCAN_DOWN) - { - if (CmdHistIndex > 0 && CmdHistIndex != KdbCommandHistoryIndex) - { - i = CmdHistIndex + 1; - if (i >= (INT)RTL_NUMBER_OF(KdbCommandHistory)) - i = 0; - - if (KdbCommandHistory[i]) - { - CmdHistIndex = i; - while (Buffer > Orig) - { - Buffer--; - *Buffer = '\0'; - - if (EchoOn) - KdpDprintf("%c %c", KEY_BS, KEY_BS); - else - KdpDprintf(" %c", KEY_BS); - } - - i = min(strlen(KdbCommandHistory[CmdHistIndex]), Size - 1); - memcpy(Orig, KdbCommandHistory[CmdHistIndex], i); - Orig[i] = '\0'; - Buffer = Orig + i; - KdpDprintf("%s", Orig); - } - } - } else { /* Don't accept any key if the buffer is full */ diff --git a/ntoskrnl/kdbg/kdb_cmdhist.c b/ntoskrnl/kdbg/kdb_cmdhist.c new file mode 100644 index 00000000000..c1f1fcb1eae --- /dev/null +++ b/ntoskrnl/kdbg/kdb_cmdhist.c @@ -0,0 +1,162 @@ +/* + * PROJECT: ReactOS KDBG Kernel Debugger + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Command History helpers + * COPYRIGHT: Copyright 2005 Gregor Anich <blight(a)blight.eu.org> + * Copyright 2023 Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> + */ + +/* INCLUDES ******************************************************************/ + +#include <ntoskrnl.h> + +/* GLOBALS *******************************************************************/ + +/** + * History range in ring buffer: + * (KdbCommandHistoryIndex; RTL_NUMBER_OF(KdbCommandHistory) - 1] + * and [0; KdbCommandHistoryIndex]. + **/ + +/* Command history string ring buffer */ +static CHAR KdbCommandHistoryBuffer[2048]; +/* Command history ring buffer */ +static PCHAR KdbCommandHistory[sizeof(KdbCommandHistoryBuffer) / 8] = { NULL }; +static LONG KdbCommandHistoryBufferIndex = 0; +static LONG KdbCommandHistoryIndex = 0; + +/* FUNCTIONS *****************************************************************/ + +/** + * @brief Appends a command to the command history. + * + * @param[in] Command + * Pointer to the command to append to the history. + **/ +VOID +KdbpCommandHistoryAppend( + _In_ PCSTR Command) +{ + SIZE_T Length1 = strlen(Command) + 1; + SIZE_T Length2 = 0; + LONG i; + PCHAR Buffer; + + ASSERT(Length1 <= RTL_NUMBER_OF(KdbCommandHistoryBuffer)); + + /* + * Do not append the string if: + * - it is empty (just the NULL terminator); + * - or the last command is the same. + */ + if (Length1 <= 1 || + (KdbCommandHistory[KdbCommandHistoryIndex] && + strcmp(KdbCommandHistory[KdbCommandHistoryIndex], Command) == 0)) + { + return; + } + + /* Calculate Length1 and Length2 */ + Buffer = KdbCommandHistoryBuffer + KdbCommandHistoryBufferIndex; + KdbCommandHistoryBufferIndex += Length1; + if (KdbCommandHistoryBufferIndex >= (LONG)RTL_NUMBER_OF(KdbCommandHistoryBuffer)) + { + KdbCommandHistoryBufferIndex -= RTL_NUMBER_OF(KdbCommandHistoryBuffer); + Length2 = KdbCommandHistoryBufferIndex; + Length1 -= Length2; + } + + /* Remove previous commands until there is enough space to append the new command */ + for (i = KdbCommandHistoryIndex; KdbCommandHistory[i];) + { + if ((Length2 > 0 && + (KdbCommandHistory[i] >= Buffer || + KdbCommandHistory[i] < (KdbCommandHistoryBuffer + KdbCommandHistoryBufferIndex))) || + (Length2 <= 0 && + (KdbCommandHistory[i] >= Buffer && + KdbCommandHistory[i] < (KdbCommandHistoryBuffer + KdbCommandHistoryBufferIndex)))) + { + KdbCommandHistory[i] = NULL; + } + + i--; + if (i < 0) + i = RTL_NUMBER_OF(KdbCommandHistory) - 1; + + if (i == KdbCommandHistoryIndex) + break; + } + + /* Make sure the new command history entry is free */ + KdbCommandHistoryIndex++; + KdbCommandHistoryIndex %= RTL_NUMBER_OF(KdbCommandHistory); + if (KdbCommandHistory[KdbCommandHistoryIndex]) + { + KdbCommandHistory[KdbCommandHistoryIndex] = NULL; + } + + /* Append command */ + KdbCommandHistory[KdbCommandHistoryIndex] = Buffer; + ASSERT((KdbCommandHistory[KdbCommandHistoryIndex] + Length1) <= KdbCommandHistoryBuffer + RTL_NUMBER_OF(KdbCommandHistoryBuffer)); + memcpy(KdbCommandHistory[KdbCommandHistoryIndex], Command, Length1); + if (Length2 > 0) + { + memcpy(KdbCommandHistoryBuffer, Command + Length1, Length2); + } +} + +static PCSTR +KdbpGetPrevHistoryEntry( + _Inout_ PLONG NextIndex) +{ + if (*NextIndex < 0) + { + /* Start at the end of the history */ + *NextIndex = KdbCommandHistoryIndex; + } + else + { + LONG i = *NextIndex - 1; + if (i < 0) + *NextIndex = RTL_NUMBER_OF(KdbCommandHistory) - 1; + + if (KdbCommandHistory[i] && i != KdbCommandHistoryIndex) + *NextIndex = i; + else + return NULL; + } + + return KdbCommandHistory[*NextIndex]; +} + +static PCSTR +KdbpGetNextHistoryEntry( + _Inout_ PLONG NextIndex) +{ + LONG i; + + if (!(*NextIndex > 0 && *NextIndex != KdbCommandHistoryIndex)) + return NULL; + + i = *NextIndex + 1; + if (i >= (LONG)RTL_NUMBER_OF(KdbCommandHistory)) + i = 0; + + if (KdbCommandHistory[i]) + *NextIndex = i; + + return KdbCommandHistory[i]; +} + +PCSTR +KdbGetHistoryEntry( + _Inout_ PLONG NextIndex, + _In_ BOOLEAN Next) +{ + if (Next) + return KdbpGetNextHistoryEntry(NextIndex); + else + return KdbpGetPrevHistoryEntry(NextIndex); +} + +/* EOF */ diff --git a/ntoskrnl/ntos.cmake b/ntoskrnl/ntos.cmake index 6816452fab4..648de8faf6b 100644 --- a/ntoskrnl/ntos.cmake +++ b/ntoskrnl/ntos.cmake @@ -405,6 +405,7 @@ if(NOT _WINKD_) list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/kdb.c ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/kdb_cli.c + ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/kdb_cmdhist.c ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/kdb_expr.c ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/kdb_symbols.c) endif()
1 year, 9 months
1
0
0
0
[reactos] 03/04: [NTOS:KD] Split internal/kd.h into a part shared in the whole kernel and a private part only used within ntoskrnl/kd.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eb02a852144c89f82b236…
commit eb02a852144c89f82b236b29160408edb6002230 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Mon Mar 27 23:13:53 2023 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Mar 27 23:31:34 2023 +0200 [NTOS:KD] Split internal/kd.h into a part shared in the whole kernel and a private part only used within ntoskrnl/kd. --- ntoskrnl/include/internal/kd.h | 116 +-------------------------------- ntoskrnl/{include/internal => kd}/kd.h | 71 ++------------------ ntoskrnl/kd/kdmain.c | 4 -- ntoskrnl/kdbg/kdb.h | 2 +- 4 files changed, 8 insertions(+), 185 deletions(-) diff --git a/ntoskrnl/include/internal/kd.h b/ntoskrnl/include/internal/kd.h index 64b83e7a168..a180acf5478 100644 --- a/ntoskrnl/include/internal/kd.h +++ b/ntoskrnl/include/internal/kd.h @@ -5,7 +5,6 @@ // // Kernel Debugger Port Definition // -struct _KD_DISPATCH_TABLE; BOOLEAN NTAPI @@ -29,7 +28,7 @@ KdPortPutByteEx( #ifdef _NTOSKRNL_ -/* KD ROUTINES ***************************************************************/ +/* KD GLOBALS ****************************************************************/ typedef enum _KD_CONTINUE_TYPE { @@ -38,94 +37,6 @@ typedef enum _KD_CONTINUE_TYPE kdHandleException } KD_CONTINUE_TYPE; -typedef -NTSTATUS -(NTAPI *PKDP_INIT_ROUTINE)( - _In_ struct _KD_DISPATCH_TABLE *DispatchTable, - _In_ ULONG BootPhase); - -typedef -VOID -(NTAPI*PKDP_PRINT_ROUTINE)( - PCHAR String, - ULONG Length -); - -/* INIT ROUTINES *************************************************************/ - -KIRQL -NTAPI -KdbpAcquireLock( - _In_ PKSPIN_LOCK SpinLock); - -VOID -NTAPI -KdbpReleaseLock( - _In_ PKSPIN_LOCK SpinLock, - _In_ KIRQL OldIrql); - -VOID -KdpScreenAcquire(VOID); - -VOID -KdpScreenRelease(VOID); - -NTSTATUS -NTAPI -KdpScreenInit( - _In_ struct _KD_DISPATCH_TABLE *DispatchTable, - _In_ ULONG BootPhase); - -NTSTATUS -NTAPI -KdpSerialInit( - _In_ struct _KD_DISPATCH_TABLE *DispatchTable, - _In_ ULONG BootPhase); - -NTSTATUS -NTAPI -KdpDebugLogInit( - _In_ struct _KD_DISPATCH_TABLE *DispatchTable, - _In_ ULONG BootPhase); - -#ifdef KDBG -#define KdpKdbgInit KdbInitialize -#endif - - -/* KD GLOBALS ***************************************************************/ - -/* Serial debug connection */ -#define DEFAULT_DEBUG_PORT 2 /* COM2 */ -#define DEFAULT_DEBUG_COM1_IRQ 4 /* COM1 IRQ */ -#define DEFAULT_DEBUG_COM2_IRQ 3 /* COM2 IRQ */ -#define DEFAULT_DEBUG_BAUD_RATE 115200 /* 115200 Baud */ - -/* KD Native Modes */ -#define KdScreen 0 -#define KdSerial 1 -#define KdFile 2 -#define KdKdbg 3 -#define KdMax 4 - -/* KD Private Debug Modes */ -typedef struct _KDP_DEBUG_MODE -{ - union - { - struct - { - /* Native Modes */ - UCHAR Screen :1; - UCHAR Serial :1; - UCHAR File :1; - }; - - /* Generic Value */ - ULONG Value; - }; -} KDP_DEBUG_MODE; - /* KD Internal Debug Services */ typedef enum _KDP_DEBUG_SERVICE { @@ -143,31 +54,6 @@ typedef enum _KDP_DEBUG_SERVICE ThatsWhatSheSaid = 69 /* FIGURE IT OUT */ } KDP_DEBUG_SERVICE; -/* Dispatch Table for Wrapper Functions */ -typedef struct _KD_DISPATCH_TABLE -{ - LIST_ENTRY KdProvidersList; - PKDP_INIT_ROUTINE KdpInitRoutine; - PKDP_PRINT_ROUTINE KdpPrintRoutine; - NTSTATUS InitStatus; -} KD_DISPATCH_TABLE, *PKD_DISPATCH_TABLE; - -/* The current Debugging Mode */ -extern KDP_DEBUG_MODE KdpDebugMode; - -/* Port Information for the Serial Native Mode */ -extern ULONG SerialPortNumber; -extern CPPORT SerialPortInfo; - -/* Init Functions for Native Providers */ -extern PKDP_INIT_ROUTINE InitRoutines[KdMax]; - -/* Dispatch Tables for Native Providers */ -extern KD_DISPATCH_TABLE DispatchTable[KdMax]; - -/* The KD Native Provider List */ -extern LIST_ENTRY KdProviders; - #endif // _NTOSKRNL_ #if DBG && defined(_M_IX86) && !defined(_WINKD_) // See ke/i386/traphdlr.c diff --git a/ntoskrnl/include/internal/kd.h b/ntoskrnl/kd/kd.h similarity index 60% copy from ntoskrnl/include/internal/kd.h copy to ntoskrnl/kd/kd.h index 64b83e7a168..5672408d4c6 100644 --- a/ntoskrnl/include/internal/kd.h +++ b/ntoskrnl/kd/kd.h @@ -1,42 +1,8 @@ #pragma once -#include <cportlib/cportlib.h> - -// -// Kernel Debugger Port Definition -// -struct _KD_DISPATCH_TABLE; - -BOOLEAN -NTAPI -KdPortInitializeEx( - PCPPORT PortInformation, - ULONG ComPortNumber -); - -BOOLEAN -NTAPI -KdPortGetByteEx( - PCPPORT PortInformation, - PUCHAR ByteReceived); - -VOID -NTAPI -KdPortPutByteEx( - PCPPORT PortInformation, - UCHAR ByteToSend -); - -#ifdef _NTOSKRNL_ - /* KD ROUTINES ***************************************************************/ -typedef enum _KD_CONTINUE_TYPE -{ - kdContinue = 0, - kdDoNotHandleException, - kdHandleException -} KD_CONTINUE_TYPE; +struct _KD_DISPATCH_TABLE; typedef NTSTATUS @@ -46,7 +12,7 @@ NTSTATUS typedef VOID -(NTAPI*PKDP_PRINT_ROUTINE)( +(NTAPI *PKDP_PRINT_ROUTINE)( PCHAR String, ULONG Length ); @@ -93,7 +59,7 @@ KdpDebugLogInit( #endif -/* KD GLOBALS ***************************************************************/ +/* KD GLOBALS ****************************************************************/ /* Serial debug connection */ #define DEFAULT_DEBUG_PORT 2 /* COM2 */ @@ -126,23 +92,6 @@ typedef struct _KDP_DEBUG_MODE }; } KDP_DEBUG_MODE; -/* KD Internal Debug Services */ -typedef enum _KDP_DEBUG_SERVICE -{ - DumpNonPagedPool = 0x1e, /* a */ - ManualBugCheck = 0x30, /* b */ - DumpNonPagedPoolStats = 0x2e, /* c */ - DumpNewNonPagedPool = 0x20, /* d */ - DumpNewNonPagedPoolStats = 0x12, /* e */ - DumpAllThreads = 0x21, /* f */ - DumpUserThreads = 0x22, /* g */ - KdSpare1 = 0x23, /* h */ - KdSpare2 = 0x17, /* i */ - KdSpare3 = 0x24, /* j */ - EnterDebugger = 0x25, /* k */ - ThatsWhatSheSaid = 69 /* FIGURE IT OUT */ -} KDP_DEBUG_SERVICE; - /* Dispatch Table for Wrapper Functions */ typedef struct _KD_DISPATCH_TABLE { @@ -159,6 +108,9 @@ extern KDP_DEBUG_MODE KdpDebugMode; extern ULONG SerialPortNumber; extern CPPORT SerialPortInfo; +/* Logging file path */ +extern ANSI_STRING KdpLogFileName; + /* Init Functions for Native Providers */ extern PKDP_INIT_ROUTINE InitRoutines[KdMax]; @@ -167,14 +119,3 @@ extern KD_DISPATCH_TABLE DispatchTable[KdMax]; /* The KD Native Provider List */ extern LIST_ENTRY KdProviders; - -#endif // _NTOSKRNL_ - -#if DBG && defined(_M_IX86) && !defined(_WINKD_) // See ke/i386/traphdlr.c -#define ID_Win32PreServiceHook 'WSH0' -#define ID_Win32PostServiceHook 'WSH1' -typedef void (NTAPI *PKDBG_PRESERVICEHOOK)(ULONG, PULONG_PTR); -typedef ULONG_PTR (NTAPI *PKDBG_POSTSERVICEHOOK)(ULONG, ULONG_PTR); -extern PKDBG_PRESERVICEHOOK KeWin32PreServiceHook; -extern PKDBG_POSTSERVICEHOOK KeWin32PostServiceHook; -#endif diff --git a/ntoskrnl/kd/kdmain.c b/ntoskrnl/kd/kdmain.c index 6281f43ab8f..77515b0bf3c 100644 --- a/ntoskrnl/kd/kdmain.c +++ b/ntoskrnl/kd/kdmain.c @@ -11,10 +11,6 @@ #define NDEBUG #include <debug.h> -/* VARIABLES ***************************************************************/ - -extern ANSI_STRING KdpLogFileName; - /* PUBLIC FUNCTIONS *********************************************************/ static PCHAR diff --git a/ntoskrnl/kdbg/kdb.h b/ntoskrnl/kdbg/kdb.h index 6a5027ec2e8..cd7a0b5bec6 100644 --- a/ntoskrnl/kdbg/kdb.h +++ b/ntoskrnl/kdbg/kdb.h @@ -1,5 +1,5 @@ #pragma once -#include "internal/kd.h" +#include "../kd/kd.h" /* TYPES *********************************************************************/
1 year, 9 months
1
0
0
0
[reactos] 02/04: [NTOS:KD] Update file headers.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bfd07a02f1872e1964c24…
commit bfd07a02f1872e1964c2420a0e12874cb0b11b0c Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Mar 26 01:32:33 2023 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Mar 27 23:31:33 2023 +0200 [NTOS:KD] Update file headers. --- ntoskrnl/kd/kdps2kbd.c | 20 ++++++++++---------- ntoskrnl/kd/kdserial.c | 19 ++++++++----------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/ntoskrnl/kd/kdps2kbd.c b/ntoskrnl/kd/kdps2kbd.c index 7b0164732ad..2f8f6661bd0 100644 --- a/ntoskrnl/kd/kdps2kbd.c +++ b/ntoskrnl/kd/kdps2kbd.c @@ -1,19 +1,19 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/kdbg/kdb_keyboard.c - * PURPOSE: Keyboard driver + * PROJECT: ReactOS KDBG Kernel Debugger Terminal Driver + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: PS/2 Keyboard driver + * COPYRIGHT: Copyright 2001 David Welch <welch(a)cwcom.net> + * Copyright 2004 Art Yerkes <ayerkes(a)speakeasy.net> + * Copyright 2005 Gregor Anich <blight(a)blight.eu.org> + * Copyright 2009-2011 Dmitry Gorbachev <gorbachev(a)reactos.org> * - * PROGRAMMERS: Victor Kirhenshtein (sauros(a)iname.com) - * Jason Filby (jasonfilby(a)yahoo.com) + * NOTE: Adapted from historic PS/2 keyboard driver authored by + * Victor Kirhenshtein <sauros(a)iname.com> and Jason Filby <jasonfilby(a)yahoo.com> */ -/* INCLUDES ****************************************************************/ +/* INCLUDES ******************************************************************/ #include <ntoskrnl.h> -#define NDEBUG -#include <debug.h> - #define KBD_STATUS_REG 0x64 #define KBD_CNTL_REG 0x64 diff --git a/ntoskrnl/kd/kdserial.c b/ntoskrnl/kd/kdserial.c index 38828065875..ff3ecf05274 100644 --- a/ntoskrnl/kd/kdserial.c +++ b/ntoskrnl/kd/kdserial.c @@ -1,19 +1,16 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/kdbg/kdb_serial.c - * PURPOSE: Serial driver - * - * PROGRAMMERS: Victor Kirhenshtein (sauros(a)iname.com) - * Jason Filby (jasonfilby(a)yahoo.com) - * arty + * PROJECT: ReactOS KDBG Kernel Debugger Terminal Driver + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Serial driver + * COPYRIGHT: Copyright 2004 Art Yerkes <ayerkes(a)speakeasy.net> + * Copyright 2005 Gregor Anich <blight(a)blight.eu.org> */ -/* INCLUDES ****************************************************************/ +/* INCLUDES ******************************************************************/ #include <ntoskrnl.h> -#define NDEBUG -#include <debug.h> + +/* FUNCTIONS *****************************************************************/ CHAR KdbpTryGetCharSerial(ULONG Retry)
1 year, 9 months
1
0
0
0
[reactos] 01/04: [NTOS:KD:KDBG] Move some files to a better place.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6fafe54f89649a654c2b6…
commit 6fafe54f89649a654c2b6b9737ae3387f645ea36 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Mar 26 01:28:59 2023 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Mar 27 23:31:28 2023 +0200 [NTOS:KD:KDBG] Move some files to a better place. --- ntoskrnl/include/internal/kd.h | 19 ------------------- ntoskrnl/kd/arm/{kdbg.c => kdserial.c} | 0 ntoskrnl/kd/i386/{kdbg.c => kdserial.c} | 0 ntoskrnl/{kdbg/kdb_keyboard.c => kd/kdps2kbd.c} | 0 ntoskrnl/{kdbg/kdb_serial.c => kd/kdserial.c} | 0 ntoskrnl/{kd => kdbg}/i386/kdmemsup.c | 3 --- ntoskrnl/kdbg/kdb.h | 16 ++++++++++++++++ ntoskrnl/ntos.cmake | 15 ++++++--------- 8 files changed, 22 insertions(+), 31 deletions(-) diff --git a/ntoskrnl/include/internal/kd.h b/ntoskrnl/include/internal/kd.h index 424ae89fe1f..64b83e7a168 100644 --- a/ntoskrnl/include/internal/kd.h +++ b/ntoskrnl/include/internal/kd.h @@ -93,25 +93,6 @@ KdpDebugLogInit( #endif -/* KD ROUTINES ***************************************************************/ - -BOOLEAN -NTAPI -KdpSafeReadMemory( - IN ULONG_PTR Addr, - IN LONG Len, - OUT PVOID Value -); - -BOOLEAN -NTAPI -KdpSafeWriteMemory( - IN ULONG_PTR Addr, - IN LONG Len, - IN ULONGLONG Value -); - - /* KD GLOBALS ***************************************************************/ /* Serial debug connection */ diff --git a/ntoskrnl/kd/arm/kdbg.c b/ntoskrnl/kd/arm/kdserial.c similarity index 100% rename from ntoskrnl/kd/arm/kdbg.c rename to ntoskrnl/kd/arm/kdserial.c diff --git a/ntoskrnl/kd/i386/kdbg.c b/ntoskrnl/kd/i386/kdserial.c similarity index 100% rename from ntoskrnl/kd/i386/kdbg.c rename to ntoskrnl/kd/i386/kdserial.c diff --git a/ntoskrnl/kdbg/kdb_keyboard.c b/ntoskrnl/kd/kdps2kbd.c similarity index 100% rename from ntoskrnl/kdbg/kdb_keyboard.c rename to ntoskrnl/kd/kdps2kbd.c diff --git a/ntoskrnl/kdbg/kdb_serial.c b/ntoskrnl/kd/kdserial.c similarity index 100% rename from ntoskrnl/kdbg/kdb_serial.c rename to ntoskrnl/kd/kdserial.c diff --git a/ntoskrnl/kd/i386/kdmemsup.c b/ntoskrnl/kdbg/i386/kdmemsup.c similarity index 98% rename from ntoskrnl/kd/i386/kdmemsup.c rename to ntoskrnl/kdbg/i386/kdmemsup.c index 20a5824deb2..86edb18663b 100644 --- a/ntoskrnl/kd/i386/kdmemsup.c +++ b/ntoskrnl/kdbg/i386/kdmemsup.c @@ -9,15 +9,12 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Kernel - * FILE: ntoskrnl/kd/i386/kdmemsup.c * PURPOSE: Kernel Debugger Safe Memory Support * * PROGRAMMERS: arty */ #include <ntoskrnl.h> -#define NDEBUG -#include <debug.h> #define HIGH_PHYS_MASK 0x80000000 #define PAGE_TABLE_MASK 0x3ff diff --git a/ntoskrnl/kdbg/kdb.h b/ntoskrnl/kdbg/kdb.h index 2ec084fbb13..6a5027ec2e8 100644 --- a/ntoskrnl/kdbg/kdb.h +++ b/ntoskrnl/kdbg/kdb.h @@ -259,6 +259,22 @@ KdbEnterDebuggerException(IN PEXCEPTION_RECORD64 ExceptionRecord, /* other functions */ +BOOLEAN +NTAPI +KdpSafeReadMemory( + IN ULONG_PTR Addr, + IN LONG Len, + OUT PVOID Value +); + +BOOLEAN +NTAPI +KdpSafeWriteMemory( + IN ULONG_PTR Addr, + IN LONG Len, + IN ULONGLONG Value +); + NTSTATUS KdbpSafeReadMemory(OUT PVOID Dest, IN PVOID Src, diff --git a/ntoskrnl/ntos.cmake b/ntoskrnl/ntos.cmake index 1bef231351f..6816452fab4 100644 --- a/ntoskrnl/ntos.cmake +++ b/ntoskrnl/ntos.cmake @@ -366,7 +366,6 @@ elseif(ARCH STREQUAL "arm") ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/trap.s) list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/config/arm/cmhardwr.c - ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/arm/kdbg.c ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/arm/kdarm.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/cpu.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/exp.c @@ -387,21 +386,19 @@ if(NOT _WINKD_) endif() if(ARCH STREQUAL "i386") - list(APPEND SOURCE - ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/i386/kdbg.c) + list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/i386/kdserial.c) if(KDBG) list(APPEND ASM_SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/i386/kdb_help.S) list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/i386/i386-dis.c) endif() elseif(ARCH STREQUAL "amd64") - list(APPEND SOURCE - ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/i386/kdbg.c) + list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/i386/kdserial.c) if(KDBG) list(APPEND ASM_SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/amd64/kdb_help.S) list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/i386/i386-dis.c) endif() elseif(ARCH STREQUAL "arm") - list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/arm/kdbg.c) + list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/arm/kdserial.c) endif() if(KDBG) @@ -409,14 +406,14 @@ if(NOT _WINKD_) ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/kdb.c ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/kdb_cli.c ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/kdb_expr.c - ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/kdb_keyboard.c - ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/kdb_serial.c ${REACTOS_SOURCE_DIR}/ntoskrnl/kdbg/kdb_symbols.c) endif() list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/kdio.c - ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/kdmain.c) + ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/kdmain.c + ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/kdps2kbd.c + ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/kdserial.c) else() add_definitions(-D_WINKD_)
1 year, 9 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Simplify OFNHookProc and FileExtFromFilter
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5c8d578a15e7e244c63a9…
commit 5c8d578a15e7e244c63a9aaf0272efc33578d70b Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Mar 22 10:42:21 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Mar 22 10:42:21 2023 +0900 [MSPAINT] Simplify OFNHookProc and FileExtFromFilter ... by using PathFindExtension and PathFindFileName. CORE-18867 --- base/applications/mspaint/main.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/base/applications/mspaint/main.cpp b/base/applications/mspaint/main.cpp index 1099f6af3f8..170610c7748 100644 --- a/base/applications/mspaint/main.cpp +++ b/base/applications/mspaint/main.cpp @@ -57,7 +57,7 @@ CTextEditWindow textEditWindow; // get file name extension from filter string static BOOL -FileExtFromFilter(LPTSTR pExt, LPCTSTR pTitle, OPENFILENAME *pOFN) +FileExtFromFilter(LPTSTR pExt, OPENFILENAME *pOFN) { LPTSTR pchExt = pExt; *pchExt = 0; @@ -96,19 +96,9 @@ OFNHookProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) hParent = GetParent(hwnd); TCHAR Path[MAX_PATH]; SendMessage(hParent, CDM_GETFILEPATH, _countof(Path), (LPARAM)Path); - LPTSTR pchTitle = _tcsrchr(Path, _T('\\')); - if (pchTitle == NULL) - pchTitle = _tcsrchr(Path, _T('/')); - - LPTSTR pch = _tcsrchr((pchTitle ? pchTitle : Path), _T('.')); - if (pch && pchTitle) - { - pchTitle++; - *pch = 0; - FileExtFromFilter(pch, pchTitle, pon->lpOFN); - SendMessage(hParent, CDM_SETCONTROLTEXT, 0x047c, (LPARAM)pchTitle); - lstrcpyn(pon->lpOFN->lpstrFile, Path, pon->lpOFN->nMaxFile); - } + FileExtFromFilter(PathFindExtension(Path), pon->lpOFN); + SendMessage(hParent, CDM_SETCONTROLTEXT, 0x047c, (LPARAM)PathFindFileName(Path)); + lstrcpyn(pon->lpOFN->lpstrFile, Path, pon->lpOFN->nMaxFile); } break; }
1 year, 9 months
1
0
0
0
← Newer
1
2
3
4
5
...
14
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Results per page:
10
25
50
100
200