:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / apps / tests / tests / volinfo / volinfo.c
1 /*
2  * This test program was copied from the former file documentation/cdrom-label
3  */
4 #include <windows.h>
5 #include <stdio.h>
6 #include <string.h> /* for strcat() */
7
8 int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
9                    LPSTR lpszCmdLine, int nCmdShow)
10 {
11     char  drive, root[]="C:\\", label[1002], fsname[1002];
12     DWORD serial, flags, filenamelen, labellen = 1000, fsnamelen = 1000;
13
14     printf("Drive Serial     Flags      Filename-Length "
15            "Label                 Fsname\n");
16     for (drive = 'A'; drive <= 'Z'; drive++)
17     {
18         root[0] = drive;
19         if (GetVolumeInformation(root,label,labellen,&serial,
20                                   &filenamelen,&flags,fsname,fsnamelen))
21         {
22             strcat(label,"\""); strcat (fsname,"\"");
23             printf("%c:\\   0x%08lx 0x%08lx %15ld \"%-20s \"%-20s\n",
24                    drive, (long) serial, (long) flags, (long) filenamelen,
25                    label, fsname);
26         }
27     }
28     return 0;
29 }