On Tue, 12 May 2015, Andrew Eikum wrote:
On Tue, May 12, 2015 at 05:17:44PM +0300, Martin Storsjö wrote:
@@ -919,8 +919,24 @@ BOOL WINAPI GetFileInformationByHandleEx( HANDLE handle, FILE_INFO_BY_HANDLE_CLA SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); return FALSE;
- case FileBasicInfo:
- case FileStandardInfo: case FileNameInfo:
status = NtQueryInformationFile( handle, &io, info, size, FileNameInformation );
switch (class) {
case FileBasicInfo:
nt_class = FileBasicInformation;
break;
case FileStandardInfo:
nt_class = FileStandardInformation;
break;
case FileNameInfo:
nt_class = FileNameInformation;
break;
default:
assert(0);
break;
The default case seems unnecessary, since it's impossible.
At least my gcc (4.7) doesn't realize it, and complains about all the unhandled cases in the switch.
But, this whole double-switch thing strikes me as ugly. Another option would be to call NtQueryInformationFile with the correct argument in each case, then break and do the 'if(status!=SUCCESS)' stuff outside of the switch statement. That would eliminate the code duplication with the NtQueryDirectoryFile error checking, too.
That sounds like a good idea.
Is there anything concrete that needs to be fixed in this (and the other kernel32 patch in the same thread) to be acceptable?
Tests would help for both patches.
Yep, although I don't off-hand have any good idea of a meaningful test for GetSystemTimePreciseAsFileTime.
// Martin