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
2025
April
March
February
January
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
August 2018
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 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
32 participants
304 discussions
Start a n
N
ew thread
01/01: [SDK][CRT] Fix _ismbblead undefined error on MSVC
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0a8ade5dd40e4209f0559…
commit 0a8ade5dd40e4209f0559e1f9ce5e9d3ec9b6ccf Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Aug 27 10:12:55 2018 +0900 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Mon Aug 27 11:09:28 2018 +0200 [SDK][CRT] Fix _ismbblead undefined error on MSVC --- sdk/lib/crt/startup/crtexe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk/lib/crt/startup/crtexe.c b/sdk/lib/crt/startup/crtexe.c index 87da3dae39..fa20f4166e 100644 --- a/sdk/lib/crt/startup/crtexe.c +++ b/sdk/lib/crt/startup/crtexe.c @@ -20,6 +20,9 @@ #include <tchar.h> #include <sect_attribs.h> #include <locale.h> +#ifdef _MBCS +#include <mbstring.h> +#endif #ifndef __winitenv extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
6 years, 7 months
1
0
0
0
02/02: [TIMEOUT] Fix a typo.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d056eb05f2a4aa11bf16d…
commit d056eb05f2a4aa11bf16d5bdd40147513d80f187 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Mon Aug 27 00:25:48 2018 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Aug 27 00:28:10 2018 +0200 [TIMEOUT] Fix a typo. --- base/applications/cmdutils/timeout/timeout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/applications/cmdutils/timeout/timeout.c b/base/applications/cmdutils/timeout/timeout.c index 604014fe8b..129a0f1ac9 100644 --- a/base/applications/cmdutils/timeout/timeout.c +++ b/base/applications/cmdutils/timeout/timeout.c @@ -218,7 +218,7 @@ INT InputWait(BOOL bNoBreak, INT timerValue) break; } - /* Be sure there is someting in the console input queue */ + /* Be sure there is something in the console input queue */ if (!PeekConsoleInputW(hInput, InputRecords, ARRAYSIZE(InputRecords), &NumRecords)) { /* An error happened, bail out */
6 years, 7 months
1
0
0
0
01/02: [USETUP] Implement a basic console 'input queue' and implement PeekConsoleInput() and CONSOLE_ConInKeyPeek() around it.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6241a16f41abb94757909…
commit 6241a16f41abb947579092b1b206fac5e34164f7 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Mon Aug 27 00:22:07 2018 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Aug 27 00:28:08 2018 +0200 [USETUP] Implement a basic console 'input queue' and implement PeekConsoleInput() and CONSOLE_ConInKeyPeek() around it. --- base/setup/usetup/console.c | 162 ++++++++++++++++++++++++++++++++++++++------ base/setup/usetup/consup.c | 32 ++++++++- base/setup/usetup/consup.h | 4 ++ 3 files changed, 177 insertions(+), 21 deletions(-) diff --git a/base/setup/usetup/console.c b/base/setup/usetup/console.c index 1c35375dd6..14a0564c6b 100644 --- a/base/setup/usetup/console.c +++ b/base/setup/usetup/console.c @@ -34,6 +34,13 @@ #define NDEBUG #include <debug.h> +/* DATA **********************************************************************/ + +static BOOLEAN InputQueueEmpty; +static BOOLEAN WaitForInput; +static KEYBOARD_INPUT_DATA InputDataQueue; // Only one element! +static IO_STATUS_BLOCK InputIosb; + /* FUNCTIONS *****************************************************************/ BOOL @@ -76,6 +83,10 @@ AllocConsole(VOID) if (!NT_SUCCESS(Status)) return FALSE; + /* Reset the queue state */ + InputQueueEmpty = TRUE; + WaitForInput = FALSE; + return TRUE; } @@ -93,6 +104,10 @@ BOOL WINAPI FreeConsole(VOID) { + /* Reset the queue state */ + InputQueueEmpty = TRUE; + WaitForInput = FALSE; + if (StdInput != INVALID_HANDLE_VALUE) NtClose(StdInput); @@ -154,11 +169,20 @@ WINAPI FlushConsoleInputBuffer( IN HANDLE hConsoleInput) { + NTSTATUS Status; LARGE_INTEGER Offset, Timeout; IO_STATUS_BLOCK IoStatusBlock; KEYBOARD_INPUT_DATA InputData; - NTSTATUS Status; + /* Cancel any pending read */ + if (WaitForInput) + NtCancelIoFile(hConsoleInput, &IoStatusBlock); + + /* Reset the queue state */ + InputQueueEmpty = TRUE; + WaitForInput = FALSE; + + /* Flush the keyboard buffer */ do { Offset.QuadPart = 0; @@ -168,7 +192,7 @@ FlushConsoleInputBuffer( NULL, &IoStatusBlock, &InputData, - sizeof(KEYBOARD_INPUT_DATA), + sizeof(InputData), &Offset, NULL); if (Status == STATUS_PENDING) @@ -188,35 +212,135 @@ FlushConsoleInputBuffer( BOOL WINAPI -ReadConsoleInput( +PeekConsoleInput( IN HANDLE hConsoleInput, OUT PINPUT_RECORD lpBuffer, IN DWORD nLength, OUT LPDWORD lpNumberOfEventsRead) { - LARGE_INTEGER Offset; - IO_STATUS_BLOCK IoStatusBlock; - KEYBOARD_INPUT_DATA InputData; NTSTATUS Status; + LARGE_INTEGER Offset, Timeout; + KEYBOARD_INPUT_DATA InputData; - Offset.QuadPart = 0; - Status = NtReadFile(hConsoleInput, - NULL, - NULL, - NULL, - &IoStatusBlock, - &InputData, - sizeof(KEYBOARD_INPUT_DATA), - &Offset, - NULL); - if (Status == STATUS_PENDING) + if (InputQueueEmpty) { - Status = NtWaitForSingleObject(hConsoleInput, FALSE, NULL); - Status = IoStatusBlock.Status; + /* Read the keyboard for an event, without waiting */ + if (!WaitForInput) + { + Offset.QuadPart = 0; + Status = NtReadFile(hConsoleInput, + NULL, + NULL, + NULL, + &InputIosb, + &InputDataQueue, + sizeof(InputDataQueue), + &Offset, + NULL); + if (!NT_SUCCESS(Status)) + return FALSE; + if (Status == STATUS_PENDING) + { + /* No input yet, we will have to wait next time */ + *lpNumberOfEventsRead = 0; + WaitForInput = TRUE; + return TRUE; + } + } + else + { + /* + * We already tried to read from the keyboard and are + * waiting for data, check whether something showed up. + */ + Timeout.QuadPart = -100; // Wait just a little bit. + Status = NtWaitForSingleObject(hConsoleInput, FALSE, &Timeout); + if (Status == STATUS_TIMEOUT) + { + /* Nothing yet, continue waiting next time */ + *lpNumberOfEventsRead = 0; + WaitForInput = TRUE; + return TRUE; + } + WaitForInput = FALSE; + if (!NT_SUCCESS(Status)) + return FALSE; + } + + /* We got something in the queue */ + InputQueueEmpty = FALSE; + WaitForInput = FALSE; } + + /* Fetch from the queue but keep it inside */ + InputData = InputDataQueue; + + lpBuffer->EventType = KEY_EVENT; + Status = IntTranslateKey(hConsoleInput, &InputData, &lpBuffer->Event.KeyEvent); if (!NT_SUCCESS(Status)) return FALSE; + *lpNumberOfEventsRead = 1; + return TRUE; +} + + +BOOL +WINAPI +ReadConsoleInput( + IN HANDLE hConsoleInput, + OUT PINPUT_RECORD lpBuffer, + IN DWORD nLength, + OUT LPDWORD lpNumberOfEventsRead) +{ + NTSTATUS Status; + LARGE_INTEGER Offset; + KEYBOARD_INPUT_DATA InputData; + + if (InputQueueEmpty) + { + /* Read the keyboard and wait for an event, skipping the queue */ + if (!WaitForInput) + { + Offset.QuadPart = 0; + Status = NtReadFile(hConsoleInput, + NULL, + NULL, + NULL, + &InputIosb, + &InputDataQueue, + sizeof(InputDataQueue), + &Offset, + NULL); + if (Status == STATUS_PENDING) + { + /* Block and wait for input */ + WaitForInput = TRUE; + Status = NtWaitForSingleObject(hConsoleInput, FALSE, NULL); + WaitForInput = FALSE; + Status = InputIosb.Status; + } + if (!NT_SUCCESS(Status)) + return FALSE; + } + else + { + /* + * We already tried to read from the keyboard and are + * waiting for data, block and wait for input. + */ + Status = NtWaitForSingleObject(hConsoleInput, FALSE, NULL); + WaitForInput = FALSE; + Status = InputIosb.Status; + if (!NT_SUCCESS(Status)) + return FALSE; + } + } + + /* Fetch from the queue and empty it */ + InputData = InputDataQueue; + InputQueueEmpty = TRUE; + lpBuffer->EventType = KEY_EVENT; Status = IntTranslateKey(hConsoleInput, &InputData, &lpBuffer->Event.KeyEvent); if (!NT_SUCCESS(Status)) diff --git a/base/setup/usetup/consup.c b/base/setup/usetup/consup.c index 461cd7cbac..f559d04edb 100644 --- a/base/setup/usetup/consup.c +++ b/base/setup/usetup/consup.c @@ -66,11 +66,39 @@ CONSOLE_ConInKey( while (TRUE) { + /* Wait for a key press */ ReadConsoleInput(StdInput, Buffer, 1, &Read); - if ((Buffer->EventType == KEY_EVENT) - && (Buffer->Event.KeyEvent.bKeyDown != FALSE)) + if ((Buffer->EventType == KEY_EVENT) && + (Buffer->Event.KeyEvent.bKeyDown != FALSE)) + { break; + } + } +} + +BOOLEAN +CONSOLE_ConInKeyPeek( + OUT PINPUT_RECORD Buffer) +{ + DWORD Read = 0; + + while (TRUE) + { + /* Try to get a key press without blocking */ + if (!PeekConsoleInput(StdInput, Buffer, 1, &Read)) + return FALSE; + if (Read == 0) + return FALSE; + + /* Consume it */ + ReadConsoleInput(StdInput, Buffer, 1, &Read); + + if ((Buffer->EventType == KEY_EVENT) && + (Buffer->Event.KeyEvent.bKeyDown != FALSE)) + { + return TRUE; + } } } diff --git a/base/setup/usetup/consup.h b/base/setup/usetup/consup.h index e00ebcd098..dce5fa86aa 100644 --- a/base/setup/usetup/consup.h +++ b/base/setup/usetup/consup.h @@ -64,6 +64,10 @@ VOID CONSOLE_ConInKey( OUT PINPUT_RECORD Buffer); +BOOLEAN +CONSOLE_ConInKeyPeek( + OUT PINPUT_RECORD Buffer); + VOID CONSOLE_ConOutChar( IN CHAR c);
6 years, 7 months
1
0
0
0
03/03: [LSASRV] LsapLogonUser creates an impersonation token for a network logon
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fc2b4bc7ea10e5d458b19…
commit fc2b4bc7ea10e5d458b1920cb7c18650ae493afa Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon Aug 27 00:19:10 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon Aug 27 00:19:10 2018 +0200 [LSASRV] LsapLogonUser creates an impersonation token for a network logon --- dll/win32/lsasrv/authpackage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/lsasrv/authpackage.c b/dll/win32/lsasrv/authpackage.c index 7405e0904e..8eef860c41 100644 --- a/dll/win32/lsasrv/authpackage.c +++ b/dll/win32/lsasrv/authpackage.c @@ -1570,7 +1570,7 @@ LsapLogonUser(PLSA_API_MSG RequestMsg, Status = NtCreateToken(&TokenHandle, TOKEN_ALL_ACCESS, &ObjectAttributes, - TokenPrimary, + (RequestMsg->LogonUser.Request.LogonType == Network) ? TokenImpersonation : TokenPrimary, &RequestMsg->LogonUser.Reply.LogonId, &TokenInfo1->ExpirationTime, &TokenInfo1->User,
6 years, 7 months
1
0
0
0
02/03: [SAMSRV] Simplify the initialization of the account expiration time
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a7b52d6a44119ac6333e6…
commit a7b52d6a44119ac6333e64dcd4600edefad7af3b Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon Aug 27 00:12:44 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon Aug 27 00:12:44 2018 +0200 [SAMSRV] Simplify the initialization of the account expiration time --- dll/win32/samsrv/samrpc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dll/win32/samsrv/samrpc.c b/dll/win32/samsrv/samrpc.c index d5651b2236..2f3729d3eb 100644 --- a/dll/win32/samsrv/samrpc.c +++ b/dll/win32/samsrv/samrpc.c @@ -2512,10 +2512,10 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle, /* Store the fixed domain attributes */ Status = SampSetObjectAttribute(DomainObject, - L"F", - REG_BINARY, - &FixedDomainData, - ulSize); + L"F", + REG_BINARY, + &FixedDomainData, + ulSize); if (!NT_SUCCESS(Status)) { TRACE("failed with status 0x%08lx\n", Status); @@ -2557,8 +2557,7 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle, FixedUserData.LastLogon.QuadPart = 0; FixedUserData.LastLogoff.QuadPart = 0; FixedUserData.PasswordLastSet.QuadPart = 0; - FixedUserData.AccountExpires.LowPart = MAXULONG; - FixedUserData.AccountExpires.HighPart = MAXLONG; + FixedUserData.AccountExpires.QuadPart = MAXLONGLONG; FixedUserData.LastBadPasswordTime.QuadPart = 0; FixedUserData.UserId = ulRid; FixedUserData.PrimaryGroupId = DOMAIN_GROUP_RID_USERS;
6 years, 7 months
1
0
0
0
01/03: [SAMLIB] Add stubs for SamTestPrivateFunctionsDomain and SamTestPrivateFunctionsUser
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2fafcff3efa544e063e3a…
commit 2fafcff3efa544e063e3a6bd488ad87098ec035b Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon Aug 27 00:11:21 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon Aug 27 00:11:21 2018 +0200 [SAMLIB] Add stubs for SamTestPrivateFunctionsDomain and SamTestPrivateFunctionsUser --- dll/win32/samlib/samlib.c | 22 ++++++++++++++++++++++ dll/win32/samlib/samlib.spec | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/dll/win32/samlib/samlib.c b/dll/win32/samlib/samlib.c index b4dacd9e42..5c9b1da228 100644 --- a/dll/win32/samlib/samlib.c +++ b/dll/win32/samlib/samlib.c @@ -2267,4 +2267,26 @@ SamShutdownSamServer(IN SAM_HANDLE ServerHandle) return Status; } + +NTSTATUS +NTAPI +SamTestPrivateFunctionsDomain( + _In_ SAM_HANDLE DomainHandle) +{ + TRACE("SamTestPrivateFunctionsDomain(%p)\n", + DomainHandle); + return STATUS_NOT_IMPLEMENTED; +} + + +NTSTATUS +NTAPI +SamTestPrivateFunctionsUser( + _In_ SAM_HANDLE UserHandle) +{ + TRACE("SamTestPrivateFunctionsUser(%p)\n", + UserHandle); + return STATUS_NOT_IMPLEMENTED; +} + /* EOF */ diff --git a/dll/win32/samlib/samlib.spec b/dll/win32/samlib/samlib.spec index 4a4c21b131..2e9dab7ee4 100644 --- a/dll/win32/samlib/samlib.spec +++ b/dll/win32/samlib/samlib.spec @@ -50,8 +50,8 @@ @ stdcall SamSetMemberAttributesOfGroup(ptr long long) @ stdcall SamSetSecurityObject(ptr long ptr) @ stdcall SamShutdownSamServer(ptr) -@ stub SamTestPrivateFunctionsDomain -@ stub SamTestPrivateFunctionsUser +@ stdcall SamTestPrivateFunctionsDomain(ptr) +@ stdcall SamTestPrivateFunctionsUser(ptr) @ stub SamiChangeKeys @ stub SamiChangePasswordUser2 @ stub SamiChangePasswordUser3
6 years, 7 months
1
0
0
0
01/01: [NTOSKRNL] Properly reset pinning state on pinning failure
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b8e4af606a1291330ebdd…
commit b8e4af606a1291330ebddde58f167e60ac66299f Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Aug 26 22:56:25 2018 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Aug 26 22:56:25 2018 +0200 [NTOSKRNL] Properly reset pinning state on pinning failure --- ntoskrnl/cc/pin.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ntoskrnl/cc/pin.c b/ntoskrnl/cc/pin.c index 3a0ee6ed9d..65525eed83 100644 --- a/ntoskrnl/cc/pin.c +++ b/ntoskrnl/cc/pin.c @@ -191,6 +191,12 @@ CcPinMappedData ( Result = ExAcquireSharedStarveExclusive(&iBcb->Lock, BooleanFlagOn(Flags, PIN_WAIT)); } + if (!Result) + { + iBcb->Pinned = FALSE; + iBcb->Vacb->PinCount--; + } + return Result; }
6 years, 7 months
1
0
0
0
01/01: [NTOSKRNL] When acquiring BCB shared, starve exclusive waiters
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=54f89baad4f537c4d326c…
commit 54f89baad4f537c4d326c81fe81b49b6505f9a1d Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Aug 26 22:47:48 2018 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Aug 26 22:47:48 2018 +0200 [NTOSKRNL] When acquiring BCB shared, starve exclusive waiters --- ntoskrnl/cc/pin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntoskrnl/cc/pin.c b/ntoskrnl/cc/pin.c index 0eaf502305..3a0ee6ed9d 100644 --- a/ntoskrnl/cc/pin.c +++ b/ntoskrnl/cc/pin.c @@ -188,7 +188,7 @@ CcPinMappedData ( } else { - Result = ExAcquireResourceSharedLite(&iBcb->Lock, BooleanFlagOn(Flags, PIN_WAIT)); + Result = ExAcquireSharedStarveExclusive(&iBcb->Lock, BooleanFlagOn(Flags, PIN_WAIT)); } return Result;
6 years, 7 months
1
0
0
0
02/02: [NTOSKRNL] Handle the PIN_WAIT flag in CcPinMappedData()
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c1dd4c142f21d3584e2da…
commit c1dd4c142f21d3584e2dab979a141f3dac83f073 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Aug 26 22:04:46 2018 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Aug 26 22:05:11 2018 +0200 [NTOSKRNL] Handle the PIN_WAIT flag in CcPinMappedData() --- ntoskrnl/cc/pin.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ntoskrnl/cc/pin.c b/ntoskrnl/cc/pin.c index 8b99b8c210..0eaf502305 100644 --- a/ntoskrnl/cc/pin.c +++ b/ntoskrnl/cc/pin.c @@ -161,6 +161,7 @@ CcPinMappedData ( IN ULONG Flags, OUT PVOID * Bcb) { + BOOLEAN Result; PINTERNAL_BCB iBcb; PROS_SHARED_CACHE_MAP SharedCacheMap; @@ -181,16 +182,16 @@ CcPinMappedData ( iBcb->Pinned = TRUE; iBcb->Vacb->PinCount++; - if (Flags & PIN_EXCLUSIVE) + if (BooleanFlagOn(Flags, PIN_EXCLUSIVE)) { - ExAcquireResourceExclusiveLite(&iBcb->Lock, TRUE); + Result = ExAcquireResourceExclusiveLite(&iBcb->Lock, BooleanFlagOn(Flags, PIN_WAIT)); } else { - ExAcquireResourceSharedLite(&iBcb->Lock, TRUE); + Result = ExAcquireResourceSharedLite(&iBcb->Lock, BooleanFlagOn(Flags, PIN_WAIT)); } - return TRUE; + return Result; } /*
6 years, 7 months
1
0
0
0
01/02: [NTOSKRNL] Stubplement CcPinMappedData() and simplify CcPinRead()
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=469e15c7ae5d2b7dc266f…
commit 469e15c7ae5d2b7dc266fdde7beb173d8263d563 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Aug 26 21:49:05 2018 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Aug 26 22:05:11 2018 +0200 [NTOSKRNL] Stubplement CcPinMappedData() and simplify CcPinRead() It's based on the code that was in CcPinRead() implementation. This made no sense to have CcPinMappedData() doing nothing while implementing everything in CcPinRead(). Indeed, drivers (starting with MS drivers) can map data first and pin it afterwards with CcPinMappedData(). It was leading to incorrect behavior with our previous noop implementation. --- ntoskrnl/cc/pin.c | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/ntoskrnl/cc/pin.c b/ntoskrnl/cc/pin.c index 2d48a27a0a..8b99b8c210 100644 --- a/ntoskrnl/cc/pin.c +++ b/ntoskrnl/cc/pin.c @@ -161,6 +161,7 @@ CcPinMappedData ( IN ULONG Flags, OUT PVOID * Bcb) { + PINTERNAL_BCB iBcb; PROS_SHARED_CACHE_MAP SharedCacheMap; CCTRACE(CC_API_DEBUG, "FileOffset=%p FileOffset=%p Length=%lu Flags=0x%lx\n", @@ -174,7 +175,21 @@ CcPinMappedData ( ASSERT(SharedCacheMap); ASSERT(SharedCacheMap->PinAccess); - /* no-op for current implementation. */ + iBcb = *Bcb; + ASSERT(iBcb->Pinned == FALSE); + + iBcb->Pinned = TRUE; + iBcb->Vacb->PinCount++; + + if (Flags & PIN_EXCLUSIVE) + { + ExAcquireResourceExclusiveLite(&iBcb->Lock, TRUE); + } + else + { + ExAcquireResourceSharedLite(&iBcb->Lock, TRUE); + } + return TRUE; } @@ -191,8 +206,6 @@ CcPinRead ( OUT PVOID * Bcb, OUT PVOID * Buffer) { - PINTERNAL_BCB iBcb; - CCTRACE(CC_API_DEBUG, "FileOffset=%p FileOffset=%p Length=%lu Flags=0x%lx\n", FileObject, FileOffset, Length, Flags); @@ -205,32 +218,20 @@ CcPinRead ( ++CcPinReadNoWait; } - if (CcMapData(FileObject, FileOffset, Length, Flags, Bcb, Buffer)) + /* Map first */ + if (!CcMapData(FileObject, FileOffset, Length, Flags, Bcb, Buffer)) { - if (CcPinMappedData(FileObject, FileOffset, Length, Flags, Bcb)) - { - iBcb = *Bcb; - - ASSERT(iBcb->Pinned == FALSE); - - iBcb->Pinned = TRUE; - iBcb->Vacb->PinCount++; - - if (Flags & PIN_EXCLUSIVE) - { - ExAcquireResourceExclusiveLite(&iBcb->Lock, TRUE); - } - else - { - ExAcquireResourceSharedLite(&iBcb->Lock, TRUE); - } + return FALSE; + } - return TRUE; - } - else - CcUnpinData(*Bcb); + /* Pin then */ + if (!CcPinMappedData(FileObject, FileOffset, Length, Flags, Bcb)) + { + CcUnpinData(*Bcb); + return FALSE; } - return FALSE; + + return TRUE; } /*
6 years, 7 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
31
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
Results per page:
10
25
50
100
200