![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2005
Posts: 10
Rep Power: 0
![]() |
Controlling ports
i want to take control over the ports, so no one could acces to the devices attached there. When trying to use the CreateFile function, i don't know where the lpDeviceName is stored so i cannot call it. Where can i find the root and name of all ports or devices of a computer? for example usb ports, cdrom...
|
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Nov 2004
Posts: 250
Rep Power: 4
![]() |
>i want to take control over the ports, so no one could acces to the devices attached there.
To what end? |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Feb 2005
Posts: 10
Rep Power: 0
![]() |
mater thesis
|
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Nov 2004
Posts: 250
Rep Power: 4
![]() |
The easiest way to lock a port is to disable the service/daemon. This terminates the device driver and nobody can access the device. Alternatively you could truly lock the device by writing or reading to it infinitely to create your own micro-DoS attack.
However, I imagine that you want your code to be able to access the device while disallowing any other programs access. For that, you need to work with the device driver (through the proper interface) to lock it for your exclusive use. How to go about that depends heavily on your system, hardware, and the driver involved. |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Feb 2005
Posts: 10
Rep Power: 0
![]() |
> you need to work with the device driver
i'm working with a wXP, so i donīt know where to look for the interface of their usb drivers. msdn maybe? but i still donīt understand why canīt i open a handle of the port using CreateFie and then block any other acces by open it on a restricted mode |
|
|
|
|
|
#6 |
|
Professional Programmer
Join Date: Nov 2004
Posts: 250
Rep Power: 4
![]() |
>i still donīt understand why canīt i open a handle of the port using
>CreateFie and then block any other acces by open it on a restricted mode CreateFile will not work if you don't have the correct name to open. This may give you some ideas on finding the name. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|