-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 新增GetProcessGroupAffinity - 新增QueryUnbiasedInterruptTime - 新增FindStringOrdinal - 新增GetEnabledXStateFeatures - 新增SetXStateFeaturesMask - 新增InitializeContext - 新增InitializeContext2 - 新增LocateXStateFeature
- Loading branch information
1 parent
4db5161
commit 22d9183
Showing
7 changed files
with
414 additions
and
3 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,45 @@ | ||
#include <processtopologyapi.h> | ||
|
||
namespace YY | ||
{ | ||
namespace Thunks | ||
{ | ||
#if (YY_Thunks_Support_Version < NTDDI_WIN7) | ||
|
||
//Minimum supported client Windows 7 [desktop apps only] | ||
//Minimum supported server Windows Server 2008 R2 [desktop apps only] | ||
__DEFINE_THUNK( | ||
kernel32, | ||
12, | ||
BOOL, | ||
WINAPI, | ||
GetProcessGroupAffinity, | ||
_In_ HANDLE _hProcess, | ||
_Inout_ PUSHORT _pGroupCount, | ||
_Out_writes_(*_pGroupCount) PUSHORT _pGroupArray | ||
) | ||
{ | ||
if (const auto _pfnGetProcessGroupAffinity = try_get_GetProcessGroupAffinity()) | ||
{ | ||
return _pfnGetProcessGroupAffinity(_hProcess, _pGroupCount, _pGroupArray); | ||
} | ||
|
||
// 更低版本系统不支持 CPU组,所以我们可以视为系统只有一组处理器。 | ||
if (_pGroupCount == nullptr || _pGroupArray == nullptr) | ||
{ | ||
SetLastError(ERROR_NOACCESS); | ||
return FALSE; | ||
} | ||
|
||
if (*_pGroupCount < 1) | ||
{ | ||
SetLastError(ERROR_INSUFFICIENT_BUFFER); | ||
return FALSE; | ||
} | ||
*_pGroupCount = 1; | ||
_pGroupArray[0] = 0; | ||
return TRUE; | ||
} | ||
#endif | ||
} // namespace Thunks | ||
} // namespace YY |
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
Oops, something went wrong.