From: Papps on
Hi,
I want to disable/enable the USB ports. So, that no one can can
access that device connected with that port. I tried the CreateFile
method with no SHARE rights & read/write access ... but it was not
useful.
Again, i found usbioctl.h header file with WINDDK there we
have a flag defines like IOCTL_INTERNAL_USB_ENABLE_PORT,
IOCTL_USB_HCD_DISABLE_PORT and IOCTL_USB_HCD_ENABLE_PORT but i don't
know how to use it.
Can any one show me a light ??

Thanks in anticipation.

From: Maxim S. Shatskih on
Find all devices of USB class and disable them using SetupDi calls.

After this, the USB ports will be disabled for non-admins - and it is
impossible anyway to hide them from admins.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim(a)storagecraft.com
http://www.storagecraft.com

"Papps" <pappu.kumar(a)gmail.com> wrote in message
news:1144747674.309331.142710(a)u72g2000cwu.googlegroups.com...
> Hi,
> I want to disable/enable the USB ports. So, that no one can can
> access that device connected with that port. I tried the CreateFile
> method with no SHARE rights & read/write access ... but it was not
> useful.
> Again, i found usbioctl.h header file with WINDDK there we
> have a flag defines like IOCTL_INTERNAL_USB_ENABLE_PORT,
> IOCTL_USB_HCD_DISABLE_PORT and IOCTL_USB_HCD_ENABLE_PORT but i don't
> know how to use it.
> Can any one show me a light ??
>
> Thanks in anticipation.
>

From: Papps on
Thanks Shatskih...
But i have tried the SetupDi method & it
didn't work for me. i had tried to enumerate all USB Devices using
SetupDiGetClassDevs and then SetupDiEnumDeviceInterfaces. But it always
returned as "No More Items". However, it works for the "ports" class
and enumerate the COM1 port. But besides this for all the device
classes it returns "No More Items".
Can you tell me what can be the problem? surely, the
ClassGUID is not a problem since i am using SetupDiClassGuidsFromName
method to get that.

Please help me out. If possible give some examples or API
functions by which i can do this.

From: Maxim S. Shatskih on
> didn't work for me. i had tried to enumerate all USB Devices using
> SetupDiGetClassDevs and then SetupDiEnumDeviceInterfaces.

Enum devices themselves, and not interfaces.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim(a)storagecraft.com
http://www.storagecraft.com