VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Random.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-27 10:18:58 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-27 12:39:22 (GMT)
commita8112b8373a9cd9c4c481895179f6b31db33d967 (patch)
treec40c7bafb960e5038e7eb3194f5969f9245a6f32 /src/Common/Random.c
parent2dbbd6b9d210c32bb672512d74a0761845608dd5 (diff)
downloadVeraCrypt-a8112b8373a9cd9c4c481895179f6b31db33d967.zip
VeraCrypt-a8112b8373a9cd9c4c481895179f6b31db33d967.tar.gz
Windows: use the correct window handle for creating message boxes. This became important after the introduction of the wait dialog in order to avoid having message boxes behind the wait dialog.
Diffstat (limited to 'src/Common/Random.c')
-rw-r--r--src/Common/Random.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Common/Random.c b/src/Common/Random.c
index f737968..cd85957 100644
--- a/src/Common/Random.c
+++ b/src/Common/Random.c
@@ -317,14 +317,14 @@ void RandaddBuf (void *buf, int len)
}
}
-BOOL RandpeekBytes (unsigned char *buf, int len)
+BOOL RandpeekBytes (void* hwndDlg, unsigned char *buf, int len)
{
if (!bRandDidInit)
return FALSE;
if (len > RNG_POOL_SIZE)
{
- Error ("ERR_NOT_ENOUGH_RANDOM_DATA");
+ Error ("ERR_NOT_ENOUGH_RANDOM_DATA", (HWND) hwndDlg);
len = RNG_POOL_SIZE;
}
@@ -337,16 +337,16 @@ BOOL RandpeekBytes (unsigned char *buf, int len)
/* Get len random bytes from the pool (max. RNG_POOL_SIZE bytes per a single call) */
-BOOL RandgetBytes (unsigned char *buf, int len, BOOL forceSlowPoll)
+BOOL RandgetBytes (void* hwndDlg, unsigned char *buf, int len, BOOL forceSlowPoll)
{
- return RandgetBytesFull (buf, len, forceSlowPoll, FALSE);
+ return RandgetBytesFull (hwndDlg, buf, len, forceSlowPoll, FALSE);
}
/* Get len random bytes from the pool.
* If allowAnyLength is FALSE, then len must be less or equal to RNG_POOL_SIZE
* If allowAnyLength is TRUE, then len can have any positive value
*/
-BOOL RandgetBytesFull ( unsigned char *buf , int len, BOOL forceSlowPoll , BOOL allowAnyLength)
+BOOL RandgetBytesFull ( void* hwndDlg, unsigned char *buf , int len, BOOL forceSlowPoll , BOOL allowAnyLength)
{
int i, looplen;
BOOL ret = TRUE;
@@ -370,7 +370,7 @@ BOOL RandgetBytesFull ( unsigned char *buf , int len, BOOL forceSlowPoll , BOOL
/* There's never more than RNG_POOL_SIZE worth of randomess */
if ( (!allowAnyLength) && (len > RNG_POOL_SIZE))
{
- Error ("ERR_NOT_ENOUGH_RANDOM_DATA");
+ Error ("ERR_NOT_ENOUGH_RANDOM_DATA", (HWND) hwndDlg);
len = RNG_POOL_SIZE;
LeaveCriticalSection (&critRandProt);
return FALSE;