title: GetLogicalDrives and bit position 23
body: <p>As far as I understand, if I would like to check for <code>X:\</code> drive, It would be bit 23 if using the <code>GetLogicalDrives</code> function; so, I am trying to test that, but it turns to <code>0</code> if I set the bitmask to <code>&gt;&gt;=23</code>.</p>
  <p>This is my code:</p>
  <pre><code>DWORD drives;
  
  drives = GetLogicalDrives();
  
  drives &gt;&gt;= 23;
  
  if (drives == 0)
  {
      wprintf(L&quot;Error: %lu\n&quot;, GetLastError());
  }
  else if (drives &amp; 1)
  {
      wprintf(L&quot;Drive is mounted\n&quot;);
  
  }       
  else
  {
      wprintf(L&quot;Drive is not mounted\n&quot;);
  }
  </code></pre>
  <p>Now, if I set <code>drives</code>, for example, to <code>17</code>, which, I believe, would refers to letter <code>R</code>, It will be tested in the first <code>else</code> and, if it is not mounted, will go to the second; so it will show <code>Drive is not mounted</code>. Same if I set <code>drives&gt;&gt;=1</code>, which refers to B, I think.</p>
  <p>It will get <code>0</code> only from <code>19</code> (letter <code>T</code>) to <code>25</code> (letter <code>Z</code>), if they are not mounted.</p>
  <p>What am I doing wrong?</p>