OSDN Git Service

Eliminate use of deprecated `GetVersionEx()` (3)
authorGreyMerlin <GreyMerlin@gmail.com>
Thu, 26 Jul 2018 18:07:28 +0000 (11:07 -0700)
committerGreyMerlin <GreyMerlin@gmail.com>
Thu, 26 Jul 2018 19:37:51 +0000 (12:37 -0700)
* Tweak comment
* Proper test before calling FindClose() in TempFile.cpp

Src/DirTravel.cpp
Src/TempFile.cpp

index defcc3e..bb1bdfa 100644 (file)
@@ -83,7 +83,7 @@ static void LoadFiles(const String& sDir, DirItemArray * dirs, DirItemArray * fi
 
        WIN32_FIND_DATA ff;
        HANDLE h;
-       if (IsWin7_OrGreater()) // (also 'Windows Server 2008 R2' and greater) for FIND_FIRST_EX_LARGE_FETCH
+       if (IsWin7_OrGreater()) // (also 'Windows Server 2008 R2' and greater) for FindExInfoBasic and FIND_FIRST_EX_LARGE_FETCH
                h = FindFirstFileEx(TFile(sPattern).wpath().c_str(), FindExInfoBasic, &ff, FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH);
        else
                h = FindFirstFile(TFile(sPattern).wpath().c_str(), &ff);
index f6a92f9..d30b1b7 100644 (file)
@@ -196,7 +196,7 @@ static bool CleanupWMtempfolder(const vector <int>& processIDs)
                }
                bok = !!FindNextFile(h, &ff) ;
        }
-       if (h)
+       if (h != INVALID_HANDLE_VALUE)
                FindClose(h);
        return res;
 }