You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
1.1 KiB
75 lines
1.1 KiB
/* demlabel.c - functions for working this volume labels.
|
|
*
|
|
* demDeleteLabel()
|
|
* demCreateLabel()
|
|
*
|
|
* Modification History:
|
|
*
|
|
* YST 1-Feb-1993 Created
|
|
*
|
|
*/
|
|
|
|
#include "dem.h"
|
|
#include "demmsg.h"
|
|
|
|
#include <softpc.h>
|
|
|
|
#include <winbase.h>
|
|
#include "dpmtbls.h"
|
|
|
|
USHORT demDeleteLabel(BYTE Drive)
|
|
{
|
|
CHAR szStr[32];
|
|
|
|
|
|
sprintf(szStr, "%c:\\", Drive);
|
|
|
|
if(!SetVolumeLabelOem(szStr, NULL))
|
|
return(1);
|
|
else
|
|
return(0);
|
|
}
|
|
|
|
|
|
USHORT demCreateLabel(BYTE Drive, LPSTR lpszName)
|
|
{
|
|
CHAR szStr[32];
|
|
CHAR szTmp[32];
|
|
CHAR *p, *s;
|
|
int i = 0;
|
|
|
|
|
|
sprintf(szStr, "%c:\\", Drive);
|
|
|
|
s = lpszName;
|
|
p = szTmp;
|
|
|
|
while(s) {
|
|
if(*s != '.') {
|
|
*p = *s;
|
|
i++;
|
|
p++;
|
|
}
|
|
else {
|
|
while(i < 8) {
|
|
*p++ = ' ';
|
|
i++;
|
|
}
|
|
}
|
|
s++;
|
|
|
|
if(i > 11) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
szTmp[i] = '\0';
|
|
|
|
if(!SetVolumeLabelOem(szStr, szTmp))
|
|
return(1);
|
|
|
|
else
|
|
return(0);
|
|
|
|
|
|
}
|