2 * VOL.C - vol internal command.
7 * 03-Dec-1998 (Eric Kohl)
8 * Replaced DOS calls by Win32 calls.
10 * 08-Dec-1998 (Eric Kohl)
11 * Added help text ("/?").
13 * 07-Jan-1999 (Eric Kohl)
16 * 18-Jan-1999 (Eric Kohl)
19 * 20-Jan-1999 (Eric Kohl)
25 #ifdef INCLUDE_CMD_VOL
29 PrintVolumeHeader (LPTSTR pszRootPath
)
34 /* get the volume information of the drive */
35 if(!GetVolumeInformation (pszRootPath
,
44 ErrorMessage (GetLastError (), _T(""));
48 /* print drive info */
49 if (szVolName
[0] != '\0')
51 ConOutResPrintf(STRING_VOL_HELP1
, pszRootPath
[0],szVolName
);
55 ConOutResPrintf(STRING_VOL_HELP2
, pszRootPath
[0]);
58 /* print the volume serial number */
59 ConOutResPrintf(STRING_VOL_HELP3
, HIWORD(dwSerialNr
), LOWORD(dwSerialNr
));
64 INT
cmd_vol (LPTSTR param
)
66 TCHAR szRootPath
[] = _T("A:\\");
67 TCHAR szPath
[MAX_PATH
];
69 if (!_tcsncmp (param
, _T("/?"), 2))
71 ConOutResPaging(TRUE
,STRING_VOL_HELP4
);
77 if (param
[0] == _T('\0'))
79 GetCurrentDirectory (MAX_PATH
, szPath
);
80 szRootPath
[0] = szPath
[0];
85 if (param
[1] == _T(':'))
86 szRootPath
[0] = param
[0];
89 error_invalid_drive ();
95 if (!IsValidPathName (szRootPath
))
97 error_invalid_drive ();
102 /* print the header */
103 if (!PrintVolumeHeader (szRootPath
))