mirror of
https://github.com/reactos/reactos.git
synced 2025-07-01 13:01:24 +00:00
[CRT]
-Export memmove_s and memcpy_s -Implement rnd_s svn path=/trunk/; revision=47964
This commit is contained in:
parent
5fd439a72e
commit
358331354d
2 changed files with 14 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
|
||||
#include <precomp.h>
|
||||
//#include <Ntsecapi.h>
|
||||
#include <ntsecapi.h>
|
||||
#include <internal/tls.h>
|
||||
|
||||
/*
|
||||
|
@ -31,12 +31,17 @@ srand(unsigned int seed)
|
|||
*/
|
||||
int CDECL rand_s(unsigned int *pval)
|
||||
{
|
||||
#if 0
|
||||
if (!pval || !RtlGenRandom(pval, sizeof(*pval)))
|
||||
BOOLEAN (WINAPI *pSystemFunction036)(PVOID, ULONG); // RtlGenRandom
|
||||
HINSTANCE hadvapi32 = LoadLibraryA("advapi32.dll");
|
||||
pSystemFunction036 = (void*)GetProcAddress(hadvapi32, "SystemFunction036");
|
||||
#if 1
|
||||
if (!pval || (pSystemFunction036 && !pSystemFunction036(pval, sizeof(*pval))))
|
||||
{
|
||||
_invalid_parameter(NULL,_CRT_WIDE("rand_s"),_CRT_WIDE(__FILE__),__LINE__, 0);
|
||||
*_errno() = EINVAL;
|
||||
return EINVAL;
|
||||
}
|
||||
#endif
|
||||
if(hadvapi32) FreeLibrary(hadvapi32);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue