Petter Reinholdtsen | f1f830c | 1998-10-17 12:27:41 +0000 | [diff] [blame] | 1 | /* |
Andreas Mohr | 7bed696 | 2001-09-19 22:34:38 +0000 | [diff] [blame] | 2 | * This test program was copied from the former file documentation/cdrom-label |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 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 |
Petter Reinholdtsen | f1f830c | 1998-10-17 12:27:41 +0000 | [diff] [blame] | 19 | */ |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 20 | |
Petter Reinholdtsen | f1f830c | 1998-10-17 12:27:41 +0000 | [diff] [blame] | 21 | #include <windows.h> |
| 22 | #include <stdio.h> |
| 23 | #include <string.h> /* for strcat() */ |
| 24 | |
Pavel Roskin | 734247b | 1999-04-03 13:52:04 +0000 | [diff] [blame] | 25 | int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, |
| 26 | LPSTR lpszCmdLine, int nCmdShow) |
Petter Reinholdtsen | f1f830c | 1998-10-17 12:27:41 +0000 | [diff] [blame] | 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"); |
Andreas Mohr | 1fe9334 | 2000-01-29 21:11:47 +0000 | [diff] [blame] | 33 | for (drive = 'A'; drive <= 'Z'; drive++) |
Petter Reinholdtsen | f1f830c | 1998-10-17 12:27:41 +0000 | [diff] [blame] | 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 | } |