On 20/07/10 14:00, Alexandre Julliard wrote:
stephenmsmith@blueyonder.co.uk writes:
diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index 7596864..4908739 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -526,10 +526,17 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len, } else {
if (!root[0] || root[1] != ':' || root[lstrlenW(root)-1] != '\\' )
if (!isalphaW(root[0]) || root[1] != ':' || root[lstrlenW(root)-1] != '\\') {
SetLastError( ERROR_INVALID_NAME );
return FALSE;
WCHAR curpath[MAX_PATH],winpath[MAX_PATH];
GetCurrentDirectoryW(MAX_PATH,curpath);
GetWindowsDirectoryW(winpath,MAX_PATH);
if(lstrlenW(curpath)> 3&& root[0] == winpath[0])
{
SetLastError( ERROR_INVALID_NAME );
return FALSE;
}
This clearly makes no sense, path syntax doesn't depend on the windows directory.
I agree it makes no sense however it seems to match windows behavior, results from my own vista box:
Current directory is C:\Users\Administrator\Documents\Visual Studio 2010\Projects\volumeandfiletests\Debug GetVolumeInformation succeds with no trailing backslash for E: Current directory is C:\ GetVolumeInformation succeds with no trailing backslash for C: GetVolumeInformation succeds with no trailing backslash for E: Current directory is E:\ GetVolumeInformation succeds with no trailing backslash for E: Current directory is E:\data