-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8775cae
commit 4db5161
Showing
6 changed files
with
53 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
extern "C" BOOL WINAPI ProcessPrng( | ||
_Out_writes_bytes_(_cbBuffer) PUCHAR _pbBuffer, | ||
_In_ ULONG _cbBuffer | ||
); | ||
|
||
namespace YY | ||
{ | ||
namespace Thunks | ||
{ | ||
#if (YY_Thunks_Support_Version < NTDDI_WIN6) | ||
|
||
// 最低受支持的客户端 Windows Vista [桌面应用|UWP 应用] | ||
// 最低受支持的服务器 Windows Server 2008[桌面应用 | UWP 应用] | ||
__DEFINE_THUNK( | ||
bcryptprimitives, | ||
8, | ||
BOOL, | ||
WINAPI, | ||
ProcessPrng, | ||
_Out_writes_bytes_(_cbBuffer) PUCHAR _pbBuffer, | ||
_In_ ULONG _cbBuffer | ||
) | ||
{ | ||
if (auto _pfnProcessPrng = try_get_ProcessPrng()) | ||
{ | ||
return _pfnProcessPrng(_pbBuffer, _cbBuffer); | ||
} | ||
|
||
const auto _pfnRtlGenRandom = try_get_SystemFunction036(); | ||
if (!_pfnRtlGenRandom) | ||
{ | ||
SetLastError(ERROR_FUNCTION_FAILED); | ||
return FALSE; | ||
} | ||
|
||
return _pfnRtlGenRandom(_pbBuffer, _cbBuffer); | ||
} | ||
#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
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