kernel32: Improve GetVolumePathName stub.
This commit is contained in:
parent
d7c154a8db
commit
9b9d8dc3e8
|
@ -1406,9 +1406,19 @@ BOOL WINAPI GetDiskFreeSpaceA( LPCSTR root, LPDWORD cluster_sectors,
|
|||
*/
|
||||
BOOL WINAPI GetVolumePathNameA(LPCSTR filename, LPSTR volumepathname, DWORD buflen)
|
||||
{
|
||||
BOOL ret;
|
||||
WCHAR *filenameW = NULL, *volumeW;
|
||||
|
||||
FIXME("(%s, %p, %d), stub!\n", debugstr_a(filename), volumepathname, buflen);
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
|
||||
if (filename && !(filenameW = FILE_name_AtoW( filename, FALSE ))) return FALSE;
|
||||
if (!(volumeW = HeapAlloc( GetProcessHeap(), 0, buflen * sizeof(WCHAR) ))) return FALSE;
|
||||
|
||||
if ((ret = GetVolumePathNameW( filenameW, volumeW, buflen )))
|
||||
FILE_name_WtoA( volumeW, -1, volumepathname, buflen );
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, volumeW );
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -1416,8 +1426,18 @@ BOOL WINAPI GetVolumePathNameA(LPCSTR filename, LPSTR volumepathname, DWORD bufl
|
|||
*/
|
||||
BOOL WINAPI GetVolumePathNameW(LPCWSTR filename, LPWSTR volumepathname, DWORD buflen)
|
||||
{
|
||||
const WCHAR *p = filename;
|
||||
|
||||
FIXME("(%s, %p, %d), stub!\n", debugstr_w(filename), volumepathname, buflen);
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
|
||||
if (p && tolowerW(p[0]) >= 'a' && tolowerW(p[0]) <= 'z' && p[1] ==':' && p[2] == '\\' && buflen >= 4)
|
||||
{
|
||||
volumepathname[0] = p[0];
|
||||
volumepathname[1] = ':';
|
||||
volumepathname[2] = '\\';
|
||||
volumepathname[3] = 0;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue