title: ioctrl using SCSI pass through
body: <p>Using Windows I can easily communicate with my USB device using the following simplified code:</p>
  
  <pre><code>DWORD dwJunk;    // discard results from DeviceIOControl()
  int   iReply;
  char  cBuffer[100];
  // cBuffer is initialized here.
  HANDLE hDevice; // handle to the drive to be examined 
  CString sDrive = _T(\\\\.\\H:); // drive H: for this test
  hDevice = CreateFile(sDrive,            // drive to open
     GENERIC_READ | GENERIC_WRITE,        // read and write access to the drive
     FILE_SHARE_READ | FILE_SHARE_WRITE,  // share mode           
     NULL,                                // default security attributes
     OPEN_EXISTING,                       // disposition
     0,                                   // file attributes
     NULL);                               // do not copy file attributes
  
  iReply = DeviceIoControl(hDevice, IOCTL_SCSI_PASS_THROUGH_DIRECT, &amp;cBuffer, sizeof(cBuffer), &amp;cBuffer, sizeof(cBuffer), &amp;dwJunk, (LPOVERLAPPED)NULL);
  </code></pre>
  
  <p>I'm trying to do the same in linux but have not been able to figure out the ioctrl() parameters, or better put the structure. A code snippet would be vey much appreciated. Thanks.</p>