ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
July
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2015
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
535 discussions
Start a n
N
ew thread
[dquintana] 69110: [FATTEN] Undo a debug change that I forgot to revert.
by dquintana@svn.reactos.org
Author: dquintana Date: Tue Sep 8 03:39:51 2015 New Revision: 69110 URL:
http://svn.reactos.org/svn/reactos?rev=69110&view=rev
Log: [FATTEN] Undo a debug change that I forgot to revert. Modified: trunk/reactos/tools/fatten/fatten.c Modified: trunk/reactos/tools/fatten/fatten.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/fatten.c?rev=…
============================================================================== --- trunk/reactos/tools/fatten/fatten.c [iso-8859-1] (original) +++ trunk/reactos/tools/fatten/fatten.c [iso-8859-1] Tue Sep 8 03:39:51 2015 @@ -182,7 +182,7 @@ if (!fe) { - printf("Error: unable to open external file '%s' for reading. errno=%d", argv[0], errno); + printf("Error: unable to open external file '%s' for reading.", argv[0]); return 1; }
9 years, 9 months
1
0
0
0
[dquintana] 69109: [FATTEN] * Fix folder creation and external file access. * Add fatten as a host-tool. * Add a target for creating efisys.bin from the bootmgfw TODO: Make the name of the boot*.ef...
by dquintana@svn.reactos.org
Author: dquintana Date: Tue Sep 8 03:37:47 2015 New Revision: 69109 URL:
http://svn.reactos.org/svn/reactos?rev=69109&view=rev
Log: [FATTEN] * Fix folder creation and external file access. * Add fatten as a host-tool. * Add a target for creating efisys.bin from the bootmgfw TODO: Make the name of the boot*.efi depend on the platform (ia32/x64/arm). TODO: Add efisys as a dependency to the bootcd, when we need to make use of the efisys.bin file for the iso (waiting for hbelusca's cdmake work). Modified: trunk/reactos/CMakeLists.txt trunk/reactos/boot/CMakeLists.txt trunk/reactos/cmake/host-tools.cmake trunk/reactos/tools/CMakeLists.txt trunk/reactos/tools/fatten/CMakeLists.txt trunk/reactos/tools/fatten/fatten.c Modified: trunk/reactos/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/CMakeLists.txt?rev=69109&r…
============================================================================== --- trunk/reactos/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/CMakeLists.txt [iso-8859-1] Tue Sep 8 03:37:47 2015 @@ -112,9 +112,9 @@ if(NOT NEW_STYLE_BUILD) if(NOT MSVC) - export(TARGETS bin2c widl gendib cabman cdmake hpp mkhive obj2bin spec2def geninc rsym mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- ) + export(TARGETS bin2c widl gendib cabman cdmake fatten hpp mkhive obj2bin spec2def geninc rsym mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- ) else() - export(TARGETS bin2c widl gendib cabman cdmake hpp mkhive obj2bin spec2def geninc mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- ) + export(TARGETS bin2c widl gendib cabman cdmake fatten hpp mkhive obj2bin spec2def geninc mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- ) endif() endif() Modified: trunk/reactos/boot/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/CMakeLists.txt?rev=69…
============================================================================== --- trunk/reactos/boot/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/boot/CMakeLists.txt [iso-8859-1] Tue Sep 8 03:37:47 2015 @@ -1,3 +1,10 @@ +## efisys.bin + +add_custom_target(efisys + COMMAND native-fatten ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin -format 2880 -mkdir efi -mkdir efi/boot -add $<TARGET_FILE:bootmgfw> efi/boot/bootia32.efi + DEPENDS native-fatten bootmgfw + VERBATIM) + ##bootcd #clear it out file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst "") Modified: trunk/reactos/cmake/host-tools.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/host-tools.cmake?rev…
============================================================================== --- trunk/reactos/cmake/host-tools.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/host-tools.cmake [iso-8859-1] Tue Sep 8 03:37:47 2015 @@ -6,7 +6,7 @@ string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type) # List of host tools -list(APPEND host_tools_list bin2c hpp widl gendib cabman cdmake mkhive obj2bin spec2def geninc mkshelllink utf16le) +list(APPEND host_tools_list bin2c hpp widl gendib cabman cdmake fatten mkhive obj2bin spec2def geninc mkshelllink utf16le) if(NOT MSVC) list(APPEND host_tools_list rsym) endif() Modified: trunk/reactos/tools/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/CMakeLists.txt?rev=6…
============================================================================== --- trunk/reactos/tools/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/tools/CMakeLists.txt [iso-8859-1] Tue Sep 8 03:37:47 2015 @@ -39,4 +39,4 @@ add_subdirectory(rsym) endif() -#add_subdirectory(fatten) +add_subdirectory(fatten) Modified: trunk/reactos/tools/fatten/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/CMakeLists.tx…
============================================================================== --- trunk/reactos/tools/fatten/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/tools/fatten/CMakeLists.txt [iso-8859-1] Tue Sep 8 03:37:47 2015 @@ -1,5 +1,5 @@ -add_executable(fatten +add_host_tool(fatten fatten.c fatfs/diskio.c fatfs/ff.c Modified: trunk/reactos/tools/fatten/fatten.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/fatten.c?rev=…
============================================================================== --- trunk/reactos/tools/fatten/fatten.c [iso-8859-1] (original) +++ trunk/reactos/tools/fatten/fatten.c [iso-8859-1] Tue Sep 8 03:37:47 2015 @@ -178,11 +178,14 @@ FILE* fe; FIL fv = { 0 }; - if (fe = fopen(argv[0], "rb")) - { - printf("Error: unable to open external file '%s' for reading.", argv[0]); - return 1; - } + fe = fopen(argv[0], "rb"); + + if (!fe) + { + printf("Error: unable to open external file '%s' for reading. errno=%d", argv[0], errno); + return 1; + } + if (f_open(&fv, argv[1], FA_WRITE | FA_CREATE_ALWAYS)) { printf("Error: unable to open file '%s' for writing.", argv[1]); @@ -218,7 +221,10 @@ printf("Error: unable to open file '%s' for reading.", argv[0]); return 1; } - if (fv = fopen(argv[1], "wb")) + + fv = fopen(argv[1], "wb"); + + if (!fv) { printf("Error: unable to open external file '%s' for writing.", argv[1]); return 1; @@ -286,16 +292,18 @@ NEED_PARAMS(1, 1); NEED_MOUNT(); + // Arg 1: folder path - f_mkdir(argv[1]); + f_mkdir(argv[0]); } else if (strcmp(parg, "delete") == 0) { NEED_PARAMS(1, 1); NEED_MOUNT(); + // Arg 1: file/folder path (cannot delete non-empty folders) - f_unlink(argv[1]); + f_unlink(argv[0]); } else if (strcmp(parg, "list") == 0) {
9 years, 9 months
1
0
0
0
[aandrejevic] 69108: [FATTEN] Not every C library out there has fopen_s.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Tue Sep 8 00:54:44 2015 New Revision: 69108 URL:
http://svn.reactos.org/svn/reactos?rev=69108&view=rev
Log: [FATTEN] Not every C library out there has fopen_s. Modified: trunk/reactos/tools/fatten/fatten.c Modified: trunk/reactos/tools/fatten/fatten.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/fatten.c?rev=…
============================================================================== --- trunk/reactos/tools/fatten/fatten.c [iso-8859-1] (original) +++ trunk/reactos/tools/fatten/fatten.c [iso-8859-1] Tue Sep 8 00:54:44 2015 @@ -178,7 +178,7 @@ FILE* fe; FIL fv = { 0 }; - if (fopen_s(&fe, argv[0], "rb")) + if (fe = fopen(argv[0], "rb")) { printf("Error: unable to open external file '%s' for reading.", argv[0]); return 1; @@ -218,7 +218,7 @@ printf("Error: unable to open file '%s' for reading.", argv[0]); return 1; } - if (fopen_s(&fv, argv[1], "wb")) + if (fv = fopen(argv[1], "wb")) { printf("Error: unable to open external file '%s' for writing.", argv[1]); return 1;
9 years, 9 months
1
0
0
0
[dquintana] 69107: Oops. Forgot to includethis file in the commit.
by dquintana@svn.reactos.org
Author: dquintana Date: Tue Sep 8 00:48:25 2015 New Revision: 69107 URL:
http://svn.reactos.org/svn/reactos?rev=69107&view=rev
Log: Oops. Forgot to includethis file in the commit. Modified: trunk/reactos/tools/fatten/CMakeLists.txt Modified: trunk/reactos/tools/fatten/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/CMakeLists.tx…
============================================================================== --- trunk/reactos/tools/fatten/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/tools/fatten/CMakeLists.txt [iso-8859-1] Tue Sep 8 00:48:25 2015 @@ -3,5 +3,4 @@ fatten.c fatfs/diskio.c fatfs/ff.c - fatfs/option/syscall.c fatfs/option/ccsbcs.c)
9 years, 9 months
1
0
0
0
[dquintana] 69106: [FATTEN] * Remove pointless dependency on BOOL and CHAR, which helps with portability. * Disable reentrancy, since all the operations are serialized by the commandline. * Improve...
by dquintana@svn.reactos.org
Author: dquintana Date: Tue Sep 8 00:45:35 2015 New Revision: 69106 URL:
http://svn.reactos.org/svn/reactos?rev=69106&view=rev
Log: [FATTEN] * Remove pointless dependency on BOOL and CHAR, which helps with portability. * Disable reentrancy, since all the operations are serialized by the commandline. * Improve a few comments. Removed: trunk/reactos/tools/fatten/fatfs/option/syscall.c Modified: trunk/reactos/tools/fatten/fatfs/ffconf.h trunk/reactos/tools/fatten/fatfs/integer.h trunk/reactos/tools/fatten/fatten.c Modified: trunk/reactos/tools/fatten/fatfs/ffconf.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/fatfs/ffconf.…
============================================================================== --- trunk/reactos/tools/fatten/fatfs/ffconf.h [iso-8859-1] (original) +++ trunk/reactos/tools/fatten/fatfs/ffconf.h [iso-8859-1] Tue Sep 8 00:45:35 2015 @@ -203,7 +203,7 @@ / This feature consumes _FS_LOCK * 12 bytes of bss area. */ -#define _FS_REENTRANT 1 /* 0:Disable or 1:Enable */ +#define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */ #define _FS_TIMEOUT 1000 /* Timeout period in unit of time ticks */ #define _SYNC_t HANDLE /* O/S dependent sync object type. e.g. HANDLE, OS_EVENT*, ID and etc.. */ /*#include <windows.h>*/ Modified: trunk/reactos/tools/fatten/fatfs/integer.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/fatfs/integer…
============================================================================== --- trunk/reactos/tools/fatten/fatfs/integer.h [iso-8859-1] (original) +++ trunk/reactos/tools/fatten/fatfs/integer.h [iso-8859-1] Tue Sep 8 00:45:35 2015 @@ -5,12 +5,12 @@ #ifndef _FF_INTEGER #define _FF_INTEGER -#ifdef _WIN32 /* Windows */ +#if defined(_MSC_VER) && (_MSC_VER < 0x1700) /* Windows with older MSVC */ #include <windows.h> #include <tchar.h> -#else /* Unixes */ +#else /* Unixes */ #include <stdint.h> @@ -22,7 +22,7 @@ typedef uint16_t WORD; typedef uint16_t WCHAR; -/* These types MUST be 16 bit or 32 bit */ +/* These types MUST be at least 16 bit */ typedef int_fast16_t INT; typedef uint_fast16_t UINT; Removed: trunk/reactos/tools/fatten/fatfs/option/syscall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/fatfs/option/…
============================================================================== --- trunk/reactos/tools/fatten/fatfs/option/syscall.c [iso-8859-1] (original) +++ trunk/reactos/tools/fatten/fatfs/option/syscall.c (removed) @@ -1,153 +0,0 @@ -/*------------------------------------------------------------------------*/ -/* Sample code of OS dependent controls for FatFs */ -/* (C)ChaN, 2012 */ -/*------------------------------------------------------------------------*/ - -#include <stdlib.h> /* ANSI memory controls */ -#include <malloc.h> /* ANSI memory controls */ - -#include "../ff.h" - - -#if _FS_REENTRANT -/*------------------------------------------------------------------------*/ -/* Create a Synchronization Object -/*------------------------------------------------------------------------*/ -/* This function is called by f_mount() function to create a new -/ synchronization object, such as semaphore and mutex. When a 0 is -/ returned, the f_mount() function fails with FR_INT_ERR. -*/ - -int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create due to any error */ - BYTE vol, /* Corresponding logical drive being processed */ - _SYNC_t* sobj /* Pointer to return the created sync object */ -) -{ - int ret; - - - *sobj = CreateMutex(NULL, FALSE, NULL); /* Win32 */ - ret = (int)(*sobj != INVALID_HANDLE_VALUE); - -// *sobj = SyncObjects[vol]; /* uITRON (give a static created semaphore) */ -// ret = 1; - -// *sobj = OSMutexCreate(0, &err); /* uC/OS-II */ -// ret = (int)(err == OS_NO_ERR); - -// *sobj = xSemaphoreCreateMutex(); /* FreeRTOS */ -// ret = (int)(*sobj != NULL); - - return ret; -} - - - -/*------------------------------------------------------------------------*/ -/* Delete a Synchronization Object */ -/*------------------------------------------------------------------------*/ -/* This function is called in f_mount() function to delete a synchronization -/ object that created with ff_cre_syncobj() function. When a 0 is -/ returned, the f_mount() function fails with FR_INT_ERR. -*/ - -int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any error */ - _SYNC_t sobj /* Sync object tied to the logical drive to be deleted */ -) -{ - int ret; - - - ret = CloseHandle(sobj); /* Win32 */ - -// ret = 1; /* uITRON (nothing to do) */ - -// OSMutexDel(sobj, OS_DEL_ALWAYS, &err); /* uC/OS-II */ -// ret = (int)(err == OS_NO_ERR); - -// xSemaphoreDelete(sobj); /* FreeRTOS */ -// ret = 1; - - return ret; -} - - - -/*------------------------------------------------------------------------*/ -/* Request Grant to Access the Volume */ -/*------------------------------------------------------------------------*/ -/* This function is called on entering file functions to lock the volume. -/ When a FALSE is returned, the file function fails with FR_TIMEOUT. -*/ - -int ff_req_grant ( /* TRUE:Got a grant to access the volume, FALSE:Could not get a grant */ - _SYNC_t sobj /* Sync object to wait */ -) -{ - int ret; - - ret = (int)(WaitForSingleObject(sobj, _FS_TIMEOUT) == WAIT_OBJECT_0); /* Win32 */ - -// ret = (int)(wai_sem(sobj) == E_OK); /* uITRON */ - -// OSMutexPend(sobj, _FS_TIMEOUT, &err)); /* uC/OS-II */ -// ret = (int)(err == OS_NO_ERR); - -// ret = (int)(xSemaphoreTake(sobj, _FS_TIMEOUT) == pdTRUE); /* FreeRTOS */ - - return ret; -} - - - -/*------------------------------------------------------------------------*/ -/* Release Grant to Access the Volume */ -/*------------------------------------------------------------------------*/ -/* This function is called on leaving file functions to unlock the volume. -*/ - -void ff_rel_grant ( - _SYNC_t sobj /* Sync object to be signaled */ -) -{ - ReleaseMutex(sobj); /* Win32 */ - -// sig_sem(sobj); /* uITRON */ - -// OSMutexPost(sobj); /* uC/OS-II */ - -// xSemaphoreGive(sobj); /* FreeRTOS */ -} - -#endif - - - - -#if _USE_LFN == 3 /* LFN with a working buffer on the heap */ -/*------------------------------------------------------------------------*/ -/* Allocate a memory block */ -/*------------------------------------------------------------------------*/ -/* If a NULL is returned, the file function fails with FR_NOT_ENOUGH_CORE. -*/ - -void* ff_memalloc ( /* Returns pointer to the allocated memory block */ - UINT msize /* Number of bytes to allocate */ -) -{ - return malloc(msize); -} - - -/*------------------------------------------------------------------------*/ -/* Free a memory block */ -/*------------------------------------------------------------------------*/ - -void ff_memfree ( - void* mblock /* Pointer to the memory block to free */ -) -{ - free(mblock); -} - -#endif Modified: trunk/reactos/tools/fatten/fatten.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/fatten.c?rev=…
============================================================================== --- trunk/reactos/tools/fatten/fatten.c [iso-8859-1] (original) +++ trunk/reactos/tools/fatten/fatten.c [iso-8859-1] Tue Sep 8 00:45:35 2015 @@ -53,7 +53,7 @@ return myTime.whole; } -BOOL is_command(const char* parg) +int is_command(const char* parg) { return (parg[0] == '/') || (parg[0] == '-'); } @@ -64,7 +64,7 @@ if(nargs>_max_) { printf("Too many args for command %s.\n",argv[-1]); goto print_help; } \ } while(0) -BOOL need_mount() +int need_mount() { if (isMounted) return FR_OK; @@ -320,7 +320,7 @@ printf("Listing directory contents of: %s\n", root); FILINFO info = { 0 }; - CHAR lfname[257]; + char lfname[257]; info.lfname = lfname; info.lfsize = 256; while ((!f_readdir(&dir, &info)) && (strlen(info.fname) > 0))
9 years, 9 months
1
0
0
0
[dquintana] 69105: [FATTEN] * Fix the integer types for non-windows platforms (assume they have stdint.h instead of assuming embedded). * Fix file I/O, which was just barely working enough to pass ...
by dquintana@svn.reactos.org
Author: dquintana Date: Tue Sep 8 00:28:28 2015 New Revision: 69105 URL:
http://svn.reactos.org/svn/reactos?rev=69105&view=rev
Log: [FATTEN] * Fix the integer types for non-windows platforms (assume they have stdint.h instead of assuming embedded). * Fix file I/O, which was just barely working enough to pass the one test I did. Modified: trunk/reactos/tools/fatten/fatfs/diskio.c trunk/reactos/tools/fatten/fatfs/integer.h Modified: trunk/reactos/tools/fatten/fatfs/diskio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/fatfs/diskio.…
============================================================================== --- trunk/reactos/tools/fatten/fatfs/diskio.c [iso-8859-1] (original) +++ trunk/reactos/tools/fatten/fatfs/diskio.c [iso-8859-1] Tue Sep 8 00:28:28 2015 @@ -31,6 +31,10 @@ return 0; driveHandle[0] = fopen(imageFileName, "r+b"); + if(!driveHandle[0]) + { + driveHandle[0] = fopen(imageFileName, "w+"); + } if (driveHandle[0] != NULL) return 0; @@ -80,10 +84,10 @@ result = fread(buff, 512, count, driveHandle[pdrv]); - if (result == count) - return RES_OK; + if (result != count) + return RES_ERROR; - return RES_ERROR; + return RES_OK; } } @@ -114,9 +118,8 @@ return RES_ERROR; result = fwrite(buff, 512, count, driveHandle[pdrv]); - return RES_ERROR; - if (result != (512 * count)) + if (result != count) return RES_ERROR; return RES_OK; @@ -155,9 +158,15 @@ *(DWORD*)buff = 512; return RES_OK; case GET_SECTOR_COUNT: - fseek(driveHandle[pdrv], 0, SEEK_END); - *(DWORD*)buff = ftell(driveHandle[pdrv]) / 512; + { + int temp = 0; + if(fseek(driveHandle[pdrv], 0, SEEK_END)) + printf("fseek failed!\n"); + else + temp = ftell(driveHandle[pdrv]); + *(DWORD*)buff = temp/512; return RES_OK; + } case SET_SECTOR_COUNT: { int count = *(DWORD*)buff; Modified: trunk/reactos/tools/fatten/fatfs/integer.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/fatfs/integer…
============================================================================== --- trunk/reactos/tools/fatten/fatfs/integer.h [iso-8859-1] (original) +++ trunk/reactos/tools/fatten/fatfs/integer.h [iso-8859-1] Tue Sep 8 00:28:28 2015 @@ -5,28 +5,30 @@ #ifndef _FF_INTEGER #define _FF_INTEGER -#ifdef _WIN32 /* FatFs development platform */ +#ifdef _WIN32 /* Windows */ #include <windows.h> #include <tchar.h> -#else /* Embedded platform */ +#else /* Unixes */ + +#include <stdint.h> /* This type MUST be 8 bit */ -typedef unsigned char BYTE; +typedef uint8_t BYTE; /* These types MUST be 16 bit */ -typedef short SHORT; -typedef unsigned short WORD; -typedef unsigned short WCHAR; +typedef int16_t SHORT; +typedef uint16_t WORD; +typedef uint16_t WCHAR; /* These types MUST be 16 bit or 32 bit */ -typedef int INT; -typedef unsigned int UINT; +typedef int_fast16_t INT; +typedef uint_fast16_t UINT; /* These types MUST be 32 bit */ -typedef long LONG; -typedef unsigned long DWORD; +typedef int32_t LONG; +typedef uint32_t DWORD; #endif
9 years, 9 months
1
0
0
0
[ion] 69104: [BOOTMGFW] - And again with the fucking non-recursion.
by ion@svn.reactos.org
Author: ion Date: Mon Sep 7 23:48:21 2015 New Revision: 69104 URL:
http://svn.reactos.org/svn/reactos?rev=69104&view=rev
Log: [BOOTMGFW] - And again with the fucking non-recursion. Modified: trunk/reactos/boot/environ/app/bootmgr/bootmgr.c trunk/reactos/boot/environ/app/bootmgr/efiemu.c trunk/reactos/boot/environ/include/bl.h Modified: trunk/reactos/boot/environ/app/bootmgr/bootmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/app/bootmgr/b…
============================================================================== --- trunk/reactos/boot/environ/app/bootmgr/bootmgr.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/app/bootmgr/bootmgr.c [iso-8859-1] Mon Sep 7 23:48:21 2015 @@ -12,10 +12,109 @@ /* DATA VARIABLES ************************************************************/ +#include <initguid.h> +DEFINE_GUID(GUID_WINDOWS_BOOTMGR, + 0x9DEA862C, + 0x5CDD, + 0x4E70, + 0xAC, 0xC1, 0xF3, 0x2B, 0x34, 0x4D, 0x47, 0x95); + ULONGLONG ApplicationStartTime; ULONGLONG PostTime; +GUID BmApplicationIdentifier; /* FUNCTIONS *****************************************************************/ + +PGUID +BlGetApplicationIdentifier ( + VOID + ) +{ + return NULL; +} + +PWCHAR BootDirectory; + +NTSTATUS +BmFwInitializeBootDirectoryPath() +{ +#if 0 + PWCHAR FinalPath; + NTSTATUS Status; + PWCHAR BcdDirectory; + UNICODE_STRING BcdPath; + ULONG FinalSize, FileHandle, DeviceHandle; + + BcdPath.MaximumLength = 0; + BcdPath.Buffer = NULL; + + FinalPath = NULL; + + FileHandle = -1; + DeviceHandle = -1; + + Status = BlpDeviceOpen(BlpBootDevice, 1u, 0, &DeviceHandle); + if (!NT_SUCCESS(Status)) + { + goto Quickie; + } + + Status = BmpFwGetApplicationDirectoryPath(&BcdPath); + BcdDirectory = BcdPath.Buffer; + if (!NT_SUCCESS(Status)) + { + goto Quickie; + } + + FinalSize = BcdPath.MaximumLength + sizeof(L"\\BCD") - sizeof(UNICODE_NULL); + if (FinalSize < BcdPath.MaximumLength) + { + goto Quickie; + } + + FinalPath = BlMmAllocateHeap(FinalSize); + if (!FinalPath) + { + goto Quickie; + } + + RtlZeroMemory(FinalPath, FinalSize); + RtlCopyMemory(FinalPath, BcdDirectory, BcdPath.MaximumLength); + wcsncat(FinalPath, L"\\BCD", FinalSize / sizeof(WCHAR)); + + EfiPrintf(L"Opening: %s\r\n", FinalPath); + Status = BlFileOpen(DeviceHandle, FinalPath, 1u, &FileHandle); + if (!NT_SUCCESS(Status)) + { + BootDirectory = BcdDirectory; + goto Quickie; + } + + BootDirectory = L"\\EFI\\Microsoft\\Boot"; + +Quickie: + if (BcdDirectory) + { + Status = BlMmFreeHeap(BcdDirectory); + } + if (FinalPath) + { + Status = BlMmFreeHeap(FinalPath); + } + if (FileHandle != -1) + { + Status = BlFileClose(FileHandle); + } + if (DeviceHandle != -1) + { + Status = BlDeviceClose(DeviceHandle); + } + return Status; +#else + return STATUS_NOT_IMPLEMENTED; +#endif +} + /*++ * @name BmMain @@ -37,8 +136,15 @@ { NTSTATUS Status; BL_LIBRARY_PARAMETERS LibraryParameters; - - EarlyPrint(L"ReactOS UEFI Boot Manager Initializing...\n"); + PBL_RETURN_ARGUMENTS ReturnArguments; + BOOLEAN RebootOnError; + PGUID AppIdentifier; +// HANDLE BcdHandle; + + EfiPrintf(L"ReactOS UEFI Boot Manager Initializing...\n"); + + /* Reading the BCD can change this later on */ + RebootOnError = FALSE; /* Save the start/end-of-POST time */ ApplicationStartTime = __rdtsc(); @@ -53,9 +159,59 @@ /* Initialize the boot library */ Status = BlInitializeLibrary(BootParameters, &LibraryParameters); - - EarlyPrint(L"ReactOS UEFI Boot Manager Exiting: %lx\n", Status); - EfiStall(3000000); + if (!NT_SUCCESS(Status)) + { + /* Check for failure due to invalid application entry */ + if (Status != STATUS_INVALID_PARAMETER_9) + { + /* Specifically print out what happened */ + EfiPrintf(L"BlInitializeLibrary failed 0x%x\r\n", Status); + } + + /* Go to exit path */ + goto Quickie; + } + + /* Get the application identifier */ + AppIdentifier = BlGetApplicationIdentifier(); + if (!AppIdentifier) + { + /* None was given, so set our default one */ + AppIdentifier = (PGUID)&GUID_WINDOWS_BOOTMGR; + } + + /* Save our identifier */ + BmApplicationIdentifier = *AppIdentifier; + + /* Initialize the file system to open a handle to our root boot directory */ + BmFwInitializeBootDirectoryPath(); + + //Status = BmOpenDataStore(&BcdHandle); + + EfiPrintf(L"We are A-OK!\n"); + EfiStall(10000000); + +Quickie: + /* Check if we should reboot */ + if ((RebootOnError) || + (BlpApplicationEntry.Flags & BL_APPLICATION_ENTRY_REBOOT_ON_ERROR)) + { + /* Reboot the box */ + BlFwReboot(); + Status = STATUS_SUCCESS; + } + else + { + /* Return back to the caller with the error argument encoded */ + ReturnArguments = (PVOID)((ULONG_PTR)BootParameters + BootParameters->ReturnArgumentsOffset); + ReturnArguments->Version = BL_RETURN_ARGUMENTS_VERSION; + ReturnArguments->Status = Status; + + /* Tear down the boot library*/ + BlDestroyLibrary(); + } + + /* Return back status */ return Status; } Modified: trunk/reactos/boot/environ/app/bootmgr/efiemu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/app/bootmgr/e…
============================================================================== --- trunk/reactos/boot/environ/app/bootmgr/efiemu.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/app/bootmgr/efiemu.c [iso-8859-1] Mon Sep 7 23:48:21 2015 @@ -665,7 +665,6 @@ RemainingSize = MaximumLength; if (RemainingSize < sizeof(BL_APPLICATION_ENTRY)) { - EarlyPrint(L"Remaining size too small!\n"); Status = STATUS_INVALID_PARAMETER; goto Quickie; } @@ -709,7 +708,6 @@ if (!NT_SUCCESS(Status)) { /* We failed, so mark the option as such and return an empty one */ - EarlyPrint(L"Failed to convert device path: %lx\n", Status); Entry->BcdData.Empty = TRUE; TotalOptionSize = sizeof(BL_BCD_OPTION); goto Quickie; @@ -731,7 +729,6 @@ { /* lol */ Status = STATUS_NOT_IMPLEMENTED; - EarlyPrint(L"UDP Boot not supported!\n"); } else { @@ -745,7 +742,6 @@ /* Bail out on failure */ if (!NT_SUCCESS(Status)) { - EarlyPrint(L"Failed to convert file path: %lx\n", Status); goto Quickie; } @@ -784,7 +780,6 @@ RemainingSize); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"Failed to convert OS device path: %lx\n", Status); goto Quickie; } @@ -811,7 +806,6 @@ RemainingSize); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"Failed to convert OS file path: %lx\n", Status); goto Quickie; } @@ -898,7 +892,6 @@ (VOID**)&LoadedImage); if (Status != EFI_SUCCESS) { - EarlyPrint(L"Loaded image failed: %lx\n", Status); return NULL; } @@ -912,7 +905,6 @@ (VOID**)&DevicePath); if (Status != EFI_SUCCESS) { - EarlyPrint(L"Device Path failed: %lx\n", Status); return NULL; } @@ -1020,10 +1012,6 @@ { NTSTATUS Status; PBOOT_APPLICATION_PARAMETER_BLOCK BootParameters; - extern EFI_SYSTEM_TABLE *g_SystemTable; - - /* Temporary debugging string */ - g_SystemTable = SystemTable; /* Convert EFI parameters to Windows Boot Application parameters */ BootParameters = EfiInitCreateInputParametersEx(ImageHandle, SystemTable); @@ -1035,7 +1023,6 @@ else { /* Conversion failed, bail out */ - EarlyPrint(L"EFI Input Conversion failed\n"); Status = STATUS_INVALID_PARAMETER; } Modified: trunk/reactos/boot/environ/include/bl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/include/bl.h?…
============================================================================== --- trunk/reactos/boot/environ/include/bl.h [iso-8859-1] (original) +++ trunk/reactos/boot/environ/include/bl.h [iso-8859-1] Mon Sep 7 23:48:21 2015 @@ -29,9 +29,6 @@ #include <GraphicsOutput.h> #include <UgaDraw.h> -VOID -EarlyPrint(_In_ PWCHAR Format, ...); - /* DEFINES *******************************************************************/ #define BL_APPLICATION_FLAG_CONVERTED_FROM_EFI 0x01 @@ -50,6 +47,7 @@ #define BL_FIRMWARE_DESCRIPTOR_VERSION 2 #define BL_APPLICATION_ENTRY_FLAG_NO_GUID 0x01 +#define BL_APPLICATION_ENTRY_REBOOT_ON_ERROR 0x20 #define BL_CONTEXT_PAGING_ON 1 #define BL_CONTEXT_INTERRUPTS_ON 2 @@ -407,7 +405,8 @@ typedef struct _BL_RETURN_ARGUMENTS { ULONG Version; - ULONG ReturnArgumentData[6]; + NTSTATUS Status; + ULONG ReturnArgumentData[5]; } BL_RETURN_ARGUMENTS, *PBL_RETURN_ARGUMENTS; typedef struct _BL_MEMORY_DESCRIPTOR @@ -784,7 +783,18 @@ _In_ ULONG Flags ); +VOID +BlDestroyLibrary ( + VOID + ); + /* FIRMWARE ROUTINES *********************************************************/ + +VOID +EfiPrintf ( + _In_ PWCHAR Format, + ... + ); NTSTATUS EfiAllocatePages ( @@ -878,6 +888,11 @@ _Out_ UINTN *FrameBufferSize ); +VOID +EfiResetSystem ( + _In_ EFI_RESET_TYPE ResetType + ); + /* PLATFORM TIMER ROUTINES ***************************************************/ NTSTATUS @@ -899,6 +914,11 @@ NTSTATUS BlUtlInitialize ( + VOID + ); + +VOID +BlFwReboot ( VOID );
9 years, 9 months
1
0
0
0
[ion] 69103: [BOOTMGFW] - EarlyPrint -> EfiPrintf, as it seems BL actually has this after all :) Change all callers to conform to it. - Add common exit/failure path in BmMain. Now the fun begins.
by ion@svn.reactos.org
Author: ion Date: Mon Sep 7 23:31:08 2015 New Revision: 69103 URL:
http://svn.reactos.org/svn/reactos?rev=69103&view=rev
Log: [BOOTMGFW] - EarlyPrint -> EfiPrintf, as it seems BL actually has this after all :) Change all callers to conform to it. - Add common exit/failure path in BmMain. Now the fun begins. Modified: trunk/reactos/boot/environ/lib/bootlib.c trunk/reactos/boot/environ/lib/firmware/efi/firmware.c trunk/reactos/boot/environ/lib/io/display/display.c trunk/reactos/boot/environ/lib/io/display/efi/gop.c trunk/reactos/boot/environ/lib/io/display/efi/guicons.c trunk/reactos/boot/environ/lib/io/display/efi/textcons.c trunk/reactos/boot/environ/lib/io/display/efi/uga.c trunk/reactos/boot/environ/lib/io/display/guicons.c trunk/reactos/boot/environ/lib/io/display/textcons.c trunk/reactos/boot/environ/lib/misc/util.c trunk/reactos/boot/environ/lib/mm/descriptor.c trunk/reactos/boot/environ/lib/mm/heapalloc.c trunk/reactos/boot/environ/lib/mm/i386/mmx86.c trunk/reactos/boot/environ/lib/mm/mm.c trunk/reactos/boot/environ/lib/mm/pagealloc.c trunk/reactos/boot/environ/lib/platform/time.c Modified: trunk/reactos/boot/environ/lib/bootlib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/bootlib.c…
============================================================================== --- trunk/reactos/boot/environ/lib/bootlib.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/bootlib.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -23,28 +23,6 @@ LIST_ENTRY BlBadpListHead; /* FUNCTIONS *****************************************************************/ - -/* HACKKKYYY */ -EFI_SYSTEM_TABLE* g_SystemTable; - -VOID -EarlyPrint(_In_ PWCHAR Format, ...) -{ - WCHAR buffer[1024]; - va_list args; - - va_start(args, Format); - - vswprintf(buffer, Format, args); - - g_SystemTable->ConOut->OutputString(g_SystemTable->ConOut, L"\r"); - g_SystemTable->ConOut->OutputString(g_SystemTable->ConOut, buffer); - - g_SystemTable->BootServices->Stall(200000); - - va_end(args); -} -/* END HACKKKYYY */ /*++ * @name InitializeLibrary @@ -131,7 +109,7 @@ LibraryParameters); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"MM init failed!\n"); + EfiPrintf(L"MM init failed!\r\n"); goto Quickie; } @@ -141,7 +119,7 @@ { /* Destroy memory manager in phase 1 */ //BlpMmDestroy(1); - EarlyPrint(L"Firmware2 init failed!\n"); + EfiPrintf(L"Firmware2 init failed!\r\n"); return Status; } @@ -163,7 +141,7 @@ if (!NT_SUCCESS(Status)) { /* Destroy memory manager in phase 1 */ - EarlyPrint(L"TSC calibration failed\n"); + EfiPrintf(L"TSC calibration failed\r\n"); //BlpMmDestroy(1); return Status; } @@ -174,7 +152,7 @@ if (!NT_SUCCESS(Status)) { /* Destroy memory manager in phase 1 */ - EarlyPrint(L"Arch2 init failed\n"); + EfiPrintf(L"Arch2 init failed\r\n"); //BlpMmDestroy(1); return Status; } @@ -195,7 +173,7 @@ if (!NT_SUCCESS(Status)) { /* Destroy memory manager in phase 1 and the event manager */ - EarlyPrint(L"IO init failed\n"); + EfiPrintf(L"IO init failed\r\n"); #ifdef BL_TPM_SUPPORT if (EnSubsystemInitialized) { @@ -240,7 +218,7 @@ } #endif //BlpMmDestroy(1); - EarlyPrint(L"Util init failed\n"); + EfiPrintf(L"Util init failed\r\n"); return Status; } @@ -407,3 +385,11 @@ return Status; } +VOID +BlDestroyLibrary ( + VOID + ) +{ + EfiPrintf(L"Destroy not yet implemented\r\n"); + return; +} Modified: trunk/reactos/boot/environ/lib/firmware/efi/firmware.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/firmware/…
============================================================================== --- trunk/reactos/boot/environ/lib/firmware/efi/firmware.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/firmware/efi/firmware.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -30,7 +30,37 @@ EFI_GUID EfiDevicePathProtocol = EFI_DEVICE_PATH_PROTOCOL_GUID; EFI_GUID EfiSimpleTextInputExProtocol = EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID; +WCHAR BlScratchBuffer[8192]; + /* FUNCTIONS *****************************************************************/ + +VOID +EfiPrintf ( + _In_ PWCHAR Format, + ... + ) +{ + va_list args; + va_start(args, Format); + + /* Capture the buffer in our scratch pad, and NULL-terminate */ + vsnwprintf(BlScratchBuffer, RTL_NUMBER_OF(BlScratchBuffer) - 1, Format, args); + BlScratchBuffer[RTL_NUMBER_OF(BlScratchBuffer) - 1] = UNICODE_NULL; + + /* Check which mode we're in */ + if (CurrentExecutionContext->Mode == BlRealMode) + { + /* Call EFI directly */ + EfiConOut->OutputString(EfiConOut, BlScratchBuffer); + } + else + { + /* FIXME: @TODO: Not yet supported */ + } + + /* All done */ + va_end(args); +} NTSTATUS EfiOpenProtocol ( @@ -589,7 +619,7 @@ if ((ModeChanged) && (NT_SUCCESS(Status))) { /* FIXME @TODO: Should be BlStatusPrint */ - EarlyPrint(L"Console video mode set to 0x%x\r\n", Mode); + EfiPrintf(L"Console video mode set to 0x%x\r\r\n", Mode); } /* Convert the error to an NTSTATUS */ @@ -668,6 +698,25 @@ /* Convert the error to an NTSTATUS */ return EfiGetNtStatusCode(EfiStatus); +} + +VOID +EfiResetSystem ( + _In_ EFI_RESET_TYPE ResetType + ) +{ + BL_ARCH_MODE OldMode; + + /* Are we in protected mode? */ + OldMode = CurrentExecutionContext->Mode; + if (OldMode != BlRealMode) + { + /* FIXME: Not yet implemented */ + return; + } + + /* Call the EFI runtime */ + EfiRT->ResetSystem(ResetType, EFI_SUCCESS, 0, NULL); } NTSTATUS @@ -868,7 +917,7 @@ if (Status != STATUS_BUFFER_TOO_SMALL) { /* This should've failed because our buffer was too small, nothing else */ - EarlyPrint(L"Got strange EFI status for memory map: %lx\n", Status); + EfiPrintf(L"Got strange EFI status for memory map: %lx\r\n", Status); if (NT_SUCCESS(Status)) { Status = STATUS_UNSUCCESSFUL; @@ -879,7 +928,7 @@ /* Add 4 more descriptors just in case things changed */ EfiMemoryMapSize += (4 * DescriptorSize); Pages = BYTES_TO_PAGES(EfiMemoryMapSize); - EarlyPrint(L"Memory map size: %lx bytes, %d pages\n", EfiMemoryMapSize, Pages); + EfiPrintf(L"Memory map size: %lx bytes, %d pages\r\n", EfiMemoryMapSize, Pages); /* Should we use EFI to grab memory? */ if (UseEfiBuffer) @@ -893,7 +942,7 @@ &EfiBuffer); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"EFI allocation failed: %lx\n", Status); + EfiPrintf(L"EFI allocation failed: %lx\r\n", Status); goto Quickie; } @@ -953,7 +1002,7 @@ /* So far so good? */ if (!NT_SUCCESS(Status)) { - EarlyPrint(L"Failed to get EFI memory map: %lx\n", Status); + EfiPrintf(L"Failed to get EFI memory map: %lx\r\n", Status); goto Quickie; } @@ -961,7 +1010,7 @@ if (((EfiMemoryMapSize % DescriptorSize)) || (DescriptorSize < sizeof(EFI_MEMORY_DESCRIPTOR))) { - EarlyPrint(L"Incorrect descriptor size\n"); + EfiPrintf(L"Incorrect descriptor size\r\n"); Status = STATUS_UNSUCCESSFUL; goto Quickie; } @@ -971,7 +1020,7 @@ (BlpBootDevice->Local.Type == RamDiskDevice)) { /* We don't handle this yet */ - EarlyPrint(L"RAM boot not supported\n"); + EfiPrintf(L"RAM boot not supported\r\n"); Status = STATUS_NOT_IMPLEMENTED; goto Quickie; } @@ -983,9 +1032,9 @@ /* Loop the EFI memory map */ #if 0 - EarlyPrint(L"UEFI MEMORY MAP\n\n"); - EarlyPrint(L"TYPE START END ATTRIBUTES\n"); - EarlyPrint(L"===============================================================\n"); + EfiPrintf(L"UEFI MEMORY MAP\n\r\n"); + EfiPrintf(L"TYPE START END ATTRIBUTES\r\n"); + EfiPrintf(L"===============================================================\r\n"); #endif while (EfiMemoryMapSize != 0) { @@ -1026,7 +1075,7 @@ goto LoopAgain; } #if 0 - EarlyPrint(L"%08X 0x%016I64X-0x%016I64X 0x%I64X\n", + EfiPrintf(L"%08X 0x%016I64X-0x%016I64X 0x%I64X\r\n", MemoryType, StartPage << PAGE_SHIFT, EndPage << PAGE_SHIFT, @@ -1057,7 +1106,7 @@ BL_MM_ADD_DESCRIPTOR_TRUNCATE_FLAG); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"Failed to add zero page descriptor: %lx\n", Status); + EfiPrintf(L"Failed to add zero page descriptor: %lx\r\n", Status); break; } @@ -1098,7 +1147,7 @@ BL_MM_ADD_DESCRIPTOR_TRUNCATE_FLAG); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"Failed to add 1MB descriptor: %lx\n", Status); + EfiPrintf(L"Failed to add 1MB descriptor: %lx\r\n", Status); break; } @@ -1111,7 +1160,7 @@ if (HaveRamDisk) { /* We don't handle this yet */ - EarlyPrint(L"RAM boot not supported\n"); + EfiPrintf(L"RAM boot not supported\r\n"); Status = STATUS_NOT_IMPLEMENTED; goto Quickie; } @@ -1144,7 +1193,7 @@ BL_MM_ADD_DESCRIPTOR_COALESCE_FLAG : 0); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"Failed to add full descriptor: %lx\n", Status); + EfiPrintf(L"Failed to add full descriptor: %lx\r\n", Status); break; } Modified: trunk/reactos/boot/environ/lib/io/display/display.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
============================================================================== --- trunk/reactos/boot/environ/lib/io/display/display.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/io/display/display.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -43,7 +43,7 @@ VOID ) { - //EarlyPrint(L"Disabling graphics\n"); + //EarlyPrint(L"Disabling graphics\r\n"); return FALSE; } @@ -75,7 +75,7 @@ /* Display re-initialization not yet handled */ if (LibraryParameters.LibraryFlags & BL_LIBRARY_FLAG_REINITIALIZE_ALL) { - EarlyPrint(L"Display path not handled\n"); + EfiPrintf(L"Display path not handled\r\n"); return STATUS_NOT_SUPPORTED; } @@ -111,7 +111,7 @@ if (NT_SUCCESS(Status)) { ConsoleGraphicalResolutionListFlags |= BL_DISPLAY_GRAPHICS_FORCED_VIDEO_MODE_FLAG; - EarlyPrint(L"Display selection not yet handled\n"); + EfiPrintf(L"Display selection not yet handled\r\n"); return STATUS_NOT_IMPLEMENTED; } @@ -127,7 +127,7 @@ if (NT_SUCCESS(Status)) { ConsoleGraphicalResolutionListFlags |= BL_DISPLAY_GRAPHICS_FORCED_HIGH_RES_MODE_FLAG; - EarlyPrint(L"High res mode not yet handled\n"); + EfiPrintf(L"High res mode not yet handled\r\n"); return STATUS_NOT_IMPLEMENTED; } @@ -142,7 +142,7 @@ Status = ConsoleGraphicalConstruct(GraphicsConsole); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"GFX FAILED: %lx\n", Status); + EfiPrintf(L"GFX FAILED: %lx\r\n", Status); BlMmFreeHeap(GraphicsConsole); GraphicsConsole = NULL; } @@ -157,7 +157,7 @@ /* Are we using something else than the default mode? */ if (DisplayMode != &ConsoleGraphicalResolutionList[0]) { - EarlyPrint(L"Display path not handled\n"); + EfiPrintf(L"Display path not handled\r\n"); return STATUS_NOT_SUPPORTED; } @@ -217,7 +217,7 @@ } /* We have a remote console -- have to figure out how to use it*/ - EarlyPrint(L"Display path not handled\n"); + EfiPrintf(L"Display path not handled\r\n"); return STATUS_NOT_SUPPORTED; } @@ -273,7 +273,7 @@ if (DspGraphicalConsole) { /* Yep -- query it */ - EarlyPrint(L"Not supported\n"); + EfiPrintf(L"Not supported\r\n"); Status = STATUS_NOT_IMPLEMENTED; } } Modified: trunk/reactos/boot/environ/lib/io/display/efi/gop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
============================================================================== --- trunk/reactos/boot/environ/lib/io/display/efi/gop.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/io/display/efi/gop.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -212,7 +212,7 @@ (PVOID*)&GopProtocol); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"GOP OPEN failed: %lx\n", Status); + EfiPrintf(L"GOP OPEN failed: %lx\r\n", Status); return STATUS_NOT_SUPPORTED; } @@ -220,7 +220,7 @@ Status = EfiGopGetCurrentMode(GopProtocol, &CurrentMode, &ModeInformation); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"GOP mode failed: %lx\n", Status); + EfiPrintf(L"GOP mode failed: %lx\r\n", Status); goto Quickie; } @@ -273,7 +273,7 @@ Quickie: /* We failed, close the protocol and return the failure code */ - EarlyPrint(L"Get format failed: %lx\n", Status); + EfiPrintf(L"Get format failed: %lx\r\n", Status); EfiCloseProtocol(GraphicsConsole->Handle, &EfiGraphicsOutputProtocol); return Status; } Modified: trunk/reactos/boot/environ/lib/io/display/efi/guicons.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
============================================================================== --- trunk/reactos/boot/environ/lib/io/display/efi/guicons.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/io/display/efi/guicons.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -54,7 +54,7 @@ if (!NT_SUCCESS(Status)) { /* Nothing supports this (no video card?) */ - EarlyPrint(L"Status: %lx Count: %d\n", Status, HandleCount); + EfiPrintf(L"Status: %lx Count: %d\r\n", Status, HandleCount); return STATUS_UNSUCCESSFUL; } Modified: trunk/reactos/boot/environ/lib/io/display/efi/textcons.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
============================================================================== --- trunk/reactos/boot/environ/lib/io/display/efi/textcons.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/io/display/efi/textcons.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -348,7 +348,7 @@ } /* Scan all the EFI modes */ - EarlyPrint(L"Scanning through %d modes\n", MaxMode); + EfiPrintf(L"Scanning through %d modes\r\n", MaxMode); for (MaxQueriedMode = 0, Mode = 0; Mode < MaxMode; Mode++) { /* Query information on this mode */ @@ -359,7 +359,7 @@ &VRes))) { /* This mode was succesfully queried. Save the data */ - EarlyPrint(L"EFI Firmware Supported Mode %d is H: %d V: %d\n", Mode, HRes, VRes); + EfiPrintf(L"EFI Firmware Supported Mode %d is H: %d V: %d\r\n", Mode, HRes, VRes); ModeEntry->HRes = HRes; ModeEntry->VRes = VRes; ModeEntry->HRes2 = HRes; @@ -376,7 +376,7 @@ { /* Check if the UEFI mode is compatible with our supported mode */ ModeEntry = &ModeList[MatchingMode]; - EarlyPrint(L"H1: %d V1: %d - H2: %d - V2: %d\n", ModeEntry->HRes, ModeEntry->VRes, SupportedModeEntry->HRes, SupportedModeEntry->VRes); + EfiPrintf(L"H1: %d V1: %d - H2: %d - V2: %d\r\n", ModeEntry->HRes, ModeEntry->VRes, SupportedModeEntry->HRes, SupportedModeEntry->VRes); if ((ModeEntry->HRes == SupportedModeEntry->HRes) && (ModeEntry->VRes == SupportedModeEntry->VRes)) { @@ -446,19 +446,19 @@ if (!ConsolepFindResolution(&DisplayMode, ConsoleTextResolutionList, 1)) { /* It isn't -- find a matching EFI mode for what we need */ - EarlyPrint(L"In incorrect mode, scanning for right one\n"); + EfiPrintf(L"In incorrect mode, scanning for right one\r\n"); Status = ConsoleEfiTextFindModeFromAllowed(EfiConOut, ConsoleTextResolutionList, 1, &Mode); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"Failed to find mode: %lx\n", Status); + EfiPrintf(L"Failed to find mode: %lx\r\n", Status); return Status; } /* Set the new EFI mode */ - EarlyPrint(L"Setting new mode: %d\n", Mode); + EfiPrintf(L"Setting new mode: %d\r\n", Mode); Status = EfiConOutSetMode(EfiConOut, Mode); if (!NT_SUCCESS(Status)) { Modified: trunk/reactos/boot/environ/lib/io/display/efi/uga.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
============================================================================== --- trunk/reactos/boot/environ/lib/io/display/efi/uga.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/io/display/efi/uga.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -19,7 +19,7 @@ _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole ) { - EarlyPrint(L"UGA not implemented\n"); + EfiPrintf(L"UGA not implemented\r\n"); return STATUS_NOT_IMPLEMENTED; } Modified: trunk/reactos/boot/environ/lib/io/display/guicons.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
============================================================================== --- trunk/reactos/boot/environ/lib/io/display/guicons.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/io/display/guicons.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -30,7 +30,7 @@ Status = ConsoleTextLocalConstruct(&GraphicsConsole->TextConsole, FALSE); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"Text failed: %lx\n", Status); + EfiPrintf(L"Text failed: %lx\r\n", Status); return Status; } @@ -42,12 +42,12 @@ if (!NT_SUCCESS(Status)) { /* That failed, try an older EFI 1.02 UGA console */ - EarlyPrint(L"GOP open failed!\n", Status); + EfiPrintf(L"GOP open failed!\r\n", Status); Status = ConsoleEfiGraphicalOpenProtocol(GraphicsConsole, BlUgaConsole); if (!NT_SUCCESS(Status)) { /* That failed too, give up */ - EarlyPrint(L"UGA failed!\n", Status); + EfiPrintf(L"UGA failed!\r\n", Status); ConsoleTextLocalDestruct(&GraphicsConsole->TextConsole); return STATUS_UNSUCCESSFUL; } @@ -58,7 +58,7 @@ if (!NT_SUCCESS(Status)) { /* Failed to enable it, undo everything */ - EarlyPrint(L"Enable failed\n"); + EfiPrintf(L"Enable failed\r\n"); ConsoleFirmwareGraphicalClose(GraphicsConsole); ConsoleTextLocalDestruct(&GraphicsConsole->TextConsole); return STATUS_UNSUCCESSFUL; Modified: trunk/reactos/boot/environ/lib/io/display/textcons.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
============================================================================== --- trunk/reactos/boot/environ/lib/io/display/textcons.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/io/display/textcons.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -118,7 +118,7 @@ Status = ConsoleFirmwareTextOpen(TextConsole); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"Failed to activate console: %lx\n", Status); + EfiPrintf(L"Failed to activate console: %lx\r\n", Status); return Status; } } @@ -138,7 +138,7 @@ if (!NT_SUCCESS(Status)) { /* We failed, back down */ - EarlyPrint(L"Failed to set console state: %lx\n", Status); + EfiPrintf(L"Failed to set console state: %lx\r\n", Status); ConsoleFirmwareTextClose(TextConsole); return Status; } Modified: trunk/reactos/boot/environ/lib/misc/util.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/misc/util…
============================================================================== --- trunk/reactos/boot/environ/lib/misc/util.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/misc/util.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -186,4 +186,18 @@ UtlProgressInfo = 0; return STATUS_SUCCESS; -} +} + +VOID +BlFwReboot ( + VOID + ) +{ +#ifdef BL_KD_SUPPORTED + /* Stop the boot debugger*/ + BlBdStop(); +#endif + + /* Reset the machine */ + EfiResetSystem(EfiResetCold); +} Modified: trunk/reactos/boot/environ/lib/mm/descriptor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/descri…
============================================================================== --- trunk/reactos/boot/environ/lib/mm/descriptor.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/mm/descriptor.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -149,7 +149,7 @@ _In_ ULONG Count ) { - EarlyPrint(L"NOT SUPPORTED!!!\n"); + EfiPrintf(L"NOT SUPPORTED!!!\r\n"); while (1); } @@ -173,7 +173,7 @@ else { /* It's a dynamic descriptor, so free it */ - EarlyPrint(L"Dynamic descriptors not yet supported\n"); + EfiPrintf(L"Dynamic descriptors not yet supported\r\n"); Status = STATUS_NOT_IMPLEMENTED; } @@ -250,7 +250,7 @@ /* If we're out of descriptors, bail out */ if (MmGlobalMemoryDescriptorsUsed >= MmGlobalMemoryDescriptorCount) { - EarlyPrint(L"Out of descriptors!\n"); + EfiPrintf(L"Out of descriptors!\r\n"); return NULL; } @@ -295,13 +295,13 @@ /* Check for backward overlap */ if ((PreviousEntry != MdList->First) && (MemoryDescriptor->BasePage < PreviousEndPage)) { - EarlyPrint(L"Overlap detected -- this is unexpected on x86/x64 platforms\n"); + EfiPrintf(L"Overlap detected -- this is unexpected on x86/x64 platforms\r\n"); } /* Check for forward overlap */ if ((NextEntry != MdList->First) && (NextDescriptor->BasePage < EndPage)) { - EarlyPrint(L"Overlap detected -- this is unexpected on x86/x64 platforms\n"); + EfiPrintf(L"Overlap detected -- this is unexpected on x86/x64 platforms\r\n"); } /* Nothing to do */ @@ -343,7 +343,7 @@ ((MemoryDescriptor->VirtualPage) && (PreviousDescriptor->VirtualPage) && (PreviousMappedEndPage == MemoryDescriptor->VirtualPage)))) { - EarlyPrint(L"Previous descriptor coalescible!\n"); + EfiPrintf(L"Previous descriptor coalescible!\r\n"); } /* CHeck if the current entry touches the next entry, and is compatible */ @@ -355,7 +355,7 @@ ((MemoryDescriptor->VirtualPage) && (PreviousDescriptor->VirtualPage) && (MappedEndPage == NextDescriptor->VirtualPage)))) { - EarlyPrint(L"Next descriptor coalescible!\n"); + EfiPrintf(L"Next descriptor coalescible!\r\n"); } /* Nothing to do */ @@ -547,7 +547,7 @@ FoundPageCount = Descriptor->PageCount; FoundEndPage = FoundBasePage + FoundPageCount; EndPage = PageCount + BasePage; - //EarlyPrint(L"Looking for Region 0x%08I64X-0x%08I64X in 0x%08I64X-0x%08I64X\n", BasePage, EndPage, FoundBasePage, FoundEndPage); + //EarlyPrint(L"Looking for Region 0x%08I64X-0x%08I64X in 0x%08I64X-0x%08I64X\r\n", BasePage, EndPage, FoundBasePage, FoundEndPage); /* Make a copy of the original descriptor */ RtlCopyMemory(&NewDescriptor, NextEntry, sizeof(NewDescriptor)); @@ -562,18 +562,18 @@ if ((FoundBasePage >= BasePage) || (EndPage >= FoundEndPage)) { /* This descriptor doesn't cover any part of the range */ - //EarlyPrint(L"No part of this descriptor contains the region\n"); + //EarlyPrint(L"No part of this descriptor contains the region\r\n"); } else { /* This descriptor covers the head of the allocation */ - //EarlyPrint(L"Descriptor covers the head of the region\n"); + //EarlyPrint(L"Descriptor covers the head of the region\r\n"); } } else { /* This descriptor contains the entire allocation */ - //EarlyPrint(L"Descriptor contains the entire region\n"); + //EarlyPrint(L"Descriptor contains the entire region\r\n"); } /* Keep going */ @@ -614,14 +614,14 @@ if (!Descriptor->PageCount) { /* Remove it */ - //EarlyPrint(L"Entire descriptor consumed\n"); + //EarlyPrint(L"Entire descriptor consumed\r\n"); MmMdRemoveDescriptorFromList(MdList, Descriptor); MmMdFreeDescriptor(Descriptor); /* Check if we're supposed to insert it into a new list */ if (HaveNewList) { - EarlyPrint(L"Not yet implemented\n"); + EfiPrintf(L"Not yet implemented\r\n"); Status = STATUS_NOT_IMPLEMENTED; goto Quickie; } @@ -681,7 +681,7 @@ /* Check for start overflow */ if (BaseMin > BaseMax) { - EarlyPrint(L"Descriptor overflow\n"); + EfiPrintf(L"Descriptor overflow\r\n"); return FALSE; } @@ -724,7 +724,7 @@ /* Any mapped page already? */ if (Descriptor->VirtualPage) { - EarlyPrint(L"Virtual memory not yet supported\n"); + EfiPrintf(L"Virtual memory not yet supported\r\n"); return FALSE; } else @@ -737,21 +737,21 @@ if ((((Flags & 0xFF) & (Descriptor->Flags & 0xFF)) != (Flags & 0xFF)) || (((Flags & 0xFF00) & (Descriptor->Flags & 0xFF00)) != (Flags & 0xFF00))) { - EarlyPrint(L"Incorrect memory attributes\n"); + EfiPrintf(L"Incorrect memory attributes\r\n"); return FALSE; } /* Bail out if the allocation flags don't match */ if (((Flags ^ Descriptor->Flags) & 0x190000)) { - EarlyPrint(L"Incorrect memory allocation flags\n"); + EfiPrintf(L"Incorrect memory allocation flags\r\n"); return FALSE; } /* Bail out if the type doesn't match */ if (Descriptor->Type != MemoryType) { - //EarlyPrint(L"Incorrect descriptor type\n"); + //EarlyPrint(L"Incorrect descriptor type\r\n"); return FALSE; } @@ -761,7 +761,7 @@ NewDescriptor->Type = Descriptor->Type; NewDescriptor->VirtualPage = VirtualPage; NewDescriptor->Flags = Descriptor->Flags; - //EarlyPrint(L"Found a matching descriptor: %08I64X with %08I64X pages\n", BasePage, Pages); + //EarlyPrint(L"Found a matching descriptor: %08I64X with %08I64X pages\r\n", BasePage, Pages); return TRUE; } @@ -775,14 +775,12 @@ PLIST_ENTRY OldFlink, OldBlink; /* Make sure we're not int middle of a call using a descriptor */ - EarlyPrint(L"Call depth is %d\n", MmDescriptorCallTreeCount); if (MmDescriptorCallTreeCount != 1) { return; } /* Loop every current global descriptor */ - EarlyPrint(L"MmGlobalMemoryDescriptorsUsed: %d\n", MmGlobalMemoryDescriptorsUsed); while (Index < MmGlobalMemoryDescriptorsUsed) { /* Does it have any valid pageS? */ Modified: trunk/reactos/boot/environ/lib/mm/heapalloc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/heapal…
============================================================================== --- trunk/reactos/boot/environ/lib/mm/heapalloc.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/mm/heapalloc.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -140,7 +140,7 @@ HeapLimit = Heap->HeapLimit + PAGE_SIZE; if (HeapLimit <= Heap->HeapEnd) { - EarlyPrint(L"Heap extension TODO\n"); + EfiPrintf(L"Heap extension TODO\r\n"); return STATUS_INSUFFICIENT_RESOURCES; } } @@ -224,16 +224,16 @@ #if 0 BOOLEAN DebuggerEnabled; - BlStatusPrint(L"Heap corruption in the links surrounding %p!\n", BufferEntry); + BlStatusPrint(L"Heap corruption in the links surrounding %p!\r\n", BufferEntry); DebuggerEnabled = BlBdDebuggerEnabled(); if (DebuggerEnabled) { - BlStatusPrint(L"\n*** Fatal Error 0x%08x :\n (0x%p, 0x%p, 0x%p, 0x%p)\n\n", 2, BufferEntry, NULL, NULL, NULL); + BlStatusPrint(L"\n*** Fatal Error 0x%08x :\n (0x%p, 0x%p, 0x%p, 0x%p)\n\r\n", 2, BufferEntry, NULL, NULL, NULL); __debugbreak(); } #else - EarlyPrint(L"Heap corruption in the links surrounding %p!\n", BufferEntry); + EfiPrintf(L"Heap corruption in the links surrounding %p!\r\n", BufferEntry); #endif } @@ -642,18 +642,18 @@ /* We have no heaps or space on any heap -- extend the heap and retry */ if (!NT_SUCCESS(MmHapHeapAllocatorExtend(BufferSize))) { - EarlyPrint(L"Heap extension failed!\n"); + EfiPrintf(L"Heap extension failed!\r\n"); return NULL; } - EarlyPrint(L"Heap extended -- trying again\n"); + EfiPrintf(L"Heap extended -- trying again\r\n"); } /* Clear all the bits, marking this entry as allocated */ BusyEntry->BufferNext.P = MmHapDecodeLink(BusyEntry->BufferNext); /* Return the entry's data buffer */ - EarlyPrint(L"Returning buffer at 0x%p\n", &BusyEntry->Buffer); + EfiPrintf(L"Returning buffer at 0x%p\r\n", &BusyEntry->Buffer); return &BusyEntry->Buffer; } Modified: trunk/reactos/boot/environ/lib/mm/i386/mmx86.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/i386/m…
============================================================================== --- trunk/reactos/boot/environ/lib/mm/i386/mmx86.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/mm/i386/mmx86.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -71,10 +71,10 @@ if (DoDeferred) { - EarlyPrint(L"Deferred todo\n"); + EfiPrintf(L"Deferred todo\r\n"); } - EarlyPrint(L"Phase 1 TODO\n"); + EfiPrintf(L"Phase 1 TODO\r\n"); return STATUS_NOT_IMPLEMENTED; } Modified: trunk/reactos/boot/environ/lib/mm/mm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/mm.c?r…
============================================================================== --- trunk/reactos/boot/environ/lib/mm/mm.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/mm/mm.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -29,7 +29,7 @@ } /* TODO */ - EarlyPrint(L"Required for protected mode\n"); + EfiPrintf(L"Required for protected mode\r\n"); return STATUS_NOT_IMPLEMENTED; } @@ -60,7 +60,7 @@ } /* Have to allocate physical pages */ - EarlyPrint(L"VM Todo\n"); + EfiPrintf(L"VM Todo\r\n"); return STATUS_NOT_IMPLEMENTED; } @@ -99,7 +99,7 @@ return STATUS_UNSUCCESSFUL; } - EarlyPrint(L"VM todo\n"); + EfiPrintf(L"VM todo\r\n"); return STATUS_NOT_IMPLEMENTED; } @@ -188,7 +188,7 @@ if (MmTranslationType != BlNone) { /* For virtual memory, there's more to do */ - EarlyPrint(L"VM not supported for mapping\n"); + EfiPrintf(L"VM not supported for mapping\r\n"); Status = STATUS_NOT_IMPLEMENTED; goto Quickie; } @@ -220,7 +220,7 @@ if ((TranslationType > BlPae) || (LibraryParameters->TranslationType > BlPae)) { /* Bail out */ - EarlyPrint(L"Invalid translation types present\n"); + EfiPrintf(L"Invalid translation types present\r\n"); Status = STATUS_INVALID_PARAMETER; goto Quickie; } @@ -278,7 +278,7 @@ if (LibraryParameters->DescriptorCount > 512) { /* Switch to using a dynamic buffer instead */ - EarlyPrint(L"Warning: too many descriptors\n"); + EfiPrintf(L"Warning: too many descriptors\r\n"); Status = STATUS_NOT_IMPLEMENTED; goto Quickie; //MmMdpSwitchToDynamicDescriptors(LibraryParameters->DescriptorCount); Modified: trunk/reactos/boot/environ/lib/mm/pagealloc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/pageal…
============================================================================== --- trunk/reactos/boot/environ/lib/mm/pagealloc.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/mm/pagealloc.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -131,7 +131,7 @@ /* Check if we exhausted the list */ if (NextEntry == ListHead) { - EarlyPrint(L"No matching memory found\n"); + EfiPrintf(L"No matching memory found\r\n"); return Status; } @@ -151,7 +151,7 @@ &EfiAddress); if (!NT_SUCCESS(Status)) { - EarlyPrint(L"EFI memory allocation failure\n"); + EfiPrintf(L"EFI memory allocation failure\r\n"); return Status; } @@ -165,14 +165,14 @@ /* Are we allocating from the virtual memory list? */ if (CurrentList == &MmMdlMappedUnallocated) { - EarlyPrint(L"Virtual memory not yet supported\n"); + EfiPrintf(L"Virtual memory not yet supported\r\n"); return STATUS_NOT_IMPLEMENTED; } /* Does the memory we received not exactly fall onto the beginning of its descriptor? */ if (LocalDescriptor.BasePage != FoundDescriptor->BasePage) { - EarlyPrint(L"Local Page: %08I64X Found Page: %08I64X\n", LocalDescriptor.BasePage, FoundDescriptor->BasePage); + EfiPrintf(L"Local Page: %08I64X Found Page: %08I64X\r\n", LocalDescriptor.BasePage, FoundDescriptor->BasePage); TempDescriptor = MmMdInitByteGranularDescriptor(FoundDescriptor->Flags, FoundDescriptor->Type, FoundDescriptor->BasePage, @@ -193,7 +193,7 @@ LocalDescriptor.VirtualPage + LocalDescriptor.PageCount : 0; if (LocalEndPage != FoundEndPage) { - EarlyPrint(L"Local Page: %08I64X Found Page: %08I64X\n", LocalEndPage, FoundEndPage); + EfiPrintf(L"Local Page: %08I64X Found Page: %08I64X\r\n", LocalEndPage, FoundEndPage); TempDescriptor = MmMdInitByteGranularDescriptor(FoundDescriptor->Flags, FoundDescriptor->Type, LocalEndPage, @@ -266,7 +266,7 @@ if (Status == STATUS_NOT_FOUND) { /* Need to re-synchronize the memory map and check other lists */ - EarlyPrint(L"No RAM found -- backup plan not yet implemented\n"); + EfiPrintf(L"No RAM found -- backup plan not yet implemented\r\n"); } /* Did we get the region we wanted? */ @@ -277,7 +277,7 @@ } /* Nope, we have to hunt for it elsewhere */ - EarlyPrint(L"TODO\n"); + EfiPrintf(L"TODO\r\n"); return Status; } @@ -488,14 +488,14 @@ PLIST_ENTRY listHead, nextEntry; /* Loop the NT firmware memory list */ - EarlyPrint(L"NT MEMORY MAP\n\n"); + EfiPrintf(L"NT MEMORY MAP\n\r\n"); listHead = &MmMdlUnmappedUnallocated.ListHead; nextEntry = listHead->Flink; while (listHead != nextEntry) { Descriptor = CONTAINING_RECORD(nextEntry, BL_MEMORY_DESCRIPTOR, ListEntry); - EarlyPrint(L"Type: %08lX Flags: %08lX Base: 0x%016I64X End: 0x%016I64X\n", + EfiPrintf(L"Type: %08lX Flags: %08lX Base: 0x%016I64X End: 0x%016I64X\r\n", Descriptor->Type, Descriptor->Flags, Descriptor->BasePage << PAGE_SHIFT, Modified: trunk/reactos/boot/environ/lib/platform/time.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/platform/…
============================================================================== --- trunk/reactos/boot/environ/lib/platform/time.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/platform/time.c [iso-8859-1] Mon Sep 7 23:31:08 2015 @@ -50,7 +50,6 @@ /* Set the frequency based on the two measurements we took */ BlpTimePerformanceFrequency = 125 * (Delta - (TimeStamp2 - TimeStamp1)) & 0x1FFFFFFFFFFFFFF; - EarlyPrint(L"Computed frequency as: %I64d\n", BlpTimePerformanceFrequency); return STATUS_SUCCESS; } @@ -79,7 +78,7 @@ { /* Read the TSC frequency from the MSR */ BlpTimePerformanceFrequency = __readmsr(0x40000022); - EarlyPrint(L"Using frequency as: %I64d\n", BlpTimePerformanceFrequency); + EfiPrintf(L"Using Hyper-V frequency as: %I64d\r\n", BlpTimePerformanceFrequency); return STATUS_SUCCESS; } }
9 years, 9 months
1
0
0
0
[rnaumann] 69102: [powercfg] convert tabs to spaces. NFC
by rnaumann@svn.reactos.org
Author: rnaumann Date: Mon Sep 7 21:56:38 2015 New Revision: 69102 URL:
http://svn.reactos.org/svn/reactos?rev=69102&view=rev
Log: [powercfg] convert tabs to spaces. NFC Modified: trunk/reactos/dll/cpl/powercfg/advanced.c trunk/reactos/dll/cpl/powercfg/alarms.c trunk/reactos/dll/cpl/powercfg/hibernate.c trunk/reactos/dll/cpl/powercfg/powercfg.c trunk/reactos/dll/cpl/powercfg/powershemes.c Modified: trunk/reactos/dll/cpl/powercfg/advanced.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/powercfg/advanced.…
============================================================================== --- trunk/reactos/dll/cpl/powercfg/advanced.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/powercfg/advanced.c [iso-8859-1] Mon Sep 7 21:56:38 2015 @@ -25,12 +25,12 @@ LRESULT Index; if (LoadString(hApplet, ResourceId, szBuffer, MAX_PATH) < MAX_PATH) { - Index = SendMessage(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)szBuffer); + Index = SendMessage(hDlgCtrl, CB_ADDSTRING, 0, (LPARAM)szBuffer); if (Index != CB_ERR) - { - SendMessage(hDlgCtrl, CB_SETITEMDATA, (WPARAM)Index, lParam); - lpAction[Index] = (POWER_ACTION)lParam; - } + { + SendMessage(hDlgCtrl, CB_SETITEMDATA, (WPARAM)Index, lParam); + lpAction[Index] = (POWER_ACTION)lParam; + } } } @@ -41,8 +41,8 @@ for (Index = 0; Index < (INT)dwActionSize; Index++) { - if (lpAction[Index] == poAction) - return Index; + if (lpAction[Index] == poAction) + return Index; } return -1; @@ -51,65 +51,65 @@ static BOOLEAN IsBatteryUsed(VOID) { - SYSTEM_BATTERY_STATE sbs; - - if (CallNtPowerInformation(SystemBatteryState,NULL, (ULONG)0, &sbs, sizeof(SYSTEM_BATTERY_STATE)) == STATUS_SUCCESS) - { - if (sbs.BatteryPresent) - { - if (sbs.AcOnLine) - { - return FALSE; - } - return TRUE; - } - } - - return FALSE; + SYSTEM_BATTERY_STATE sbs; + + if (CallNtPowerInformation(SystemBatteryState,NULL, (ULONG)0, &sbs, sizeof(SYSTEM_BATTERY_STATE)) == STATUS_SUCCESS) + { + if (sbs.BatteryPresent) + { + if (sbs.AcOnLine) + { + return FALSE; + } + return TRUE; + } + } + + return FALSE; } POWER_ACTION GetPowerActionFromPolicy(POWER_ACTION_POLICY *Policy) { - POWER_ACTION poAction = PowerActionNone; - /* - - TCHAR szBuffer[MAX_PATH]; - - // Note: Windows XP SP2+ does not return the PowerAction code - // for PowerActionWarmEject + PowerActionShutdown but sets it - // to PowerActionNone and sets the Flags & EventCode - - - _stprintf(szBuffer, L"Action: %x EventCode %x Flags %x",Policy->Action, Policy->EventCode, Policy->Flags); - MessageBoxW(NULL, szBuffer, NULL, MB_OK); - - */ - - if (Policy->Action == PowerActionNone) - { - if (Policy->Flags == (POWER_ACTION_UI_ALLOWED | POWER_ACTION_QUERY_ALLOWED)) - { - if (Policy->EventCode == POWER_FORCE_TRIGGER_RESET) - { - poAction = PowerActionNone; - } - else if (Policy->EventCode == POWER_USER_NOTIFY_BUTTON) - { - poAction = PowerActionWarmEject; - } - else if (Policy->EventCode == POWER_USER_NOTIFY_SHUTDOWN) - { - poAction = PowerActionShutdown; - } - } - } - else - { - poAction = Policy->Action; - } - - return poAction; + POWER_ACTION poAction = PowerActionNone; + /* + + TCHAR szBuffer[MAX_PATH]; + + // Note: Windows XP SP2+ does not return the PowerAction code + // for PowerActionWarmEject + PowerActionShutdown but sets it + // to PowerActionNone and sets the Flags & EventCode + + + _stprintf(szBuffer, L"Action: %x EventCode %x Flags %x",Policy->Action, Policy->EventCode, Policy->Flags); + MessageBoxW(NULL, szBuffer, NULL, MB_OK); + + */ + + if (Policy->Action == PowerActionNone) + { + if (Policy->Flags == (POWER_ACTION_UI_ALLOWED | POWER_ACTION_QUERY_ALLOWED)) + { + if (Policy->EventCode == POWER_FORCE_TRIGGER_RESET) + { + poAction = PowerActionNone; + } + else if (Policy->EventCode == POWER_USER_NOTIFY_BUTTON) + { + poAction = PowerActionWarmEject; + } + else if (Policy->EventCode == POWER_USER_NOTIFY_SHUTDOWN) + { + poAction = PowerActionShutdown; + } + } + } + else + { + poAction = Policy->Action; + } + + return poAction; } VOID @@ -118,60 +118,60 @@ DWORD dwActionSize, POWER_ACTION_POLICY *Policy) { - int poActionIndex; - POWER_ACTION poAction; - - poAction = GetPowerActionFromPolicy(Policy); - poActionIndex = FindActionIndex(lpAction, dwActionSize, poAction); - - if (poActionIndex < 0) - { - return; - } - - SendMessage(hDlgCtrl, CB_SETCURSEL, (WPARAM)poActionIndex, (LPARAM)0); + int poActionIndex; + POWER_ACTION poAction; + + poAction = GetPowerActionFromPolicy(Policy); + poActionIndex = FindActionIndex(lpAction, dwActionSize, poAction); + + if (poActionIndex < 0) + { + return; + } + + SendMessage(hDlgCtrl, CB_SETCURSEL, (WPARAM)poActionIndex, (LPARAM)0); } BOOLEAN SaveCurrentPowerActionPolicy(IN HWND hDlgCtrl, OUT POWER_ACTION_POLICY *Policy) { - LRESULT Index; - LRESULT ItemData; - - Index = SendMessage(hDlgCtrl, CB_GETCURSEL, 0, 0); - if (Index == CB_ERR) - return FALSE; - - ItemData = SendMessage(hDlgCtrl, CB_GETITEMDATA, (WPARAM)Index, 0); - if (ItemData == CB_ERR) - return FALSE; - - switch(ItemData) - { - case PowerActionNone: - Policy->Action = PowerActionNone; - Policy->EventCode = POWER_FORCE_TRIGGER_RESET; - break; - case PowerActionWarmEject: - Policy->Action = PowerActionNone; - Policy->EventCode = POWER_USER_NOTIFY_BUTTON; - break; - case PowerActionShutdown: - Policy->Action = PowerActionNone; - Policy->EventCode = POWER_USER_NOTIFY_SHUTDOWN; - break; - case PowerActionSleep: - case PowerActionHibernate: - Policy->Action = (POWER_ACTION)ItemData; - Policy->EventCode = 0; - break; - default: - return FALSE; - } - Policy->Flags = (POWER_ACTION_UI_ALLOWED | POWER_ACTION_QUERY_ALLOWED); - - return TRUE; + LRESULT Index; + LRESULT ItemData; + + Index = SendMessage(hDlgCtrl, CB_GETCURSEL, 0, 0); + if (Index == CB_ERR) + return FALSE; + + ItemData = SendMessage(hDlgCtrl, CB_GETITEMDATA, (WPARAM)Index, 0); + if (ItemData == CB_ERR) + return FALSE; + + switch(ItemData) + { + case PowerActionNone: + Policy->Action = PowerActionNone; + Policy->EventCode = POWER_FORCE_TRIGGER_RESET; + break; + case PowerActionWarmEject: + Policy->Action = PowerActionNone; + Policy->EventCode = POWER_USER_NOTIFY_BUTTON; + break; + case PowerActionShutdown: + Policy->Action = PowerActionNone; + Policy->EventCode = POWER_USER_NOTIFY_SHUTDOWN; + break; + case PowerActionSleep: + case PowerActionHibernate: + Policy->Action = (POWER_ACTION)ItemData; + Policy->EventCode = 0; + break; + default: + return FALSE; + } + Policy->Flags = (POWER_ACTION_UI_ALLOWED | POWER_ACTION_QUERY_ALLOWED); + + return TRUE; } @@ -180,297 +180,297 @@ VOID ShowCurrentPowerActionPolicies(HWND hwndDlg) { - TCHAR szAction[MAX_PATH]; - - if (!IsBatteryUsed()) - { + TCHAR szAction[MAX_PATH]; + + if (!IsBatteryUsed()) + { #if 0 - /* expiremental code */ -// ShowCurrentPowerButtonAcAction(hList2, - ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), - g_SystemBatteries, - sizeof(g_SystemBatteries) / sizeof(POWER_ACTION), - &gGPP.user.LidCloseAc); + /* expiremental code */ +// ShowCurrentPowerButtonAcAction(hList2, + ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), + g_SystemBatteries, + sizeof(g_SystemBatteries) / sizeof(POWER_ACTION), + &gGPP.user.LidCloseAc); #else - if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.LidCloseAc.Action, szAction, MAX_PATH)) - { - SendDlgItemMessage(hwndDlg, IDC_LIDCLOSE, - CB_SELECTSTRING, - TRUE, - (LPARAM)szAction); - } + if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.LidCloseAc.Action, szAction, MAX_PATH)) + { + SendDlgItemMessage(hwndDlg, IDC_LIDCLOSE, + CB_SELECTSTRING, + TRUE, + (LPARAM)szAction); + } #endif - ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), - g_PowerButton, - sizeof(g_PowerButton) / sizeof(POWER_ACTION), - &gGPP.user.PowerButtonAc); + ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), + g_PowerButton, + sizeof(g_PowerButton) / sizeof(POWER_ACTION), + &gGPP.user.PowerButtonAc); #if 0 - /* expiremental code */ - ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), - g_SleepButton, - sizeof(g_SleepButton) / sizeof(POWER_ACTION), - &gGPP.user.SleepButtonAc); + /* expiremental code */ + ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), + g_SleepButton, + sizeof(g_SleepButton) / sizeof(POWER_ACTION), + &gGPP.user.SleepButtonAc); #else - if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.SleepButtonAc.Action, szAction, MAX_PATH)) - { - SendDlgItemMessage(hwndDlg, IDC_SLEEPBUTTON, - CB_SELECTSTRING, - TRUE, - (LPARAM)szAction); - } + if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.SleepButtonAc.Action, szAction, MAX_PATH)) + { + SendDlgItemMessage(hwndDlg, IDC_SLEEPBUTTON, + CB_SELECTSTRING, + TRUE, + (LPARAM)szAction); + } #endif - } - else - { + } + else + { #if 0 - ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_LIDCLOSE), - g_SleepButton, - sizeof(g_SleepButton) / sizeof(POWER_ACTION), - &gGPP.user.LidCloseDc); - - ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), - g_SleepButton, - sizeof(g_SleepButton) / sizeof(POWER_ACTION), - &gGPP.user.PowerButtonDc); - - ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), - g_SleepButton, - sizeof(g_SleepButton) / sizeof(POWER_ACTION), - &gGPP.user.SleepButtonDc); + ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_LIDCLOSE), + g_SleepButton, + sizeof(g_SleepButton) / sizeof(POWER_ACTION), + &gGPP.user.LidCloseDc); + + ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), + g_SleepButton, + sizeof(g_SleepButton) / sizeof(POWER_ACTION), + &gGPP.user.PowerButtonDc); + + ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), + g_SleepButton, + sizeof(g_SleepButton) / sizeof(POWER_ACTION), + &gGPP.user.SleepButtonDc); #else - if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.LidCloseDc.Action, szAction, MAX_PATH)) - { - SendDlgItemMessage(hwndDlg, IDC_LIDCLOSE, - CB_SELECTSTRING, - TRUE, - (LPARAM)szAction); - } - if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.PowerButtonDc.Action, szAction, MAX_PATH)) - { - SendDlgItemMessage(hwndDlg, IDC_POWERBUTTON, - CB_SELECTSTRING, - TRUE, - (LPARAM)szAction); - } - if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.SleepButtonDc.Action, szAction, MAX_PATH)) - { - SendDlgItemMessage(hwndDlg, IDC_SLEEPBUTTON, - CB_SELECTSTRING, - TRUE, - (LPARAM)szAction); - } + if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.LidCloseDc.Action, szAction, MAX_PATH)) + { + SendDlgItemMessage(hwndDlg, IDC_LIDCLOSE, + CB_SELECTSTRING, + TRUE, + (LPARAM)szAction); + } + if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.PowerButtonDc.Action, szAction, MAX_PATH)) + { + SendDlgItemMessage(hwndDlg, IDC_POWERBUTTON, + CB_SELECTSTRING, + TRUE, + (LPARAM)szAction); + } + if (LoadString(hApplet, IDS_PowerActionNone1+gGPP.user.SleepButtonDc.Action, szAction, MAX_PATH)) + { + SendDlgItemMessage(hwndDlg, IDC_SLEEPBUTTON, + CB_SELECTSTRING, + TRUE, + (LPARAM)szAction); + } #endif - } + } } VOID Adv_InitDialog(VOID) { - HWND hList1; - HWND hList2; - HWND hList3; - - BOOLEAN bSuspend = FALSE; - BOOLEAN bHibernate; - BOOLEAN bShutdown; - - SYSTEM_POWER_CAPABILITIES spc; - - CheckDlgButton(hAdv, - IDC_SYSTRAYBATTERYMETER, - gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hAdv, - IDC_PASSWORDLOGON, - gGPP.user.GlobalFlags & EnablePasswordLogon ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hAdv, - IDC_VIDEODIMDISPLAY, - gGPP.user.GlobalFlags & EnableVideoDimDisplay ? BST_CHECKED : BST_UNCHECKED); - - GetPwrCapabilities(&spc); - - if (spc.SystemS1 || spc.SystemS2 || spc.SystemS3) - bSuspend=TRUE; - - bHibernate = spc.HiberFilePresent; - bShutdown = spc.SystemS5; - - hList1 = GetDlgItem(hAdv, IDC_LIDCLOSE); - SendMessage(hList1, CB_RESETCONTENT, 0, 0); - - memset(g_SystemBatteries, 0x0, sizeof(g_SystemBatteries)); - if (spc.SystemBatteriesPresent) - { - AddItem(hList1, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_SystemBatteries); - - if (bSuspend) - { - AddItem(hList1, IDS_PowerActionSleep, (LPARAM)PowerActionSleep, g_SystemBatteries); - } - - if (bHibernate) - { - AddItem(hList1, IDS_PowerActionHibernate, (LPARAM)PowerActionHibernate, g_SystemBatteries); - } - } - else - { - ShowWindow(GetDlgItem(hAdv, IDC_VIDEODIMDISPLAY), FALSE); - ShowWindow(GetDlgItem(hAdv, IDC_SLIDCLOSE), FALSE); - ShowWindow(hList1, FALSE); - } - - hList2 = GetDlgItem(hAdv, IDC_POWERBUTTON); - SendMessage(hList2, CB_RESETCONTENT, 0, 0); - - memset(g_PowerButton, 0x0, sizeof(g_PowerButton)); - if (spc.PowerButtonPresent) - { - AddItem(hList2, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_PowerButton); - AddItem(hList2, IDS_PowerActionWarmEject, (LPARAM)PowerActionWarmEject, g_PowerButton); - - if (bSuspend) - { - AddItem(hList2, IDS_PowerActionSleep, (LPARAM)PowerActionSleep, g_PowerButton); - } - - if (bHibernate) - { - AddItem(hList2, IDS_PowerActionHibernate, (LPARAM)PowerActionHibernate, g_PowerButton); - - } - if (bShutdown) - { - AddItem(hList2, IDS_PowerActionShutdown, (LPARAM)PowerActionShutdown, g_PowerButton); - } - } - else - { - ShowWindow(GetDlgItem(hAdv, IDC_SPOWERBUTTON), FALSE); - ShowWindow(hList2, FALSE); - } - - hList3=GetDlgItem(hAdv, IDC_SLEEPBUTTON); - SendMessage(hList3, CB_RESETCONTENT, 0, 0); + HWND hList1; + HWND hList2; + HWND hList3; + + BOOLEAN bSuspend = FALSE; + BOOLEAN bHibernate; + BOOLEAN bShutdown; + + SYSTEM_POWER_CAPABILITIES spc; + + CheckDlgButton(hAdv, + IDC_SYSTRAYBATTERYMETER, + gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hAdv, + IDC_PASSWORDLOGON, + gGPP.user.GlobalFlags & EnablePasswordLogon ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hAdv, + IDC_VIDEODIMDISPLAY, + gGPP.user.GlobalFlags & EnableVideoDimDisplay ? BST_CHECKED : BST_UNCHECKED); + + GetPwrCapabilities(&spc); + + if (spc.SystemS1 || spc.SystemS2 || spc.SystemS3) + bSuspend=TRUE; + + bHibernate = spc.HiberFilePresent; + bShutdown = spc.SystemS5; + + hList1 = GetDlgItem(hAdv, IDC_LIDCLOSE); + SendMessage(hList1, CB_RESETCONTENT, 0, 0); + + memset(g_SystemBatteries, 0x0, sizeof(g_SystemBatteries)); + if (spc.SystemBatteriesPresent) + { + AddItem(hList1, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_SystemBatteries); + + if (bSuspend) + { + AddItem(hList1, IDS_PowerActionSleep, (LPARAM)PowerActionSleep, g_SystemBatteries); + } + + if (bHibernate) + { + AddItem(hList1, IDS_PowerActionHibernate, (LPARAM)PowerActionHibernate, g_SystemBatteries); + } + } + else + { + ShowWindow(GetDlgItem(hAdv, IDC_VIDEODIMDISPLAY), FALSE); + ShowWindow(GetDlgItem(hAdv, IDC_SLIDCLOSE), FALSE); + ShowWindow(hList1, FALSE); + } + + hList2 = GetDlgItem(hAdv, IDC_POWERBUTTON); + SendMessage(hList2, CB_RESETCONTENT, 0, 0); + + memset(g_PowerButton, 0x0, sizeof(g_PowerButton)); + if (spc.PowerButtonPresent) + { + AddItem(hList2, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_PowerButton); + AddItem(hList2, IDS_PowerActionWarmEject, (LPARAM)PowerActionWarmEject, g_PowerButton); + + if (bSuspend) + { + AddItem(hList2, IDS_PowerActionSleep, (LPARAM)PowerActionSleep, g_PowerButton); + } + + if (bHibernate) + { + AddItem(hList2, IDS_PowerActionHibernate, (LPARAM)PowerActionHibernate, g_PowerButton); + + } + if (bShutdown) + { + AddItem(hList2, IDS_PowerActionShutdown, (LPARAM)PowerActionShutdown, g_PowerButton); + } + } + else + { + ShowWindow(GetDlgItem(hAdv, IDC_SPOWERBUTTON), FALSE); + ShowWindow(hList2, FALSE); + } + + hList3=GetDlgItem(hAdv, IDC_SLEEPBUTTON); + SendMessage(hList3, CB_RESETCONTENT, 0, 0); memset(g_SleepButton, 0x0, sizeof(g_SleepButton)); - if (spc.SleepButtonPresent) - { - AddItem(hList3, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_SleepButton); - AddItem(hList3, IDS_PowerActionWarmEject, (LPARAM)PowerActionWarmEject, g_SleepButton); - - if (bSuspend) - { - AddItem(hList3, IDS_PowerActionSleep, (LPARAM)PowerActionSleep, g_SleepButton); - } - - if (bHibernate) - { - AddItem(hList3, IDS_PowerActionHibernate, (LPARAM)PowerActionHibernate, g_SleepButton); - } - - if (bShutdown) - { - AddItem(hList3, IDS_PowerActionShutdown, (LPARAM)PowerActionShutdown, g_SleepButton); - } - } - else - { - ShowWindow(GetDlgItem(hAdv, IDC_SSLEEPBUTTON), FALSE); - ShowWindow(hList3, FALSE); - } - - if (ReadGlobalPwrPolicy(&gGPP)) - { - ShowCurrentPowerActionPolicies(hAdv); - } + if (spc.SleepButtonPresent) + { + AddItem(hList3, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_SleepButton); + AddItem(hList3, IDS_PowerActionWarmEject, (LPARAM)PowerActionWarmEject, g_SleepButton); + + if (bSuspend) + { + AddItem(hList3, IDS_PowerActionSleep, (LPARAM)PowerActionSleep, g_SleepButton); + } + + if (bHibernate) + { + AddItem(hList3, IDS_PowerActionHibernate, (LPARAM)PowerActionHibernate, g_SleepButton); + } + + if (bShutdown) + { + AddItem(hList3, IDS_PowerActionShutdown, (LPARAM)PowerActionShutdown, g_SleepButton); + } + } + else + { + ShowWindow(GetDlgItem(hAdv, IDC_SSLEEPBUTTON), FALSE); + ShowWindow(hList3, FALSE); + } + + if (ReadGlobalPwrPolicy(&gGPP)) + { + ShowCurrentPowerActionPolicies(hAdv); + } } static VOID Adv_SaveData(HWND hwndDlg) { - BOOL bSystrayBatteryMeter; - BOOL bPasswordLogon; - BOOL bVideoDimDisplay; - - bSystrayBatteryMeter = - (IsDlgButtonChecked(hwndDlg, IDC_SYSTRAYBATTERYMETER) == BST_CHECKED); - - bPasswordLogon = - (IsDlgButtonChecked(hwndDlg, IDC_PASSWORDLOGON) == BST_CHECKED); - - bVideoDimDisplay = - (IsDlgButtonChecked(hwndDlg, IDC_VIDEODIMDISPLAY) == BST_CHECKED); - - if (bSystrayBatteryMeter) - { - if (!(gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter)) - { - gGPP.user.GlobalFlags = gGPP.user.GlobalFlags + EnableSysTrayBatteryMeter; - } - } - else - { - if ((gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter)) - { - gGPP.user.GlobalFlags = gGPP.user.GlobalFlags - EnableSysTrayBatteryMeter; - } - } - - if (bPasswordLogon) - { - if (!(gGPP.user.GlobalFlags & EnablePasswordLogon)) - { - gGPP.user.GlobalFlags = gGPP.user.GlobalFlags + EnablePasswordLogon; - } - } - else - { - if ((gGPP.user.GlobalFlags & EnablePasswordLogon)) - { - gGPP.user.GlobalFlags = gGPP.user.GlobalFlags - EnablePasswordLogon; - } - } - - if (bVideoDimDisplay) - { - if (!(gGPP.user.GlobalFlags & EnableVideoDimDisplay)) - { - gGPP.user.GlobalFlags = gGPP.user.GlobalFlags + EnableVideoDimDisplay; - } - } - else - { - if ((gGPP.user.GlobalFlags & EnableVideoDimDisplay)) - { - gGPP.user.GlobalFlags = gGPP.user.GlobalFlags - EnableVideoDimDisplay; - } - } - - if (!IsBatteryUsed()) - { - SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), &gGPP.user.PowerButtonAc); + BOOL bSystrayBatteryMeter; + BOOL bPasswordLogon; + BOOL bVideoDimDisplay; + + bSystrayBatteryMeter = + (IsDlgButtonChecked(hwndDlg, IDC_SYSTRAYBATTERYMETER) == BST_CHECKED); + + bPasswordLogon = + (IsDlgButtonChecked(hwndDlg, IDC_PASSWORDLOGON) == BST_CHECKED); + + bVideoDimDisplay = + (IsDlgButtonChecked(hwndDlg, IDC_VIDEODIMDISPLAY) == BST_CHECKED); + + if (bSystrayBatteryMeter) + { + if (!(gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter)) + { + gGPP.user.GlobalFlags = gGPP.user.GlobalFlags + EnableSysTrayBatteryMeter; + } + } + else + { + if ((gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter)) + { + gGPP.user.GlobalFlags = gGPP.user.GlobalFlags - EnableSysTrayBatteryMeter; + } + } + + if (bPasswordLogon) + { + if (!(gGPP.user.GlobalFlags & EnablePasswordLogon)) + { + gGPP.user.GlobalFlags = gGPP.user.GlobalFlags + EnablePasswordLogon; + } + } + else + { + if ((gGPP.user.GlobalFlags & EnablePasswordLogon)) + { + gGPP.user.GlobalFlags = gGPP.user.GlobalFlags - EnablePasswordLogon; + } + } + + if (bVideoDimDisplay) + { + if (!(gGPP.user.GlobalFlags & EnableVideoDimDisplay)) + { + gGPP.user.GlobalFlags = gGPP.user.GlobalFlags + EnableVideoDimDisplay; + } + } + else + { + if ((gGPP.user.GlobalFlags & EnableVideoDimDisplay)) + { + gGPP.user.GlobalFlags = gGPP.user.GlobalFlags - EnableVideoDimDisplay; + } + } + + if (!IsBatteryUsed()) + { + SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), &gGPP.user.PowerButtonAc); #if 0 - SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_LIDCLOSE), &gGPP.user.LidCloseAc); - SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), &gGPP.user.SleepButtonAc); + SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_LIDCLOSE), &gGPP.user.LidCloseAc); + SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), &gGPP.user.SleepButtonAc); #endif - } - else - { + } + else + { #if 0 - SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), &gGPP.user.PowerButtonDc); - SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_LIDCLOSE), &gGPP.user.LidCloseDc); - SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), &gGPP.user.SleepButtonDc); + SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON), &gGPP.user.PowerButtonDc); + SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_LIDCLOSE), &gGPP.user.LidCloseDc); + SaveCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON), &gGPP.user.SleepButtonDc); #endif - } - - if (!WriteGlobalPwrPolicy(&gGPP)) - { - MessageBox(hwndDlg, L"WriteGlobalPwrPolicy failed", NULL, MB_OK); - } - - Adv_InitDialog(); + } + + if (!WriteGlobalPwrPolicy(&gGPP)) + { + MessageBox(hwndDlg, L"WriteGlobalPwrPolicy failed", NULL, MB_OK); + } + + Adv_InitDialog(); } /* Property page dialog callback */ @@ -483,40 +483,40 @@ switch(uMsg) { case WM_INITDIALOG: - hAdv = hwndDlg; - Adv_InitDialog(); - return TRUE; + hAdv = hwndDlg; + Adv_InitDialog(); + return TRUE; break; - case WM_COMMAND: - switch(LOWORD(wParam)) - { - case IDC_SYSTRAYBATTERYMETER: - case IDC_PASSWORDLOGON: - case IDC_VIDEODIMDISPLAY: - if (HIWORD(wParam) == BN_CLICKED) - { - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - break; - case IDC_LIDCLOSE: - case IDC_POWERBUTTON: - case IDC_SLEEPBUTTON: - if (HIWORD(wParam) == CBN_SELCHANGE) - { - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - break; - } - break; - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - if (lpnm->code == (UINT)PSN_APPLY) - { - Adv_SaveData(hwndDlg); - } - return TRUE; - } + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDC_SYSTRAYBATTERYMETER: + case IDC_PASSWORDLOGON: + case IDC_VIDEODIMDISPLAY: + if (HIWORD(wParam) == BN_CLICKED) + { + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + case IDC_LIDCLOSE: + case IDC_POWERBUTTON: + case IDC_SLEEPBUTTON: + if (HIWORD(wParam) == CBN_SELCHANGE) + { + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + break; + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + if (lpnm->code == (UINT)PSN_APPLY) + { + Adv_SaveData(hwndDlg); + } + return TRUE; + } } return FALSE; } Modified: trunk/reactos/dll/cpl/powercfg/alarms.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/powercfg/alarms.c?…
============================================================================== --- trunk/reactos/dll/cpl/powercfg/alarms.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/powercfg/alarms.c [iso-8859-1] Mon Sep 7 21:56:38 2015 @@ -14,152 +14,152 @@ static BOOLEAN Ala_InitData(HWND hwndDlg) { - TCHAR szAction[MAX_PATH]; - TCHAR szText[MAX_PATH]; - TCHAR szSound[MAX_PATH]; - TCHAR szMessage[MAX_PATH]; - TCHAR szTemp[MAX_PATH]; - TCHAR szBatteryLevel[MAX_PATH]; - TCHAR szProgram[MAX_PATH]; + TCHAR szAction[MAX_PATH]; + TCHAR szText[MAX_PATH]; + TCHAR szSound[MAX_PATH]; + TCHAR szMessage[MAX_PATH]; + TCHAR szTemp[MAX_PATH]; + TCHAR szBatteryLevel[MAX_PATH]; + TCHAR szProgram[MAX_PATH]; - if (!ReadGlobalPwrPolicy(&gGPP)) - { - return FALSE; - } + if (!ReadGlobalPwrPolicy(&gGPP)) + { + return FALSE; + } - if (gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].Enable) - { - CheckDlgButton(hwndDlg, IDC_ALARM1, - gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].Enable ? BST_CHECKED : BST_UNCHECKED); + if (gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].Enable) + { + CheckDlgButton(hwndDlg, IDC_ALARM1, + gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].Enable ? BST_CHECKED : BST_UNCHECKED); - if (LoadString(hApplet, IDS_PROCENT, szTemp, MAX_PATH)) - { - _stprintf(szBatteryLevel, szTemp, gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].BatteryLevel); - SetDlgItemText(hwndDlg, IDC_ALARMVALUE1, szBatteryLevel); - } + if (LoadString(hApplet, IDS_PROCENT, szTemp, MAX_PATH)) + { + _stprintf(szBatteryLevel, szTemp, gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].BatteryLevel); + SetDlgItemText(hwndDlg, IDC_ALARMVALUE1, szBatteryLevel); + } - SendDlgItemMessage(hwndDlg, IDC_ALARMBAR1, - TBM_SETRANGE, - (WPARAM)TRUE, - (LPARAM)MAKELONG(0, 100)); - SendDlgItemMessage(hwndDlg, IDC_ALARMBAR1, - TBM_SETTICFREQ, - (WPARAM)TRUE, - (LPARAM)20); - SendDlgItemMessage(hwndDlg, IDC_ALARMBAR1, - TBM_SETPOS, - (WPARAM)TRUE, - (LPARAM)gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].BatteryLevel); + SendDlgItemMessage(hwndDlg, IDC_ALARMBAR1, + TBM_SETRANGE, + (WPARAM)TRUE, + (LPARAM)MAKELONG(0, 100)); + SendDlgItemMessage(hwndDlg, IDC_ALARMBAR1, + TBM_SETTICFREQ, + (WPARAM)TRUE, + (LPARAM)20); + SendDlgItemMessage(hwndDlg, IDC_ALARMBAR1, + TBM_SETPOS, + (WPARAM)TRUE, + (LPARAM)gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].BatteryLevel); - if (LoadString(hApplet, gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.Action+IDS_PowerActionNone1, szAction, MAX_PATH)) - { - SetDlgItemText(hwndDlg, IDC_ALARMAKTION1, szAction); - } + if (LoadString(hApplet, gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.Action+IDS_PowerActionNone1, szAction, MAX_PATH)) + { + SetDlgItemText(hwndDlg, IDC_ALARMAKTION1, szAction); + } - memset(szMessage, 0x0, sizeof(szMessage)); - LoadString(hApplet, IDS_NOACTION, szMessage, MAX_PATH); + memset(szMessage, 0x0, sizeof(szMessage)); + LoadString(hApplet, IDS_NOACTION, szMessage, MAX_PATH); - if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_TEXT) - { - if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND) - { - if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH) && LoadString(hApplet, IDS_TEXT, szText, MAX_PATH)) - { - _stprintf(szMessage,_T("%s, %s"),szSound,szText); - } - } - else - { - if (LoadString(hApplet, IDS_TEXT, szText, MAX_PATH)) - { - _stprintf(szMessage,_T("%s"),szText); - } - } - } - else - { - if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND) - { - if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH)) - { - _stprintf(szMessage,_T("%s"),szSound); - } - } - } + if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_TEXT) + { + if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND) + { + if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH) && LoadString(hApplet, IDS_TEXT, szText, MAX_PATH)) + { + _stprintf(szMessage,_T("%s, %s"),szSound,szText); + } + } + else + { + if (LoadString(hApplet, IDS_TEXT, szText, MAX_PATH)) + { + _stprintf(szMessage,_T("%s"),szText); + } + } + } + else + { + if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND) + { + if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH)) + { + _stprintf(szMessage,_T("%s"),szSound); + } + } + } - SetDlgItemText(hwndDlg, IDC_ALARMMSG1, szMessage); + SetDlgItemText(hwndDlg, IDC_ALARMMSG1, szMessage); - if (LoadString(hApplet, IDS_PowerActionNone2, szProgram, MAX_PATH)) - { - SetDlgItemText(hwndDlg, IDC_ALARMPROG1, szProgram); - } - } + if (LoadString(hApplet, IDS_PowerActionNone2, szProgram, MAX_PATH)) + { + SetDlgItemText(hwndDlg, IDC_ALARMPROG1, szProgram); + } + } - if (gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].Enable) - { - CheckDlgButton(hwndDlg, IDC_ALARM2, - gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].Enable ? BST_CHECKED : BST_UNCHECKED); + if (gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].Enable) + { + CheckDlgButton(hwndDlg, IDC_ALARM2, + gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].Enable ? BST_CHECKED : BST_UNCHECKED); - if (LoadString(hApplet, IDS_PROCENT, szTemp, MAX_PATH)) - { - _stprintf(szBatteryLevel, szTemp, gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].BatteryLevel); - SetDlgItemText(hwndDlg, IDC_ALARMVALUE2, szBatteryLevel); - } + if (LoadString(hApplet, IDS_PROCENT, szTemp, MAX_PATH)) + { + _stprintf(szBatteryLevel, szTemp, gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].BatteryLevel); + SetDlgItemText(hwndDlg, IDC_ALARMVALUE2, szBatteryLevel); + } - SendDlgItemMessage(hwndDlg, IDC_ALARMBAR2, - TBM_SETRANGE, - (WPARAM)TRUE, - (LPARAM)MAKELONG(0, 100)); - SendDlgItemMessage(hwndDlg, IDC_ALARMBAR2, - TBM_SETPOS, - (WPARAM)TRUE, - (LPARAM)gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].BatteryLevel); + SendDlgItemMessage(hwndDlg, IDC_ALARMBAR2, + TBM_SETRANGE, + (WPARAM)TRUE, + (LPARAM)MAKELONG(0, 100)); + SendDlgItemMessage(hwndDlg, IDC_ALARMBAR2, + TBM_SETPOS, + (WPARAM)TRUE, + (LPARAM)gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].BatteryLevel); - if (LoadString(hApplet, gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.Action+IDS_PowerActionNone1, szAction, MAX_PATH)) - { - SetDlgItemText(hwndDlg, IDC_ALARMAKTION2, szAction); - } + if (LoadString(hApplet, gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.Action+IDS_PowerActionNone1, szAction, MAX_PATH)) + { + SetDlgItemText(hwndDlg, IDC_ALARMAKTION2, szAction); + } - memset(szMessage, 0x0, sizeof(szMessage)); - LoadString(hApplet, IDS_NOACTION, szMessage, MAX_PATH); + memset(szMessage, 0x0, sizeof(szMessage)); + LoadString(hApplet, IDS_NOACTION, szMessage, MAX_PATH); - if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_TEXT) - { - if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND) - { - if (LoadString(hApplet, IDS_TEXT, szText, MAX_PATH) && LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH)) - { - _stprintf(szMessage,_T("%s, %s"),szSound,szText); - } - } - else - { - if (LoadString(hApplet, IDS_TEXT, szText, MAX_PATH)) - { - _stprintf(szMessage,_T("%s"),szText); - } - } - } - else - { - if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND) - { - if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH)) - { - _stprintf(szMessage,_T("%s"),szSound); - } - } - } + if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_TEXT) + { + if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND) + { + if (LoadString(hApplet, IDS_TEXT, szText, MAX_PATH) && LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH)) + { + _stprintf(szMessage,_T("%s, %s"),szSound,szText); + } + } + else + { + if (LoadString(hApplet, IDS_TEXT, szText, MAX_PATH)) + { + _stprintf(szMessage,_T("%s"),szText); + } + } + } + else + { + if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND) + { + if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH)) + { + _stprintf(szMessage,_T("%s"),szSound); + } + } + } - SetDlgItemText(hwndDlg, IDC_ALARMMSG2, szMessage); + SetDlgItemText(hwndDlg, IDC_ALARMMSG2, szMessage); - if (LoadString(hApplet, IDS_PowerActionNone2, szProgram, MAX_PATH)) - { - SetDlgItemText(hwndDlg, IDC_ALARMPROG2, szProgram); - } - } + if (LoadString(hApplet, IDS_PowerActionNone2, szProgram, MAX_PATH)) + { + SetDlgItemText(hwndDlg, IDC_ALARMPROG2, szProgram); + } + } - return TRUE; + return TRUE; } /* Property page dialog callback */ @@ -174,14 +174,14 @@ switch(uMsg) { case WM_INITDIALOG: - if (!Ala_InitData(hwndDlg)) - { - // TODO: - // Handle initialization error - } - return TRUE; - default: - break; + if (!Ala_InitData(hwndDlg)) + { + // TODO: + // Handle initialization error + } + return TRUE; + default: + break; } return FALSE; } Modified: trunk/reactos/dll/cpl/powercfg/hibernate.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/powercfg/hibernate…
============================================================================== --- trunk/reactos/dll/cpl/powercfg/hibernate.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/powercfg/hibernate.c [iso-8859-1] Mon Sep 7 21:56:38 2015 @@ -18,98 +18,98 @@ static VOID Hib_InitDialog(HWND hwndDlg) { - SYSTEM_POWER_CAPABILITIES PowerCaps; - MEMORYSTATUSEX msex; - TCHAR szSize[MAX_PATH]; - TCHAR szTemp[MAX_PATH]; - ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes, TotalNumberOfFreeBytes; + SYSTEM_POWER_CAPABILITIES PowerCaps; + MEMORYSTATUSEX msex; + TCHAR szSize[MAX_PATH]; + TCHAR szTemp[MAX_PATH]; + ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes, TotalNumberOfFreeBytes; - if (GetPwrCapabilities(&PowerCaps)) - { - CheckDlgButton(hwndDlg, - IDC_HIBERNATEFILE, - PowerCaps.HiberFilePresent ? BST_CHECKED : BST_UNCHECKED); + if (GetPwrCapabilities(&PowerCaps)) + { + CheckDlgButton(hwndDlg, + IDC_HIBERNATEFILE, + PowerCaps.HiberFilePresent ? BST_CHECKED : BST_UNCHECKED); - msex.dwLength = sizeof(msex); - if (!GlobalMemoryStatusEx(&msex)) - { - return; // FIXME - } + msex.dwLength = sizeof(msex); + if (!GlobalMemoryStatusEx(&msex)) + { + return; // FIXME + } - if (GetWindowsDirectory(szTemp,MAX_PATH)) - { - if (!GetDiskFreeSpaceEx(szTemp,&FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) - TotalNumberOfFreeBytes.QuadPart = 0; - } - else - { - if (!GetDiskFreeSpaceEx(NULL,&FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) - TotalNumberOfFreeBytes.QuadPart = 0; - } + if (GetWindowsDirectory(szTemp,MAX_PATH)) + { + if (!GetDiskFreeSpaceEx(szTemp,&FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) + TotalNumberOfFreeBytes.QuadPart = 0; + } + else + { + if (!GetDiskFreeSpaceEx(NULL,&FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) + TotalNumberOfFreeBytes.QuadPart = 0; + } - if (TotalNumberOfFreeBytes.QuadPart > 0x100000) - { - if (LoadString(hApplet, IDS_SIZEMB, szTemp, MAX_PATH)) - { - _stprintf(szSize,szTemp,TotalNumberOfFreeBytes.QuadPart / 0x100000); - SetDlgItemText(hwndDlg, IDC_FREESPACE, szSize); - } - } - else - { - if (LoadString(hApplet, IDS_SIZEBYTS, szTemp, MAX_PATH)) - { - _stprintf(szSize,szTemp,TotalNumberOfFreeBytes.QuadPart); - SetDlgItemText(hwndDlg, IDC_FREESPACE, szSize); - } - } + if (TotalNumberOfFreeBytes.QuadPart > 0x100000) + { + if (LoadString(hApplet, IDS_SIZEMB, szTemp, MAX_PATH)) + { + _stprintf(szSize,szTemp,TotalNumberOfFreeBytes.QuadPart / 0x100000); + SetDlgItemText(hwndDlg, IDC_FREESPACE, szSize); + } + } + else + { + if (LoadString(hApplet, IDS_SIZEBYTS, szTemp, MAX_PATH)) + { + _stprintf(szSize,szTemp,TotalNumberOfFreeBytes.QuadPart); + SetDlgItemText(hwndDlg, IDC_FREESPACE, szSize); + } + } - if (msex.ullTotalPhys>0x100000) - { - if (LoadString(hApplet, IDS_SIZEMB, szTemp, MAX_PATH)) - { - _stprintf(szSize,szTemp,msex.ullTotalPhys/0x100000); - SetDlgItemText(hwndDlg, IDC_SPACEFORHIBERNATEFILE,szSize); - } - } - else - { - if (LoadString(hApplet, IDS_SIZEBYTS, szTemp, MAX_PATH)) - { - _stprintf(szSize,szTemp,msex.ullTotalPhys); - SetDlgItemText(hwndDlg, IDC_SPACEFORHIBERNATEFILE, szSize); - } - } + if (msex.ullTotalPhys>0x100000) + { + if (LoadString(hApplet, IDS_SIZEMB, szTemp, MAX_PATH)) + { + _stprintf(szSize,szTemp,msex.ullTotalPhys/0x100000); + SetDlgItemText(hwndDlg, IDC_SPACEFORHIBERNATEFILE,szSize); + } + } + else + { + if (LoadString(hApplet, IDS_SIZEBYTS, szTemp, MAX_PATH)) + { + _stprintf(szSize,szTemp,msex.ullTotalPhys); + SetDlgItemText(hwndDlg, IDC_SPACEFORHIBERNATEFILE, szSize); + } + } - if (TotalNumberOfFreeBytes.QuadPart < msex.ullTotalPhys && !PowerCaps.HiberFilePresent) - { - EnableWindow(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE), FALSE); - ShowWindow(GetDlgItem(hwndDlg, IDC_TOLESSFREESPACE), TRUE); - } - else - { - ShowWindow(GetDlgItem(hwndDlg, IDC_TOLESSFREESPACE), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE), TRUE); - } - } + if (TotalNumberOfFreeBytes.QuadPart < msex.ullTotalPhys && !PowerCaps.HiberFilePresent) + { + EnableWindow(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE), FALSE); + ShowWindow(GetDlgItem(hwndDlg, IDC_TOLESSFREESPACE), TRUE); + } + else + { + ShowWindow(GetDlgItem(hwndDlg, IDC_TOLESSFREESPACE), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE), TRUE); + } + } } INT_PTR Hib_SaveData(HWND hwndDlg) { - BOOLEAN bHibernate; + BOOLEAN bHibernate; - bHibernate = (BOOLEAN)(IsDlgButtonChecked(hwndDlg, IDC_HIBERNATEFILE) == BST_CHECKED); + bHibernate = (BOOLEAN)(IsDlgButtonChecked(hwndDlg, IDC_HIBERNATEFILE) == BST_CHECKED); - if (CallNtPowerInformation(SystemReserveHiberFile,&bHibernate, sizeof(bHibernate), NULL, 0) == STATUS_SUCCESS) - { - Pos_InitData(); - Adv_InitDialog(); - Hib_InitDialog(hwndDlg); - return TRUE; - } + if (CallNtPowerInformation(SystemReserveHiberFile,&bHibernate, sizeof(bHibernate), NULL, 0) == STATUS_SUCCESS) + { + Pos_InitData(); + Adv_InitDialog(); + Hib_InitDialog(hwndDlg); + return TRUE; + } - return FALSE; + return FALSE; } /* Property page dialog callback */ @@ -122,26 +122,26 @@ switch(uMsg) { case WM_INITDIALOG: - Hib_InitDialog(hwndDlg); - return TRUE; - case WM_COMMAND: - switch(LOWORD(wParam)) - { - case IDC_HIBERNATEFILE: - if (HIWORD(wParam) == BN_CLICKED) - { - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - } - break; - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - if (lpnm->code == (UINT)PSN_APPLY) - { - return Hib_SaveData(hwndDlg); - } - } + Hib_InitDialog(hwndDlg); + return TRUE; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDC_HIBERNATEFILE: + if (HIWORD(wParam) == BN_CLICKED) + { + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + } + break; + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + if (lpnm->code == (UINT)PSN_APPLY) + { + return Hib_SaveData(hwndDlg); + } + } } return FALSE; } Modified: trunk/reactos/dll/cpl/powercfg/powercfg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/powercfg/powercfg.…
============================================================================== --- trunk/reactos/dll/cpl/powercfg/powercfg.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/powercfg/powercfg.c [iso-8859-1] Mon Sep 7 21:56:38 2015 @@ -14,7 +14,7 @@ #include <winreg.h> #include <regstr.h> -#define NUM_APPLETS (1) +#define NUM_APPLETS (1) static LONG APIENTRY Applet1(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam); @@ -101,9 +101,9 @@ if (GetPwrCapabilities(&spc)) { if (spc.SystemBatteriesPresent) - { - InitPropSheetPage(&psh, IDD_PROPPAGEALARMS, (DLGPROC)AlarmsDlgProc); - } + { + InitPropSheetPage(&psh, IDD_PROPPAGEALARMS, (DLGPROC)AlarmsDlgProc); + } } InitPropSheetPage(&psh, IDD_PROPPAGEADVANCED, (DLGPROC)AdvancedDlgProc); InitPropSheetPage(&psh, IDD_PROPPAGEHIBERNATE, (DLGPROC)HibernateDlgProc); Modified: trunk/reactos/dll/cpl/powercfg/powershemes.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/powercfg/powershem…
============================================================================== --- trunk/reactos/dll/cpl/powercfg/powershemes.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/powercfg/powershemes.c [iso-8859-1] Mon Sep 7 21:56:38 2015 @@ -13,22 +13,22 @@ UINT Sec[]= { - 60, - 120, - 180, - 300, - 600, - 900, - 1200, - 1500, - 1800, - 2700, - 3600, - 7200, - 10800, - 14400, - 18000, - 0 + 60, + 120, + 180, + 300, + 600, + 900, + 1200, + 1500, + 1800, + 2700, + 3600, + 7200, + 10800, + 14400, + 18000, + 0 }; HWND hList = 0; @@ -36,7 +36,7 @@ unsigned aps = 0; -#define MAX_POWER_POLICY 20 +#define MAX_POWER_POLICY 20 POWER_POLICY gPP[MAX_POWER_POLICY]; UINT guiIndex = 0; @@ -46,193 +46,193 @@ BOOLEAN Pos_InitData(VOID) { - SYSTEM_POWER_CAPABILITIES spc; + SYSTEM_POWER_CAPABILITIES spc; /* - RECT rectCtl, rectDlg, rectCtl2; - LONG movetop = 0; - LONG moveright = 0; - - if (GetWindowRect(hPos,&rectDlg)) - { - if (GetWindowRect(GetDlgItem(hPos, IDC_SAT),&rectCtl2)) - { - if (GetWindowRect(GetDlgItem(hPos, IDC_MONITOR),&rectCtl)) - { - movetop=rectCtl.top - rectCtl2.top; - MoveWindow(GetDlgItem(hPos, IDC_MONITOR),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE); - if (GetWindowRect(GetDlgItem(hPos, IDC_DISK),&rectCtl)) - { - MoveWindow(GetDlgItem(hPos, IDC_DISK),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE); - } - if (GetWindowRect(GetDlgItem(hPos, IDC_STANDBY),&rectCtl)) - { - MoveWindow(GetDlgItem(hPos, IDC_STANDBY),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE); - } - if (GetWindowRect(GetDlgItem(hPos, IDC_HYBERNATE),&rectCtl)) - { - MoveWindow(GetDlgItem(hPos, IDC_HYBERNATE),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE); - } - if (GetWindowRect(GetDlgItem(hPos, IDC_MONITORDCLIST),&rectCtl2)) - { - movetop=movetop-8; - if (GetWindowRect(GetDlgItem(hPos, IDC_MONITORACLIST),&rectCtl)) - { - moveright=rectCtl.right - rectCtl2.right; - MoveWindow(GetDlgItem(hPos, IDC_MONITORACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE); - if (GetWindowRect(GetDlgItem(hPos, IDC_DISKACLIST),&rectCtl)) - { - MoveWindow(GetDlgItem(hPos, IDC_DISKACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE); - } - if (GetWindowRect(GetDlgItem(hPos, IDC_STANDBYACLIST),&rectCtl)) - { - MoveWindow(GetDlgItem(hPos, IDC_STANDBYACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE); - } - if (GetWindowRect(GetDlgItem(hPos, IDC_HYBERNATEACLIST),&rectCtl)) - { - MoveWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE); - } - } - if (GetWindowRect(GetDlgItem(hPos, IDC_GRPDETAIL),&rectCtl)) - { - MoveWindow(GetDlgItem(hPos, IDC_GRPDETAIL),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE); - } - } - } - } - } - } + RECT rectCtl, rectDlg, rectCtl2; + LONG movetop = 0; + LONG moveright = 0; + + if (GetWindowRect(hPos,&rectDlg)) + { + if (GetWindowRect(GetDlgItem(hPos, IDC_SAT),&rectCtl2)) + { + if (GetWindowRect(GetDlgItem(hPos, IDC_MONITOR),&rectCtl)) + { + movetop=rectCtl.top - rectCtl2.top; + MoveWindow(GetDlgItem(hPos, IDC_MONITOR),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE); + if (GetWindowRect(GetDlgItem(hPos, IDC_DISK),&rectCtl)) + { + MoveWindow(GetDlgItem(hPos, IDC_DISK),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE); + } + if (GetWindowRect(GetDlgItem(hPos, IDC_STANDBY),&rectCtl)) + { + MoveWindow(GetDlgItem(hPos, IDC_STANDBY),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE); + } + if (GetWindowRect(GetDlgItem(hPos, IDC_HYBERNATE),&rectCtl)) + { + MoveWindow(GetDlgItem(hPos, IDC_HYBERNATE),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE); + } + if (GetWindowRect(GetDlgItem(hPos, IDC_MONITORDCLIST),&rectCtl2)) + { + movetop=movetop-8; + if (GetWindowRect(GetDlgItem(hPos, IDC_MONITORACLIST),&rectCtl)) + { + moveright=rectCtl.right - rectCtl2.right; + MoveWindow(GetDlgItem(hPos, IDC_MONITORACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE); + if (GetWindowRect(GetDlgItem(hPos, IDC_DISKACLIST),&rectCtl)) + { + MoveWindow(GetDlgItem(hPos, IDC_DISKACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE); + } + if (GetWindowRect(GetDlgItem(hPos, IDC_STANDBYACLIST),&rectCtl)) + { + MoveWindow(GetDlgItem(hPos, IDC_STANDBYACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE); + } + if (GetWindowRect(GetDlgItem(hPos, IDC_HYBERNATEACLIST),&rectCtl)) + { + MoveWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top-movetop,rectCtl.right-rectCtl.left-moveright,rectCtl.bottom-rectCtl.top,FALSE); + } + } + if (GetWindowRect(GetDlgItem(hPos, IDC_GRPDETAIL),&rectCtl)) + { + MoveWindow(GetDlgItem(hPos, IDC_GRPDETAIL),rectCtl.left-rectDlg.left,rectCtl.top-rectDlg.top,rectCtl.right-rectCtl.left,rectCtl.bottom-rectCtl.top,FALSE); + } + } + } + } + } + } */ - if (!GetPwrCapabilities(&spc)) - { - return FALSE; - } - - if (!spc.SystemBatteriesPresent) - { - ShowWindow(GetDlgItem(hPos, IDC_SAT),FALSE); - ShowWindow(GetDlgItem(hPos, IDC_IAC),FALSE); - ShowWindow(GetDlgItem(hPos, IDC_SAC),FALSE); - ShowWindow(GetDlgItem(hPos, IDC_IDC),FALSE); - ShowWindow(GetDlgItem(hPos, IDC_SDC),FALSE); - ShowWindow(GetDlgItem(hPos, IDC_MONITORDCLIST),FALSE); - ShowWindow(GetDlgItem(hPos, IDC_DISKDCLIST),FALSE); - ShowWindow(GetDlgItem(hPos, IDC_STANDBYDCLIST),FALSE); - ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEDCLIST),FALSE); - ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST), spc.HiberFilePresent); - - } - else - { - ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEDCLIST), spc.HiberFilePresent); - ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST), FALSE); - } - - - if (!(spc.SystemS1 ||spc.SystemS2 || spc.SystemS3)) - { - ShowWindow(GetDlgItem(hPos, IDC_STANDBYACLIST), TRUE); - ShowWindow(GetDlgItem(hPos, IDC_STANDBYDCLIST), TRUE); - ShowWindow(GetDlgItem(hPos, IDC_STANDBY), TRUE); - } - - ShowWindow(GetDlgItem(hPos, IDC_HYBERNATE), spc.HiberFilePresent); - - return TRUE; + if (!GetPwrCapabilities(&spc)) + { + return FALSE; + } + + if (!spc.SystemBatteriesPresent) + { + ShowWindow(GetDlgItem(hPos, IDC_SAT),FALSE); + ShowWindow(GetDlgItem(hPos, IDC_IAC),FALSE); + ShowWindow(GetDlgItem(hPos, IDC_SAC),FALSE); + ShowWindow(GetDlgItem(hPos, IDC_IDC),FALSE); + ShowWindow(GetDlgItem(hPos, IDC_SDC),FALSE); + ShowWindow(GetDlgItem(hPos, IDC_MONITORDCLIST),FALSE); + ShowWindow(GetDlgItem(hPos, IDC_DISKDCLIST),FALSE); + ShowWindow(GetDlgItem(hPos, IDC_STANDBYDCLIST),FALSE); + ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEDCLIST),FALSE); + ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST), spc.HiberFilePresent); + + } + else + { + ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEDCLIST), spc.HiberFilePresent); + ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST), FALSE); + } + + + if (!(spc.SystemS1 ||spc.SystemS2 || spc.SystemS3)) + { + ShowWindow(GetDlgItem(hPos, IDC_STANDBYACLIST), TRUE); + ShowWindow(GetDlgItem(hPos, IDC_STANDBYDCLIST), TRUE); + ShowWindow(GetDlgItem(hPos, IDC_STANDBY), TRUE); + } + + ShowWindow(GetDlgItem(hPos, IDC_HYBERNATE), spc.HiberFilePresent); + + return TRUE; } static VOID LoadConfig(HWND hwndDlg) { - INT i=0, iCurSel=0; - UINT uiIndex; - TCHAR szProfile[MAX_PATH]; - TCHAR szTemp[MAX_PATH]; - TCHAR szConfig[MAX_PATH]; - POWER_POLICY pp; - - iCurSel = (INT)SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST, - CB_GETCURSEL, - 0, - 0); - if (iCurSel == CB_ERR) - return; - - memcpy(&pp, &gPP[iCurSel], sizeof(POWER_POLICY)); - - uiIndex = (UINT)SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST, CB_GETCURSEL, 0, 0); - if(uiIndex != (UINT)CB_ERR) - { - SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST, CB_GETLBTEXT, uiIndex, (LPARAM)szProfile); - if(LoadString(hApplet, IDS_CONFIG1, szTemp, MAX_PATH)) - { - _stprintf(szConfig,szTemp,szProfile); - SetWindowText(GetDlgItem(hwndDlg, IDC_GRPDETAIL),szConfig); - } - } - - for(i=0;i<16;i++) - { - if (Sec[i]==pp.user.VideoTimeoutAc) - { - SendDlgItemMessage(hwndDlg, IDC_MONITORACLIST, - CB_SETCURSEL, - i, - (LPARAM)0); - } - - if (Sec[i]==pp.user.VideoTimeoutDc) - { - SendDlgItemMessage(hwndDlg, IDC_MONITORDCLIST, - CB_SETCURSEL, - i, - (LPARAM)0); - } - if (Sec[i]==pp.user.SpindownTimeoutAc) - { - SendDlgItemMessage(hwndDlg, IDC_DISKACLIST, - CB_SETCURSEL, - i-2, - (LPARAM)0); - } - if (Sec[i]==pp.user.SpindownTimeoutDc) // IdleTimeoutDc) - { - SendDlgItemMessage(hwndDlg, IDC_DISKDCLIST, - CB_SETCURSEL, - i-2, - (LPARAM)0); - } - if (Sec[i]==pp.user.IdleTimeoutAc) - { - SendDlgItemMessage(hwndDlg, IDC_STANDBYACLIST, - CB_SETCURSEL, - i, - (LPARAM)0); - } - if (Sec[i]==pp.user.IdleTimeoutDc) - { - SendDlgItemMessage(hwndDlg, IDC_STANDBYDCLIST, - CB_SETCURSEL, - i, - (LPARAM)0); - } - - if (Sec[i]==pp.mach.DozeS4TimeoutAc) - { - SendDlgItemMessage(hwndDlg, IDC_HYBERNATEACLIST, - CB_SETCURSEL, - i, - (LPARAM)0); - } - if (Sec[i]==pp.mach.DozeS4TimeoutDc) - { - SendDlgItemMessage(hwndDlg, IDC_HYBERNATEDCLIST, - CB_SETCURSEL, - i, - (LPARAM)0); - } - } + INT i=0, iCurSel=0; + UINT uiIndex; + TCHAR szProfile[MAX_PATH]; + TCHAR szTemp[MAX_PATH]; + TCHAR szConfig[MAX_PATH]; + POWER_POLICY pp; + + iCurSel = (INT)SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST, + CB_GETCURSEL, + 0, + 0); + if (iCurSel == CB_ERR) + return; + + memcpy(&pp, &gPP[iCurSel], sizeof(POWER_POLICY)); + + uiIndex = (UINT)SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST, CB_GETCURSEL, 0, 0); + if(uiIndex != (UINT)CB_ERR) + { + SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST, CB_GETLBTEXT, uiIndex, (LPARAM)szProfile); + if(LoadString(hApplet, IDS_CONFIG1, szTemp, MAX_PATH)) + { + _stprintf(szConfig,szTemp,szProfile); + SetWindowText(GetDlgItem(hwndDlg, IDC_GRPDETAIL),szConfig); + } + } + + for(i=0;i<16;i++) + { + if (Sec[i]==pp.user.VideoTimeoutAc) + { + SendDlgItemMessage(hwndDlg, IDC_MONITORACLIST, + CB_SETCURSEL, + i, + (LPARAM)0); + } + + if (Sec[i]==pp.user.VideoTimeoutDc) + { + SendDlgItemMessage(hwndDlg, IDC_MONITORDCLIST, + CB_SETCURSEL, + i, + (LPARAM)0); + } + if (Sec[i]==pp.user.SpindownTimeoutAc) + { + SendDlgItemMessage(hwndDlg, IDC_DISKACLIST, + CB_SETCURSEL, + i-2, + (LPARAM)0); + } + if (Sec[i]==pp.user.SpindownTimeoutDc) // IdleTimeoutDc) + { + SendDlgItemMessage(hwndDlg, IDC_DISKDCLIST, + CB_SETCURSEL, + i-2, + (LPARAM)0); + } + if (Sec[i]==pp.user.IdleTimeoutAc) + { + SendDlgItemMessage(hwndDlg, IDC_STANDBYACLIST, + CB_SETCURSEL, + i, + (LPARAM)0); + } + if (Sec[i]==pp.user.IdleTimeoutDc) + { + SendDlgItemMessage(hwndDlg, IDC_STANDBYDCLIST, + CB_SETCURSEL, + i, + (LPARAM)0); + } + + if (Sec[i]==pp.mach.DozeS4TimeoutAc) + { + SendDlgItemMessage(hwndDlg, IDC_HYBERNATEACLIST, + CB_SETCURSEL, + i, + (LPARAM)0); + } + if (Sec[i]==pp.mach.DozeS4TimeoutDc) + { + SendDlgItemMessage(hwndDlg, IDC_HYBERNATEDCLIST, + CB_SETCURSEL, + i, + (LPARAM)0); + } + } } @@ -240,304 +240,304 @@ callback_EnumPwrScheme(UINT uiIndex, DWORD dwName, LPTSTR sName, DWORD dwDesc, LPWSTR sDesc, PPOWER_POLICY pp,LPARAM lParam) { - int index; - - UNREFERENCED_PARAMETER(lParam); - UNREFERENCED_PARAMETER(sDesc); - UNREFERENCED_PARAMETER(dwDesc); - UNREFERENCED_PARAMETER(dwName); - - if (ValidatePowerPolicies(0,pp)) - { - if (guiIndex >= MAX_POWER_POLICY) - { - // FIXME: - // Implement store power policy dynamically - return FALSE; - } - - - memcpy(&gPP[guiIndex], pp, sizeof(POWER_POLICY)); - guiIndex++; - - index = (int) SendMessage(hList, - CB_ADDSTRING, - 0, - (LPARAM)sName); - if (index == CB_ERR) - return FALSE; - - SendMessage(hList, - CB_SETITEMDATA, - index, - (LPARAM)uiIndex); - - if (aps == uiIndex) - { - SendMessage(hList, - CB_SELECTSTRING, - TRUE, - (LPARAM)sName); - LoadConfig(GetParent(hList)); - } - } - return TRUE; + int index; + + UNREFERENCED_PARAMETER(lParam); + UNREFERENCED_PARAMETER(sDesc); + UNREFERENCED_PARAMETER(dwDesc); + UNREFERENCED_PARAMETER(dwName); + + if (ValidatePowerPolicies(0,pp)) + { + if (guiIndex >= MAX_POWER_POLICY) + { + // FIXME: + // Implement store power policy dynamically + return FALSE; + } + + + memcpy(&gPP[guiIndex], pp, sizeof(POWER_POLICY)); + guiIndex++; + + index = (int) SendMessage(hList, + CB_ADDSTRING, + 0, + (LPARAM)sName); + if (index == CB_ERR) + return FALSE; + + SendMessage(hList, + CB_SETITEMDATA, + index, + (LPARAM)uiIndex); + + if (aps == uiIndex) + { + SendMessage(hList, + CB_SELECTSTRING, + TRUE, + (LPARAM)sName); + LoadConfig(GetParent(hList)); + } + } + return TRUE; } static VOID Pos_InitPage(HWND hwndDlg) { - int ifrom=0,i=0,imin=0; - HWND hwnd = NULL; - TCHAR szName[MAX_PATH]; - LRESULT index; - - for(i=1;i<9;i++) - { - switch(i) - { - case 1: - hwnd=GetDlgItem(hwndDlg, IDC_MONITORACLIST); - imin=IDS_TIMEOUT1; - break; - case 2: - hwnd=GetDlgItem(hwndDlg, IDC_STANDBYACLIST); - imin=IDS_TIMEOUT1; - break; - case 3: - hwnd=GetDlgItem(hwndDlg, IDC_DISKACLIST); - imin=IDS_TIMEOUT3; - break; - case 4: - hwnd=GetDlgItem(hwndDlg, IDC_HYBERNATEACLIST); - imin=IDS_TIMEOUT3; - break; - case 5: - hwnd=GetDlgItem(hwndDlg, IDC_MONITORDCLIST); - imin=IDS_TIMEOUT1; - break; - case 6: - hwnd=GetDlgItem(hwndDlg, IDC_STANDBYDCLIST); - imin=IDS_TIMEOUT1; - break; - case 7: - hwnd=GetDlgItem(hwndDlg, IDC_DISKDCLIST); - imin=IDS_TIMEOUT3; - break; - case 8: - hwnd=GetDlgItem(hwndDlg, IDC_HYBERNATEDCLIST); - imin=IDS_TIMEOUT3; - break; - default: - return; - } - for (ifrom=imin;ifrom<(IDS_TIMEOUT15+1);ifrom++) - { - if (LoadString(hApplet, ifrom, szName, MAX_PATH)) - { - index = SendMessage(hwnd, - CB_ADDSTRING, - 0, - (LPARAM)szName); - - if (index == CB_ERR) - return; - - SendMessage(hwnd, - CB_SETITEMDATA, - index, - (LPARAM)Sec[ifrom-IDS_TIMEOUT16]); - } - } - if (LoadString(hApplet, IDS_TIMEOUT16, szName, MAX_PATH)) - { - index = SendMessage(hwnd, - CB_ADDSTRING, - 0, - (LPARAM)szName); - if (index == CB_ERR) - return; - - SendMessage(hwnd, - CB_SETITEMDATA, - index, - (LPARAM)Sec[0]); - } - } + int ifrom=0,i=0,imin=0; + HWND hwnd = NULL; + TCHAR szName[MAX_PATH]; + LRESULT index; + + for(i=1;i<9;i++) + { + switch(i) + { + case 1: + hwnd=GetDlgItem(hwndDlg, IDC_MONITORACLIST); + imin=IDS_TIMEOUT1; + break; + case 2: + hwnd=GetDlgItem(hwndDlg, IDC_STANDBYACLIST); + imin=IDS_TIMEOUT1; + break; + case 3: + hwnd=GetDlgItem(hwndDlg, IDC_DISKACLIST); + imin=IDS_TIMEOUT3; + break; + case 4: + hwnd=GetDlgItem(hwndDlg, IDC_HYBERNATEACLIST); + imin=IDS_TIMEOUT3; + break; + case 5: + hwnd=GetDlgItem(hwndDlg, IDC_MONITORDCLIST); + imin=IDS_TIMEOUT1; + break; + case 6: + hwnd=GetDlgItem(hwndDlg, IDC_STANDBYDCLIST); + imin=IDS_TIMEOUT1; + break; + case 7: + hwnd=GetDlgItem(hwndDlg, IDC_DISKDCLIST); + imin=IDS_TIMEOUT3; + break; + case 8: + hwnd=GetDlgItem(hwndDlg, IDC_HYBERNATEDCLIST); + imin=IDS_TIMEOUT3; + break; + default: + return; + } + for (ifrom=imin;ifrom<(IDS_TIMEOUT15+1);ifrom++) + { + if (LoadString(hApplet, ifrom, szName, MAX_PATH)) + { + index = SendMessage(hwnd, + CB_ADDSTRING, + 0, + (LPARAM)szName); + + if (index == CB_ERR) + return; + + SendMessage(hwnd, + CB_SETITEMDATA, + index, + (LPARAM)Sec[ifrom-IDS_TIMEOUT16]); + } + } + if (LoadString(hApplet, IDS_TIMEOUT16, szName, MAX_PATH)) + { + index = SendMessage(hwnd, + CB_ADDSTRING, + 0, + (LPARAM)szName); + if (index == CB_ERR) + return; + + SendMessage(hwnd, + CB_SETITEMDATA, + index, + (LPARAM)Sec[0]); + } + } } static VOID Pos_SaveData(HWND hwndDlg) { - INT iCurSel=0,tmp=0; - - iCurSel = (INT) SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST, - CB_GETCURSEL, - 0, - 0); - if (iCurSel == CB_ERR) - return; + INT iCurSel=0,tmp=0; + + iCurSel = (INT) SendDlgItemMessage(hwndDlg, IDC_ENERGYLIST, + CB_GETCURSEL, + 0, + 0); + if (iCurSel == CB_ERR) + return; tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_MONITORDCLIST, - CB_GETCURSEL, - 0, - (LPARAM)0); - if (tmp > 0 && tmp < 16) - { - gPP[iCurSel].user.VideoTimeoutAc = Sec[tmp]; - } + CB_GETCURSEL, + 0, + (LPARAM)0); + if (tmp > 0 && tmp < 16) + { + gPP[iCurSel].user.VideoTimeoutAc = Sec[tmp]; + } tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_MONITORDCLIST, - CB_GETCURSEL, - 0, - (LPARAM)0); - if (tmp > 0 && tmp < 16) - { - gPP[iCurSel].user.VideoTimeoutDc = Sec[tmp]; - } + CB_GETCURSEL, + 0, + (LPARAM)0); + if (tmp > 0 && tmp < 16) + { + gPP[iCurSel].user.VideoTimeoutDc = Sec[tmp]; + } tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_DISKACLIST, - CB_GETCURSEL, - 0, - (LPARAM)0); - if (tmp > 0 && tmp < 16) - { - gPP[iCurSel].user.SpindownTimeoutAc = Sec[tmp+2]; - } + CB_GETCURSEL, + 0, + (LPARAM)0); + if (tmp > 0 && tmp < 16) + { + gPP[iCurSel].user.SpindownTimeoutAc = Sec[tmp+2]; + } tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_DISKDCLIST, - CB_GETCURSEL, - 0, - (LPARAM)0); - if (tmp > 0 && tmp < 16) - { - gPP[iCurSel].user.SpindownTimeoutDc = Sec[tmp+2]; - } + CB_GETCURSEL, + 0, + (LPARAM)0); + if (tmp > 0 && tmp < 16) + { + gPP[iCurSel].user.SpindownTimeoutDc = Sec[tmp+2]; + } tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_STANDBYACLIST, - CB_GETCURSEL, - 0, - (LPARAM)0); - if (tmp > 0 && tmp < 16) - { - gPP[iCurSel].user.IdleTimeoutAc = Sec[tmp]; - } + CB_GETCURSEL, + 0, + (LPARAM)0); + if (tmp > 0 && tmp < 16) + { + gPP[iCurSel].user.IdleTimeoutAc = Sec[tmp]; + } tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_STANDBYDCLIST, - CB_GETCURSEL, - 0, - (LPARAM)0); - if (tmp > 0 && tmp < 16) - { - gPP[iCurSel].user.IdleTimeoutDc = Sec[tmp]; - } + CB_GETCURSEL, + 0, + (LPARAM)0); + if (tmp > 0 && tmp < 16) + { + gPP[iCurSel].user.IdleTimeoutDc = Sec[tmp]; + } tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_HYBERNATEACLIST, - CB_GETCURSEL, - 0, - (LPARAM)0); - if (tmp > 0 && tmp < 16) - { - gPP[iCurSel].mach.DozeS4TimeoutAc = Sec[tmp]; - } + CB_GETCURSEL, + 0, + (LPARAM)0); + if (tmp > 0 && tmp < 16) + { + gPP[iCurSel].mach.DozeS4TimeoutAc = Sec[tmp]; + } tmp = (INT) SendDlgItemMessage(hwndDlg, IDC_HYBERNATEDCLIST, - CB_GETCURSEL, - 0, - (LPARAM)0); - if (tmp > 0 && tmp < 16) - { - gPP[iCurSel].mach.DozeS4TimeoutDc = Sec[tmp]; - } + CB_GETCURSEL, + 0, + (LPARAM)0); + if (tmp > 0 && tmp < 16) + { + gPP[iCurSel].mach.DozeS4TimeoutDc = Sec[tmp]; + } SetActivePwrScheme(iCurSel,NULL,&gPP[iCurSel]); - LoadConfig(hwndDlg); + LoadConfig(hwndDlg); } static BOOLEAN DelScheme(HWND hwnd) { - INT iCurSel; - HWND hList; - TCHAR szBuf[1024], szBufT[1024]; - UINT DelScheme; - - hList = GetDlgItem(hwnd, IDC_ENERGYLIST); - - iCurSel = SendMessage(hList, CB_GETCURSEL, 0, 0); - if (iCurSel == CB_ERR) return FALSE; - - SendMessage(hList, CB_SETCURSEL, iCurSel, 0); - - DelScheme = SendMessage(hList, CB_GETITEMDATA, (WPARAM)iCurSel, 0); - if (DelScheme == (UINT)CB_ERR) return FALSE; - - LoadString(hApplet, IDS_DEL_SCHEME_TITLE, szBufT, sizeof(szBufT) / sizeof(TCHAR)); - LoadString(hApplet, IDS_DEL_SCHEME, szBuf, sizeof(szBuf) / sizeof(TCHAR)); - - if (MessageBox(hwnd, szBuf, szBufT, MB_YESNO | MB_ICONQUESTION) == IDYES) - { - UINT Current; - - if (GetActivePwrScheme(&Current)) - { - SendMessage(hList, CB_SETCURSEL, (WPARAM)0, 0); - SendMessage(hList, CB_DELETESTRING, (WPARAM)iCurSel, 0); - if (Current == DelScheme) Pos_SaveData(hwnd); - } - - if (DeletePwrScheme(DelScheme) != 0) return TRUE; - } - - return FALSE; + INT iCurSel; + HWND hList; + TCHAR szBuf[1024], szBufT[1024]; + UINT DelScheme; + + hList = GetDlgItem(hwnd, IDC_ENERGYLIST); + + iCurSel = SendMessage(hList, CB_GETCURSEL, 0, 0); + if (iCurSel == CB_ERR) return FALSE; + + SendMessage(hList, CB_SETCURSEL, iCurSel, 0); + + DelScheme = SendMessage(hList, CB_GETITEMDATA, (WPARAM)iCurSel, 0); + if (DelScheme == (UINT)CB_ERR) return FALSE; + + LoadString(hApplet, IDS_DEL_SCHEME_TITLE, szBufT, sizeof(szBufT) / sizeof(TCHAR)); + LoadString(hApplet, IDS_DEL_SCHEME, szBuf, sizeof(szBuf) / sizeof(TCHAR)); + + if (MessageBox(hwnd, szBuf, szBufT, MB_YESNO | MB_ICONQUESTION) == IDYES) + { + UINT Current; + + if (GetActivePwrScheme(&Current)) + { + SendMessage(hList, CB_SETCURSEL, (WPARAM)0, 0); + SendMessage(hList, CB_DELETESTRING, (WPARAM)iCurSel, 0); + if (Current == DelScheme) Pos_SaveData(hwnd); + } + + if (DeletePwrScheme(DelScheme) != 0) return TRUE; + } + + return FALSE; } static BOOLEAN CreateEnergyList(HWND hwnd) { - BOOLEAN retval; - POWER_POLICY pp; - SYSTEM_POWER_CAPABILITIES spc; - - hList = hwnd; - - if (!GetActivePwrScheme(&aps)) - return FALSE; - - if (!ReadGlobalPwrPolicy(&gGPP)) - return FALSE; - - if (!ReadPwrScheme(aps,&pp)) - return FALSE; - - if (!ValidatePowerPolicies(&gGPP,0)) - return FALSE; + BOOLEAN retval; + POWER_POLICY pp; + SYSTEM_POWER_CAPABILITIES spc; + + hList = hwnd; + + if (!GetActivePwrScheme(&aps)) + return FALSE; + + if (!ReadGlobalPwrPolicy(&gGPP)) + return FALSE; + + if (!ReadPwrScheme(aps,&pp)) + return FALSE; + + if (!ValidatePowerPolicies(&gGPP,0)) + return FALSE; /* - if (!SetActivePwrScheme(aps,&gGPP,&pp)) - return FALSE; + if (!SetActivePwrScheme(aps,&gGPP,&pp)) + return FALSE; */ - if (!GetPwrCapabilities(&spc)) - return FALSE; - - if (CanUserWritePwrScheme()) - { - // TODO: - // Enable write / delete powerscheme button - } - - Pos_InitPage(GetParent(hwnd)); - - if (!GetActivePwrScheme(&aps)) - return FALSE; - - retval = EnumPwrSchemes(callback_EnumPwrScheme, aps); + if (!GetPwrCapabilities(&spc)) + return FALSE; + + if (CanUserWritePwrScheme()) + { + // TODO: + // Enable write / delete powerscheme button + } + + Pos_InitPage(GetParent(hwnd)); + + if (!GetActivePwrScheme(&aps)) + return FALSE; + + retval = EnumPwrSchemes(callback_EnumPwrScheme, aps); if(SendMessage(hwnd, CB_GETCOUNT, 0, 0) > 0) { EnableWindow(GetDlgItem(hwndDialog, IDC_DELETE_BTN),TRUE); - EnableWindow(GetDlgItem(hwndDialog, IDC_SAVEAS_BTN),TRUE); - } - - return retval; + EnableWindow(GetDlgItem(hwndDialog, IDC_SAVEAS_BTN),TRUE); + } + + return retval; } @@ -553,69 +553,69 @@ switch(uMsg) { case WM_INITDIALOG: - hPos = hwndDlg; - hwndDialog = hwndDlg; - if (!Pos_InitData()) - { - // TODO: - // Initialization failed - // Handle error - MessageBox(hwndDlg,_T("Pos_InitData failed\n"), NULL, MB_OK); - - } - if (!CreateEnergyList(GetDlgItem(hwndDlg, IDC_ENERGYLIST))) - { - // TODO: - // Initialization failed - // Handle error - MessageBox(hwndDlg,_T("CreateEnergyList failed\n"), NULL, MB_OK); - } - return TRUE; - case WM_COMMAND: - switch(LOWORD(wParam)) - { - case IDC_ENERGYLIST: - if (HIWORD(wParam) == CBN_SELCHANGE) - { - LoadConfig(hwndDlg); - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - break; - case IDC_DELETE_BTN: - { - DelScheme(hwndDlg); - } - break; - case IDC_SAVEAS_BTN: - { - - } - break; - case IDC_MONITORACLIST: - case IDC_MONITORDCLIST: - case IDC_DISKACLIST: - case IDC_DISKDCLIST: - case IDC_STANDBYACLIST: - case IDC_STANDBYDCLIST: - case IDC_HYBERNATEACLIST: - case IDC_HYBERNATEDCLIST: - if (HIWORD(wParam) == CBN_SELCHANGE) - { - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); - } - break; - } - break; - case WM_NOTIFY: - { - LPNMHDR lpnm = (LPNMHDR)lParam; - if (lpnm->code == (UINT)PSN_APPLY) - { - Pos_SaveData(hwndDlg); - } - return TRUE; - } - break; + hPos = hwndDlg; + hwndDialog = hwndDlg; + if (!Pos_InitData()) + { + // TODO: + // Initialization failed + // Handle error + MessageBox(hwndDlg,_T("Pos_InitData failed\n"), NULL, MB_OK); + + } + if (!CreateEnergyList(GetDlgItem(hwndDlg, IDC_ENERGYLIST))) + { + // TODO: + // Initialization failed + // Handle error + MessageBox(hwndDlg,_T("CreateEnergyList failed\n"), NULL, MB_OK); + } + return TRUE; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDC_ENERGYLIST: + if (HIWORD(wParam) == CBN_SELCHANGE) + { + LoadConfig(hwndDlg); + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + case IDC_DELETE_BTN: + { + DelScheme(hwndDlg); + } + break; + case IDC_SAVEAS_BTN: + { + + } + break; + case IDC_MONITORACLIST: + case IDC_MONITORDCLIST: + case IDC_DISKACLIST: + case IDC_DISKDCLIST: + case IDC_STANDBYACLIST: + case IDC_STANDBYDCLIST: + case IDC_HYBERNATEACLIST: + case IDC_HYBERNATEDCLIST: + if (HIWORD(wParam) == CBN_SELCHANGE) + { + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + break; + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + if (lpnm->code == (UINT)PSN_APPLY) + { + Pos_SaveData(hwndDlg); + } + return TRUE; + } + break; } return FALSE; }
9 years, 9 months
1
0
0
0
[sginsberg] 69101: - Fix my email to the @reactos.org one -- remove outdated hotmail.
by sginsberg@svn.reactos.org
Author: sginsberg Date: Mon Sep 7 21:39:37 2015 New Revision: 69101 URL:
http://svn.reactos.org/svn/reactos?rev=69101&view=rev
Log: - Fix my email to the @reactos.org one -- remove outdated hotmail. Modified: trunk/reactos/CREDITS trunk/reactos/lib/rtl/actctx.c trunk/reactos/lib/rtl/interlck.c trunk/reactos/lib/rtl/slist.c Modified: trunk/reactos/CREDITS URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/CREDITS?rev=69101&r1=69100…
============================================================================== --- trunk/reactos/CREDITS [iso-8859-1] (original) +++ trunk/reactos/CREDITS [iso-8859-1] Mon Sep 7 21:39:37 2015 @@ -67,7 +67,7 @@ Royce Mitchell III <royce3(a)ev1.net> Samuel Serapión <samdwise51(a)gmail.com> Saveliy Tretiakov <saveliyt(a)mail.ru> -Stefan Ginsberg <stefan__100__(a)hotmail.com> +Stefan Ginsberg <stefan.ginsberg(a)reactos.org> Steven Edwards <winehacker(a)gmail.com> Thomas Weidenmueller <w3seek(a)users.sourceforge.net> Timo Kreuzer <timo.kreuzer(a)reactos.org> Modified: trunk/reactos/lib/rtl/actctx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/actctx.c?rev=69101…
============================================================================== --- trunk/reactos/lib/rtl/actctx.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/actctx.c [iso-8859-1] Mon Sep 7 21:39:37 2015 @@ -8,7 +8,7 @@ * Eric Pouech * Jacek Caban for CodeWeavers * Alexandre Julliard - * Stefan Ginsberg (stefan__100__(a)hotmail.com) + * Stefan Ginsberg (stefan.ginsberg(a)reactos.org) * Samuel Serapión */ Modified: trunk/reactos/lib/rtl/interlck.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/interlck.c?rev=691…
============================================================================== --- trunk/reactos/lib/rtl/interlck.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/interlck.c [iso-8859-1] Mon Sep 7 21:39:37 2015 @@ -3,7 +3,7 @@ * PROJECT: ReactOS Runtime Library * PURPOSE: RTL Interlocked Routines * FILE: lib/rtl/interlck.c - * PROGRAMERS: Stefan Ginsberg (stefan__100__(a)hotmail.com) + * PROGRAMERS: Stefan Ginsberg (stefan.ginsberg(a)reactos.org) */ /* INCLUDES *****************************************************************/ Modified: trunk/reactos/lib/rtl/slist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/slist.c?rev=69101&…
============================================================================== --- trunk/reactos/lib/rtl/slist.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/slist.c [iso-8859-1] Mon Sep 7 21:39:37 2015 @@ -3,7 +3,7 @@ * PROJECT: ReactOS Runtime Library * PURPOSE: Slist Routines * FILE: lib/rtl/slist.c - * PROGRAMERS: Stefan Ginsberg (stefan__100__(a)hotmail.com) + * PROGRAMERS: Stefan Ginsberg (stefan.ginsberg(a)reactos.org) * Timo Kreuzer (timo.kreuzer(a)reactos.org) */
9 years, 9 months
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
54
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
Results per page:
10
25
50
100
200