I recall having the same problems in WinXP with rand(), the c equivalent. I used then a different API, iinm this one
<a href="https://msdn.microsoft.com/en-us/library/bb982398.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/bb982398.aspx</a>