RE: [EXTERNAL] Re: Wrong value for |FileNormalizedNameInfo| (|24| vs. |48|) in Cygwin 3.6 /usr/include ...
> Looking at /usr/include/w32api/minwinbase.h: > snip > typedef enum _FILE_INFO_BY_HANDLE_CLASS { >FileBasicInfo /* is zero? */, >FileStandardInfo, >FileNameInfo, >FileRenameInfo, >FileDispositionInfo, >FileAllocationInfo, >FileEndOfFileInfo, >FileStreamInfo, >FileCompressionInfo, >FileAttributeTagInfo, >FileIdBothDirectoryInfo, >FileIdBothDirectoryRestartInfo, >FileIoPriorityHintInfo, >FileRemoteProtocolInfo, >FileFullDirectoryInfo, >FileFullDirectoryRestartInfo, > #if _WIN32_WINNT >= 0x0602 >FileStorageInfo, >FileAlignmentInfo, >FileIdInfo, >FileIdExtdDirectoryInfo, >FileIdExtdDirectoryRestartInfo, > #endif > #if _WIN32_WINNT >= 0x0A02 >FileDispositionInfoEx, >FileRenameInfoEx, > #endif >FileCaseSensitiveInfo, >FileNormalizedNameInfo, >MaximumFileInfoByHandleClass > } FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS; > #endif > snip FWIW, this is how it is defined by the native M$ SDK: #if (NTDDI_VERSION >= NTDDI_LONGHORN) typedef enum _FILE_INFO_BY_HANDLE_CLASS { FileBasicInfo, FileStandardInfo, FileNameInfo, FileRenameInfo, FileDispositionInfo, FileAllocationInfo, FileEndOfFileInfo, FileStreamInfo, FileCompressionInfo, FileAttributeTagInfo, FileIdBothDirectoryInfo, FileIdBothDirectoryRestartInfo, FileIoPriorityHintInfo, FileRemoteProtocolInfo, FileFullDirectoryInfo, FileFullDirectoryRestartInfo, #if (NTDDI_VERSION >= NTDDI_WIN8) FileStorageInfo, FileAlignmentInfo, FileIdInfo, FileIdExtdDirectoryInfo, FileIdExtdDirectoryRestartInfo, #endif #if (NTDDI_VERSION >= NTDDI_WIN10_RS1) FileDispositionInfoEx, FileRenameInfoEx, #endif #if (NTDDI_VERSION >= NTDDI_WIN10_19H1) FileCaseSensitiveInfo, FileNormalizedNameInfo, #endif MaximumFileInfoByHandleClass } FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS; #endif Anton Lavrentiev Contractor NIH/NLM/NCBI -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: [EXTERNAL] Re: Wrong value for |FileNormalizedNameInfo| (|24| vs. |48|) in Cygwin 3.6 /usr/include ...
On 2024-05-13 07:34, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: *FileNormalizedNameInformation* 44/0x2e is defined in winternl.h FILE_INFORMATION_CLASS for NtQueryInformationFile: I see it's defined as 48/0x30 there, though... Good catch and point! My computer glasses did not seem to be working well last weekend! -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: Wrong value for |FileNormalizedNameInfo| (|24| vs. |48|) in Cygwin 3.6 /usr/include ...
On Sat, May 11, 2024 at 6:17 PM Brian Inglis via Cygwin wrote: > On 2024-05-11 05:30, Roland Mainz via Cygwin wrote: > > I'm writing a test program for |FileNormalizedNameInfo| right now (see > > https://rovema.kpaste.net/07074abc). > > Per > > https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ne-minwinbase-file_info_by_handle_class > > |FileNormalizedNameInfo| should be |24|, but on Cygwin 3.6 I get the > > value |48|. > > Since |GetFileInformationByHandleEx()| gives me error 87 (="Invalid > > Parameter") for |48|, but works as intended for |24| I assume that the > > Cygwin header is wrong. > > > > Could someone please check the Cygwin header files ? > > Could someone please read the enum constant names and classes carefully? > > Package w32api-headers: > > > Headers: > > snip > > $ grep -r FileNormalizedNameInfo /usr/include/ > > /usr/include/w32api/ddk/wdm.h: FileNormalizedNameInformation, > > /usr/include/w32api/minwinbase.h:*FileNormalizedNameInfo*, > > /usr/include/w32api/winternl.h:FileNormalizedNameInformation = 48, > > snip > > *FileNormalizedNameInfo* 24/0x18 is defined in minwinbase.h > FILE_INFO_BY_HANDLE_CLASS for GetFileInformationByHandleEx whereas > *FileNormalizedNameInformation* 44/0x2e is defined in winternl.h > FILE_INFORMATION_CLASS for NtQueryInformationFile: > > https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntqueryinformationfile > > ditto in ddk/wdm.h! Something is still wrong on my side, with Cygwin 3.6 on Windows 10: Example: snip #define UNICODE 1 #define _UNICODE 1 #include #include #include #include int main(int ac, char *av[]) { (void)printf("FileNormalizedNameInfo=%d/0x%x\n", (int)FileNormalizedNameInfo, (int)FileNormalizedNameInfo); return EXIT_SUCCESS; } snip Compiling this with $ gcc -Wall test4.c -o test4 # and running it returns this: snip $ ./test4 FileNormalizedNameInfo=22/0x16 snip The expected output would be "FileNormalizedNameInfo=24/0x18", because in https://learn.microsoft.com/de-de/windows/win32/api/minwinbase/ne-minwinbase-file_info_by_handle_class |FileNormalizedNameInfo| is in position 24. Looking at /usr/include/w32api/minwinbase.h: snip typedef enum _FILE_INFO_BY_HANDLE_CLASS { FileBasicInfo /* is zero? */, FileStandardInfo, FileNameInfo, FileRenameInfo, FileDispositionInfo, FileAllocationInfo, FileEndOfFileInfo, FileStreamInfo, FileCompressionInfo, FileAttributeTagInfo, FileIdBothDirectoryInfo, FileIdBothDirectoryRestartInfo, FileIoPriorityHintInfo, FileRemoteProtocolInfo, FileFullDirectoryInfo, FileFullDirectoryRestartInfo, #if _WIN32_WINNT >= 0x0602 FileStorageInfo, FileAlignmentInfo, FileIdInfo, FileIdExtdDirectoryInfo, FileIdExtdDirectoryRestartInfo, #endif #if _WIN32_WINNT >= 0x0A02 FileDispositionInfoEx, FileRenameInfoEx, #endif FileCaseSensitiveInfo, FileNormalizedNameInfo, MaximumFileInfoByHandleClass } FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS; #endif snip This code cannot work, because the integer value for |FileNormalizedNameInfo| enum shift with different Windows versions, e.g. |FileNormalizedNameInfo| has value |22| if |_WIN32_WINNT==0x0602| but value |24| if |_WIN32_WINNT==0x0A02|. I filed https://github.com/mingw-w64/mingw-w64/issues/48 for the issue, but it would be nice if this can be fixed in both Cygwin 3.5 and 3.6... Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.ma...@nrubsig.org \__\/\/__/ MPEG specialist, C&&& programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: Wrong value for |FileNormalizedNameInfo| (|24| vs. |48|) in Cygwin 3.6 /usr/include ...
On 2024-05-11 05:30, Roland Mainz via Cygwin wrote: I'm writing a test program for |FileNormalizedNameInfo| right now (see https://rovema.kpaste.net/07074abc). Per https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ne-minwinbase-file_info_by_handle_class |FileNormalizedNameInfo| should be |24|, but on Cygwin 3.6 I get the value |48|. Since |GetFileInformationByHandleEx()| gives me error 87 (="Invalid Parameter") for |48|, but works as intended for |24| I assume that the Cygwin header is wrong. Could someone please check the Cygwin header files ? Could someone please read the enum constant names and classes carefully? Package w32api-headers: Headers: snip $ grep -r FileNormalizedNameInfo /usr/include/ /usr/include/w32api/ddk/wdm.h: FileNormalizedNameInformation, /usr/include/w32api/minwinbase.h:*FileNormalizedNameInfo*, /usr/include/w32api/winternl.h:FileNormalizedNameInformation = 48, snip *FileNormalizedNameInfo* 24/0x18 is defined in minwinbase.h FILE_INFO_BY_HANDLE_CLASS for GetFileInformationByHandleEx whereas *FileNormalizedNameInformation* 44/0x2e is defined in winternl.h FILE_INFORMATION_CLASS for NtQueryInformationFile: https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntqueryinformationfile ditto in ddk/wdm.h! -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Wrong value for |FileNormalizedNameInfo| (|24| vs. |48|) in Cygwin 3.6 /usr/include ...
Hi! I'm writing a test program for |FileNormalizedNameInfo| right now (see https://rovema.kpaste.net/07074abc). Per https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ne-minwinbase-file_info_by_handle_class |FileNormalizedNameInfo| should be |24|, but on Cygwin 3.6 I get the value |48|. Since |GetFileInformationByHandleEx()| gives me error 87 (="Invalid Parameter") for |48|, but works as intended for |24| I assume that the Cygwin header is wrong. Could someone please check the Cygwin header files ? Headers: snip $ grep -r FileNormalizedNameInfo /usr/include/ /usr/include/w32api/ddk/wdm.h: FileNormalizedNameInformation, /usr/include/w32api/minwinbase.h:FileNormalizedNameInfo, /usr/include/w32api/winternl.h:FileNormalizedNameInformation = 48, snip Cygwin version: snip $ uname -a CYGWIN_NT-10.0-19045 okkoto 3.6.0-0.115.g579064bf4d40.x86_64 2024-04-09 21:11 UTC x86_64 Cygwin snip Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.ma...@nrubsig.org \__\/\/__/ MPEG specialist, C&&& programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple