-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fea #29, 添加PowerDeterminePlatformRole,PowerDeterminePlatformRoleEx
- Loading branch information
1 parent
3249536
commit cc1e3ca
Showing
6 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#if (YY_Thunks_Support_Version < NTDDI_WIN8) | ||
#include <powrprof.h> | ||
#endif | ||
|
||
#if (YY_Thunks_Support_Version < NTDDI_WIN8) | ||
#pragma comment(lib, "PowrProf.lib") | ||
#endif | ||
|
||
namespace YY | ||
{ | ||
namespace Thunks | ||
{ | ||
#if (YY_Thunks_Support_Version < NTDDI_WIN8) | ||
|
||
// 最低受支持的客户端 Windows 8 [桌面应用|UWP 应用] | ||
// 最低受支持的服务器 Windows Server 2012[桌面应用 | UWP 应用] | ||
__DEFINE_THUNK( | ||
powrprof, | ||
4, | ||
POWER_PLATFORM_ROLE, | ||
WINAPI, | ||
PowerDeterminePlatformRoleEx, | ||
_In_ ULONG _uVersion | ||
) | ||
{ | ||
if (auto const _pfnPowerDeterminePlatformRoleEx = try_get_PowerDeterminePlatformRoleEx()) | ||
{ | ||
return _pfnPowerDeterminePlatformRoleEx(_uVersion); | ||
} | ||
|
||
if (_uVersion == POWER_PLATFORM_ROLE_V1) | ||
{ | ||
return PowerDeterminePlatformRole(); | ||
} | ||
else | ||
{ | ||
return PlatformRoleUnspecified; | ||
} | ||
} | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#if (YY_Thunks_Support_Version < NTDDI_VISTA) | ||
#include <powrprof.h> | ||
#endif | ||
|
||
namespace YY | ||
{ | ||
namespace Thunks | ||
{ | ||
#if (YY_Thunks_Support_Version < NTDDI_VISTA) | ||
|
||
// 最低受支持的客户端 Windows 8 [桌面应用|UWP 应用] | ||
// 最低受支持的服务器 Windows Server 2012[桌面应用 | UWP 应用] | ||
__DEFINE_THUNK( | ||
powrprof, | ||
0, | ||
POWER_PLATFORM_ROLE, | ||
WINAPI, | ||
PowerDeterminePlatformRole, | ||
) | ||
{ | ||
if (auto const _pfnPowerDeterminePlatformRole = try_get_PowerDeterminePlatformRole()) | ||
{ | ||
return _pfnPowerDeterminePlatformRole(); | ||
} | ||
|
||
// 假定自己没有电池 | ||
return PlatformRoleDesktop; | ||
} | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters