This is a mirror of official site: http://jasper-net.blogspot.com/

Why are there two values for NoDriveTypeAutoRun which disable Autoplay on drives of unknown type?

| Monday, April 19, 2010
The Windows 2000 Resource Kit described the No­Drive­Type­Auto­Run policy as consisting of a bitfield whose values are as follows:

Value Meaning
0x1 Disables Autoplay on drives of unknown type.
0x4 Disables Autoplay on removable drives.
0x8 Disables Autoplay on fixed drives.
0x10 Disables Autoplay on network drives.
0x20 Disables Autoplay on CD-ROM drives.
0x40 Disables Autoplay on RAM drives.
0x80 Disables Autoplay on drives of unknown type.
0xFF Disables Autoplay on all types of drives.

Hey, wait, two of the entries are the same. What's the difference between 0x1 (Disables Autoplay on drives of unknown type) and 0x80 (Disables Autoplay on drives of unknown type)?  The values in the bitfield correspond to return values of the Get­Drive­Type function:

#define DRIVE_UNKNOWN     0
#define DRIVE_NO_ROOT_DIR 1
#define DRIVE_REMOVABLE   2
#define DRIVE_FIXED       3
#define DRIVE_REMOTE      4
#define DRIVE_CDROM       5
#define DRIVE_RAMDISK     6

The value 0x1 corresponds to bit zero, which means that the Get­Drive­Type function could not tell what type of drive it is. On the other hand, the value 0x80 does not correspond to any known return value of Get­Drive­Type. It's reserved for future use. My guess as to how this happened is that the original table did not have an entry for 0x80. Then somebody asked, "What does 0x80 mean?"

Read more: The Old New Thing

Posted via email from jasper22's posterous

0 comments: