Alright I got it working now, thanks a lot for the help, that was fast!
Here is what I ended up with. Note that TCHAR and TSTR are substitutes for char and C string. If you can see any issue let me know.
Code:
TCHAR infoBuf[32767];
if (GetWindowsDirectory(infoBuf, 32767))
{
TSTR drive;
drive.printf(_T("%s"),infoBuf);
TSTR maindir = drive.Substr(0,3);
DWORD dwVolSerial;
BOOL bIsRetrieved = GetVolumeInformation(maindir,NULL,NULL,&dwVolSerial,NULL,NULL,NULL,NULL);
if (bIsRetrieved)
{
TSTR buf;
buf.printf(_T("%u"),dwVolSerial);
return new String(buf);
}
return &undefined;
}
return &undefined;