<div dir="rtl"><div dir="ltr">Nick, I have seen RtlGenRandom, but I didn't initally use it since Microsoft is recommending to use CryptGenRandom instead:</div><div dir="ltr"><br></div><div dir="ltr"><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa387694(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/aa387694(v=vs.85).aspx</a><span style="font-family:arial,sans-serif;font-size:12.499999046325684px"><br>

</span></div><div dir="ltr"><br></div><div dir="ltr"><span style="color:rgb(69,69,69);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:14.166666030883789px;line-height:20px">[The </span><strong style="color:rgb(69,69,69);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:14.166666030883789px;line-height:20px">RtlGenRandom</strong><span style="color:rgb(69,69,69);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:14.166666030883789px;line-height:20px"> function is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use the </span><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa379942(v=vs.85).aspx" style="text-decoration:none;font-family:'Segoe UI Semibold','Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:14.166666030883789px;line-height:20px;color:rgb(0,24,143)"><strong>CryptGenRandom</strong></a><span style="color:rgb(69,69,69);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:14.166666030883789px;line-height:20px"> function.]</span><br>

</div><div dir="ltr"><br></div><div dir="ltr">Due to backward compatibility it's very low chance RtlGenRandom will actually go away, I'll use it.</div><div dir="ltr"><br></div><div dir="ltr"><span style="font-size:12.499999046325684px;font-family:arial,sans-serif">Yaron</span><br>

</div><div dir="ltr"><font face="arial, sans-serif"><span style="font-size:12.499999046325684px"><br></span></font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div dir="ltr">2013/10/7 Nico Rieck <span dir="ltr"><<a href="mailto:nico.rieck@gmail.com" target="_blank">nico.rieck@gmail.com</a>></span></div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 07.10.2013 20:57, Yaron Keren wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm trying to implement random_device for Windows using the CryptGenRandom<br>
API, as in the attached non-working code.<br>
</blockquote>
<br></div>
There's no need for CryptGenRandom and its overhead here. RtlGenRandom is just fine for random_device. MSVCRT does the same.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Nico<br>
</font></span></blockquote></div><br></div>