/* demlabel.c - functions for working this volume labels. * * demDeleteLabel() * demCreateLabel() * * Modification History: * * YST 1-Feb-1993 Created * */ #include "dem.h" #include "demmsg.h" #include #include #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); }