From da312003a8edb85dd38c172cb1fd67cba9622c99 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 18 Apr 2008 22:08:29 +0000 Subject: [PATCH] reverted last commit it forced usage of GetDiskFreeSpace instead of GetDiskFreeSpaceEx for non-existent directories or anything GetDiskFreeSpaceEx deemed invalid git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5602 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Ui.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index ee7989ea..2d89cf80 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -982,6 +982,7 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (uMsg == WM_IN_UPDATEMSG || uMsg == WM_NOTIFY_START) { static char s[NSIS_MAX_STRLEN]; + char *p; int error = 0; int available_set = 0; unsigned total, available = 0xFFFFFFFF; @@ -991,6 +992,9 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar error = NSIS_INSTDIR_INVALID; mystrcpy(s,dir); + p=skip_root(s); + if (p) + *p=0; // Test for and use the GetDiskFreeSpaceEx API { @@ -1016,12 +1020,6 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar { // GetDiskFreeSpaceEx is not available DWORD spc, bps, fc, tc; - - // GetDiskFreeSpaceEx accepts any path, but GetDiskFreeSpace accepts only the root - char *p=skip_root(s); - if (p) - *p=0; - if (GetDiskFreeSpace(s, &spc, &bps, &fc, &tc)) { available = (int)MulDiv(bps * spc, fc, 1 << 10);