From a01e289696ca6540ece91a32a3db14c233e6f0dc Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Sat, 15 Jan 2000 23:28:26 +0000 Subject: [PATCH] Made SetVolumeLabel report failure on CD-ROM drives. --- files/drive.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/files/drive.c b/files/drive.c index 5ccf32e9d7e..7363c2f7333 100644 --- a/files/drive.c +++ b/files/drive.c @@ -1267,10 +1267,29 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, /*********************************************************************** * SetVolumeLabelA (KERNEL32.675) */ -BOOL WINAPI SetVolumeLabelA(LPCSTR rootpath,LPCSTR volname) +BOOL WINAPI SetVolumeLabelA( LPCSTR root, LPCSTR volname ) { - FIXME("(%s,%s),stub!\n",rootpath,volname); - return TRUE; + int drive; + + /* FIXME, SetLastErrors missing */ + + if (!root) drive = DRIVE_GetCurrentDrive(); + else + { + if ((root[1]) && (root[1] != ':')) + { + WARN("invalid root '%s'\n",root); + return FALSE; + } + drive = toupper(root[0]) - 'A'; + } + if (!DRIVE_IsValid( drive )) return FALSE; + + /* some copy protection stuff check this */ + if (DRIVE_GetType( drive ) == TYPE_CDROM) return FALSE; + + FIXME("(%s,%s),stub!\n", root, volname); + return TRUE; } /***********************************************************************