0

I need to be able to switch on/off the operation of the USB ports on a WinCE6 system within my application based on user input.

I've seen ways in normal Windows to do this that use "Setupapi.h", however, this isn't part of WinCE6 so isn't usable.

http://social.msdn.microsoft.com/Forums/en-NZ/windowssdk/thread/3f812f32-3f97-4b35-b878-be5f5327a4e8

I'm aware of the option about modifying the USB host driver, but I was hoping for a simpler solution. eg Using some kind of API call from within my application?

Dave
  • 1,696
  • 4
  • 23
  • 47

1 Answers1

0

It would appear that an API for this isn't available, however, there is a workaround.

In my case, I'm trying to prevent pen drives from being used for security purposes.

As such, I was able to achieve this by just using registry values!

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor\Start

A value of 3 allows the USB Storage device to work. A value of 4 prevents it from working.

http://support.microsoft.com/kb/103000

Dave
  • 1,696
  • 4
  • 23
  • 47