+#ifdef __WINDOWS__
+ #include "wx/msw/private.h"
+#endif
+
+// ----------------------------------------------------------------------------
+// define the types and functions used for file searching
+// ----------------------------------------------------------------------------
+
+namespace
+{
+
+typedef WIN32_FIND_DATA FIND_STRUCT;
+typedef HANDLE FIND_DATA;
+typedef DWORD FIND_ATTR;
+
+inline FIND_DATA InitFindData()
+{
+ return INVALID_HANDLE_VALUE;
+}
+
+inline bool IsFindDataOk(FIND_DATA fd)
+{
+ return fd != INVALID_HANDLE_VALUE;
+}
+
+inline void FreeFindData(FIND_DATA fd)
+{
+ if ( !::FindClose(fd) )
+ {
+ wxLogLastError(wxT("FindClose"));
+ }
+}
+
+inline FIND_DATA FindFirst(const wxString& spec,
+ FIND_STRUCT *finddata)
+{
+ return ::FindFirstFile(spec.t_str(), finddata);
+}
+
+inline bool FindNext(FIND_DATA fd, FIND_STRUCT *finddata)
+{
+ return ::FindNextFile(fd, finddata) != 0;
+}
+
+const wxChar *GetNameFromFindData(FIND_STRUCT *finddata)
+{
+ return finddata->cFileName;
+}
+
+inline FIND_ATTR GetAttrFromFindData(FIND_STRUCT *finddata)
+{
+ return finddata->dwFileAttributes;
+}
+
+inline bool IsDir(FIND_ATTR attr)
+{
+ return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0;
+}
+
+inline bool IsHidden(FIND_ATTR attr)
+{
+ return (attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)) != 0;
+}
+
+} // anonymous namespace