-Export memmove_s and memcpy_s
-Implement rnd_s


svn path=/trunk/; revision=47964
This commit is contained in:
Sylvain Petreolle 2010-07-07 20:05:47 +00:00
parent 5fd439a72e
commit 358331354d
2 changed files with 14 additions and 6 deletions

View file

@ -1266,9 +1266,9 @@
@ cdecl memchr(ptr long long)
@ cdecl memcmp(ptr ptr long)
@ cdecl memcpy(ptr ptr long)
# @ cdecl memcpy_s(ptr long ptr long) memmove_s
@ cdecl memcpy_s(ptr long ptr long) memmove_s
@ cdecl memmove(ptr ptr long)
# @ cdecl memmove_s(ptr long ptr long)
@ cdecl memmove_s(ptr long ptr long)
@ cdecl memset(ptr long long)
@ cdecl mktime(ptr)
@ cdecl modf(double ptr)
@ -1285,7 +1285,7 @@
# stub qsort_s
@ cdecl raise(long)
@ cdecl rand()
# @ cdecl rand_s(ptr)
@ cdecl rand_s(ptr)
@ cdecl realloc(ptr long)
@ cdecl remove(str)
@ cdecl rename(str str)
@ -1405,3 +1405,6 @@
@ varargs wscanf(wstr)
# @ varargs wscanf_s(wstr)
# Functions not exported in native dll:
@ cdecl _get_invalid_parameter_handler()
@ cdecl _set_invalid_parameter_handler(ptr)

View file

@ -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;
}