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
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
June 2006
----- 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
19 participants
595 discussions
Start a n
N
ew thread
[jimtabor] 22373: Fix functionality in WM_SHOWWINDOW. Part II of last nights patch for TWOPARAM_ROUTINE_ROS_SHOWWINDOW.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Jun 15 20:23:24 2006 New Revision: 22373 URL:
http://svn.reactos.ru/svn/reactos?rev=22373&view=rev
Log: Fix functionality in WM_SHOWWINDOW. Part II of last nights patch for TWOPARAM_ROUTINE_ROS_SHOWWINDOW. Modified: trunk/reactos/dll/win32/user32/windows/defwnd.c Modified: trunk/reactos/dll/win32/user32/windows/defwnd.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/user32/windows/de…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/defwnd.c (original) +++ trunk/reactos/dll/win32/user32/windows/defwnd.c Thu Jun 15 20:23:24 2006 @@ -1268,7 +1268,8 @@ case WM_SHOWWINDOW: { LONG Style; - + INT Ret = 0; + if (!lParam) return 0; Style = GetWindowLongW(hWnd, GWL_STYLE); @@ -1280,8 +1281,13 @@ return 0; if (!GetWindow(hWnd, GW_OWNER)) return 0; - NtUserCallTwoParam((DWORD) hWnd, (DWORD) wParam, TWOPARAM_ROUTINE_ROS_SHOWWINDOW); - ShowWindow(hWnd, wParam ? SW_SHOWNA : SW_HIDE); + Ret = NtUserCallTwoParam((DWORD) hWnd, (DWORD) wParam, TWOPARAM_ROUTINE_ROS_SHOWWINDOW); + if(Ret) + { + if( Ret == -1) return 0; + return Ret; + } + ShowWindow(hWnd, wParam ? SW_SHOWNOACTIVATE : SW_HIDE); break; }
18 years, 5 months
1
0
0
0
[fireball] 22372: - Add russian translation by Andrey Korotaev - Fix small typo in german resources
by fireball@svn.reactos.org
Author: fireball Date: Thu Jun 15 20:08:32 2006 New Revision: 22372 URL:
http://svn.reactos.ru/svn/reactos?rev=22372&view=rev
Log: - Add russian translation by Andrey Korotaev - Fix small typo in german resources Added: trunk/reactos/dll/cpl/powercfg/ru.rc (with props) Modified: trunk/reactos/dll/cpl/powercfg/de.rc trunk/reactos/dll/cpl/powercfg/powercfg.rc Modified: trunk/reactos/dll/cpl/powercfg/de.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/de.rc?rev=…
============================================================================== --- trunk/reactos/dll/cpl/powercfg/de.rc (original) +++ trunk/reactos/dll/cpl/powercfg/de.rc Thu Jun 15 20:08:32 2006 @@ -1,4 +1,4 @@ -// German (De) resources by Lohegrim (Lohnegrim at gmx dot net) +// German (De) resources by Lohnegrim (Lohnegrim at gmx dot net) LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL Modified: trunk/reactos/dll/cpl/powercfg/powercfg.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.r…
============================================================================== --- trunk/reactos/dll/cpl/powercfg/powercfg.rc (original) +++ trunk/reactos/dll/cpl/powercfg/powercfg.rc Thu Jun 15 20:08:32 2006 @@ -16,3 +16,4 @@ #include "en.rc" #include "de.rc" +#include "ru.rc" Added: trunk/reactos/dll/cpl/powercfg/ru.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/ru.rc?rev=…
============================================================================== --- trunk/reactos/dll/cpl/powercfg/ru.rc (added) +++ trunk/reactos/dll/cpl/powercfg/ru.rc Thu Jun 15 20:08:32 2006 @@ -1,0 +1,162 @@ +// Russian (ru) resources by Andrey Korotaev (unC0Rr(a)gmail.com) + +LANGUAGE LANG_RUSSIAN, SUBLANG_NEUTRAL + +IDD_PROPPAGEPOWERSHEMES DIALOGEX 0, 0, 250, 220 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "奬ë ã¯à ¢«¥¨ï ¯¨â ¨¥¬" +FONT 8, "MS Shell Dlg" +BEGIN + ICON IDI_ACDC, IDI_ACDC, 7,7,28,22 + LTEXT "ë¡¥à¨â¥ á奬ã ã¯à ¢«¥¨ï í«¥ªâய¨â ¨¥¬ á ¨¡®«¥¥ ¯®¤å®¤ï騬¨ ¯ à ¬¥âà ¬¨ ¤«ï í⮣® ª®¬¯ìîâ¥à . §¬¥¥¨¥ ¨¦¥á«¥¤ãîé¨å ¯ à ¬¥â஢ ¨§¬¥¨â ¢ë¡à ãî á奬ã.", + -1,45,13,194,36 + GROUPBOX "&奬ë ã¯à ¢«¥¨ï ¯¨â ¨¥¬", -1, 7,57,240,46 + COMBOBOX IDC_ENERGYLIST, 14,70,224,92, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "®åà ¨âì &ª ª...", -1, 100,85,75,15,WS_DISABLED + PUSHBUTTON "&¤ «¨âì", -1, 180,85,55,15,WS_DISABLED + GROUPBOX "¥â ¤ ëå", IDC_GRPDETAIL, 7,108,240,105 + LTEXT "ਠ¯¨â ¨¨:",IDC_SAT,15,120,60,10 + LTEXT "®â á¥â¨",IDC_SAC,100,120,45,15 + ICON IDI_AC, IDC_IAC, 75,115,25,15 + LTEXT "®â ¡ â ३",IDC_SDC,197,120,45,15 + ICON IDI_DC, IDC_IDC, 165,115,25,15 + LTEXT "⪫îç¨âì &¬®¨â®à:",IDC_MONITOR,15,142,80,10 + COMBOBOX IDC_MONITORACLIST, 100,140,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_MONITORDCLIST, 175,140,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "⪫îç¨âì &¤¨áª¨:",IDC_DISK,15,157,80,10 + COMBOBOX IDC_DISKACLIST, 100,155,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_DISKDCLIST, 175,155,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "&¤ã騩 ०¨¬ ç¥à¥§:",IDC_STANDBY,15,177,80,10 + COMBOBOX IDC_STANDBYACLIST, 100,175,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_STANDBYDCLIST, 175,175,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "&¯ï騩 ०¨¬ ç¥à¥§:",IDC_HYBERNATE,15,192,80,10 + COMBOBOX IDC_HYBERNATEACLIST, 100,190,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_HYBERNATEDCLIST, 175,190,65,150, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +END + +IDD_PROPPAGEALARMS DIALOG DISCARDABLE 0, 0, 250, 220 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¢¥¤®¬«¥¨ï" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "¨£ « ¨§ª®£® § àï¤ ¡ â ३",-1,10,15,235,95 + CONTROL "ª«îç¨âì ᨣ « &¨§ª®£® § àï¤ ¯à¨ ã஢¥:",IDC_ALARM1, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 + LTEXT "¥â ¤ ëå",IDC_ALARMVALUE1,200,25,40,10 + LTEXT "0%",-1,20,40,15,15 + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 + LTEXT "100%",-1,215,40,25,10 + PUSHBUTTON "&¥©á⢨¥...",-1,20,70,70,15,WS_DISABLED + LTEXT "¢¥¤®¬«¥¨¥:",-1,95,70,50,10 + LTEXT "¥â ¤ ëå",IDC_ALARMMSG1,145,70,95,10 + LTEXT "¥©á⢨¥:",-1,95,80,45,10 + LTEXT "¥â ¤ ëå",IDC_ALARMAKTION1,145,80,95,10 + LTEXT " ¯ã᪠¯à®£à ¬¬ë:",-1,95,90,50,10 + LTEXT "¥â ¤ ëå",IDC_ALARMPROG1,150,90,40,10 + + GROUPBOX "¨£ « ªà¨â¨ç¥áª¨ ¨§ª®£® § àï¤ ¡ â ३",-1,10,115,235,95 + CONTROL "ª«îç¨âì â ª®© &ᨣ « ¯à¨ ã஢¥:",IDC_ALARM2, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 + LTEXT "¥â ¤ ëå",IDC_ALARMVALUE2,200,125,40,10 + LTEXT "0%",-1,20,140,15,15 + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 + LTEXT "100%",-1,215,140,25,10 + PUSHBUTTON "¥&©á⢨¥...",-1,20,170,70,15,WS_DISABLED + LTEXT "¢¥¤®¬«¥¨¥:",-1,95,170,50,10 + LTEXT "¥â ¤ ëå",IDC_ALARMMSG2,145,170,95,10 + LTEXT "¥©á⢨¥:",-1,95,180,45,10 + LTEXT "¥â ¤ ëå",IDC_ALARMAKTION2,145,180,95,10 + LTEXT " ¯ã᪠¯à®£à ¬¬ë:",-1,95,190,50,10 + LTEXT "¥â ¤ ëå",IDC_ALARMPROG2,150,190,40,10 +END + +IDD_PROPPAGEADVANCED DIALOG DISCARDABLE 0, 0, 250, 220 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "®¯®«¨â¥«ì®" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_ACDC,IDI_ACDC,5,5,20,20 + LTEXT "ë¡¥à¨â¥ ¦¥« ¥¬ë¥ ¯ à ¬¥âàë í¥à£®á¡¥à¥¦¥¨ï.",-1,30,5,205,20 + GROUPBOX " à ¬¥âàë",-1,5,35,225,55 + CONTROL "&ᥣ¤ ®â®¡à ¦ âì § 箪 ¯ ¥«¨ § ¤ ç",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,15,48,200,10 + CONTROL "& ¯à 訢 âì ¯ à®«ì ¯à¨ ¢ë室¥ ¨§ ¦¤ã饣® ०¨¬ ",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,15,60,200,10 + CONTROL "&¨§¨âì ïમáâì ¬®¨â®à ¯à¨ à ¡®â¥ ®â ¡ â ३",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,15,72,200,10 + GROUPBOX "®¯ª¨ ¯¨â ¨ï",-1,5,100,230,105 + LTEXT "&ਠ§ ªàë⨨ ªàë誨 ¯¥à¥®á®£® ª®¬¯ìîâ¥à :", IDC_SLIDCLOSE,10,110,210,10 + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ਠ& ¦ ⨨ ª®¯ª¨ ¢ª«îç¥¨ï ¯¨â ¨ï ª®¬¯ìîâ¥à :", IDC_SPOWERBUTTON,10,140,210,10 + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ਠ¦ ⨨ &ª®¯ª¨ ¯¥à¥å®¤ ¢ á¯ï騩 ०¨¬:", IDC_SSLEEPBUTTON,10,170,210,10 + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP +END + +IDD_PROPPAGEHIBERNATE DIALOG DISCARDABLE 0, 0, 250, 220 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¯ï騩 ०¨¬" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_SCREEN,IDI_SCREEN,5,5,20,20 + LTEXT "ਠ¯¥à¥å®¤¥ ¢ á¯ï騩 ०¨¬ ª®¬¯ìîâ¥à ¯¥à¥®á¨â ᮤ¥à¦¨¬®¥ ®¯¥à ⨢®© ¯ ¬ï⨠¤¨áª ¨ ¢ëª«îç ¥âáï. ਠ¢ë室¥ ¨§ á¯ï饣® ०¨¬ ª®¬¯ìîâ¥à ¢®§¢à é ¥âáï ¢ ¯à¥¦¥¥ á®áâ®ï¨¥.", + -1,35,5,195,35 + GROUPBOX "¯ï騩 ०¨¬",-1,5,45,235,25 + CONTROL "& §à¥è¨âì ¯¥à¥å®¤ ¢ á¯ï騩 ०¨¬",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,10,55,210,10 + GROUPBOX "¥áâ® ¤¨áª¥ ¤«ï ¯¥à¥å®¤ ¢ á¯ï騩 ०¨¬",-1,5,80,240,60 + LTEXT "¢®¡®¤® ¬¥áâ ¤¨áª¥:",-1,10,90,100,10 + LTEXT "¥â ¤ ëå",IDC_FREESPACE,130,90,70,10 + LTEXT "ॡã¥âáï ¤«ï á¯ï饣® ०¨¬ :",-1,10,100,115,10 + LTEXT "¥â ¤ ëå",IDC_SPACEFORHIBERNATEFILE,130,100,55,10 + LTEXT "«ï ¢®§¬®¦®á⨠¯¥à¥å®¤ ¢ á¯ï騩 ०¨¬ âॡã¥âáï ®á¢®¡®¤¨âì ¬¥áâ® ¤¨áª¥.",IDC_TOLESSFREESPACE,10,115,220,20 +END + +STRINGTABLE +BEGIN + IDS_CPLNAME_1 "«¥ªâய¨â ¨¥" + IDS_CPLDESCRIPTION_1 " áâனª ¯ à ¬¥â஢ í¥à£®á¡¥à¥¦¥¨ï ¤«ï ª®¬¯ìîâ¥à ." + IDS_PROCENT "%i%%" + IDS_SOUND "¢ãª" + IDS_TEXT "¥ªáâ" + IDS_CONFIG1 " à ¬¥âàë á奬ë %1" + IDS_CONFIG2 "®¯®«¨â¥«ìë¥ ¯ à ¬¥âàë á奬ë %1" + + IDS_SIZEBYTS "%i ¡ ©â" + IDS_SIZEMB "%i " + + IDS_NOACTION "Do nothing" + + IDS_PowerActionNone1 "¥©á⢨¥ ¥ âॡã¥âáï" + IDS_PowerActionUnknown "¥â ¤ ëå" + IDS_PowerActionSleep "¤ã騩 ०¨¬" + IDS_PowerActionHibernate "¯ï騩 ०¨¬" + IDS_PowerActionShutdown " ¢¥à襨¥ à ¡®âë" + IDS_PowerActionRestart "¥à¥§ £à㧪 " + IDS_PowerActionShutdownOff " ¢¥à襨¥ à ¡®âë ¨ ¢ëª«î票¥ ¯¨â ¨ï" + IDS_PowerActionWarmEject "¯à®á¨âì ® 㦮¬ ¤¥©á⢨¨" + IDS_PowerActionNone2 "âáãâáâ¢ã¥â" + + IDS_TIMEOUT1 "ç¥à¥§ 1 ¬¨" + IDS_TIMEOUT2 "ç¥à¥§ 2 ¬¨" + IDS_TIMEOUT3 "ç¥à¥§ 3 ¬¨" + IDS_TIMEOUT4 "ç¥à¥§ 5 ¬¨" + IDS_TIMEOUT5 "ç¥à¥§ 10 ¬¨" + IDS_TIMEOUT6 "ç¥à¥§ 15 ¬¨" + IDS_TIMEOUT7 "ç¥à¥§ 20 ¬¨" + IDS_TIMEOUT8 "ç¥à¥§ 25 ¬¨" + IDS_TIMEOUT9 "ç¥à¥§ 30 ¬¨" + IDS_TIMEOUT10 "ç¥à¥§ 45 ¬¨" + IDS_TIMEOUT11 "ç¥à¥§ 1 ç á" + IDS_TIMEOUT12 "ç¥à¥§ 2 ç á " + IDS_TIMEOUT13 "ç¥à¥§ 3 ç á " + IDS_TIMEOUT14 "ç¥à¥§ 4 ç á " + IDS_TIMEOUT15 "ç¥à¥§ 5 ç ᮢ" + IDS_TIMEOUT16 "¨ª®£¤ " +END + Propchange: trunk/reactos/dll/cpl/powercfg/ru.rc ------------------------------------------------------------------------------ svn:eol-style = native
18 years, 5 months
1
0
0
0
[janderwald] 22371: use SUBLANG_ENGLISH_US spotted by Usurp
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jun 15 19:53:52 2006 New Revision: 22371 URL:
http://svn.reactos.ru/svn/reactos?rev=22371&view=rev
Log: use SUBLANG_ENGLISH_US spotted by Usurp Modified: trunk/reactos/dll/cpl/powercfg/en.rc Modified: trunk/reactos/dll/cpl/powercfg/en.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/en.rc?rev=…
============================================================================== --- trunk/reactos/dll/cpl/powercfg/en.rc (original) +++ trunk/reactos/dll/cpl/powercfg/en.rc Thu Jun 15 19:53:52 2006 @@ -1,6 +1,6 @@ // English (en) resources by Lohegrim (Lohnegrim at gmx dot net) -LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US IDD_PROPPAGEPOWERSHEMES DIALOGEX 0, 0, 250, 220 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
18 years, 5 months
1
0
0
0
[fireball] 22370: Add code to query volume for its filesystem type
by fireball@svn.reactos.org
Author: fireball Date: Thu Jun 15 19:00:37 2006 New Revision: 22370 URL:
http://svn.reactos.ru/svn/reactos?rev=22370&view=rev
Log: Add code to query volume for its filesystem type Modified: trunk/reactos/base/system/autochk/autochk.c Modified: trunk/reactos/base/system/autochk/autochk.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/system/autochk/autochk…
============================================================================== --- trunk/reactos/base/system/autochk/autochk.c (original) +++ trunk/reactos/base/system/autochk/autochk.c Thu Jun 15 19:00:37 2006 @@ -3,16 +3,25 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: base/system/autochk/autochk.c * PURPOSE: Filesystem checker - * PROGRAMMERS: Eric Kohl + * PROGRAMMERS: Aleksey Bragin + * Eric Kohl */ /* INCLUDES *****************************************************************/ + +//#define NDEBUG +#include <debug.h> #include <stdio.h> #define WIN32_NO_STATUS #include <windows.h> #define NTOS_MODE_USER #include <ndk/ntndk.h> + +/* DEFINES ******************************************************************/ + +#define FS_ATTRIBUTE_BUFFER_SIZE (MAX_PATH * sizeof(WCHAR) + sizeof(FILE_FS_ATTRIBUTE_INFORMATION)) + /* FUNCTIONS ****************************************************************/ @@ -45,6 +54,97 @@ RtlFreeUnicodeString(&UnicodeString); } +// this func is taken from kernel32/file/volume.c +HANDLE +OpenDirectory(LPCWSTR DirName, + BOOLEAN Write) +{ + UNICODE_STRING NtPathU; + OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + HANDLE hFile; + + if (!RtlDosPathNameToNtPathName_U(DirName, + &NtPathU, + NULL, + NULL)) + { + DPRINT1("Invalid path!\n"); + return INVALID_HANDLE_VALUE; + } + + InitializeObjectAttributes( + &ObjectAttributes, + &NtPathU, + Write ? FILE_WRITE_ATTRIBUTES : FILE_READ_ATTRIBUTES, + NULL, + NULL); + + Status = NtCreateFile( + &hFile, + Write ? FILE_GENERIC_WRITE : FILE_GENERIC_READ, + &ObjectAttributes, + &IoStatusBlock, + NULL, + 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_OPEN, + 0, + NULL, + 0); + + RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathU.Buffer); + + if (!NT_SUCCESS(Status)) + { + return INVALID_HANDLE_VALUE; + } + + return hFile; +} + +NTSTATUS +GetFileSystem(LPCWSTR Drive, + LPWSTR FileSystemName, + ULONG FileSystemNameSize) +{ + HANDLE FileHandle; + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + PFILE_FS_ATTRIBUTE_INFORMATION FileFsAttribute; + UCHAR Buffer[FS_ATTRIBUTE_BUFFER_SIZE]; + + FileFsAttribute = (PFILE_FS_ATTRIBUTE_INFORMATION)Buffer; + + FileHandle = OpenDirectory(Drive, FALSE); + if (FileHandle == INVALID_HANDLE_VALUE) + return STATUS_INVALID_PARAMETER; + + Status = NtQueryVolumeInformationFile(FileHandle, + &IoStatusBlock, + FileFsAttribute, + FS_ATTRIBUTE_BUFFER_SIZE, + FileFsAttributeInformation); + NtClose(FileHandle); + + if (NT_SUCCESS(Status)) + { + if (FileSystemNameSize * sizeof(WCHAR) >= FileFsAttribute->FileSystemNameLength + sizeof(WCHAR)) + { + memcpy(FileSystemName, + FileFsAttribute->FileSystemName, + FileFsAttribute->FileSystemNameLength); + FileSystemName[FileFsAttribute->FileSystemNameLength / sizeof(WCHAR)] = 0; + } + else + return STATUS_BUFFER_TOO_SMALL; + } + else + return Status; + + return STATUS_SUCCESS; +} /* Native image's entry point */ int @@ -57,8 +157,17 @@ PROCESS_DEVICEMAP_INFORMATION DeviceMap; ULONG i; NTSTATUS Status; - - PrintString("Autochk 0.0.1\n"); + WCHAR FileSystem[128]; + WCHAR DrivePath[128]; + + PrintString("Autochk 0.0.2\n"); + + // Win2003 passes the only param - "*". Probably means to check all drives + /* + DPRINT("Got %d params\n", argc); + for (i=0; i<argc; i++) + DPRINT("Param %d: %s\n", i, argv[i]); + */ Status = NtQueryInformationProcess(NtCurrentProcess(), ProcessDeviceMap, @@ -73,13 +182,34 @@ if ((DeviceMap.Query.DriveMap & (1 << i)) && (DeviceMap.Query.DriveType[i] == DOSDEVICE_DRIVE_FIXED)) { - PrintString(" Checking drive %c:", 'A'+i); - PrintString(" OK\n"); + swprintf(DrivePath, L"%c:\\", 'A'+i); + Status = GetFileSystem(DrivePath, + FileSystem, + sizeof(FileSystem)); + PrintString(" Checking drive %c: \n", 'A'+i); + + if (NT_SUCCESS(Status)) + { + PrintString(" Filesystem type "); + DisplayString(FileSystem); + PrintString("\n"); + PrintString(" OK\n"); + } + else + { + DPRINT1("Error getting FS information, Status=0x%08X\n", + Status); + } } } PrintString("\n"); return 0; } + else + { + DPRINT1("NtQueryInformationProcess() failed with status=0x%08X\n", + Status); + } return 1; }
18 years, 5 months
1
0
0
0
[janderwald] 22369: * add powrprof regression tests * developed by Alex Wurzinger, Johannes Anderwald & Martin Rottensteiner
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jun 15 18:50:42 2006 New Revision: 22369 URL:
http://svn.reactos.ru/svn/reactos?rev=22369&view=rev
Log: * add powrprof regression tests * developed by Alex Wurzinger, Johannes Anderwald & Martin Rottensteiner Added: trunk/reactos/regtests/winetests/powrprof/ trunk/reactos/regtests/winetests/powrprof/powrprof.rbuild (with props) trunk/reactos/regtests/winetests/powrprof/pwrprof.c (with props) trunk/reactos/regtests/winetests/powrprof/testlist.c (with props) Modified: trunk/reactos/regtests/winetests/directory.rbuild Modified: trunk/reactos/regtests/winetests/directory.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/director…
============================================================================== --- trunk/reactos/regtests/winetests/directory.rbuild (original) +++ trunk/reactos/regtests/winetests/directory.rbuild Thu Jun 15 18:50:42 2006 @@ -26,6 +26,9 @@ <directory name="psapi"> <xi:include href="psapi/psapi.rbuild" /> </directory> +<directory name="powrprof"> + <xi:include href="powrprof/powrprof.rbuild" /> +</directory> <directory name="setupapi"> <xi:include href="setupapi/setupapi.rbuild" /> </directory> Added: trunk/reactos/regtests/winetests/powrprof/powrprof.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/powrprof…
============================================================================== --- trunk/reactos/regtests/winetests/powrprof/powrprof.rbuild (added) +++ trunk/reactos/regtests/winetests/powrprof/powrprof.rbuild Thu Jun 15 18:50:42 2006 @@ -1,0 +1,10 @@ +<module name="powrprof_winetest" type="win32cui" installbase="bin" installname="powrprof_winetest.exe" allowwarnings="true"> + <include base="setupapi_winetest">.</include> + <define name="__USE_W32API" /> + <define name="UNICODE" /> + <define name="_UNICODE" /> + <library>ntdll</library> + <library>powrprof</library> + <file>testlist.c</file> + <file>pwrprof.c</file> +</module> Propchange: trunk/reactos/regtests/winetests/powrprof/powrprof.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/regtests/winetests/powrprof/pwrprof.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/powrprof…
============================================================================== --- trunk/reactos/regtests/winetests/powrprof/pwrprof.c (added) +++ trunk/reactos/regtests/winetests/powrprof/pwrprof.c Thu Jun 15 18:50:42 2006 @@ -1,0 +1,1093 @@ +#include<stdarg.h> +#include "ntstatus.h" +#define WIN32_NO_STATUS +#define STANDALONE +#include "wine/test.h" +#include "winternl.h" +#include "windef.h" +#include "winbase.h" +#include "powrprof.h" +#include "assert.h" + +#include "wine/unicode.h" +/* + LONG WINAPI RegOpenCurrentUser(REGSAM a,PHKEY b) + { + *b = HKEY_CURRENT_USER; + return ERROR_SUCCESS; + } + */ +unsigned int g_NumPwrSchemes = 0; +unsigned int g_NumPwrSchemesEnumerated = 0; +unsigned int g_ActivePwrScheme = 3; +unsigned int g_TempPwrScheme = 99; + +typedef struct _PROCESSOR_POWER_INFORMATION { + ULONG Number; + ULONG MaxMhz; + ULONG CurrentMhz; + ULONG MhzLimit; + ULONG MaxIdleState; + ULONG CurrentIdleState; +} PROCESSOR_POWER_INFORMATION, +*PPROCESSOR_POWER_INFORMATION; + +POWER_POLICY g_PowerPolicy; + +static const WCHAR szMachPowerPoliciesSubKey[] = { 'S', 'O', 'F', 'T', 'W', 'A', 'R', + 'E', '\\', 'M', 'i', 'c', 'r', 'o', 's', 'o', 'f', 't', '\\', 'W', 'i', 'n', 'd', + 'o', 'w', 's', '\\', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'V', 'e', 'r', 's', 'i', + 'o', 'n', '\\', 'C', 'o', 'n', 't', 'r', 'o', 'l', 's', ' ', 'F', 'o', 'l', 'd', + 'e', 'r', '\\', 'P', 'o', 'w', 'e', 'r', 'C', 'f', 'g', '\\', 'P', 'o', 'w', 'e', + 'r', 'P', 'o', 'l', 'i', 'c', 'i', 'e', 's', 0}; + +static const WCHAR szTempPwrScheme[] = { '9', '9', 0 }; + +ULONG DbgPrint(PCH X,...) +{ + return (ULONG)NULL; +} + +void test_CallNtPowerInformation(void) +{ + DWORD retval; + ADMINISTRATOR_POWER_POLICY apolicy; + ULONGLONG atime, ctime; + PROCESSOR_POWER_INFORMATION ppi, *pppi; + PROCESSOR_POWER_POLICY ppp; + SYSTEM_BATTERY_STATE sbs; + SYSTEM_POWER_CAPABILITIES spc; + SYSTEM_POWER_INFORMATION spi; + SYSTEM_POWER_POLICY spp; + HANDLE x=NULL; + + /* AdministratorPowerPolicy tests */ + retval = CallNtPowerInformation(AdministratorPowerPolicy, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(AdministratorPowerPolicy, 0, 0, &apolicy, sizeof(ADMINISTRATOR_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(AdministratorPowerPolicy, &apolicy, sizeof(ADMINISTRATOR_POWER_POLICY), 0, 0); + ok(retval != STATUS_PRIVILEGE_NOT_HELD, "Privileg not held!!!! more errors to expect"); + ok(retval == STATUS_SUCCESS, "function expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* LastSleepTime tests */ + retval = CallNtPowerInformation(LastSleepTime, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(LastSleepTime, &atime, sizeof(sizeof(ULONGLONG)), 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(LastSleepTime, &atime, sizeof(ULONGLONG), &ctime, sizeof(ULONGLONG)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(LastSleepTime, 0, 0, &atime, sizeof(ULONGLONG)); + ok(retval == STATUS_SUCCESS, "function expected STATUS_SUCCESS but got %d\n",(UINT)retval); + + /* LastWakeTime tests */ + retval = CallNtPowerInformation(LastWakeTime, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(LastWakeTime, &atime, sizeof(sizeof(ULONGLONG)), 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(LastWakeTime, &atime, sizeof(ULONGLONG), &ctime, sizeof(ULONGLONG)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(LastWakeTime, 0, 0, &atime, sizeof(ULONGLONG)); + ok(retval == STATUS_SUCCESS, "function expected STATUS_SUCCESS but got %d\n",(UINT)retval); + + /* ProcessorInformation tests */ + retval = CallNtPowerInformation(ProcessorInformation, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorInformation, 0, 0, &ppi, sizeof(PROCESSOR_POWER_INFORMATION)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorInformation, &ppi, sizeof(PROCESSOR_POWER_INFORMATION), 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorInformation, &ppi, sizeof(PROCESSOR_POWER_INFORMATION), &ppi, sizeof(PROCESSOR_POWER_INFORMATION)); + + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorInformation, 0, 0, &pppi, sizeof(PPROCESSOR_POWER_INFORMATION)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorInformation, &pppi, sizeof(PPROCESSOR_POWER_INFORMATION), 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorInformation, &pppi, sizeof(PPROCESSOR_POWER_INFORMATION), &pppi, sizeof(PPROCESSOR_POWER_INFORMATION)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* ProcessorPowerPolicyAc tests */ + retval = CallNtPowerInformation(ProcessorPowerPolicyAc, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorPowerPolicyAc, 0, 0, &ppp, sizeof(PROCESSOR_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorPowerPolicyAc, &ppp, sizeof(PROCESSOR_POWER_POLICY), 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorPowerPolicyAc, &ppp, sizeof(PROCESSOR_POWER_POLICY), &ppp, sizeof(PROCESSOR_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* ProcessorPowerPolicyCurrent tests */ + retval = CallNtPowerInformation(ProcessorPowerPolicyCurrent, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorPowerPolicyCurrent, 0, 0, &ppp, sizeof(PROCESSOR_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorPowerPolicyCurrent, &ppp, sizeof(PROCESSOR_POWER_POLICY), 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorPowerPolicyCurrent, &ppp, sizeof(PROCESSOR_POWER_POLICY), &ppp, sizeof(PROCESSOR_POWER_POLICY)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + + /* ProcessorPowerPolicyDc tests */ + retval = CallNtPowerInformation(ProcessorPowerPolicyDc, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorPowerPolicyDc, 0, 0, &ppp, sizeof(PROCESSOR_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorPowerPolicyDc, &ppp, sizeof(PROCESSOR_POWER_POLICY), 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorPowerPolicyDc, &ppp, sizeof(PROCESSOR_POWER_POLICY), &ppp, sizeof(PROCESSOR_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* SystemBatteryState tests */ + retval = CallNtPowerInformation(SystemBatteryState, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemBatteryState, 0, 0, &sbs, sizeof(SYSTEM_BATTERY_STATE)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemBatteryState, &sbs, sizeof(SYSTEM_BATTERY_STATE), 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemBatteryState, &sbs, sizeof(SYSTEM_BATTERY_STATE), &sbs, sizeof(SYSTEM_BATTERY_STATE)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* SystemExecutionState tests */ + retval = CallNtPowerInformation(SystemExecutionState, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* SystemPowerCapabilities tests */ + retval = CallNtPowerInformation(SystemPowerCapabilities, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerCapabilities, 0, 0, &spc, sizeof(SYSTEM_POWER_CAPABILITIES)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerCapabilities, &spc, sizeof(SYSTEM_POWER_CAPABILITIES), 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerCapabilities, &spc, sizeof(SYSTEM_POWER_CAPABILITIES), &spc, sizeof(SYSTEM_POWER_CAPABILITIES)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + + /* SystemPowerInformation tests */ + retval = CallNtPowerInformation(SystemPowerInformation, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerInformation, 0, 0, &spi, sizeof(SYSTEM_POWER_INFORMATION)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerInformation, &spi, sizeof(SYSTEM_POWER_INFORMATION), 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerInformation, &spi, sizeof(SYSTEM_POWER_INFORMATION), &spi, sizeof(SYSTEM_POWER_INFORMATION)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerInformation, &spp, sizeof(SYSTEM_POWER_POLICY), 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerInformation, &spp, sizeof(SYSTEM_POWER_POLICY), &spi, sizeof(SYSTEM_POWER_INFORMATION)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* SystemPowerPolicyAc tests */ + retval = CallNtPowerInformation(SystemPowerPolicyAc, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerPolicyAc, 0, 0, &spp, sizeof(SYSTEM_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerPolicyAc, &spp, sizeof(SYSTEM_POWER_POLICY), 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerPolicyAc, &spp, sizeof(SYSTEM_POWER_POLICY), &spp, sizeof(SYSTEM_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* SystemPowerPolicyCurrent tests */ + retval = CallNtPowerInformation(SystemPowerPolicyCurrent, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerPolicyCurrent, 0, 0, &spp, sizeof(SYSTEM_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerPolicyCurrent, &spp, sizeof(SYSTEM_POWER_POLICY), 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerPolicyCurrent, &spp, sizeof(SYSTEM_POWER_POLICY), &spp, sizeof(SYSTEM_POWER_POLICY)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + + /* SystemPowerPolicyDc tests */ + retval = CallNtPowerInformation(SystemPowerPolicyDc, 0, 0, 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerPolicyDc, 0, 0, &spp, sizeof(SYSTEM_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerPolicyDc, &spp, sizeof(SYSTEM_POWER_POLICY), 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerPolicyDc, &spp, sizeof(SYSTEM_POWER_POLICY), &spp, sizeof(SYSTEM_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* SystemReserveHiberFile tests */ +/* + retval = CallNtPowerInformation(SystemReserveHiberFile, 0, 0, 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %ld\n", retval); + bln=TRUE; + retval = CallNtPowerInformation(SystemReserveHiberFile, &bln, sizeof(bln), 0, 0); + ok(retval == STATUS_DISK_FULL, "function result wrong expected STATUS_DISK_FULL but got %ld\n", nret); + bln=FALSE; + retval = CallNtPowerInformation(SystemReserveHiberFile, &bln, sizeof(bln), 0, 0); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %ld\n", nret); + + bln2=TRUE; + nret = CallNtPowerInformation(SystemReserveHiberFile, 0, 0, &bln2, sizeof(bln2)); + ok(nret == STATUS_DATATYPE_MISALIGNMENT, "function result wrong expected STATUS_DATATYPE_MISALIGNMENT but got %ld\n", nret); + bln2=FALSE; + nret = CallNtPowerInformation(SystemReserveHiberFile, 0, 0, &bln2, sizeof(bln2)); + ok(nret == STATUS_DATATYPE_MISALIGNMENT, "function result wrong expected STATUS_DATATYPE_MISALIGNMENT but got %ld\n", nret); + + bln=TRUE; + bln2=TRUE; + nret = CallNtPowerInformation(SystemReserveHiberFile, &bln, sizeof(bln), &bln2, sizeof(bln2)); + ok(nret == STATUS_DATATYPE_MISALIGNMENT, "function result wrong expected STATUS_DATATYPE_MISALIGNMENT but got %ld\n", nret); + bln2=FALSE; + nret = CallNtPowerInformation(SystemReserveHiberFile, &bln, sizeof(bln), &bln2, sizeof(bln2)); + ok(nret == STATUS_DATATYPE_MISALIGNMENT, "function result wrong expected STATUS_DATATYPE_MISALIGNMENT but got %ld\n", nret); + bln=FALSE; + bln2=TRUE; + nret = CallNtPowerInformation(SystemReserveHiberFile, &bln, sizeof(bln), &bln2, sizeof(bln2)); + ok(nret == STATUS_DATATYPE_MISALIGNMENT, "function result wrong expected STATUS_DATATYPE_MISALIGNMENT but got %ld\n", nret); + bln2=FALSE; + nret = CallNtPowerInformation(SystemReserveHiberFile, &bln, sizeof(bln), &bln2, sizeof(bln2)); + ok(nret == STATUS_DATATYPE_MISALIGNMENT, "function result wrong expected STATUS_DATATYPE_MISALIGNMENT but got %ld\n", nret); + */ + + /* VerifyProcessorPowerPolicyAc tests */ + retval = CallNtPowerInformation(VerifyProcessorPowerPolicyAc, 0, 0, 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifyProcessorPowerPolicyAc, 0, 0, &ppp, sizeof(PROCESSOR_POWER_POLICY)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifyProcessorPowerPolicyAc, &ppp, sizeof(PROCESSOR_POWER_POLICY), 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifyProcessorPowerPolicyAc, &ppp, sizeof(PROCESSOR_POWER_POLICY), &ppp, sizeof(PROCESSOR_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* VerifyProcessorPowerPolicyDc tests */ + retval = CallNtPowerInformation(VerifyProcessorPowerPolicyDc, 0, 0, 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifyProcessorPowerPolicyDc, 0, 0, &ppp, sizeof(PROCESSOR_POWER_POLICY)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifyProcessorPowerPolicyDc, &ppp, sizeof(PROCESSOR_POWER_POLICY), 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifyProcessorPowerPolicyDc, &ppp, sizeof(PROCESSOR_POWER_POLICY), &ppp, sizeof(PROCESSOR_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* VerifySystemPolicyAc tests */ + retval = CallNtPowerInformation(VerifySystemPolicyAc, 0, 0, 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifySystemPolicyAc, 0, 0, &spp, sizeof(SYSTEM_POWER_POLICY)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifySystemPolicyAc, &spp, sizeof(SYSTEM_POWER_POLICY), 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifySystemPolicyAc, &spp, sizeof(SYSTEM_POWER_POLICY), &spp, sizeof(SYSTEM_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* VerifySystemPolicyDc tests */ + retval = CallNtPowerInformation(VerifySystemPolicyDc, 0, 0, 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifySystemPolicyDc, 0, 0, &spp, sizeof(SYSTEM_POWER_POLICY)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifySystemPolicyDc, &spp, sizeof(SYSTEM_POWER_POLICY), 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(VerifySystemPolicyDc, &spp, sizeof(SYSTEM_POWER_POLICY), &spp, sizeof(SYSTEM_POWER_POLICY)); + ok(retval == STATUS_SUCCESS, "function result wrong expected STATUS_SUCCESS but got %d\n", (UINT)retval); + + /* SystemPowerStateHandler tests */ + retval = CallNtPowerInformation(SystemPowerStateHandler, 0, 0, 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerStateHandler, 0, 0, x, sizeof(HANDLE)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + + /* ProcessorStateHandler tests */ + retval = CallNtPowerInformation(ProcessorStateHandler, 0, 0, 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorStateHandler, 0, 0, x, sizeof(HANDLE)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + + /* ProcessorStateHandler2 tests */ + retval = CallNtPowerInformation(ProcessorStateHandler2, 0, 0, 0, 0); + ok(retval == STATUS_ACCESS_DENIED, "function result wrong expected STATUS_ACCESS_DENIED but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(ProcessorStateHandler2, 0, 0, x, sizeof(HANDLE)); + ok(retval == STATUS_ACCESS_DENIED, "function result wrong expected STATUS_ACCESS_DENIED but got %d\n", (UINT)retval); + + /* SystemPowerStateNotifyHandler tests */ + retval = CallNtPowerInformation(SystemPowerStateNotifyHandler, 0, 0, 0, 0); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + retval = CallNtPowerInformation(SystemPowerStateNotifyHandler, 0, 0, x, sizeof(HANDLE)); + ok(retval == STATUS_INVALID_PARAMETER, "function result wrong expected STATUS_INVALID_PARAMETER but got %d\n", (UINT)retval); + +} + +/* + @implemented + */ +void test_CanUserWritePwrScheme(void) +{ + DWORD error, retval; + + retval = CanUserWritePwrScheme(); + + error = GetLastError(); + + if (retval) + ok(retval, "function failed?"); + else + ok(error == ERROR_ACCESS_DENIED, "function last error wrong expected ERROR_ACCESS_DENIED but got %d\n", (UINT)error); + +} +BOOLEAN CALLBACK test_callback_EnumPwrScheme(UINT uiIndex, DWORD dwName, LPWSTR sName, DWORD dwDesc, + LPWSTR sDesc, PPOWER_POLICY pp,LPARAM lParam ) +{ + ok(uiIndex == g_NumPwrSchemes, "expected power scheme index of %d but got %d\n", g_NumPwrSchemes, uiIndex); + g_NumPwrSchemes++; + + ok(lParam == 0xDEADBEEF, "expected function lParam to be 0xDEADBEEF but got %d\n", (UINT)lParam); + + return TRUE; +} + +BOOLEAN CALLBACK test_callback_stop_EnumPwrScheme(UINT uiIndex, DWORD dwName, LPWSTR sName, DWORD dwDesc, + LPWSTR sDesc, PPOWER_POLICY pp,LPARAM lParam ) +{ + ok((!uiIndex || g_NumPwrSchemesEnumerated + 1 == uiIndex), "expected power scheme %d but got %d\n",g_NumPwrSchemesEnumerated+1, uiIndex); + g_NumPwrSchemesEnumerated = uiIndex; + + ok(uiIndex <= (UINT)lParam, "enumeration should have already been stopped at index %d current index %d\n", (UINT)lParam, uiIndex); + if (uiIndex == (UINT)lParam) + return FALSE; + else + return TRUE; +} + +void test_DeletePwrScheme(void) +{ + DWORD retval; + HKEY hSubKey = NULL; + + + /* + * try inexistant profile number, should fail + */ + + retval = DeletePwrScheme(0xFFFFFFFF); + ok(!retval, "function should have failed error %x\n",(UINT)GetLastError()); + + /* + * delete active power scheme, should fail + */ + + retval = GetActivePwrScheme(&g_ActivePwrScheme); + ok(retval, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + retval = DeletePwrScheme(g_ActivePwrScheme); + ok(!retval, "function should have failed\n"); + ok(GetLastError() == ERROR_ACCESS_DENIED, "function should have failed with ERROR_ACCESS_DENIED but got %x\n", (UINT)GetLastError()); + + /* + * delete a temporarly created power scheme + */ + retval = DeletePwrScheme(g_TempPwrScheme); + ok(retval, "function should have succeeded\n"); + +/* + * clean up, delete illegal entry, witch was created for this test + */ + + if (RegOpenKeyW(HKEY_LOCAL_MACHINE, szMachPowerPoliciesSubKey, &hSubKey) == ERROR_SUCCESS) + { + if (RegDeleteKeyW(hSubKey, szTempPwrScheme) != STATUS_SUCCESS) + printf("failed to delete subkey %i (testentry)\n", g_TempPwrScheme); + RegCloseKey(hSubKey); + } + +} + +void test_EnumPwrSchemes(void) +{ + BOOLEAN retval; + + /* + * test EnumPwrScheme with null pointer callback + */ + + retval = EnumPwrSchemes(0, 0); + ok(!retval, "function was expected to fail\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER but got %x\n",(UINT)GetLastError()); + + /* + * enumerate power schemes, should succeed + */ + + retval = EnumPwrSchemes(test_callback_EnumPwrScheme, 0xDEADBEEF); + ok(retval, "function was expected to succeed %d\n",retval); + ok(g_NumPwrSchemes, "Warning: no power schemes available\n"); + + /* + * stop enumeration after first power scheme + */ + + retval = EnumPwrSchemes(test_callback_stop_EnumPwrScheme, (LPARAM)0); + ok(!retval, "function was expected to false\n"); + + /* + * enumerate half of all avalailble profiles + */ + + g_NumPwrSchemesEnumerated = 0; + retval = EnumPwrSchemes(test_callback_stop_EnumPwrScheme, (LPARAM)g_NumPwrSchemes / 2); + ok(retval, "function was expected to succeed but got %i\n", (UINT)retval); + ok(g_NumPwrSchemesEnumerated == g_NumPwrSchemes / 2, "function did not enumerate requested num of profiles %d enumerated %d\n", g_NumPwrSchemes / 2, g_NumPwrSchemesEnumerated); + + +} + +void test_GetSetActivePwrScheme(void) +{ + DWORD retval; + UINT current_scheme = 2; + UINT temp_scheme = 0; + + /* + * read active power scheme + */ + + retval = GetActivePwrScheme(&g_ActivePwrScheme); + + ok(retval, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + ok(retval <= g_NumPwrSchemes, "expected index lower as power scheme count %d but got %d\n", g_NumPwrSchemes, g_ActivePwrScheme); + + /* + * sets active power scheme to inexistant profile + * -> corrupts power scheme enumeration on Windows XP SP2 + */ + //corrupts registry + //retval = SetActivePwrScheme(0xFFFFFFFF, 0, 0); + //ok(!retval, "function was expected to fail"); + //current_scheme = min(active_scheme+1, g_NumPwrSchemes-1); + + /* + * sets the active power scheme to profile with index 0 + */ + + retval = SetActivePwrScheme(current_scheme, 0, 0); + ok(retval, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + /* + * read back the active power scheme + */ + + retval = GetActivePwrScheme(&temp_scheme); + ok(retval, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + ok(temp_scheme == current_scheme, "expected %d but got %d\n", (UINT)current_scheme, (UINT)temp_scheme); + + /* + * restore previous active power scheme + */ + + retval = SetActivePwrScheme(g_ActivePwrScheme, 0, 0); + ok(retval, "Warning: failed to restore old active power scheme %d\n", (UINT)g_ActivePwrScheme); +} + +void test_GetCurrentPowerPolicies(void) +{ + GLOBAL_POWER_POLICY gpp; + POWER_POLICY pp; + BOOLEAN ret; + UINT current_scheme = 2; + + g_ActivePwrScheme=3; + ret = GetActivePwrScheme(&g_ActivePwrScheme); + + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + ret = SetActivePwrScheme(0, &gpp, 0); + + ok(!ret, "function was expected to fail, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(0, 0, &pp); + ok(!ret, "function was expected to fail, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(0, &gpp, &pp); + ok(!ret, "function was expected to fail, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(current_scheme, &gpp, 0); + ok(!ret, "function was expected to fail, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(current_scheme, 0, &pp); + ok(!ret, "function was expected to fail, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(current_scheme, &gpp, &pp); + ok(!ret, "function was expected to fail, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(g_ActivePwrScheme, 0, 0); + ok(ret, "Warning: failed to restore old active power scheme %d\n", (UINT)g_ActivePwrScheme); + + ret = GetCurrentPowerPolicies(0,0); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + ret = GetCurrentPowerPolicies(&gpp,0); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + ret = GetCurrentPowerPolicies(0,&pp); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + ret = GetCurrentPowerPolicies(&gpp,&pp); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + ok(gpp.mach.Revision == 1,"Global Mach Revision was expected to be 1 got %i",(UINT)gpp.mach.Revision); + ok(gpp.user.Revision == 1,"Global User Revision was expected to be 1 got %i",(UINT)gpp.mach.Revision); + ok(pp.mach.Revision == 1,"Mach Revision was expected to be 1 got %i",(UINT)gpp.mach.Revision); + ok(pp.user.Revision == 1,"User Revision was expected to be 1 got %i",(UINT)gpp.mach.Revision); + + + ret = GetActivePwrScheme(&g_ActivePwrScheme); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(0, &gpp, 0); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(0, 0, &pp); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(0, &gpp, &pp); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(current_scheme, &gpp, 0); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(current_scheme, 0, &pp); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(current_scheme, &gpp, &pp); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + + ret = SetActivePwrScheme(g_ActivePwrScheme, 0, 0); + ok(ret, "Warning: failed to restore old active power scheme %d\n", (UINT)g_ActivePwrScheme); + +} + +void test_GetPwrCapabilities(void) +{ + SYSTEM_POWER_CAPABILITIES spc; + BOOLEAN ret; + + ret = GetPwrCapabilities(0); + ok(!ret, "function was expected to fail\n"); + if (!ret) + { + ok(GetLastError() == ERROR_INVALID_PARAMETER,"function was expectet to return ERROR_INVALID_PARAMETER, but returns: %x\n",(UINT)GetLastError()); + } + ret = GetPwrCapabilities(&spc); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); +} + +void test_GetPwrDiskSpindownRange(void) +{ + DWORD retval; + UINT min = 0; + UINT max = 0; + + /* + * invalid parameter checks + */ + + retval = GetPwrDiskSpindownRange(NULL, NULL); + ok(!retval, "function was expected to fail\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected error ERROR_INVALID_PARAMETER but got %x\n", (UINT)GetLastError()); + + retval = GetPwrDiskSpindownRange(&max, NULL); + ok(!retval, "function was expected to fail\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected error ERROR_INVALID_PARAMETER but got %x\n", (UINT)GetLastError()); + + retval = GetPwrDiskSpindownRange(NULL, &min); + ok(!retval, "function was expected to fail\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected error ERROR_INVALID_PARAMETER but got %x\n", (UINT)GetLastError()); + + /* + * read disk spindown range + */ + + retval = GetPwrDiskSpindownRange(&max, &min); + ok(retval, "function was expected to succeed error %x\n",(UINT)GetLastError()); + ok(min <= max, "range mismatch min %d max %d\n",min, max); +} + +void test_IsAdminOverrideActive(void) +{ + ADMINISTRATOR_POWER_POLICY app; + BOOLEAN ret; + + ret = IsAdminOverrideActive(0); + ok(!ret, "function was expected to fail, error %x\n",(UINT)GetLastError()); + + ret = IsAdminOverrideActive(&app); + ok(!ret, "function was expected to fail, error %x\n",(UINT)GetLastError()); + + app.MinSleep = 0; + app.MaxSleep = 0; + app.MinVideoTimeout = 0; + app.MaxVideoTimeout = 0; + app.MinSpindownTimeout = 0; + app.MaxSpindownTimeout = 0; + + ret = IsAdminOverrideActive(&app); + ok(!ret, "function was expected to fail, error %x\n",(UINT)GetLastError()); + + app.MinSleep = 1; + app.MaxSleep = 2; + app.MinVideoTimeout = 3; + app.MaxVideoTimeout = 4; + app.MinSpindownTimeout = 5; + app.MaxSpindownTimeout = 6; + + ret = IsAdminOverrideActive(&app); + ok(!ret, "function was expected to fail, error %x\n",(UINT)GetLastError()); + +} + +void test_IsPwrHibernateAllowed(void) +{ +/* + BOOLEAN ret; + + ret = IsPwrHibernateAllowed(); + ok(!ret, "function was expected to fail, error %x\n",(UINT)GetLastError()); + */ +} + +void test_IsPwrShutdownAllowed(void) +{ +/* + BOOLEAN ret; + + ret = IsPwrShutdownAllowed(); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + */ +} + +void test_IsPwrSuspendAllowed(void) +{ +/* + BOOLEAN ret; + + ret = IsPwrSuspendAllowed(); + ok(ret, "function was expected to succed, error %x\n",(UINT)GetLastError()); + */ +} + +void test_ReadGlobalPwrPolicy(void) +{ + GLOBAL_POWER_POLICY gpp; + BOOLEAN ret; + + ret = ReadGlobalPwrPolicy(&gpp); + ok(ret, "function was expected to succeed, error %x\n",(UINT)GetLastError()); + ok(gpp.mach.Revision == 1,"Global Mach Revision was expected to be 1 got %i",(UINT)gpp.mach.Revision); + ok(gpp.user.Revision == 1,"Global User Revision was expected to be 1 got %i",(UINT)gpp.mach.Revision); + + + +} + +void test_ReadProcessorPwrScheme(void) +{ + MACHINE_PROCESSOR_POWER_POLICY mppp; + BOOLEAN ret; + UINT i = 0; + DWORD err; + + do + { + RtlZeroMemory(&mppp, sizeof(MACHINE_PROCESSOR_POWER_POLICY)); + ret = ReadProcessorPwrScheme(i,&mppp); + if (ret) + { + ok(mppp.Revision == 1,"Main Revision was expected to be 1 got %i",(UINT)mppp.Revision); + ok(mppp.ProcessorPolicyAc.Revision == 1,"PowerAC Revision was expected to be 1 got %i",(UINT)mppp.ProcessorPolicyAc.Revision); + ok(mppp.ProcessorPolicyDc.Revision == 1,"PowerDC Revision was expected to be 1 got %i",(UINT)mppp.ProcessorPolicyDc.Revision); + } + else + { + err = GetLastError(); + ok(err == 0,"Failed Error %x\n",(UINT)err); + return; + } + i++; + if (i == g_NumPwrSchemes) + return; + } while (TRUE); + +} + +void test_ReadPwrScheme(void) +{ + DWORD retval; + + /* + * read power scheme with null pointer -> crashs on Windows XP SP2 + */ + //retval = ReadPwrScheme(0, NULL); + //ok(!retval, "function was expected to fail\n"); + //ok(GetLastError() == STATUS_INVALID_PARAMETER, "expected error ... but got %x\n", GetLastError()); + + /* + * read a power scheme with an invalid index, leads to the creation of the key + * -> corrupts power scheme enumeration + */ + //retval = ReadPwrScheme(0xFFFFFFFF, &powerPolicy); + //ok(!retval, "function was expected to fail\n"); + //ok(GetLastError() == ERROR_ACCESS_DENIED, "expected error ERROR_ACCESS_DENIED but got %x\n", GetLastError()); + + /* + * read current active power scheme + */ + + retval = ReadPwrScheme(g_ActivePwrScheme, &g_PowerPolicy); + ok(retval, "function was expected to succeed error %x\n",(UINT)GetLastError()); + +} + +void test_SetSuspendState(void) +{ +// SetSuspendState(FALSE,FALSE,FALSE) +} + +void test_ValidatePowerPolicies(void) +{ + GLOBAL_POWER_POLICY gpp; + POWER_POLICY pp; + BOOLEAN ret; + + SetLastError(0); + ret = ValidatePowerPolicies(0,0); + ok(ret, "function was expected to succeed error %i\n",(UINT)GetLastError()); + + ret = ValidatePowerPolicies(&gpp,0); + ok(!ret, "function was expected to fail return %i\n",(UINT)ret); + ok(GetLastError() == ERROR_REVISION_MISMATCH,"function was expected to fail with ERROR_REVISION_MISMATCH(%i,%i), but error :%i\n",(UINT)gpp.user.Revision,(UINT)gpp.mach.Revision,(UINT)GetLastError()); + + ret = ValidatePowerPolicies(0,&pp); + ok(!ret, "function was expected to fail return %i\n",(UINT)ret); + ok(GetLastError() == ERROR_REVISION_MISMATCH,"function was expected to fail with ERROR_REVISION_MISMATCH, but error :%i\n",(UINT)GetLastError()); + + ret = ValidatePowerPolicies(&gpp,&pp); + ok(!ret, "function was expected to fail return %i\n",(UINT)ret); + ok(GetLastError() == ERROR_REVISION_MISMATCH,"function was expected to fail with ERROR_REVISION_MISMATCH, but error :%i\n",(UINT)GetLastError()); + + gpp.user.Revision = 1; + gpp.mach.Revision = 1; + + ret = ValidatePowerPolicies(&gpp,0); + ok(!ret, "function was expected to fail return %i\n",(UINT)ret); + ok(GetLastError() == ERROR_INVALID_DATA,"function was expected to fail with ERROR_INVALID_DATA, but error :%i\n",(UINT)GetLastError()); + + gpp.mach.LidOpenWakeAc = PowerSystemWorking; + gpp.mach.LidOpenWakeDc = PowerSystemWorking; + + ret = ValidatePowerPolicies(&gpp,0); + ok(!ret, "function was expected to fail return %i\n",(UINT)ret); + ok(GetLastError() == ERROR_INVALID_DATA,"function was expected to fail with ERROR_INVALID_DATA, but error :%i\n",(UINT)GetLastError()); + + gpp.user.PowerButtonAc.Action = PowerActionNone; + gpp.user.PowerButtonDc.Action = PowerActionNone; + gpp.user.SleepButtonAc.Action = PowerActionNone; + gpp.user.SleepButtonDc.Action = PowerActionNone; + gpp.user.LidCloseAc.Action = PowerActionNone; + gpp.user.LidCloseDc.Action = PowerActionNone; + + gpp.user.DischargePolicy[0].Enable=FALSE; + gpp.user.DischargePolicy[1].Enable=FALSE; + gpp.user.DischargePolicy[2].Enable=FALSE; + gpp.user.DischargePolicy[3].Enable=FALSE; + gpp.user.DischargePolicy[4].Enable=FALSE; + ret = ValidatePowerPolicies(&gpp,0); + ok(ret, "function was expected to succeed return %i\n",(UINT)GetLastError()); + if (!ret) + { + ok(GetLastError() == ERROR_INVALID_DATA,"function was expected to fail with ERROR_INVALID_DATA, but error :%i\n",(UINT)GetLastError()); + } + + pp.user.Revision = 1; + pp.mach.Revision = 1; + + ret = ValidatePowerPolicies(0,&pp); + ok(!ret, "function was expected to fail return %i\n",(UINT)ret); + ok(GetLastError() == ERROR_INVALID_DATA || GetLastError() == ERROR_GEN_FAILURE,"function was expected to fail with ERROR_GEN_FAILURE or ERROR_INVALID_DATA, but error :%i\n",(UINT)GetLastError()); + + pp.mach.MinSleepAc = PowerSystemWorking; + pp.mach.MinSleepDc = PowerSystemWorking; + pp.mach.ReducedLatencySleepAc = PowerSystemWorking; + pp.mach.ReducedLatencySleepDc = PowerSystemWorking; + pp.mach.OverThrottledAc.Action = PowerActionNone; + pp.mach.OverThrottledDc.Action = PowerActionNone; + + pp.user.IdleAc.Action = PowerActionWarmEject+1; + pp.user.IdleDc.Action = PowerActionNone-1; + pp.user.MaxSleepAc = PowerSystemMaximum+1; + pp.user.MaxSleepDc = PowerSystemUnspecified; + + ret = ValidatePowerPolicies(0,&pp); + ok(!ret, "function was expected to fail return %i\n",(UINT)GetLastError()); + if (!ret) + { + ok(GetLastError() == ERROR_INVALID_DATA,"function was expected to fail with ERROR_INVALID_DATA, but error :%i\n",(UINT)GetLastError()); + } + + pp.user.IdleAc.Action = PowerActionNone; + pp.user.IdleDc.Action = PowerActionNone; + pp.user.MaxSleepAc = PowerSystemWorking; + pp.user.MaxSleepDc = PowerSystemWorking; + + ret = ValidatePowerPolicies(0,&pp); + ok(ret, "function was expected to succeed, error %i\n",(UINT)GetLastError()); + if (!ret) + { + ok(GetLastError() == ERROR_GEN_FAILURE,"function was expected to fail with ERROR_GEN_FAILURE, but error :%i\n",(UINT)GetLastError()); + } + + ret = ValidatePowerPolicies(&gpp,&pp); + ok(ret, "function was expected to succeed, error %i\n",(UINT)GetLastError()); + if (!ret) + { +// ok(GetLastError() == ERROR_GEN_FAILURE,"function was expected to fail with ERROR_GEN_FAILURE, but error :%i\n",(UINT)GetLastError()); + } + + + ret = GetCurrentPowerPolicies(&gpp,&pp); + ok(ret, "function was expected to succeed error %i\n",(UINT)GetLastError()); + + ret = ValidatePowerPolicies(&gpp,0); + ok(ret, "function was expected to succeed error %i\n",(UINT)GetLastError()); + + ret = ValidatePowerPolicies(0,&pp); + ok(ret, "function was expected to succeed error %i\n",(UINT)GetLastError()); + + ret = ValidatePowerPolicies(&gpp,&pp); + ok(ret, "function was expected to succeed error %i\n",(UINT)GetLastError()); + +} + +void test_WriteGlobalPwrPolicy(void) +{ +// WriteGlobalPwrPolicy(&gpp); +} + +void test_WriteProcessorPwrScheme(void) +{ +// WriteProcessorPwrScheme(0,&mppp); +} + +void test_WritePwrScheme(void) +{ + DWORD retval; + static const WCHAR szTestSchemeName[] = {'P','o','w','r','p','r','o','f',0}; + static const WCHAR szTestSchemeDesc[] = {'P','o','w','r','p','r','o','f',' ','S','c','h','e','m','e',0}; + + /* + * create a temporarly profile, will be deleted in test_DeletePwrScheme + */ + + retval = WritePwrScheme(&g_TempPwrScheme, (LPWSTR)szTestSchemeName, (LPWSTR)szTestSchemeDesc, &g_PowerPolicy); + ok(retval, "Warning: function should have succeeded\n"); +} + +void func_power(void) +{ + test_CallNtPowerInformation(); + test_CanUserWritePwrScheme(); + test_EnumPwrSchemes(); + test_GetSetActivePwrScheme(); + test_ReadPwrScheme(); + test_WritePwrScheme(); + test_DeletePwrScheme(); + test_GetPwrDiskSpindownRange(); + + test_GetCurrentPowerPolicies(); + + test_GetPwrCapabilities(); + test_IsAdminOverrideActive(); + test_IsPwrHibernateAllowed(); + test_IsPwrShutdownAllowed(); + test_IsPwrSuspendAllowed(); + test_ReadGlobalPwrPolicy(); + test_ReadProcessorPwrScheme(); + test_SetSuspendState(); + test_ValidatePowerPolicies(); + test_WriteGlobalPwrPolicy(); + test_WriteProcessorPwrScheme(); + +} + +void func_ros_init(void) +{ + HKEY hUser, hKeyPowrCfg, hKeyGlobalPowrPol, hKeyPowerPolicies, hKeytmp; + DWORD err; + GLOBAL_USER_POWER_POLICY gupp; + GLOBAL_MACHINE_POWER_POLICY gmpp; + USER_POWER_POLICY upp; + MACHINE_POWER_POLICY mpp; + MACHINE_PROCESSOR_POWER_POLICY mppp; + GLOBAL_POWER_POLICY gpp; + POWER_POLICY pp; + + int i; + + static const WCHAR szUserPowrCfgKey[] = { 'C', 'o', 'n', 't', 'r', 'o', 'l', ' ', + 'P', 'a', 'n', 'e', 'l', '\\', 'P', 'o', 'w', 'e', 'r', 'C', 'f', 'g', 0}; + + static const WCHAR szCurrentPowerPolicy[] = {'C', 'u', 'r', 'r', 'e', 'n', 't', 'P', + 'o', 'w', 'e', 'r', 'P', 'o', 'l', 'i', 'c', 'y', 0}; + static const WCHAR szcpp[] = {'3', 0 }; + + static const WCHAR szGlobalPowerPolicy[] = { 'G', 'l', 'o', 'b', 'a', 'l', 'P', 'o', + 'w', 'e', 'r', 'P', 'o', 'l', 'i', 'c', 'y', 0}; + static const WCHAR szPolicies[] = {'P', 'o', 'l', 'i', 'c', 'i', 'e', 's', 0}; + static const WCHAR szPowerPolicies[] = { 'P', 'o', 'w', 'e', 'r', 'P', 'o', 'l', 'i', + 'c', 'i', 'e', 's', 0}; + + static const WCHAR szProcessorPolicies[] = { 'P', 'r', 'o', 'c', 'e', 's', 's', 'o', 'r', + 'P', 'o', 'l', 'i', 'c', 'i', 'e', 's', 0}; + + static const WCHAR szcName[] = {'N', 'a', 'm', 'e', 0}; + static const WCHAR szcDescription[] = {'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'i', 'o', 'n', 0}; + + static WCHAR szName[] = {'N', 'a', 'm', 'e', '(', '0', ')', 0}; + static WCHAR szDescription[] = {'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'i', 'o', 'n', '(', '0', ')', 0}; + + static const WCHAR szMachPowrCfgKey[] = {'S', 'O', 'F', 'T', 'W', 'A', 'R', 'E', '\\', 'M', 'i', + 'c', 'r', 'o', 's', 'o', 'f', 't', '\\', 'W', 'i', 'n', 'd', 'o', 'w', 's', '\\', 'C', 'u', + 'r', 'r', 'e', 'n', 't', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\\', 'C', 'o', 'n', 't', 'r', + 'o', 'l', 's', ' ', 'F', 'o', 'l', 'd', 'e', 'r', '\\', 'P', 'o', 'w', 'e', 'r', 'C', 'f', 'g', 0}; + + static const WCHAR szLastID[] = {'L', 'a', 's', 't', 'I', 'D', 0}; + static const WCHAR szDiskSpinDownMax[] = {'D', 'i', 's', 'k', 'S', 'p', 'i', 'n', 'D', 'o', 'w', 'n', 'M', 'a', 'x', 0}; + static const WCHAR szDiskSpinDownMin[] = {'D', 'i', 's', 'k', 'S', 'p', 'i', 'n', 'D', 'o', 'w', 'n', 'M', 'i', 'n', 0}; + + static const WCHAR szLastIDValue[] = {'5', 0}; + static const WCHAR szDiskSpinDownMaxValue[] = {'3', '6', '0', '0', 0}; + static const WCHAR szDiskSpinDownMinValue[] = {'3', 0}; + + WCHAR tmp[20]; + /* + * Erstelle die Registry-struktur und Daten, welche dafür erforderlich ist damit diese Tests funktionieren + */ + + /* + * User + */ + err = RegOpenCurrentUser(KEY_ALL_ACCESS,&hUser); + ok(err == ERROR_SUCCESS,"Öffnen des Aktuellen Users Fehlgeschlagen\n"); + if (err == ERROR_SUCCESS) + { + err = RegCreateKey(hUser,szUserPowrCfgKey,&hKeyPowrCfg); + ok(err == ERROR_SUCCESS,"Create Key UserPowrCfg failed with error %i\n",(UINT)err); + ok(hKeyPowrCfg != NULL,"Erstellen des Eintrages Powercfg fehlgeschalgen\n"); + err = RegSetValueExW(hKeyPowrCfg,szCurrentPowerPolicy,(DWORD)NULL,REG_SZ,(CONST BYTE *)szcpp,strlenW(szcpp)*sizeof(WCHAR)); + ok(err == ERROR_SUCCESS,"Set Value CurrentPowerPolicy failed with error %i\n",(UINT)err); + err = RegCreateKey(hKeyPowrCfg,szGlobalPowerPolicy,&hKeyGlobalPowrPol); + ok(err == ERROR_SUCCESS,"Create Key GlobalPowerPolicy failed with error %i\n",(UINT)err); + gupp.Revision = 1; + gupp.PowerButtonAc.Action = PowerActionNone; + gupp.PowerButtonDc.Action = PowerActionNone; + gupp.SleepButtonAc.Action = PowerActionNone; + gupp.SleepButtonDc.Action = PowerActionNone; + gupp.LidCloseAc.Action = PowerActionNone; + gupp.LidCloseDc.Action = PowerActionNone; + for (i=0; i<NUM_DISCHARGE_POLICIES; i++) + { + gupp.DischargePolicy[0].Enable=FALSE; + } + + err = RegSetValueExW(hKeyGlobalPowrPol,szPolicies,(DWORD)NULL,REG_BINARY,(CONST BYTE *)&gupp,sizeof(GLOBAL_USER_POWER_POLICY)); + ok(err == ERROR_SUCCESS,"Set Value GlobalPowrPol failed with error %i\n",(UINT)err); + err = RegCloseKey(hKeyGlobalPowrPol); + ok(err == ERROR_SUCCESS,"Close Key GlobalPowrPol failed with error %i\n",(UINT)err); + err = RegCreateKey(hKeyPowrCfg,szPowerPolicies,&hKeyPowerPolicies); + ok(err == ERROR_SUCCESS,"Create Key PowerPolicies failed with error %i\n",(UINT)err); + + upp.Revision = 1; + upp.IdleAc.Action = PowerActionNone; + upp.IdleDc.Action = PowerActionNone; + upp.MaxSleepAc = PowerSystemWorking; + upp.MaxSleepDc = PowerSystemWorking; + upp.VideoTimeoutAc = 0; + upp.VideoTimeoutDc = 0; + upp.SpindownTimeoutAc = 0; + upp.SpindownTimeoutDc = 0; + + for (i = 0; i<6; i++) + { + _itow(i,tmp,10); + err = RegCreateKey(hKeyPowerPolicies,tmp,&hKeytmp); + ok(err == ERROR_SUCCESS,"Create Key PowerPolicies(%i) failed with error %i\n",i,(UINT)err); + szName[5]++; + szDescription[12]++; + err = RegSetValueExW(hKeytmp,szcName,(DWORD)NULL,REG_SZ,(CONST BYTE *)szName,strlenW(szName)*sizeof(WCHAR)); + err = RegSetValueExW(hKeytmp,szcDescription,(DWORD)NULL,REG_SZ,(CONST BYTE *)szDescription,strlenW(szDescription)*sizeof(WCHAR)); + err = RegSetValueExW(hKeytmp,szPolicies,(DWORD)NULL,REG_BINARY,(CONST BYTE *)&upp,sizeof(USER_POWER_POLICY)); + err = RegCloseKey(hKeytmp); + } + err = RegCloseKey(hKeyPowerPolicies); + err = RegCloseKey(hKeyPowrCfg); + err = RegCloseKey(hUser); + } + + /* + * Mach + */ + err = RegCreateKey(HKEY_LOCAL_MACHINE,szMachPowrCfgKey,&hKeyPowrCfg); + ok(err == ERROR_SUCCESS,"Create Key MachPowrCfgKey failed with error %i\n",(UINT)err); + err = RegSetValueExW(hKeyPowrCfg,szLastID,(DWORD)NULL,REG_SZ,(CONST BYTE *)szLastIDValue,strlenW(szLastIDValue)*sizeof(WCHAR)); + err = RegSetValueExW(hKeyPowrCfg,szDiskSpinDownMax,(DWORD)NULL,REG_SZ,(CONST BYTE *)szDiskSpinDownMaxValue,strlenW(szDiskSpinDownMaxValue)*sizeof(WCHAR)); + err = RegSetValueExW(hKeyPowrCfg,szDiskSpinDownMin,(DWORD)NULL,REG_SZ,(CONST BYTE *)szDiskSpinDownMinValue,strlenW(szDiskSpinDownMinValue)*sizeof(WCHAR)); + + err = RegCreateKey(hKeyPowrCfg,szGlobalPowerPolicy,&hKeyGlobalPowrPol); + ok(err == ERROR_SUCCESS,"Create Key Mach GlobalPowerPolicy failed with error %i\n",(UINT)err); + gmpp.Revision = 1; + gmpp.LidOpenWakeAc = PowerSystemWorking; + gmpp.LidOpenWakeDc = PowerSystemWorking; + gmpp.BroadcastCapacityResolution=0; + + err = RegSetValueExW(hKeyGlobalPowrPol,szPolicies,(DWORD)NULL,REG_BINARY,(CONST BYTE *)&gmpp,sizeof(GLOBAL_MACHINE_POWER_POLICY)); + + err = RegCloseKey(hKeyGlobalPowrPol); + err = RegCreateKey(hKeyPowrCfg,szPowerPolicies,&hKeyPowerPolicies); + ok(err == ERROR_SUCCESS,"Create Key Mach PowerPolicies failed with error %i\n",(UINT)err); + + mpp.Revision = 1; + mpp.MinSleepAc = PowerSystemWorking; + mpp.MinSleepDc = PowerSystemWorking; + mpp.ReducedLatencySleepAc = PowerSystemWorking; + mpp.ReducedLatencySleepDc = PowerSystemWorking; + mpp.OverThrottledAc.Action = PowerActionNone; + mpp.OverThrottledDc.Action = PowerActionNone; + mpp.DozeS4TimeoutAc=0; + mpp.DozeS4TimeoutDc=0; + + for (i = 0; i<6; i++) + { + _itow(i,tmp,10); + err = RegCreateKey(hKeyPowerPolicies,tmp,&hKeytmp); + ok(err == ERROR_SUCCESS,"Create Key Mach PowerPolicies(%i) failed with error %i\n",(UINT)i,(UINT)err); + err = RegSetValueExW(hKeytmp,szPolicies,(DWORD)NULL,REG_BINARY,(CONST BYTE *)&mpp,sizeof(MACHINE_POWER_POLICY)); + err = RegCloseKey(hKeytmp); + } + err = RegCloseKey(hKeyPowerPolicies); + + err = RegCreateKey(hKeyPowrCfg,szProcessorPolicies,&hKeyPowerPolicies); + ok(err == ERROR_SUCCESS,"Create Key Mach ProcessorPolicies failed with error %i\n",(UINT)err); + + mppp.Revision = 1; + mppp.ProcessorPolicyAc.Revision = 1; + mppp.ProcessorPolicyDc.Revision = 1; + + for (i = 0; i<6; i++) + { + _itow(i,tmp,10); + err = RegCreateKey(hKeyPowerPolicies,tmp,&hKeytmp); + ok(err == ERROR_SUCCESS,"Create Key Mach ProcessorPolicies(%i) failed with error %i\n",i,(UINT)err); + err = RegSetValueExW(hKeytmp,szPolicies,(DWORD)NULL,REG_BINARY,(CONST BYTE *)&mppp,sizeof(MACHINE_PROCESSOR_POWER_POLICY)); + err = RegCloseKey(hKeytmp); + } + err = RegCloseKey(hKeyPowerPolicies); + + err = RegCloseKey(hKeyPowrCfg); + + err = GetCurrentPowerPolicies(&gpp,&pp); + ok(err, "function was expected to succeed error %i\n",(UINT)GetLastError()); + + err = ValidatePowerPolicies(&gpp,&pp); + ok(err, "function was expected to succeed error %i\n",(UINT)GetLastError()); + + /* + [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\GlobalPowerPolicy] + "CursorProperties"=... + + */ + +} Propchange: trunk/reactos/regtests/winetests/powrprof/pwrprof.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/regtests/winetests/powrprof/testlist.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/regtests/winetests/powrprof…
============================================================================== --- trunk/reactos/regtests/winetests/powrprof/testlist.c (added) +++ trunk/reactos/regtests/winetests/powrprof/testlist.c Thu Jun 15 18:50:42 2006 @@ -1,0 +1,27 @@ +/* Automatically generated file; DO NOT EDIT!! */ + +/* stdarg.h is needed for Winelib */ +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include "windef.h" +#include "winbase.h" + +struct test +{ + const char *name; + void (*func)(void); +}; + +extern void func_power(void); +extern void func_ros_init(void); + +const struct test winetest_testlist[] = +{ + { "power", func_power }, + { "ros_init", func_ros_init }, + { 0, 0 } +}; + +#define WINETEST_WANT_MAIN +#include "wine/test.h" Propchange: trunk/reactos/regtests/winetests/powrprof/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native
18 years, 5 months
1
0
0
0
[janderwald] 22368: fix typo spotted by Christoph_vW
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jun 15 18:44:11 2006 New Revision: 22368 URL:
http://svn.reactos.ru/svn/reactos?rev=22368&view=rev
Log: fix typo spotted by Christoph_vW Modified: trunk/reactos/dll/cpl/powercfg/de.rc Modified: trunk/reactos/dll/cpl/powercfg/de.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/de.rc?rev=…
============================================================================== --- trunk/reactos/dll/cpl/powercfg/de.rc (original) +++ trunk/reactos/dll/cpl/powercfg/de.rc Thu Jun 15 18:44:11 2006 @@ -4,13 +4,13 @@ IDD_PROPPAGEPOWERSHEMES DIALOGEX 0, 0, 252, 218 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Energieschemas" +CAPTION "Energieschemata" FONT 8, "MS Shell Dlg" BEGIN ICON IDI_ACDC, IDI_ACDC, 7,7,28,22 LTEXT "Wählen Sie das Energieschema mit den am besten zu diesem Computer passenden Einstellungen. Bedenken Sie, dass die Einstellungen das unten ausgewählte Schema modifizieren.", -1,45,13,194,36 - GROUPBOX "&Energieschemen", -1, 7,57,240,46 + GROUPBOX "&Energieschemata", -1, 7,57,240,46 COMBOBOX IDC_ENERGYLIST, 14,70,224,92, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Speichern &unter...", -1, 100,85,75,15,WS_DISABLED PUSHBUTTON "&Löschen", -1, 180,85,55,15,WS_DISABLED
18 years, 5 months
1
0
0
0
[janderwald] 22367: * remove warning * return true in ValidatePowerPolicy
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jun 15 18:36:17 2006 New Revision: 22367 URL:
http://svn.reactos.ru/svn/reactos?rev=22367&view=rev
Log: * remove warning * return true in ValidatePowerPolicy Modified: trunk/reactos/dll/win32/powrprof/powrprof.c Modified: trunk/reactos/dll/win32/powrprof/powrprof.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/powrprof/powrprof…
============================================================================== --- trunk/reactos/dll/win32/powrprof/powrprof.c (original) +++ trunk/reactos/dll/win32/powrprof/powrprof.c Thu Jun 15 18:36:17 2006 @@ -29,6 +29,7 @@ #include "powrprof.h" #include "wine/debug.h" #include "wine/unicode.h" +#include "stdlib.h" WINE_DEFAULT_DEBUG_CHANNEL(powrprof); @@ -308,7 +309,7 @@ /* FIXME: See note #3 */ FIXME("(%p, %p) stub!\n", pGPP, pPP); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + return TRUE; }
18 years, 5 months
1
0
0
0
[janderwald] 22366: add missing export
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jun 15 18:28:46 2006 New Revision: 22366 URL:
http://svn.reactos.ru/svn/reactos?rev=22366&view=rev
Log: add missing export Modified: trunk/reactos/dll/win32/powrprof/powrprof.c trunk/reactos/dll/win32/powrprof/powrprof_gcc.def Modified: trunk/reactos/dll/win32/powrprof/powrprof.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/powrprof/powrprof…
============================================================================== --- trunk/reactos/dll/win32/powrprof/powrprof.c (original) +++ trunk/reactos/dll/win32/powrprof/powrprof.c Thu Jun 15 18:28:46 2006 @@ -303,6 +303,15 @@ return FALSE; } +BOOLEAN WINAPI ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP) +{ + /* FIXME: See note #3 */ + FIXME("(%p, %p) stub!\n", pGPP, pPP); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; + +} + BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { FIXME("(%p, %ld, %p) not fully implemented\n", hinstDLL, fdwReason, lpvReserved); Modified: trunk/reactos/dll/win32/powrprof/powrprof_gcc.def URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/powrprof/powrprof…
============================================================================== --- trunk/reactos/dll/win32/powrprof/powrprof_gcc.def (original) +++ trunk/reactos/dll/win32/powrprof/powrprof_gcc.def Thu Jun 15 18:28:46 2006 @@ -30,7 +30,7 @@ ReadPwrScheme@8 SetActivePwrScheme@12 SetSuspendState@12 -;ValidatePowerPolicies@8 +ValidatePowerPolicies@8 WriteGlobalPwrPolicy@4 WriteProcessorPwrScheme@8 WritePwrScheme@16
18 years, 5 months
1
0
0
0
[janderwald] 22365: forgot to add powercfg baseaddress
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jun 15 18:19:29 2006 New Revision: 22365 URL:
http://svn.reactos.ru/svn/reactos?rev=22365&view=rev
Log: forgot to add powercfg baseaddress Modified: trunk/reactos/baseaddress.rbuild Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=2236…
============================================================================== --- trunk/reactos/baseaddress.rbuild (original) +++ trunk/reactos/baseaddress.rbuild Thu Jun 15 18:19:29 2006 @@ -7,6 +7,7 @@ <property name="BASEADDRESS_NOTIFYHOOK" value="0x08000000" /> <property name="BASEADDRESS_DEVENUM" value="0x35680000" /> <property name="BASEADDRESS_MMSYS" value="0x588A0000" /> + <property name="BASEADDRESS_PWRCFG" value="0x587E0000" /> <property name="BASEADDRESS_UXTHEME" value="0x5AD70000" /> <property name="BASEADDRESS_VDMDBG" value="0x5B0D0000" /> <property name="BASEADDRESS_OBJSEL" value="0x5B400000" />
18 years, 5 months
1
0
0
0
[janderwald] 22364: set eol-style:native set keywords:author date id revision
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Jun 15 18:16:29 2006 New Revision: 22364 URL:
http://svn.reactos.ru/svn/reactos?rev=22364&view=rev
Log: set eol-style:native set keywords:author date id revision Modified: trunk/reactos/dll/cpl/powercfg/advanced.c (contents, props changed) trunk/reactos/dll/cpl/powercfg/alarms.c (contents, props changed) trunk/reactos/dll/cpl/powercfg/de.rc (contents, props changed) trunk/reactos/dll/cpl/powercfg/en.rc (contents, props changed) trunk/reactos/dll/cpl/powercfg/hibernate.c (contents, props changed) trunk/reactos/dll/cpl/powercfg/powercfg.c (contents, props changed) trunk/reactos/dll/cpl/powercfg/powercfg.def (contents, props changed) trunk/reactos/dll/cpl/powercfg/powercfg.h (contents, props changed) trunk/reactos/dll/cpl/powercfg/powercfg.rbuild (contents, props changed) trunk/reactos/dll/cpl/powercfg/powercfg.rc (contents, props changed) trunk/reactos/dll/cpl/powercfg/powershemes.c (contents, props changed) trunk/reactos/dll/cpl/powercfg/resource.h (contents, props changed) [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/cpl/powercfg/advanced.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/advanced.c…
Modified: trunk/reactos/dll/cpl/powercfg/alarms.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/alarms.c?r…
Modified: trunk/reactos/dll/cpl/powercfg/de.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/de.rc?rev=…
Modified: trunk/reactos/dll/cpl/powercfg/en.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/en.rc?rev=…
Modified: trunk/reactos/dll/cpl/powercfg/hibernate.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/hibernate.…
Modified: trunk/reactos/dll/cpl/powercfg/powercfg.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.c…
Modified: trunk/reactos/dll/cpl/powercfg/powercfg.def URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.d…
Modified: trunk/reactos/dll/cpl/powercfg/powercfg.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.h…
Modified: trunk/reactos/dll/cpl/powercfg/powercfg.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.r…
Modified: trunk/reactos/dll/cpl/powercfg/powercfg.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.r…
Modified: trunk/reactos/dll/cpl/powercfg/powershemes.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/powersheme…
Modified: trunk/reactos/dll/cpl/powercfg/resource.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/powercfg/resource.h…
18 years, 5 months
1
0
0
0
← Newer
1
...
34
35
36
37
38
39
40
...
60
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Results per page:
10
25
50
100
200