From 3b96069e587c6f56d62c584d5df21c25d759aea4 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Tue, 25 Mar 2014 15:26:13 +0100 Subject: [PATCH] msvcp90: Add _Random_device implementation. --- dlls/msvcp100/msvcp100.spec | 2 +- dlls/msvcp110/msvcp110.spec | 2 +- dlls/msvcp90/misc.c | 14 ++++++++++++++ dlls/msvcp90/msvcp90.spec | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/dlls/msvcp100/msvcp100.spec b/dlls/msvcp100/msvcp100.spec index e949b98d9e5..1dcbdedf907 100644 --- a/dlls/msvcp100/msvcp100.spec +++ b/dlls/msvcp100/msvcp100.spec @@ -1214,7 +1214,7 @@ @ cdecl -arch=win64 ?_Putgrouped@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@PEBD_K_W@Z(ptr ptr ptr str long long) num_put_wchar__Putgrouped @ stub -arch=win32 ?_Raise_handler@std@@3P6AXABVexception@stdext@@@ZA @ stub -arch=win64 ?_Raise_handler@std@@3P6AXAEBVexception@stdext@@@ZEA -@ stub ?_Random_device@tr1@std@@YAIXZ +@ cdecl ?_Random_device@tr1@std@@YAIXZ() _Random_device @ cdecl -arch=win32 ?_Rep@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@DI@Z(ptr ptr long ptr long long) num_put_char__Rep @ cdecl -arch=win64 ?_Rep@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@D_K@Z(ptr ptr ptr long long) num_put_char__Rep @ cdecl -arch=win32 ?_Rep@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@GI@Z(ptr ptr long ptr long long) num_put_wchar__Rep diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec index 3bdff794c76..05279365f89 100644 --- a/dlls/msvcp110/msvcp110.spec +++ b/dlls/msvcp110/msvcp110.spec @@ -1710,7 +1710,7 @@ @ cdecl -arch=win64 ?_Put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@PEB_W_K@Z(ptr ptr ptr wstr long) num_put_wchar__Put @ stub -arch=win32 ?_Raise_handler@std@@3P6AXABVexception@stdext@@@ZA @ stub -arch=win64 ?_Raise_handler@std@@3P6AXAEBVexception@stdext@@@ZEA -@ stub ?_Random_device@std@@YAIXZ +@ cdecl ?_Random_device@std@@YAIXZ() _Random_device @ stub -arch=win32 ?_Read_dir@sys@tr2@std@@YAPADPADPAXAAW4file_type@123@@Z @ stub -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEADPEADPEAXAEAW4file_type@123@@Z @ stub -arch=win32 ?_Read_dir@sys@tr2@std@@YAPA_WPA_WPAXAAW4file_type@123@@Z diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index f2ae32f1aed..1c3bd2f735b 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -360,3 +360,17 @@ LONGLONG __cdecl _Xtime_get_ticks(void) GetSystemTimeAsFileTime(&ft); return ((LONGLONG)ft.dwHighDateTime<<32) + ft.dwLowDateTime - TICKS_1601_TO_1970; } + +#if _MSVCP_VER >= 90 +unsigned int __cdecl _Random_device(void) +{ + unsigned int ret; + + TRACE("\n"); + + /* TODO: throw correct exception in case of failure */ + if(rand_s(&ret)) + throw_exception(EXCEPTION, "random number generator failed\n"); + return ret; +} +#endif diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec index a5116fab3f5..fe02bbbdca0 100644 --- a/dlls/msvcp90/msvcp90.spec +++ b/dlls/msvcp90/msvcp90.spec @@ -3062,7 +3062,7 @@ @ stub -arch=win64 ?_Putmfld@?$money_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_NAEAVios_base@2@_W1V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z @ stub -arch=win32 ?_Raise_handler@std@@3P6AXABVexception@stdext@@@ZA @ stub -arch=win64 ?_Raise_handler@std@@3P6AXAEBVexception@stdext@@@ZEA -@ stub ?_Random_device@tr1@std@@YAIXZ +@ cdecl ?_Random_device@tr1@std@@YAIXZ() _Random_device @ thiscall -arch=win32 ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z(ptr ptr long long) basic_istream_char__Read_s @ cdecl -arch=win64 ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z(ptr ptr long long) basic_istream_char__Read_s @ thiscall -arch=win32 ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z(ptr ptr long long) basic_istream_wchar__Read_s