CryptGenRandom is currently marked as deprecated:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa379942(v=vs.85).aspx
It has been replaced with:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa375458(v=vs.85).aspx
The new API is compatible with Vista+ and additionally since Rust officially only supports Windows 7 afaik, you could even take a little shortcut by passing the flag BCRYPT_USE_SYSTEM_PREFERRED_RNG, which enables omitting hAlgorithm and therefore requires no additional handles.