diff options
Diffstat (limited to '3rdparty/lzma/CPP/Windows/FileFind.h')
-rw-r--r-- | 3rdparty/lzma/CPP/Windows/FileFind.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/3rdparty/lzma/CPP/Windows/FileFind.h b/3rdparty/lzma/CPP/Windows/FileFind.h index fcfe02c7e64..11408d05958 100644 --- a/3rdparty/lzma/CPP/Windows/FileFind.h +++ b/3rdparty/lzma/CPP/Windows/FileFind.h @@ -1,7 +1,7 @@ // Windows/FileFind.h -#ifndef __WINDOWS_FILE_FIND_H -#define __WINDOWS_FILE_FIND_H +#ifndef ZIP7_INC_WINDOWS_FILE_FIND_H +#define ZIP7_INC_WINDOWS_FILE_FIND_H #ifndef _WIN32 #include <sys/stat.h> @@ -249,7 +249,15 @@ class CFindChangeNotification MY_UNCOPYABLE HANDLE _handle; public: operator HANDLE () { return _handle; } - bool IsHandleAllocated() const { return _handle != INVALID_HANDLE_VALUE && _handle != 0; } + bool IsHandleAllocated() const + { + /* at least on win2000/XP (undocumented): + if pathName is "" or NULL, + FindFirstChangeNotification() could return NULL. + So we check for INVALID_HANDLE_VALUE and NULL. + */ + return _handle != INVALID_HANDLE_VALUE && _handle != NULL; + } CFindChangeNotification(): _handle(INVALID_HANDLE_VALUE) {} ~CFindChangeNotification() { Close(); } bool Close() throw(); |