Shell32 File Property Dialog

Johannes Anderwald j_anderw at sbox.tugraz.at
Tue Nov 1 18:15:32 CST 2005


Andreas Mohr wrote:
>>             FIXME("Unhandled Verb %xl\n",LOWORD(lpcmi->lpVerb));
> 
> What kind of format specifier is that supposed to be?
> I don't know that one...
> Maybe use %p instead? (or %lx??)
This statement should be %lx. However, this statement is _not_ part of 
my patch.

>>    if (GetFileSize(hFile, NULL) == 0xFFFFFFFF)
>>    {
>>        CloseHandle(hFile);
>>        return FALSE;
>>    }
>> 
>>    dwFileLo = GetFileSize(hFile, &dwFileHi);
>>    CloseHandle(hFile);
>> 
>>    if (dwFileLo == 0xFFFFFFFF && GetLastError() != NO_ERROR) 
>>        return FALSE;
> 
> This whole check sounds very weird.
> Why are you checking with NULL hiword when there might be a > 4GB file?
> (and to make it worse, even one with e.g. a size of 0x12345678FFFFFFFF !!!!!!)
> And directly after that even doing a full large file check **again**?
> Not to mention that you're not using the INVALID_FILE_SIZE macro that I really,
> really think should be used since it's been created *exactly* for this purpose
> (and for the even better purpose of *never* managing to write/edit/delete a
> 0xFFFFFF or 0xFFFFFFF instead...)

I agree that the INVALID_FILE_SIZE should be used. However, 
INVALID_FILE_SIZE macro is exactly 0xFFFFFFFF. Furthermore, this code 
does work with file sizes of 0x12345678FFFFFFFF. Have a look at the MSDN 
documentation[1]. Alternatively, GetFileSizeEx could be used.

> 
> Andreas
> 

[1] 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/getfilesize.asp

regards,

-- 
Johannes Anderwald




More information about the wine-devel mailing list