title: SPTI/SCSI operations from a Windows 7 application
body: <p>I need some help regarding a security problem in updating some Windows software for communicating with a non-storage SCSI device.</p>
  
  <p>The original software was written for Windows XP as a DLL, and talked with the device via Adaptec's ASPI API. ASPI didn't really have any security, so any application run by any user could use my DLL to talk to one of these devices, and everything worked great.</p>
  
  <p>I'm now updating the software to work with Windows 7 using Microsoft's modern SPTI (SCSI Pass-Through Interface) API. Things work fine with SPTI under XP, but Windows 7 has much tighter security, and for normal users or even administrators, SPTI calls return an error indicating insufficient permissions. If I log in using the hidden "Administrator" account, my software runs fine with SPTI, but that's not an acceptable deployment option.</p>
  
  <p>Here are some alternatives I've looked into so far, in order of decreasing level of having to rewrite existing code:</p>
  
  <ul>
  <li>Spinning off a thread and escalating its privileges to be pretend to be "Administrator" so it can talk with SPTI. [I haven't been able to get this to work using LogonUser()/ImpersonateLoggedOnUser()/LoadUserProfile(); the call to LoadUserProfile() fails, and SPTI calls fail as well with an insufficient permissions error.]</li>
  <li>Writing a Windows Service that has adequate permissions to talk with SPTI, and then having my DLL talk with that service.</li>
  <li>Userspace (UMDF) driver. It would be an expensive rewrite, and it's not clear to me whether UMDF supports accessing SCSI devices.</li>
  <li>Kernel (KMDF) driver. Should work, but would be a longer, more expensive rewrite.</li>
  </ul>
  
  <p>I hope the community here can help with some wisdom/experience/ideas that will let my code talk to this SCSI device under Windows 7, ideally without having to rewrite too much.</p>