mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 08:00:24 +00:00
- Fix GetLogicalDriveStringsA/W. +5 passed tests
- Add params check for GetVolumeNameForVolumeMountPointW svn path=/trunk/; revision=38428
This commit is contained in:
parent
21421f90d2
commit
e4739139f7
1 changed files with 24 additions and 18 deletions
|
@ -81,7 +81,7 @@ InternalOpenDirW(LPCWSTR DirName,
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
/* Synced to Wine-? */
|
/* Synced to Wine-2008/12/28 */
|
||||||
DWORD WINAPI
|
DWORD WINAPI
|
||||||
GetLogicalDriveStringsA(DWORD nBufferLength,
|
GetLogicalDriveStringsA(DWORD nBufferLength,
|
||||||
LPSTR lpBuffer)
|
LPSTR lpBuffer)
|
||||||
|
@ -98,8 +98,8 @@ GetLogicalDriveStringsA(DWORD nBufferLength,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (count * 4 <= nBufferLength)
|
if ((count * 4) + 1 > nBufferLength) return ((count * 4) + 1);
|
||||||
{
|
|
||||||
LPSTR p = lpBuffer;
|
LPSTR p = lpBuffer;
|
||||||
|
|
||||||
for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
|
for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
|
||||||
|
@ -111,7 +111,7 @@ GetLogicalDriveStringsA(DWORD nBufferLength,
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
}
|
}
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
}
|
|
||||||
return (count * 4);
|
return (count * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ GetLogicalDriveStringsA(DWORD nBufferLength,
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
/* Synced to Wine-? */
|
/* Synced to Wine-2008/12/28 */
|
||||||
DWORD WINAPI
|
DWORD WINAPI
|
||||||
GetLogicalDriveStringsW(DWORD nBufferLength,
|
GetLogicalDriveStringsW(DWORD nBufferLength,
|
||||||
LPWSTR lpBuffer)
|
LPWSTR lpBuffer)
|
||||||
|
@ -135,19 +135,19 @@ GetLogicalDriveStringsW(DWORD nBufferLength,
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count * 4 <= nBufferLength)
|
if ((count * 4) + 1 > nBufferLength) return ((count * 4) + 1);
|
||||||
{
|
|
||||||
LPWSTR p = lpBuffer;
|
LPWSTR p = lpBuffer;
|
||||||
for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
|
for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
|
||||||
if (dwDriveMap & (1<<drive))
|
if (dwDriveMap & (1<<drive))
|
||||||
{
|
{
|
||||||
*p++ = (WCHAR)('A' + drive);
|
*p++ = (WCHAR)('A' + drive);
|
||||||
*p++ = (WCHAR)':';
|
*p++ = (WCHAR)':';
|
||||||
*p++ = (WCHAR)'\\';
|
*p++ = (WCHAR)'\\';
|
||||||
*p++ = (WCHAR)'\0';
|
*p++ = (WCHAR)'\0';
|
||||||
}
|
}
|
||||||
*p = (WCHAR)'\0';
|
*p = (WCHAR)'\0';
|
||||||
}
|
|
||||||
return (count * 4);
|
return (count * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -872,6 +872,12 @@ GetVolumeNameForVolumeMountPointW(
|
||||||
BOOL Result;
|
BOOL Result;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
if (!VolumeMountPoint || !VolumeMountPoint[0])
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_PATH_NOT_FOUND);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First step is to convert the passed volume mount point name to
|
* First step is to convert the passed volume mount point name to
|
||||||
* an NT acceptable name.
|
* an NT acceptable name.
|
||||||
|
|
Loading…
Reference in a new issue