2 * VOL.C - vol internal command.
7 * 03-Dec-1998 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
8 * Replaced DOS calls by Win32 calls.
10 * 08-Dec-1998 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
11 * Added help text ("/?").
13 * 07-Jan-1999 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
16 * 18-Jan-1999 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
19 * 20-Jan-1999 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
26 #ifdef INCLUDE_CMD_VOL
30 PrintVolumeHeader (LPTSTR pszRootPath
)
32 TCHAR szMsg
[RC_STRING_MAX_SIZE
];
36 /* get the volume information of the drive */
37 if(!GetVolumeInformation (pszRootPath
,
46 ErrorMessage (GetLastError (), _T(""));
50 /* print drive info */
51 if (szVolName
[0] != '\0')
53 LoadString(CMD_ModuleHandle
, STRING_VOL_HELP1
, szMsg
, RC_STRING_MAX_SIZE
);
54 ConOutPrintf(szMsg
, pszRootPath
[0],szVolName
);
58 LoadString(CMD_ModuleHandle
, STRING_VOL_HELP2
, szMsg
, RC_STRING_MAX_SIZE
);
59 ConOutPrintf(szMsg
, pszRootPath
[0]);
62 /* print the volume serial number */
63 LoadString(CMD_ModuleHandle
, STRING_VOL_HELP3
, szMsg
, RC_STRING_MAX_SIZE
);
64 ConOutPrintf(szMsg
, HIWORD(dwSerialNr
), LOWORD(dwSerialNr
));
69 INT
cmd_vol (LPTSTR cmd
, LPTSTR param
)
71 TCHAR szRootPath
[] = _T("A:\\");
72 TCHAR szPath
[MAX_PATH
];
74 if (!_tcsncmp (param
, _T("/?"), 2))
76 ConOutResPaging(TRUE
,STRING_VOL_HELP4
);
82 if (param
[0] == _T('\0'))
84 GetCurrentDirectory (MAX_PATH
, szPath
);
85 szRootPath
[0] = szPath
[0];
90 if (param
[1] == _T(':'))
91 szRootPath
[0] = param
[0];
94 error_invalid_drive ();
100 if (!IsValidPathName (szRootPath
))
102 error_invalid_drive ();
107 /* print the header */
108 if (!PrintVolumeHeader (szRootPath
))