On 15.10.2015 20:39, Joachim Priesner wrote:
Thanks for having a look at the code, will fix the method wrapper issue and resend later.
Not necessary wrong, but it'd be better if all that validation was GetDriveTypeW responsibility. I don't see many tests for it in kernel32/tests, could you please add some, so we can get rid of this extra logic?
GetDriveTypeW does not accept strings consisting of only a single drive letter, but filesys_DriveExists does. So we cannot rely on GetDriveTypeW's validation and have to do our own.
I'll send the GetDriveType tests in a separate patch, good to have them anyway :)
Thanks.
I haven't looked much at its implementation but it feels like DRIVE_UNKNOWN would also qualify as non-existent drive.
The Windows implementation of DriveExists returns true for DRIVE_UNKNOWN. (I tested using a native scrrun.dll by patching GetDriveTypeW to always return DRIVE_UNKNOWN.)
It was a bad idea to test it in such way I think, it's essentially the same as +relay-ing native dlls - we don't want to look into implementation details, and the fact that DriveExists uses GetDriveTypeW is such implementation detail. If it's possible to make GetDriveTypeW fail with DRIVE_UNKNOWN we should just add such tests for it and for DriveExists. If it's not testable for some reason I think it's better to differ and consider DRIVE_UNKNOWN as non-existent drive.