Added LGPL standard comment, and copyright notices where necessary.
[wine] / libtest / volinfo.c
1 /*
2  * This test program was copied from the former file documentation/cdrom-label
3  *
4  * Copyright 1998 Petter Reinholdtsen
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include <windows.h>
22 #include <stdio.h>
23 #include <string.h> /* for strcat() */
24
25 int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
26                    LPSTR lpszCmdLine, int nCmdShow)
27 {
28     char  drive, root[]="C:\\", label[1002], fsname[1002];
29     DWORD serial, flags, filenamelen, labellen = 1000, fsnamelen = 1000;
30
31     printf("Drive Serial     Flags      Filename-Length "
32            "Label                 Fsname\n");
33     for (drive = 'A'; drive <= 'Z'; drive++)
34     {
35         root[0] = drive;
36         if (GetVolumeInformation(root,label,labellen,&serial,
37                                   &filenamelen,&flags,fsname,fsnamelen))
38         {
39             strcat(label,"\""); strcat (fsname,"\"");
40             printf("%c:\\   0x%08lx 0x%08lx %15ld \"%-20s \"%-20s\n",
41                    drive, (long) serial, (long) flags, (long) filenamelen,
42                    label, fsname);
43         }
44     }
45     return 0;
46 }