advapi32: Print error if opening /dev/urandom fails, and update comment.

This commit is contained in:
Juan Lang 2008-10-23 11:38:04 -07:00 committed by Alexandre Julliard
parent 3fdf6024a2
commit 59f2a3312e
1 changed files with 2 additions and 5 deletions

View File

@ -2281,11 +2281,6 @@ BOOL WINAPI SystemFunction036(PVOID pbBuffer, ULONG dwLen)
{
int dev_random;
/* FIXME: /dev/urandom does not provide random numbers of a sufficient
* quality for cryptographic applications. /dev/random is much better,
* but it blocks if the kernel has not yet collected enough entropy for
* the request, which will suspend the calling thread for an indefinite
* amount of time. */
dev_random = open("/dev/urandom", O_RDONLY);
if (dev_random != -1)
{
@ -2296,6 +2291,8 @@ BOOL WINAPI SystemFunction036(PVOID pbBuffer, ULONG dwLen)
}
close(dev_random);
}
else
FIXME("couldn't open /dev/urandom\n");
SetLastError(NTE_FAIL);
return FALSE;
}