#include "powercfg.h"
#include <debug.h>
Go to the source code of this file.
|
static PPOWER_SCHEME | AddPowerScheme (PPOWER_SCHEMES_PAGE_DATA pPageData, UINT uId, DWORD dwName, LPTSTR pszName, DWORD dwDescription, LPWSTR pszDescription, PPOWER_POLICY pp) |
|
static VOID | DeletePowerScheme (PPOWER_SCHEME pScheme) |
|
static BOOLEAN CALLBACK | EnumPowerSchemeCallback (UINT uiIndex, DWORD dwName, LPTSTR pszName, DWORD dwDesc, LPWSTR pszDesc, PPOWER_POLICY pp, LPARAM lParam) |
|
static VOID | BuildSchemesList (PPOWER_SCHEMES_PAGE_DATA pPageData) |
|
static VOID | DestroySchemesList (PPOWER_SCHEMES_PAGE_DATA pPageData) |
|
BOOLEAN | Pos_InitData (HWND hwndDlg) |
|
static VOID | LoadConfig (HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData, PPOWER_SCHEME pScheme) |
|
static VOID | Pos_InitPage (HWND hwndDlg) |
|
static VOID | Pos_SaveData (HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData) |
|
static BOOL | DelScheme (HWND hwnd, PPOWER_SCHEMES_PAGE_DATA pPageData) |
|
static BOOL | SavePowerScheme (HWND hwndDlg, PSAVE_POWER_SCHEME_DATA pSaveSchemeData) |
|
INT_PTR CALLBACK | SaveSchemeDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
|
static VOID | SaveScheme (HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData) |
|
static BOOL | CreateEnergyList (HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData) |
|
INT_PTR CALLBACK | PowerSchemesDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
|
◆ POWER_SCHEME
◆ POWER_SCHEMES_PAGE_DATA
◆ PPOWER_SCHEME
◆ PPOWER_SCHEMES_PAGE_DATA
◆ PSAVE_POWER_SCHEME_DATA
◆ SAVE_POWER_SCHEME_DATA
◆ AddPowerScheme()
Definition at line 64 of file powershemes.c.
72{
75
81
84
85 if (dwName != 0)
86 {
89 dwName);
91 goto done;
92
94 }
95
96 if (dwDescription != 0)
97 {
100 dwDescription);
102 goto done;
103
105 }
106
109
110done:
111 if (bResult ==
FALSE)
112 {
115
118
121 }
122
123 return pScheme;
124}
#define HeapFree(x, y, z)
#define InsertTailList(ListHead, Entry)
LIST_ENTRY PowerSchemesList
Referenced by EnumPowerSchemeCallback(), and SavePowerScheme().
◆ BuildSchemesList()
Definition at line 172 of file powershemes.c.
174{
176
178}
#define InitializeListHead(ListHead)
static BOOLEAN CALLBACK EnumPowerSchemeCallback(UINT uiIndex, DWORD dwName, LPTSTR pszName, DWORD dwDesc, LPWSTR pszDesc, PPOWER_POLICY pp, LPARAM lParam)
BOOLEAN WINAPI EnumPwrSchemes(PWRSCHEMESENUMPROC lpfnPwrSchemesEnumProc, LPARAM lParam)
Referenced by PowerSchemesDlgProc().
◆ CreateEnergyList()
Definition at line 738 of file powershemes.c.
741{
749
751
754
757
760
763
764
765
766
767
768
771
773 {
774
775
776 }
777
779
782
785 {
787
790 0,
793 break;
794
799
800 if (aps == pScheme->
uId)
801 {
806
809 }
810
811 ListEntry = ListEntry->
Flink;
812 }
813
815 {
817 }
818
820}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static VOID LoadConfig(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData, PPOWER_SCHEME pScheme)
static VOID Pos_InitPage(HWND hwndDlg)
BOOLEAN WINAPI GetPwrCapabilities(PSYSTEM_POWER_CAPABILITIES lpSystemPowerCapabilities)
BOOLEAN WINAPI ReadPwrScheme(UINT uiID, PPOWER_POLICY pPowerPolicy)
BOOLEAN WINAPI GetActivePwrScheme(PUINT puiID)
BOOLEAN WINAPI ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP)
BOOLEAN WINAPI CanUserWritePwrScheme(VOID)
BOOLEAN WINAPI ReadGlobalPwrPolicy(PGLOBAL_POWER_POLICY pGlobalPowerPolicy)
struct _LIST_ENTRY * Flink
PPOWER_SCHEME pActivePowerScheme
#define CONTAINING_RECORD(address, type, field)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
Referenced by PowerSchemesDlgProc().
◆ DeletePowerScheme()
◆ DelScheme()
Definition at line 529 of file powershemes.c.
532{
533 WCHAR szTitleBuffer[256];
534 WCHAR szRawBuffer[256], szCookedBuffer[512];
538 WCHAR szErrorText[512];
539
541
545
547
551
555
557 {
559 {
563 }
564
568
570
573 {
575 }
576 else
577 {
579 }
580
583 }
584
586}
#define IDS_DEL_SCHEME_TITLE
#define IDS_DEL_SCHEME_ERROR
static VOID DeletePowerScheme(PPOWER_SCHEME pScheme)
struct _POWER_SCHEME * PPOWER_SCHEME
BOOLEAN WINAPI DeletePwrScheme(UINT uiIndex)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
Referenced by PowerSchemesDlgProc().
◆ DestroySchemesList()
◆ EnumPowerSchemeCallback()
Definition at line 147 of file powershemes.c.
155{
157 {
159 uiIndex,
160 dwName,
161 pszName,
162 dwDesc,
163 pszDesc,
164 pp);
165 }
166
168}
static PPOWER_SCHEME AddPowerScheme(PPOWER_SCHEMES_PAGE_DATA pPageData, UINT uId, DWORD dwName, LPTSTR pszName, DWORD dwDescription, LPWSTR pszDescription, PPOWER_POLICY pp)
Referenced by BuildSchemesList().
◆ LoadConfig()
Definition at line 237 of file powershemes.c.
241{
242 INT i = 0, iCurSel = 0;
247
251 0,
252 0);
254 return;
255
257 (iCurSel > 0));
258
260 {
265 0);
267 return;
268 }
269
271
273 {
276 }
277
279
280 for (
i = 0;
i < 16;
i++)
281 {
284 {
286 }
287
290 {
292 }
293
296 {
298 }
299
302 {
304 }
305
308 {
310 }
311
314 {
316 }
317
320 {
322 }
323
326 {
328 }
329 }
330}
#define IDC_MONITORDCLIST
#define IDC_STANDBYACLIST
#define IDC_MONITORACLIST
#define IDC_HIBERNATEACLIST
#define IDC_STANDBYDCLIST
#define IDC_HIBERNATEDCLIST
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
MACHINE_POWER_POLICY mach
#define SendDlgItemMessage
Referenced by check_loadconfig(), CreateEnergyList(), DelScheme(), LdrpInitializeProcess(), PowerSchemesDlgProc(), and SaveScheme().
◆ Pos_InitData()
Definition at line 205 of file powershemes.c.
207{
209
211 {
213 }
214
222
230
232}
BOOLEAN SystemBatteriesPresent
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
Referenced by PowerSchemesDlgProc().
◆ Pos_InitPage()
static VOID Pos_InitPage |
( |
HWND |
hwndDlg | ) |
|
|
static |
Definition at line 334 of file powershemes.c.
335{
336 int ifrom = 0,
i = 0,
imin = 0;
340
341 for (
i = 1;
i < 9;
i++)
342 {
344 {
345 case 1:
348 break;
349
350 case 2:
353 break;
354
355 case 3:
358 break;
359
360 case 4:
363 break;
364
365 case 5:
368 break;
369
370 case 6:
373 break;
374
375 case 7:
378 break;
379
380 case 8:
383 break;
384
385 default:
387 return;
388 }
389
391 continue;
392
394 {
396 {
399 0,
402 return;
403
408 }
409 }
410
412 {
415 0,
418 return;
419
424 }
425 }
426}
static const WCHAR szName[]
Referenced by CreateEnergyList().
◆ Pos_SaveData()
Definition at line 430 of file powershemes.c.
433{
437
439
441 if (hwndCtrl !=
NULL)
442 {
444 if (tmp > 0 && tmp < 16)
445 {
447 }
448 }
449
451 if (hwndCtrl !=
NULL)
452 {
454 if (tmp > 0 && tmp < 16)
455 {
457 }
458 }
459
461 if (hwndCtrl !=
NULL)
462 {
464 if (tmp > 0 && tmp < 16)
465 {
467 }
468 }
469
471 if (hwndCtrl !=
NULL)
472 {
474 if (tmp > 0 && tmp < 16)
475 {
477 }
478 }
479
481 if (hwndCtrl !=
NULL)
482 {
484 if (tmp > 0 && tmp < 16)
485 {
487 }
488 }
489
491 if (hwndCtrl !=
NULL)
492 {
494 if (tmp > 0 && tmp < 16)
495 {
497 }
498 }
499
501 if (hwndCtrl !=
NULL)
502 {
504 if (tmp > 0 && tmp < 16)
505 {
507 }
508 }
509
511 if (hwndCtrl !=
NULL)
512 {
514 if (tmp > 0 && tmp < 16)
515 {
517 }
518 }
519
521 {
523 }
524}
BOOLEAN WINAPI SetActivePwrScheme(UINT uiID, PGLOBAL_POWER_POLICY lpGlobalPowerPolicy, PPOWER_POLICY lpPowerPolicy)
Referenced by PowerSchemesDlgProc(), and SaveScheme().
◆ PowerSchemesDlgProc()
Definition at line 825 of file powershemes.c.
830{
832
834
835 switch (uMsg)
836 {
842
844
846 {
847
848
849
851 }
852
854 {
855
856
857
859 }
861
863 if (pPageData)
864 {
868 }
869 break;
870
873 {
876 {
879 }
880 break;
881
884 break;
885
888 break;
889
899 {
901 }
902 break;
903 }
904 break;
905
908 {
912
916 }
917 break;
918 }
919
921}
static VOID Pos_SaveData(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
static BOOL CreateEnergyList(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
BOOLEAN Pos_InitData(HWND hwndDlg)
static BOOL DelScheme(HWND hwnd, PPOWER_SCHEMES_PAGE_DATA pPageData)
struct _POWER_SCHEMES_PAGE_DATA POWER_SCHEMES_PAGE_DATA
struct _POWER_SCHEMES_PAGE_DATA * PPOWER_SCHEMES_PAGE_DATA
static VOID BuildSchemesList(PPOWER_SCHEMES_PAGE_DATA pPageData)
static VOID DestroySchemesList(PPOWER_SCHEMES_PAGE_DATA pPageData)
static VOID SaveScheme(HWND hwndDlg, PPOWER_SCHEMES_PAGE_DATA pPageData)
#define PropSheet_Changed(d, w)
HWND WINAPI GetParent(_In_ HWND)
Referenced by Applet1().
◆ SavePowerScheme()
Definition at line 591 of file powershemes.c.
594{
597 TCHAR szSchemeName[512];
599
601
603
605 -1,
607 szSchemeName,
612 {
617 {
620 }
621 else
622 {
624 }
625 }
626
627 return bRet;
628}
BOOLEAN WINAPI WritePwrScheme(PUINT puiID, LPWSTR lpszName, LPWSTR lpszDescription, PPOWER_POLICY pPowerPolicy)
PPOWER_SCHEMES_PAGE_DATA pPageData
Referenced by SaveSchemeDlgProc().
◆ SaveScheme()
Definition at line 674 of file powershemes.c.
677{
682
686
690
692
695 hwndDlg,
698 {
699 if (SaveSchemeData.pNewScheme)
700 {
702
706 -1,
707 (
LPARAM)SaveSchemeData.pNewScheme->pszName);
708
710 {
713 0,
714 (
LPARAM)SaveSchemeData.pNewScheme->pszName);
716 {
720 (
LPARAM)SaveSchemeData.pNewScheme);
721
724 }
725
726 }
727 LoadConfig(hwndDlg, pPageData, SaveSchemeData.pNewScheme);
728 }
729 }
730
732 &BackupPowerPolicy,
734}
#define IDD_SAVEPOWERSCHEME
INT_PTR CALLBACK SaveSchemeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Referenced by PowerSchemesDlgProc().
◆ SaveSchemeDlgProc()
Definition at line 633 of file powershemes.c.
638{
640
642
643 switch (uMsg)
644 {
648
653
656 {
659 break;
660
663 break;
664 }
665 break;
666 }
667
669}
struct _SAVE_POWER_SCHEME_DATA * PSAVE_POWER_SCHEME_DATA
static BOOL SavePowerScheme(HWND hwndDlg, PSAVE_POWER_SCHEME_DATA pSaveSchemeData)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
Referenced by SaveScheme().
◆ Sec
Initial value:=
{
60,
120,
180,
300,
600,
900,
1200,
1500,
1800,
2700,
3600,
7200,
10800,
14400,
18000,
0
}
Definition at line 41 of file powershemes.c.
Referenced by LoadConfig(), Pos_InitPage(), Pos_SaveData(), and SetScreenSaver().