Log in

View Full Version : GetDriveTypeA


ReVeR
December 8th, 2004, 19:03
Hey
i was wondering about teh return values of teh GetDriveTypeA.
i know that 5 is a cd rom drive. But what is the harddrive?
It was on the msdn, btu they changed it and now i am stuck

dELTA
December 8th, 2004, 19:48
Yeah, sure, they changed msdn and removed some APIs just for fun...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/getdrivetype.asp

Look up the constants in the SDK or possibly windows.inc (or write a friggin one line program and test it yourself ).

WaxfordSqueers
December 8th, 2004, 21:25
Quote:
[Originally Posted by dELTA]...snip....(or write a friggin one line program and test it yourself ).


Now that's something I wouldn't have thought of. See...even in your sarcasm you're helpful

I've been using the Windows 95 Win32 Programming API Bible from the Waite Group. Do you know of any good books (not apps) that are more recent? Sometimes I prefer to hold a book in my hands and read it. Old habits

doug
December 8th, 2004, 22:55
First: Get the platform SDK: msdn.microsoft.com/platformsdk/
Right now, there are 2 versions of it.. the XP SP2 (2004) & the server 2003 (february 2003). Make sure you install ALL documentation.

@rever: don't be lazy. That information is everywhere.
1. search the net
2. search the platform SDK include directory for the name, you'll get the constant.
3. Look in undocumented windows resources.
4. ask

@WaxfordSqueers:
Show the contents and print the overviews.
Then also navigate in the index for the "* functions" and the general topics (ex: About *"

The About <some topic> in the index is a very good introduction to a subject.

Don't forget to check the "See also" sections at the bottom.

example:

About Hooks

--------------------------------------------------------------------------------
Hooks tend to slow down the system because they increase the amount of processing the system must perform for each message. You should install a hook only when necessary, and remove it as soon as possible.
This section discusses the following:

Hook Chains
Hook Procedures
Hook Types

ReVeR
December 9th, 2004, 07:22
excuse me for my stupidity....but which one of the return values in getdrivetypeA is the number for the hd. Because all i see are the string retunr values, while in the olly w/e etc.. they are numbers.....so am i suppoused to strart counting from 0 or 1 to get to the network drive?

Neitsa
December 9th, 2004, 08:22
Hello,

As stated by Delta, just write a single line and take a look at the return !

Asm :

invoke GetDriveType,NULL

debug it, look at EAX and you'll have the value for FIXED_DRIVE (wich is harddrive).

If you don't know how to write even a single line of program, I suggest you to look at header files (C ; C++ ,etc.) or inc files in asm, you should be able to find a clue...

If you doesn't have headers nor include files, just try googling !

typing "getdrivetype hard disk" on google return, for the first match, the right answer !

Is it so hard that you haven't been able to do it ?

|azy|eg
December 9th, 2004, 14:08
http://custom.programming-in.net/articles/art9-1.asp?f=GetDriveType

Const Unknown = 0
Const NoRootDrive = 1
Const Removable = 2
Const LocalDisk = 3
Const Network = 4
Const CD = 5
Const RAMDrive = 6