From a8112b8373a9cd9c4c481895179f6b31db33d967 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 27 Dec 2014 11:18:58 +0100 Subject: 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. --- src/Common/Fat.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Common/Fat.c') diff --git a/src/Common/Fat.c b/src/Common/Fat.c index 6a2c77db..b6138528 100644 --- a/src/Common/Fat.c +++ b/src/Common/Fat.c @@ -253,7 +253,7 @@ static void PutFSInfo (unsigned char *sector, fatparams *ft) int -FormatFat (unsigned __int64 startSector, fatparams * ft, void * dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat) +FormatFat (void* hwndDlgPtr, unsigned __int64 startSector, fatparams * ft, void * dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat) { int write_buf_cnt = 0; char sector[TC_MAX_VOLUME_SECTOR_SIZE], *write_buf; @@ -261,6 +261,7 @@ FormatFat (unsigned __int64 startSector, fatparams * ft, void * dev, PCRYPTO_INF int x, n; int retVal; char temporaryKey[MASTER_KEYDATA_SIZE]; + HWND hwndDlg = (HWND) hwndDlgPtr; LARGE_INTEGER startOffset; LARGE_INTEGER newOffset; @@ -281,7 +282,7 @@ FormatFat (unsigned __int64 startSector, fatparams * ft, void * dev, PCRYPTO_INF memset (sector, 0, ft->sector_size); - RandgetBytes (ft->volume_id, sizeof (ft->volume_id), FALSE); + RandgetBytes (hwndDlg, ft->volume_id, sizeof (ft->volume_id), FALSE); PutBoot (ft, (unsigned char *) sector); if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo, @@ -399,11 +400,11 @@ FormatFat (unsigned __int64 startSector, fatparams * ft, void * dev, PCRYPTO_INF within the volume). */ // Temporary master key - if (!RandgetBytes (temporaryKey, EAGetKeySize (cryptoInfo->ea), FALSE)) + if (!RandgetBytes (hwndDlg, temporaryKey, EAGetKeySize (cryptoInfo->ea), FALSE)) goto fail; // Temporary secondary key (XTS mode) - if (!RandgetBytes (cryptoInfo->k2, sizeof cryptoInfo->k2, FALSE)) + if (!RandgetBytes (hwndDlg, cryptoInfo->k2, sizeof cryptoInfo->k2, FALSE)) goto fail; retVal = EAInit (cryptoInfo->ea, temporaryKey, cryptoInfo->ks); -- cgit v1.2.3