On 15.10.2015 13:56, Joachim Priesner wrote:
+ if (!pfExists) return E_POINTER; + *pfExists = VARIANT_FALSE; + len = SysStringLen(DriveSpec); + if (len >= 1 && DriveSpec[0] >= 'A' && DriveSpec[0] <= 'Z' + && (len < 2 || DriveSpec[1] == ':') + && (len < 3 || DriveSpec[2] == '\\')) { + WCHAR root[] = {toupperW(DriveSpec[0]), ':', '\\', 0}; + *pfExists = GetDriveTypeW(root) != DRIVE_NO_ROOT_DIR ? VARIANT_TRUE : VARIANT_FALSE; + }
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? I haven't looked much at its implementation but it feels like DRIVE_UNKNOWN would also qualify as non-existent drive.