blob: 5d0a7703e52f34c014fc9c8629aa503275d2f46c [file] [log] [blame]
Petter Reinholdtsenf1f830c1998-10-17 12:27:41 +00001/*
Andreas Mohr7bed6962001-09-19 22:34:38 +00002 * This test program was copied from the former file documentation/cdrom-label
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00003 *
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
Petter Reinholdtsenf1f830c1998-10-17 12:27:41 +000019 */
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000020
Petter Reinholdtsenf1f830c1998-10-17 12:27:41 +000021#include <windows.h>
22#include <stdio.h>
23#include <string.h> /* for strcat() */
24
Pavel Roskin734247b1999-04-03 13:52:04 +000025int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
26 LPSTR lpszCmdLine, int nCmdShow)
Petter Reinholdtsenf1f830c1998-10-17 12:27:41 +000027{
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");
Andreas Mohr1fe93342000-01-29 21:11:47 +000033 for (drive = 'A'; drive <= 'Z'; drive++)
Petter Reinholdtsenf1f830c1998-10-17 12:27:41 +000034 {
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}