{"id":14323,"date":"2010-04-15T07:00:00","date_gmt":"2010-04-15T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2010\/04\/15\/why-are-there-two-values-for-nodrivetypeautorun-which-disable-autoplay-on-drives-of-unknown-type\/"},"modified":"2010-04-15T07:00:00","modified_gmt":"2010-04-15T07:00:00","slug":"why-are-there-two-values-for-nodrivetypeautorun-which-disable-autoplay-on-drives-of-unknown-type","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20100415-00\/?p=14323","title":{"rendered":"Why are there two values for NoDriveTypeAutoRun which disable Autoplay on drives of unknown type?"},"content":{"rendered":"<p>\n<a HREF=\"http:\/\/www.microsoft.com\/technet\/prodtechnol\/windows2000serv\/reskit\/default.mspx\">\nThe Windows 2000 Resource Kit<\/a>\ndescribed\n<a HREF=\"http:\/\/www.microsoft.com\/technet\/prodtechnol\/windows2000serv\/reskit\/regentry\/93502.mspx\">\nthe <code>No&shy;Drive&shy;Type&shy;Auto&shy;Run<\/code> policy<\/a>\nas consisting of a bitfield whose values are as follows:\n<\/p>\n<table BORDER=\"1\" RULES=\"all\" STYLE=\"border-collapse: collapse\" CELLPADDING=\"3\">\n<tr>\n<th>Value<\/th>\n<th>Meaning<\/th>\n<\/tr>\n<tr>\n<td>0x1<\/td>\n<td>Disables Autoplay on drives of unknown type.<\/td>\n<\/tr>\n<tr>\n<td>0x4<\/td>\n<td>Disables Autoplay on removable drives.<\/td>\n<tr>\n<td>0x8<\/td>\n<td>Disables Autoplay on fixed drives.<\/td>\n<\/tr>\n<tr>\n<td>0x10<\/td>\n<td>Disables Autoplay on network drives.<\/td>\n<\/tr>\n<tr>\n<td>0x20<\/td>\n<td>Disables Autoplay on CD-ROM drives.<\/td>\n<\/tr>\n<tr>\n<td>0x40<\/td>\n<td>Disables Autoplay on RAM drives.<\/td>\n<\/tr>\n<tr>\n<td>0x80<\/td>\n<td>Disables Autoplay on drives of unknown type.<\/td>\n<\/tr>\n<tr>\n<td>0xFF<\/td>\n<td>Disables Autoplay on all types of drives.<\/td>\n<\/tr>\n<\/table>\n<p>\nHey, wait, two of the entries are the same.\nWhat&#8217;s the difference between 0x1 (<i>Disables Autoplay\non drives of unknown type<\/i>)\nand\n0x80 (<i>Disables Autoplay on drives of unknown type<\/i>)?\n<\/p>\n<p>\nThe values in the bitfield correspond to return values\nof the <code>Get&shy;Drive&shy;Type<\/code> function:\n<\/p>\n<pre>\n#define DRIVE_UNKNOWN     0\n#define DRIVE_NO_ROOT_DIR 1\n#define DRIVE_REMOVABLE   2\n#define DRIVE_FIXED       3\n#define DRIVE_REMOTE      4\n#define DRIVE_CDROM       5\n#define DRIVE_RAMDISK     6\n<\/pre>\n<p>\nThe value 0x1 corresponds to bit zero, which means that\nthe <code>Get&shy;Drive&shy;Type<\/code> function could not tell what\ntype of drive it is.\n<\/p>\n<p>\nOn the other hand, the value 0x80 does not correspond to\nany known return value of <code>Get&shy;Drive&shy;Type<\/code>.\nIt&#8217;s reserved for future use.\n<\/p>\n<p>\nMy guess as to how this happened is that the original table\ndid not have an entry for 0x80.\nThen somebody asked,\n&#8220;What does 0x80 mean?&#8221;\n<\/p>\n<p>\nThe response was,\n&#8220;It&#8217;s not used yet.\nIt&#8217;s for some future unknown drive type that has yet to be invented.&#8221;\n<\/p>\n<p>\n&#8220;Okay, thanks. I&#8217;ll just say that the drive type is unknown.&#8221;\n<\/p>\n<p>\nBingo, now you have two copies of &#8220;drives of unknown type.&#8221;\nThe 0x1 means &#8220;drives whose type cannot be determined&#8221;\nwhereas the 0x80 means\n&#8220;drives of a type not currently known to mankind.&#8221;\n<\/p>\n<p>\nSo let&#8217;s just pretend that the entry for\n0x80 reads &#8220;Reserved for future use.&#8221;\n(The page is archived content, so it&#8217;s not like anybody&#8217;s\ngoing to be updating it.)\n<\/p>\n<p>\n<b>Pre-emptive snarky comment<\/b>:\n&#8220;Autoplay is the stupidest feature on the face of the planet.&#8221;\nThe issue here is not discussing whether Autoplay is a good idea or\nbad idea.\nI&#8217;m trying to improve the documentation.\nI try to avoid providing tips\/support about\ncontroversial features because of the\n<a HREF=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2010\/04\/07\/9991494.aspx\">\nflame-fest that invariably results<\/a>.\nThis is an experiment to see if it&#8217;s safe to go back into the water.\n<\/p>\n<p>\n<b>Update<\/b>: Comments have been disabled because everybody wants to\ndiscuss whether Autoplay is a good idea or not, even though that topic\nwas explicitly taken off the table.\nStrike two.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Windows 2000 Resource Kit described the No&shy;Drive&shy;Type&shy;Auto&shy;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 [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[104],"class_list":["post-14323","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>The Windows 2000 Resource Kit described the No&shy;Drive&shy;Type&shy;Auto&shy;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 [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/14323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=14323"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/14323\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=14323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=14323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=14323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}