Firstly, fix the
Code:
void main(char *CSN)
There's so much wrong with that...........
Anyway....heres a working example
Code:
#include <windows.h>
#include <iostream>
using namespace std;
int main(void)
{
LPCTSTR szHD = "C:\\";
UCHAR szFileSys[255],szVolNameBuff[255];
DWORD dwSerial,dwMFL,dwSysFlags;
BOOL bSuccess;
bSuccess = GetVolumeInformation(szHD,(LPTSTR)szVolNameBuff,
255,&dwSerial, &dwMFL,&dwSysFlags,
(LPTSTR)szFileSys,255);
if(!bSuccess){
cout << "Error number " << GetLastError() << endl;
return 1;
}
if(szVolNameBuff[0] == NULL)
cout << "Vol Name not present" << endl;
else
cout << "Vol Name is " << szVolNameBuff << endl;
cout << "Vol Serial is " << dwSerial << endl;
cout << "Max Filelength is " << dwMFL << " chars" << endl;
cout << "Filesystem is " << szFileSys << endl;
return 0;
}