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
August 2018
----- 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: [SAMSRV] Simplify the initialization of the account expiration date for new user accounts
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a9f267778270a9c8585a1…
commit a9f267778270a9c8585a1a77ca1c2a892e08deb9 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Aug 26 21:26:31 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Aug 26 21:26:31 2018 +0200 [SAMSRV] Simplify the initialization of the account expiration date for new user accounts --- dll/win32/samsrv/setup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dll/win32/samsrv/setup.c b/dll/win32/samsrv/setup.c index 43f224d248..eb7d0c9c24 100644 --- a/dll/win32/samsrv/setup.c +++ b/dll/win32/samsrv/setup.c @@ -389,8 +389,7 @@ SampSetupCreateUserAccount(HANDLE hDomainKey, 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 = ulRelativeId; FixedUserData.PrimaryGroupId = DOMAIN_GROUP_RID_USERS;
6 years, 4 months
1
0
0
0
01/01: [NETAPI32] Add code to handle special values of the last logon time, last logoff time and account expiration time
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dcc188e97474c73702c4b…
commit dcc188e97474c73702c4beb1f0fdbdbeb9a74082 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Aug 26 21:06:32 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Aug 26 21:07:05 2018 +0200 [NETAPI32] Add code to handle special values of the last logon time, last logoff time and account expiration time --- dll/win32/netapi32/user.c | 92 ++++++++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 32 deletions(-) diff --git a/dll/win32/netapi32/user.c b/dll/win32/netapi32/user.c index 270ea070a1..d105634a52 100644 --- a/dll/win32/netapi32/user.c +++ b/dll/win32/netapi32/user.c @@ -692,14 +692,23 @@ BuildUserInfoBuffer(SAM_HANDLE UserHandle, UserInfo2->usri2_workstations[UserInfo->WorkStations.Length / sizeof(WCHAR)] = UNICODE_NULL; Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->WorkStations.Length + sizeof(WCHAR)); - RtlTimeToSecondsSince1970(&UserInfo->LastLogon, - &UserInfo2->usri2_last_logon); + if (UserInfo->LastLogon.QuadPart == 0) + UserInfo2->usri2_last_logon = 0; + else + RtlTimeToSecondsSince1970(&UserInfo->LastLogon, + &UserInfo2->usri2_last_logon); - RtlTimeToSecondsSince1970(&UserInfo->LastLogoff, - &UserInfo2->usri2_last_logoff); + if (UserInfo->LastLogoff.QuadPart == 0) + UserInfo2->usri2_last_logoff = 0; + else + RtlTimeToSecondsSince1970(&UserInfo->LastLogoff, + &UserInfo2->usri2_last_logoff); - RtlTimeToSecondsSince1970(&UserInfo->AccountExpires, - &UserInfo2->usri2_acct_expires); + if (UserInfo->AccountExpires.QuadPart == MAXLONGLONG) + UserInfo2->usri2_acct_expires = TIMEQ_FOREVER; + else + RtlTimeToSecondsSince1970(&UserInfo->AccountExpires, + &UserInfo2->usri2_acct_expires); UserInfo2->usri2_max_storage = USER_MAXSTORAGE_UNLIMITED; UserInfo2->usri2_units_per_week = UserInfo->LogonHours.UnitsPerWeek; @@ -802,14 +811,23 @@ BuildUserInfoBuffer(SAM_HANDLE UserHandle, UserInfo3->usri3_workstations[UserInfo->WorkStations.Length / sizeof(WCHAR)] = UNICODE_NULL; Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->WorkStations.Length + sizeof(WCHAR)); - RtlTimeToSecondsSince1970(&UserInfo->LastLogon, - &UserInfo3->usri3_last_logon); + if (UserInfo->LastLogon.QuadPart == 0) + UserInfo3->usri3_last_logon = 0; + else + RtlTimeToSecondsSince1970(&UserInfo->LastLogon, + &UserInfo3->usri3_last_logon); - RtlTimeToSecondsSince1970(&UserInfo->LastLogoff, - &UserInfo3->usri3_last_logoff); + if (UserInfo->LastLogoff.QuadPart == 0) + UserInfo3->usri3_last_logoff = 0; + else + RtlTimeToSecondsSince1970(&UserInfo->LastLogoff, + &UserInfo3->usri3_last_logoff); - RtlTimeToSecondsSince1970(&UserInfo->AccountExpires, - &UserInfo3->usri3_acct_expires); + if (UserInfo->AccountExpires.QuadPart == MAXLONGLONG) + UserInfo3->usri3_acct_expires = TIMEQ_FOREVER; + else + RtlTimeToSecondsSince1970(&UserInfo->AccountExpires, + &UserInfo3->usri3_acct_expires); UserInfo3->usri3_max_storage = USER_MAXSTORAGE_UNLIMITED; UserInfo3->usri3_units_per_week = UserInfo->LogonHours.UnitsPerWeek; @@ -930,14 +948,23 @@ BuildUserInfoBuffer(SAM_HANDLE UserHandle, UserInfo4->usri4_workstations[UserInfo->WorkStations.Length / sizeof(WCHAR)] = UNICODE_NULL; Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->WorkStations.Length + sizeof(WCHAR)); - RtlTimeToSecondsSince1970(&UserInfo->LastLogon, - &UserInfo4->usri4_last_logon); + if (UserInfo->LastLogon.QuadPart == 0) + UserInfo4->usri4_last_logon = 0; + else + RtlTimeToSecondsSince1970(&UserInfo->LastLogon, + &UserInfo4->usri4_last_logon); - RtlTimeToSecondsSince1970(&UserInfo->LastLogoff, - &UserInfo4->usri4_last_logoff); + if (UserInfo->LastLogoff.QuadPart == 0) + UserInfo4->usri4_last_logoff = 0; + else + RtlTimeToSecondsSince1970(&UserInfo->LastLogoff, + &UserInfo4->usri4_last_logoff); - RtlTimeToSecondsSince1970(&UserInfo->AccountExpires, - &UserInfo4->usri4_acct_expires); + if (UserInfo->AccountExpires.QuadPart == MAXLONGLONG) + UserInfo4->usri4_acct_expires = TIMEQ_FOREVER; + else + RtlTimeToSecondsSince1970(&UserInfo->AccountExpires, + &UserInfo4->usri4_acct_expires); UserInfo4->usri4_max_storage = USER_MAXSTORAGE_UNLIMITED; UserInfo4->usri4_units_per_week = UserInfo->LogonHours.UnitsPerWeek; @@ -1076,11 +1103,17 @@ BuildUserInfoBuffer(SAM_HANDLE UserHandle, UserInfo11->usri11_parms[UserInfo->Parameters.Length / sizeof(WCHAR)] = UNICODE_NULL; Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->Parameters.Length + sizeof(WCHAR)); - RtlTimeToSecondsSince1970(&UserInfo->LastLogon, - &UserInfo11->usri11_last_logon); + if (UserInfo->LastLogon.QuadPart == 0) + UserInfo11->usri11_last_logon = 0; + else + RtlTimeToSecondsSince1970(&UserInfo->LastLogon, + &UserInfo11->usri11_last_logon); - RtlTimeToSecondsSince1970(&UserInfo->LastLogoff, - &UserInfo11->usri11_last_logoff); + if (UserInfo->LastLogoff.QuadPart == 0) + UserInfo11->usri11_last_logoff = 0; + else + RtlTimeToSecondsSince1970(&UserInfo->LastLogoff, + &UserInfo11->usri11_last_logoff); UserInfo11->usri11_bad_pw_count = UserInfo->BadPasswordCount; UserInfo11->usri11_num_logons = UserInfo->LogonCount; @@ -1382,8 +1415,7 @@ SetUserInfo(SAM_HANDLE UserHandle, if (UserInfo2->usri2_acct_expires == TIMEQ_FOREVER) { - UserAllInfo.AccountExpires.LowPart = 0; - UserAllInfo.AccountExpires.HighPart = 0; + UserAllInfo.AccountExpires.QuadPart = MAXLONGLONG; } else { @@ -1485,8 +1517,7 @@ SetUserInfo(SAM_HANDLE UserHandle, if (UserInfo3->usri3_acct_expires == TIMEQ_FOREVER) { - UserAllInfo.AccountExpires.LowPart = 0; - UserAllInfo.AccountExpires.HighPart = 0; + UserAllInfo.AccountExpires.QuadPart = MAXLONGLONG; } else { @@ -1610,8 +1641,7 @@ SetUserInfo(SAM_HANDLE UserHandle, if (UserInfo4->usri4_acct_expires == TIMEQ_FOREVER) { - UserAllInfo.AccountExpires.LowPart = 0; - UserAllInfo.AccountExpires.HighPart = 0; + UserAllInfo.AccountExpires.QuadPart = MAXLONGLONG; } else { @@ -1732,8 +1762,7 @@ SetUserInfo(SAM_HANDLE UserHandle, if (UserInfo22->usri22_acct_expires == TIMEQ_FOREVER) { - UserAllInfo.AccountExpires.LowPart = 0; - UserAllInfo.AccountExpires.HighPart = 0; + UserAllInfo.AccountExpires.QuadPart = MAXLONGLONG; } else { @@ -1865,8 +1894,7 @@ SetUserInfo(SAM_HANDLE UserHandle, if (UserInfo1017->usri1017_acct_expires == TIMEQ_FOREVER) { - UserAllInfo.AccountExpires.LowPart = 0; - UserAllInfo.AccountExpires.HighPart = 0; + UserAllInfo.AccountExpires.QuadPart = MAXLONGLONG; } else {
6 years, 4 months
1
0
0
0
03/03: [USETUP] Progress-bar: Add support for displaying a custom progress text.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e9ba3a8ebcad051e1f17d…
commit e9ba3a8ebcad051e1f17d0fcad16976817accf82 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Aug 26 20:40:34 2018 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Aug 26 20:41:57 2018 +0200 [USETUP] Progress-bar: Add support for displaying a custom progress text. --- base/setup/usetup/progress.c | 93 +++++++++++++++++++++++++++++++------------- base/setup/usetup/progress.h | 17 +++++++- 2 files changed, 81 insertions(+), 29 deletions(-) diff --git a/base/setup/usetup/progress.c b/base/setup/usetup/progress.c index e7ea1e5fc5..ebbc715cb1 100644 --- a/base/setup/usetup/progress.c +++ b/base/setup/usetup/progress.c @@ -1,3 +1,10 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS text-mode setup + * FILE: base/setup/usetup/progress.c + * PURPOSE: Partition list functions + * PROGRAMMER: + */ /* INCLUDES *****************************************************************/ @@ -8,6 +15,37 @@ /* FUNCTIONS ****************************************************************/ +static +BOOLEAN NTAPI +UpdateProgressPercentage( + IN PPROGRESSBAR Bar, + IN BOOLEAN ComputeProgress, + OUT PSTR Buffer, + IN SIZE_T cchBufferSize) +{ + // static PCSTR ProgressFormatText; + ULONG OldProgress = Bar->Progress; + + if (ComputeProgress) + { + /* Calculate the new percentage */ + if (Bar->StepCount == 0) + Bar->Progress = 0; + else + Bar->Progress = ((100 * Bar->CurrentStep + (Bar->StepCount / 2)) / Bar->StepCount); + } + + /* Build the progress string if it has changed */ + if ( Bar->ProgressFormatText && + (!ComputeProgress || (Bar->Progress != OldProgress)) ) + { + RtlStringCchPrintfA(Buffer, cchBufferSize, + Bar->ProgressFormatText, Bar->Progress); + return TRUE; + } + return FALSE; +} + static VOID DrawBorder( @@ -179,10 +217,10 @@ VOID DrawProgressBar( IN PPROGRESSBAR Bar) { - CHAR TextBuffer[8]; COORD coPos; DWORD Written; PROGRESSBAR BarBorder = *Bar; + CHAR TextBuffer[256]; /* Draw the progress bar "border" border */ if (Bar->DoubleEdge) @@ -201,16 +239,18 @@ DrawProgressBar( if (Bar->DescriptionText) CONSOLE_SetTextXY(Bar->TextTop, Bar->TextRight, Bar->DescriptionText); - /* Print percentage */ - sprintf(TextBuffer, "%-3lu%%", Bar->Percent); - - coPos.X = Bar->Left + (Bar->Width - 2) / 2; - coPos.Y = Bar->Top; - WriteConsoleOutputCharacterA(StdOutput, - TextBuffer, - 4, - coPos, - &Written); + /* Display the progress */ + if (Bar->UpdateProgressProc && + Bar->UpdateProgressProc(Bar, FALSE, TextBuffer, ARRAYSIZE(TextBuffer))) + { + coPos.X = Bar->Left + (Bar->Width - strlen(TextBuffer) + 1) / 2; + coPos.Y = Bar->Top; + WriteConsoleOutputCharacterA(StdOutput, + TextBuffer, + strlen(TextBuffer), + coPos, + &Written); + } /* Draw the empty bar */ coPos.X = Bar->Left + 1; @@ -241,7 +281,9 @@ CreateProgressBarEx( IN SHORT TextRight, IN BOOLEAN DoubleEdge, IN SHORT ProgressColour, - IN PCSTR DescriptionText OPTIONAL) + IN PCSTR DescriptionText OPTIONAL, + IN PCSTR ProgressFormatText OPTIONAL, + IN PUPDATE_PROGRESS UpdateProgressProc OPTIONAL) { PPROGRESSBAR Bar; @@ -263,11 +305,13 @@ CreateProgressBarEx( Bar->DoubleEdge = DoubleEdge; Bar->ProgressColour = ProgressColour; Bar->DescriptionText = DescriptionText; + Bar->ProgressFormatText = ProgressFormatText; Bar->StepCount = 0; Bar->CurrentStep = 0; - Bar->Percent = 0; + Bar->UpdateProgressProc = UpdateProgressProc; + Bar->Progress = 0; Bar->Pos = 0; DrawProgressBar(Bar); @@ -291,7 +335,9 @@ CreateProgressBar( TextTop, TextRight, DoubleEdge, FOREGROUND_YELLOW | BACKGROUND_BLUE, - DescriptionText); + DescriptionText, + "%-3lu%%", + UpdateProgressPercentage); } VOID @@ -325,32 +371,25 @@ ProgressSetStep( IN PPROGRESSBAR Bar, IN ULONG Step) { - CHAR TextBuffer[8]; COORD coPos; DWORD Written; - ULONG NewPercent; ULONG NewPos; + CHAR TextBuffer[256]; if (Step > Bar->StepCount) return; Bar->CurrentStep = Step; - /* Calculate new percentage */ - NewPercent = ((100 * Bar->CurrentStep + (Bar->StepCount / 2)) / Bar->StepCount); - - /* Redraw percentage if changed */ - if (Bar->Percent != NewPercent) + /* Update the progress and redraw it if it has changed */ + if (Bar->UpdateProgressProc && + Bar->UpdateProgressProc(Bar, TRUE, TextBuffer, ARRAYSIZE(TextBuffer))) { - Bar->Percent = NewPercent; - - sprintf(TextBuffer, "%-3lu%%", Bar->Percent); - - coPos.X = Bar->Left + (Bar->Width - 2) / 2; + coPos.X = Bar->Left + (Bar->Width - strlen(TextBuffer) + 1) / 2; coPos.Y = Bar->Top; WriteConsoleOutputCharacterA(StdOutput, TextBuffer, - 4, + strlen(TextBuffer), coPos, &Written); } diff --git a/base/setup/usetup/progress.h b/base/setup/usetup/progress.h index d125f7b712..1cc5ed3ce7 100644 --- a/base/setup/usetup/progress.h +++ b/base/setup/usetup/progress.h @@ -26,6 +26,15 @@ #pragma once +struct _PROGRESSBAR; + +typedef BOOLEAN +(NTAPI *PUPDATE_PROGRESS)( + IN struct _PROGRESSBAR* Bar, + IN BOOLEAN ComputeProgress, + OUT PSTR Buffer, + IN SIZE_T cchBufferSize); + typedef struct _PROGRESSBAR { /* Border and text positions */ @@ -43,13 +52,15 @@ typedef struct _PROGRESSBAR ULONG CurrentStep; /* User-specific displayed bar progress/position */ - ULONG Percent; + PUPDATE_PROGRESS UpdateProgressProc; + ULONG Progress; SHORT Pos; /* Static progress bar cues */ BOOLEAN DoubleEdge; SHORT ProgressColour; PCSTR DescriptionText; + PCSTR ProgressFormatText; } PROGRESSBAR, *PPROGRESSBAR; @@ -65,7 +76,9 @@ CreateProgressBarEx( IN SHORT TextRight, IN BOOLEAN DoubleEdge, IN SHORT ProgressColour, - IN PCSTR DescriptionText OPTIONAL); + IN PCSTR DescriptionText OPTIONAL, + IN PCSTR ProgressFormatText OPTIONAL, + IN PUPDATE_PROGRESS UpdateProgressProc OPTIONAL); PPROGRESSBAR CreateProgressBar(
6 years, 4 months
1
0
0
0
02/03: [USETUP] Progress-bar: Code formatting, add annotations, don't use floats.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3a33de0fb138a4531faf0…
commit 3a33de0fb138a4531faf0c6055968fea6bb42bd8 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Aug 26 20:31:14 2018 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Aug 26 20:41:56 2018 +0200 [USETUP] Progress-bar: Code formatting, add annotations, don't use floats. --- base/setup/usetup/progress.c | 79 ++++++++++++++++++++++---------------------- base/setup/usetup/progress.h | 61 ++++++++++++++++++---------------- 2 files changed, 73 insertions(+), 67 deletions(-) diff --git a/base/setup/usetup/progress.c b/base/setup/usetup/progress.c index 48e202ecbf..e7ea1e5fc5 100644 --- a/base/setup/usetup/progress.c +++ b/base/setup/usetup/progress.c @@ -11,7 +11,7 @@ static VOID DrawBorder( - PPROGRESSBAR Bar) + IN PPROGRESSBAR Bar) { COORD coPos; DWORD Written; @@ -94,7 +94,7 @@ DrawBorder( static VOID DrawThickBorder( - PPROGRESSBAR Bar) + IN PPROGRESSBAR Bar) { COORD coPos; DWORD Written; @@ -177,7 +177,7 @@ DrawThickBorder( static VOID DrawProgressBar( - PPROGRESSBAR Bar) + IN PPROGRESSBAR Bar) { CHAR TextBuffer[8]; COORD coPos; @@ -185,7 +185,7 @@ DrawProgressBar( PROGRESSBAR BarBorder = *Bar; /* Draw the progress bar "border" border */ - if (Bar->Double) + if (Bar->DoubleEdge) { BarBorder.Top -= 5; BarBorder.Bottom += 2; @@ -197,8 +197,9 @@ DrawProgressBar( /* Draw the progress bar border */ DrawBorder(Bar); - /* Write the text associated with the bar */ - CONSOLE_SetTextXY(Bar->TextTop, Bar->TextRight, Bar->Text); + /* Display the description text */ + if (Bar->DescriptionText) + CONSOLE_SetTextXY(Bar->TextTop, Bar->TextRight, Bar->DescriptionText); /* Print percentage */ sprintf(TextBuffer, "%-3lu%%", Bar->Percent); @@ -232,15 +233,15 @@ DrawProgressBar( PPROGRESSBAR CreateProgressBarEx( - SHORT Left, - SHORT Top, - SHORT Right, - SHORT Bottom, - SHORT TextTop, - SHORT TextRight, + IN SHORT Left, + IN SHORT Top, + IN SHORT Right, + IN SHORT Bottom, + IN SHORT TextTop, + IN SHORT TextRight, IN BOOLEAN DoubleEdge, - SHORT ProgressColour, - CHAR *Text) + IN SHORT ProgressColour, + IN PCSTR DescriptionText OPTIONAL) { PPROGRESSBAR Bar; @@ -256,18 +257,19 @@ CreateProgressBarEx( Bar->Bottom = Bottom; Bar->TextTop = TextTop; Bar->TextRight = TextRight; - Bar->Double = DoubleEdge; - Bar->ProgressColour = ProgressColour; - Bar->Text = Text; Bar->Width = Bar->Right - Bar->Left + 1; - Bar->Percent = 0; - Bar->Pos = 0; + Bar->DoubleEdge = DoubleEdge; + Bar->ProgressColour = ProgressColour; + Bar->DescriptionText = DescriptionText; Bar->StepCount = 0; Bar->CurrentStep = 0; + Bar->Percent = 0; + Bar->Pos = 0; + DrawProgressBar(Bar); return Bar; @@ -275,27 +277,26 @@ CreateProgressBarEx( PPROGRESSBAR CreateProgressBar( - SHORT Left, - SHORT Top, - SHORT Right, - SHORT Bottom, - SHORT TextTop, - SHORT TextRight, + IN SHORT Left, + IN SHORT Top, + IN SHORT Right, + IN SHORT Bottom, + IN SHORT TextTop, + IN SHORT TextRight, IN BOOLEAN DoubleEdge, - CHAR *Text) + IN PCSTR DescriptionText OPTIONAL) { - /* Call the Ex variant of the function */ return CreateProgressBarEx(Left, Top, Right, Bottom, TextTop, TextRight, DoubleEdge, FOREGROUND_YELLOW | BACKGROUND_BLUE, - Text); + DescriptionText); } VOID DestroyProgressBar( - PPROGRESSBAR Bar) + IN OUT PPROGRESSBAR Bar) { RtlFreeHeap(ProcessHeap, 0, Bar); } @@ -303,8 +304,8 @@ DestroyProgressBar( VOID ProgressSetStepCount( - PPROGRESSBAR Bar, - ULONG StepCount) + IN PPROGRESSBAR Bar, + IN ULONG StepCount) { Bar->CurrentStep = 0; Bar->StepCount = StepCount; @@ -314,15 +315,15 @@ ProgressSetStepCount( VOID ProgressNextStep( - PPROGRESSBAR Bar) + IN PPROGRESSBAR Bar) { ProgressSetStep(Bar, Bar->CurrentStep + 1); } VOID ProgressSetStep( - PPROGRESSBAR Bar, - ULONG Step) + IN PPROGRESSBAR Bar, + IN ULONG Step) { CHAR TextBuffer[8]; COORD coPos; @@ -336,7 +337,7 @@ ProgressSetStep( Bar->CurrentStep = Step; /* Calculate new percentage */ - NewPercent = (ULONG)(((100.0 * (float)Bar->CurrentStep) / (float)Bar->StepCount) + 0.5); + NewPercent = ((100 * Bar->CurrentStep + (Bar->StepCount / 2)) / Bar->StepCount); /* Redraw percentage if changed */ if (Bar->Percent != NewPercent) @@ -354,10 +355,10 @@ ProgressSetStep( &Written); } - /* Calculate bar position */ - NewPos = (ULONG)((((float)(Bar->Width - 2) * 2.0 * (float)Bar->CurrentStep) / (float)Bar->StepCount) + 0.5); + /* Calculate the bar position */ + NewPos = (((Bar->Width - 2) * 2 * Bar->CurrentStep + (Bar->StepCount / 2)) / Bar->StepCount); - /* Redraw bar if changed */ + /* Redraw the bar if it has changed */ if (Bar->Pos != NewPos) { Bar->Pos = NewPos; @@ -370,7 +371,7 @@ ProgressSetStep( Bar->Pos / 2, coPos, &Written); - coPos.X += Bar->Pos/2; + coPos.X += Bar->Pos / 2; if (NewPos & 1) { diff --git a/base/setup/usetup/progress.h b/base/setup/usetup/progress.h index ee438e95c2..d125f7b712 100644 --- a/base/setup/usetup/progress.h +++ b/base/setup/usetup/progress.h @@ -26,8 +26,9 @@ #pragma once -typedef struct _PROGRESS +typedef struct _PROGRESSBAR { + /* Border and text positions */ SHORT Left; SHORT Top; SHORT Right; @@ -37,58 +38,62 @@ typedef struct _PROGRESS SHORT Width; - ULONG Percent; - SHORT Pos; - + /* Maximum and current step counts */ ULONG StepCount; ULONG CurrentStep; - BOOLEAN Double; + /* User-specific displayed bar progress/position */ + ULONG Percent; + SHORT Pos; + + /* Static progress bar cues */ + BOOLEAN DoubleEdge; SHORT ProgressColour; - CHAR *Text; + PCSTR DescriptionText; } PROGRESSBAR, *PPROGRESSBAR; + /* FUNCTIONS ****************************************************************/ PPROGRESSBAR CreateProgressBarEx( - SHORT Left, - SHORT Top, - SHORT Right, - SHORT Bottom, - SHORT TextTop, - SHORT TextRight, + IN SHORT Left, + IN SHORT Top, + IN SHORT Right, + IN SHORT Bottom, + IN SHORT TextTop, + IN SHORT TextRight, IN BOOLEAN DoubleEdge, - SHORT ProgressColour, - CHAR *Text); + IN SHORT ProgressColour, + IN PCSTR DescriptionText OPTIONAL); PPROGRESSBAR CreateProgressBar( - SHORT Left, - SHORT Top, - SHORT Right, - SHORT Bottom, - SHORT TextTop, - SHORT TextRight, - BOOLEAN DoubleEdge, - CHAR *Text); + IN SHORT Left, + IN SHORT Top, + IN SHORT Right, + IN SHORT Bottom, + IN SHORT TextTop, + IN SHORT TextRight, + IN BOOLEAN DoubleEdge, + IN PCSTR DescriptionText OPTIONAL); VOID DestroyProgressBar( - PPROGRESSBAR Bar); + IN OUT PPROGRESSBAR Bar); VOID ProgressSetStepCount( - PPROGRESSBAR Bar, - ULONG StepCount); + IN PPROGRESSBAR Bar, + IN ULONG StepCount); VOID ProgressNextStep( - PPROGRESSBAR Bar); + IN PPROGRESSBAR Bar); VOID ProgressSetStep( - PPROGRESSBAR Bar, - ULONG Step); + IN PPROGRESSBAR Bar, + IN ULONG Step); /* EOF */
6 years, 4 months
1
0
0
0
01/03: [USETUP] DrawProgressBar(): Draw the progress bar borders first, then draw its contents.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=914769a14ab6b7810e098…
commit 914769a14ab6b7810e0984eb974e21d724226493 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Aug 26 16:41:43 2018 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Aug 26 20:41:49 2018 +0200 [USETUP] DrawProgressBar(): Draw the progress bar borders first, then draw its contents. --- base/setup/usetup/progress.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/base/setup/usetup/progress.c b/base/setup/usetup/progress.c index 71f9ae99df..48e202ecbf 100644 --- a/base/setup/usetup/progress.c +++ b/base/setup/usetup/progress.c @@ -8,7 +8,6 @@ /* FUNCTIONS ****************************************************************/ - static VOID DrawBorder( @@ -92,7 +91,6 @@ DrawBorder( &Written); } - static VOID DrawThickBorder( @@ -176,7 +174,6 @@ DrawThickBorder( &Written); } - static VOID DrawProgressBar( @@ -187,6 +184,22 @@ DrawProgressBar( DWORD Written; PROGRESSBAR BarBorder = *Bar; + /* Draw the progress bar "border" border */ + if (Bar->Double) + { + BarBorder.Top -= 5; + BarBorder.Bottom += 2; + BarBorder.Right += 5; + BarBorder.Left -= 5; + DrawThickBorder(&BarBorder); + } + + /* Draw the progress bar border */ + DrawBorder(Bar); + + /* Write the text associated with the bar */ + CONSOLE_SetTextXY(Bar->TextTop, Bar->TextRight, Bar->Text); + /* Print percentage */ sprintf(TextBuffer, "%-3lu%%", Bar->Percent); @@ -198,23 +211,7 @@ DrawProgressBar( coPos, &Written); - /* Draw the progress bar border */ - DrawBorder(Bar); - - /* Write Text Associated with Bar */ - CONSOLE_SetTextXY(Bar->TextTop, Bar->TextRight, Bar->Text); - - /* Draw the progress bar "border" border */ - if (Bar->Double) - { - BarBorder.Top -= 5; - BarBorder.Bottom += 2; - BarBorder.Right += 5; - BarBorder.Left -= 5; - DrawThickBorder(&BarBorder); - } - - /* Draw the bar */ + /* Draw the empty bar */ coPos.X = Bar->Left + 1; for (coPos.Y = Bar->Top + 2; coPos.Y <= Bar->Bottom - 1; coPos.Y++) { @@ -315,7 +312,6 @@ ProgressSetStepCount( DrawProgressBar(Bar); } - VOID ProgressNextStep( PPROGRESSBAR Bar) @@ -323,7 +319,6 @@ ProgressNextStep( ProgressSetStep(Bar, Bar->CurrentStep + 1); } - VOID ProgressSetStep( PPROGRESSBAR Bar,
6 years, 4 months
1
0
0
0
01/01: [NET] Set the proper account expiration time (TIMEQ_FOREVER) when a new user account is created
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8f63c209bc1ae1ad0240b…
commit 8f63c209bc1ae1ad0240b66f43e82efd4bb0d947 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Aug 26 20:26:34 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Aug 26 20:27:20 2018 +0200 [NET] Set the proper account expiration time (TIMEQ_FOREVER) when a new user account is created --- base/applications/network/net/cmdUser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/base/applications/network/net/cmdUser.c b/base/applications/network/net/cmdUser.c index a67476e13d..fd8450057a 100644 --- a/base/applications/network/net/cmdUser.c +++ b/base/applications/network/net/cmdUser.c @@ -729,6 +729,7 @@ cmdUser( UserInfo.usri4_name = lpUserName; UserInfo.usri4_password = lpPassword; UserInfo.usri4_flags = UF_SCRIPT | UF_NORMAL_ACCOUNT; + UserInfo.usri4_acct_expires = TIMEQ_FOREVER; pUserInfo = &UserInfo; }
6 years, 4 months
1
0
0
0
01/01: [SHELL32] Fix CShellLink::GetIconLocation (#810)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6eb6aa289518b530f40b0…
commit 6eb6aa289518b530f40b065837d2bcf7506595e5 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Aug 26 22:37:15 2018 +0900 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Aug 26 15:37:15 2018 +0200 [SHELL32] Fix CShellLink::GetIconLocation (#810) Fixes a regression from PR #784. CORE-14961, CORE-14009 --- dll/win32/shell32/CShellLink.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/dll/win32/shell32/CShellLink.cpp b/dll/win32/shell32/CShellLink.cpp index 7efddc998e..67da3ed848 100644 --- a/dll/win32/shell32/CShellLink.cpp +++ b/dll/win32/shell32/CShellLink.cpp @@ -1721,6 +1721,9 @@ static HRESULT SHELL_PidlGetIconLocationW(PCIDLIST_ABSOLUTE pidl, HRESULT STDMETHODCALLTYPE CShellLink::GetIconLocation(UINT uFlags, PWSTR pszIconFile, UINT cchMax, int *piIndex, UINT *pwFlags) { HRESULT hr; + + pszIconFile[0] = UNICODE_NULL; + /* * It is possible for a shell link to point to another shell link, * and in particular there is the possibility to point to itself. @@ -1739,11 +1742,17 @@ HRESULT STDMETHODCALLTYPE CShellLink::GetIconLocation(UINT uFlags, PWSTR pszIcon */ uFlags |= GIL_FORSHORTCUT; + if (uFlags & GIL_DEFAULTICON) + return E_FAIL; + hr = GetIconLocation(pszIconFile, cchMax, piIndex); - if (FAILED(hr)) + if (FAILED(hr) || pszIconFile[0] == UNICODE_NULL) + { + hr = SHELL_PidlGetIconLocationW(m_pPidl, uFlags, pszIconFile, cchMax, piIndex, pwFlags); + } + else { - if (m_pPidl) - hr = SHELL_PidlGetIconLocationW(m_pPidl, uFlags, pszIconFile, cchMax, piIndex, pwFlags); + *pwFlags = GIL_NOTFILENAME | GIL_PERCLASS; } return hr; @@ -1888,13 +1897,14 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetIconLocation(LPCWSTR pszIconPath, INT i */ // FIXME:
http://stackoverflow.com/questions/2976489/ishelllinkseticonlocation-transl…
// if (PathFullyUnExpandEnvStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath))) - SHExpandEnvironmentStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath)); + PathUnExpandEnvStringsW(pszIconPath, szUnExpIconPath, _countof(szUnExpIconPath)); if (wcscmp(pszIconPath, szUnExpIconPath) != 0) { /* Unexpansion succeeded, so we need an icon environment block */ EXP_SZ_LINK buffer; LPEXP_SZ_LINK pInfo; + pszIconPath = szUnExpIconPath; pInfo = (LPEXP_SZ_LINK)SHFindDataBlock(m_pDBList, EXP_SZ_ICON_SIG); if (pInfo) {
6 years, 4 months
1
0
0
0
01/01: [NTOS:KE] Fix stub for KeAcquireInStackQueuedSpinLockForDpc (#814)
by Denis Malikov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0cf5efc14c427534621d3…
commit 0cf5efc14c427534621d343a6cad294b511733f6 Author: Denis Malikov <Getequ(a)users.noreply.github.com> AuthorDate: Sun Aug 26 20:19:26 2018 +0700 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Aug 26 15:19:26 2018 +0200 [NTOS:KE] Fix stub for KeAcquireInStackQueuedSpinLockForDpc (#814) Error was found when building as 0x600+. CORE-12596 --- ntoskrnl/ke/spinlock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ntoskrnl/ke/spinlock.c b/ntoskrnl/ke/spinlock.c index 39d92294e5..c6e44a21c0 100644 --- a/ntoskrnl/ke/spinlock.c +++ b/ntoskrnl/ke/spinlock.c @@ -415,13 +415,13 @@ KeReleaseSpinLockForDpc(IN PKSPIN_LOCK SpinLock, /* * @unimplemented */ -KIRQL +VOID FASTCALL KeAcquireInStackQueuedSpinLockForDpc(IN PKSPIN_LOCK SpinLock, IN PKLOCK_QUEUE_HANDLE LockHandle) { UNIMPLEMENTED; - return 0; + return; } /*
6 years, 4 months
1
0
0
0
01/01: [NET] Add a date parser for the expires option of the net user command
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bf76e1bf20c0da25c9245…
commit bf76e1bf20c0da25c9245d01566a6f796f54e929 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Aug 26 00:13:14 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Aug 26 00:13:14 2018 +0200 [NET] Add a date parser for the expires option of the net user command --- base/applications/network/net/cmdUser.c | 132 +++++++++++++++++++++++++++++++- 1 file changed, 130 insertions(+), 2 deletions(-) diff --git a/base/applications/network/net/cmdUser.c b/base/applications/network/net/cmdUser.c index d093ffc9e0..a67476e13d 100644 --- a/base/applications/network/net/cmdUser.c +++ b/base/applications/network/net/cmdUser.c @@ -488,6 +488,130 @@ BuildWorkstationsList( } +static +BOOL +ReadNumber( + PWSTR *s, + PWORD pwValue) +{ + if (!iswdigit(**s)) + return FALSE; + + while (iswdigit(**s)) + { + *pwValue = *pwValue * 10 + **s - L'0'; + (*s)++; + } + + return TRUE; +} + + +static +BOOL +ReadSeparator( + PWSTR *s) +{ + if (**s == L'/' || **s == L'.') + { + (*s)++; + return TRUE; + } + + return FALSE; +} + + +static +BOOL +ParseDate( + PWSTR s, + PULONG pSeconds) +{ + SYSTEMTIME SystemTime = {0}; + FILETIME LocalFileTime, FileTime; + LARGE_INTEGER Time; + INT nDateFormat = 0; + PWSTR p = s; + + if (!*s) + return FALSE; + + GetLocaleInfoW(LOCALE_USER_DEFAULT, + LOCALE_IDATE, + (PWSTR)&nDateFormat, + sizeof(INT)); + + switch (nDateFormat) + { + case 0: /* mmddyy */ + default: + if (!ReadNumber(&p, &SystemTime.wMonth)) + return FALSE; + if (!ReadSeparator(&p)) + return FALSE; + if (!ReadNumber(&p, &SystemTime.wDay)) + return FALSE; + if (!ReadSeparator(&p)) + return FALSE; + if (!ReadNumber(&p, &SystemTime.wYear)) + return FALSE; + break; + + case 1: /* ddmmyy */ + if (!ReadNumber(&p, &SystemTime.wDay)) + return FALSE; + if (!ReadSeparator(&p)) + return FALSE; + if (!ReadNumber(&p, &SystemTime.wMonth)) + return FALSE; + if (!ReadSeparator(&p)) + return FALSE; + if (!ReadNumber(&p, &SystemTime.wYear)) + return FALSE; + break; + + case 2: /* yymmdd */ + if (!ReadNumber(&p, &SystemTime.wYear)) + return FALSE; + if (!ReadSeparator(&p)) + return FALSE; + if (!ReadNumber(&p, &SystemTime.wMonth)) + return FALSE; + if (!ReadSeparator(&p)) + return FALSE; + if (!ReadNumber(&p, &SystemTime.wDay)) + return FALSE; + break; + } + + /* if only entered two digits: */ + /* assume 2000's if value less than 80 */ + /* assume 1900's if value greater or equal 80 */ + if (SystemTime.wYear <= 99) + { + if (SystemTime.wYear >= 80) + SystemTime.wYear += 1900; + else + SystemTime.wYear += 2000; + } + + if (!SystemTimeToFileTime(&SystemTime, &LocalFileTime)) + return FALSE; + + if (!LocalFileTimeToFileTime(&LocalFileTime, &FileTime)) + return FALSE; + + Time.u.LowPart = FileTime.dwLowDateTime; + Time.u.HighPart = FileTime.dwHighDateTime; + + if (!RtlTimeToSecondsSince1970(&Time, pSeconds)) + return FALSE; + + return TRUE; +} + + INT cmdUser( INT argc, @@ -655,10 +779,14 @@ cmdUser( { pUserInfo->usri4_acct_expires = TIMEQ_FOREVER; } - else + else if (!ParseDate(p, &pUserInfo->usri4_acct_expires)) { + ConResPrintf(StdErr, IDS_ERROR_INVALID_OPTION_VALUE, L"/EXPIRES"); + result = 1; + goto done; + /* FIXME: Parse the date */ - ConResPrintf(StdErr, IDS_ERROR_OPTION_NOT_SUPPORTED, L"/EXPIRES"); +// ConResPrintf(StdErr, IDS_ERROR_OPTION_NOT_SUPPORTED, L"/EXPIRES"); } } else if (_wcsnicmp(argv[j], L"/fullname:", 10) == 0)
6 years, 4 months
1
0
0
0
01/01: [NTOSKRNL] IopGetDeviceProperty: Initialize power data struct and convert flags from device capabilities to power data
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=06e72331349ed1e63a244…
commit 06e72331349ed1e63a244df62cc1c5b82ba3792e Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Aug 25 19:49:29 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat Aug 25 19:49:29 2018 +0200 [NTOSKRNL] IopGetDeviceProperty: Initialize power data struct and convert flags from device capabilities to power data --- ntoskrnl/io/pnpmgr/plugplay.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/ntoskrnl/io/pnpmgr/plugplay.c b/ntoskrnl/io/pnpmgr/plugplay.c index 4c65792a4a..83a4cb6000 100644 --- a/ntoskrnl/io/pnpmgr/plugplay.c +++ b/ntoskrnl/io/pnpmgr/plugplay.c @@ -365,15 +365,33 @@ IopGetDeviceProperty(PPLUGPLAY_CONTROL_PROPERTY_DATA PropertyData) // Status = IopQueryDeviceCapabilities(DeviceNode, &DeviceCapabilities); PowerData = (PCM_POWER_DATA)Buffer; + + RtlZeroMemory(PowerData, sizeof(CM_POWER_DATA)); PowerData->PD_Size = sizeof(CM_POWER_DATA); +// PowerData->PD_MostRecentPowerState; + PowerData->PD_Capabilities = PDCAP_D0_SUPPORTED | PDCAP_D3_SUPPORTED; /* - PowerData->PD_MostRecentPowerState; - PowerData->PD_Capabilities; - PowerData->PD_D1Latency; - PowerData->PD_D2Latency; - PowerData->PD_D3Latency; - PowerData->PD_PowerStateMapping[POWER_SYSTEM_MAXIMUM]; - PowerData->PD_DeepestSystemWake; + if (DeviceCapabilities.DeviceD1) + PowerData->PD_Capabilities |= PDCAP_D1_SUPPORTED; + if (DeviceCapabilities.DeviceD2) + PowerData->PD_Capabilities |= PDCAP_D2_SUPPORTED; + if (DeviceCapabilities.WakeFromD0) + PowerData->PD_Capabilities |= PDCAP_WAKE_FROM_D0_SUPPORTED; + if (DeviceCapabilities.WakeFromD1) + PowerData->PD_Capabilities |= PDCAP_WAKE_FROM_D1_SUPPORTED; + if (DeviceCapabilities.WakeFromD2) + PowerData->PD_Capabilities |= PDCAP_WAKE_FROM_D2_SUPPORTED; + if (DeviceCapabilities.WakeFromD3) + PowerData->PD_Capabilities |= PDCAP_WAKE_FROM_D3_SUPPORTED; + if (DeviceCapabilities.WarmEjectSupported) + PowerData->PD_Capabilities |= PDCAP_WARM_EJECT_SUPPORTED; + PowerData->PD_D1Latency = DeviceCapabilities.D1Latency; + PowerData->PD_D2Latency = DeviceCapabilities.D2Latency; + PowerData->PD_D3Latency = DeviceCapabilities.D3Latency; + RtlCopyMemory(&PowerData->PD_PowerStateMapping, + &DeviceCapabilities.DeviceState, + sizeof(DeviceCapabilities.DeviceState)); + PowerData->PD_DeepestSystemWake = DeviceCapabilities.SystemWake; */ } }
6 years, 4 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
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