Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
What method can judge system is diskless system
Please give me some Suggestions
Posted 6-Jan-13 22:01pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I believe that this task would be OS specific and so would defer from OS to OS.
 
In Windows, you can use one of the following methods -
 
Use QueryDosDevice to list all the device names in the system.
The device names listed would be something like \Device\HarddiskVolume1, \Device\Floppy0 etc.
From this list you can check that if there is no Harddiskxxx, it means there is no hard disk in the system.
 
Use CreateFile to open physical drives like \\.\PhysicalDrive0, \\.\PhysicalDrive1 etc.
Check the return value to ensure that none of the disks exists.
  Permalink  
Comments
SajeeshCheviry at 7-Jan-13 3:29am
   
good answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 190
1 PIEBALDconsult 150
2 BillWoodruff 148
3 DamithSL 140
4 Jochen Arndt 125
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 7 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100