dokan-dev / dokany

User mode file system library for windows with FUSE Wrapper
http://dokan-dev.github.io
5.27k stars 665 forks source link

Undefined type FILE_ID_EXTD_DIR_INFO in version 1.4.1.1000 #960

Closed brechtsanders closed 3 years ago

brechtsanders commented 3 years ago

Version 1.4.1.1000 won't build because PFILE_ID_EXTD_DIR_INFO and FILE_ID_EXTD_DIR_INFO are not defined in dokan/directory.c.

Compiles fine by replacing them with PFILE_ID_EXTD_DIR_INFO and FILE_ID_EXTD_DIR_INFO in dokan/directory.c, but I'm not sure that is how it should be.

patch -ulbf dokan/directory.c << EOF
@@ -172,3 +172,3 @@

-VOID DokanFillIdExtdDirInfo(PFILE_ID_EXTD_DIR_INFO Buffer,
+VOID DokanFillIdExtdDirInfo(PFILE_ID_EXTD_BOTH_DIR_INFORMATION Buffer,
                             PWIN32_FIND_DATAW FindData, ULONG Index,
@@ -316,3 +316,3 @@
   case FileIdExtdDirectoryInformation:
-    thisEntrySize += sizeof(FILE_ID_EXTD_DIR_INFO);
+    thisEntrySize += sizeof(FILE_ID_EXTD_BOTH_DIR_INFORMATION);
     break;
EOF
Liryna commented 3 years ago

It build locally for me and it also build successfully on the CI. What ask version are you using ?

brechtsanders commented 3 years ago

I built from tarball downloaded from: https://github.com/dokan-dev/dokany/archive/v1.4.1.1000.tar.gz

Liryna commented 3 years ago

Yes but what windows sdk is used to build the project ? The undefined type comes from windows headers not the dokan code.

brechtsanders commented 3 years ago

MinGW-w64 8.0.0 using MinGW-w64 GCC from http://winlibs.com/

Liryna commented 3 years ago

I have no idea why this is not defined in your mingw version sorry. The type should exist and it is not a new windows 10 type so that's surprising.

The patch your proposed is unfortunately not valid. We do need to use that exact type.

brechtsanders commented 3 years ago

Ok. For now I will work around it like this:

mv dokan/directory.c dokan/directory.c.bak
cat > dokan/directory.c << EOF
#include <windows.h>
typedef struct DOKAN__FILE_ID_EXTD_DIR_INFO {
  ULONG         NextEntryOffset;
  ULONG         FileIndex;
  LARGE_INTEGER CreationTime;
  LARGE_INTEGER LastAccessTime;
  LARGE_INTEGER LastWriteTime;
  LARGE_INTEGER ChangeTime;
  LARGE_INTEGER EndOfFile;
  LARGE_INTEGER AllocationSize;
  ULONG         FileAttributes;
  ULONG         FileNameLength;
  ULONG         EaSize;
  ULONG         ReparsePointTag;
  FILE_ID_128   FileId;
  WCHAR         FileName[1];
} DOKAN_FILE_ID_EXTD_DIR_INFO, *DOKAN_PFILE_ID_EXTD_DIR_INFO;
EOF
sed -e "s/P*FILE_ID_EXTD_DIR_INFO/DOKAN_&/g" dokan/directory.c.bak >> dokan/directory.c