Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 2nd December 2011, 15:59   #1
Lloigor
Junior Member
 
Join Date: Oct 2011
Posts: 9
RtlGenRandom -> Rnd, Rnd64

I was looking for a way to get random numbers, and found http://nsis.sourceforge.net/Random. Nice one but it returns the same results given the same seed.

So i digged google and msdn and came across the api function RtlGenRandom.
I used SystemFunction036 because, like they said: "This function has no associated import library. This function is available as a resource named SystemFunction036 in Advapi32.dll."

I made two functions with it, they're working very well, so i've put them on the wiki: http://nsis.sourceforge.net/Rnd,_Rnd64.

Should still work post win7: "Finally, the statement that it may disappear in future versions is rather unlikely: the Microsoft C Runtime Library makes use of this function in its implementation of "rand_s". " (msdn comment added on 6/16/10)
Lloigor is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump