Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 9th, 2005, 6:00 AM   #1
Esmirna
Newbie
 
Join Date: Feb 2005
Posts: 10
Rep Power: 0 Esmirna is on a distinguished road
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...
Esmirna is offline   Reply With Quote
Old Feb 9th, 2005, 8:27 AM   #2
Eggbert
Professional Programmer
 
Eggbert's Avatar
 
Join Date: Nov 2004
Posts: 250
Rep Power: 4 Eggbert is on a distinguished road
>i want to take control over the ports, so no one could acces to the devices attached there.
To what end?
Eggbert is offline   Reply With Quote
Old Feb 9th, 2005, 8:49 AM   #3
Esmirna
Newbie
 
Join Date: Feb 2005
Posts: 10
Rep Power: 0 Esmirna is on a distinguished road
mater thesis
Esmirna is offline   Reply With Quote
Old Feb 9th, 2005, 9:13 AM   #4
Eggbert
Professional Programmer
 
Eggbert's Avatar
 
Join Date: Nov 2004
Posts: 250
Rep Power: 4 Eggbert is on a distinguished road
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.
Eggbert is offline   Reply With Quote
Old Feb 9th, 2005, 9:28 AM   #5
Esmirna
Newbie
 
Join Date: Feb 2005
Posts: 10
Rep Power: 0 Esmirna is on a distinguished road
> 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
Esmirna is offline   Reply With Quote
Old Feb 9th, 2005, 10:17 AM   #6
Eggbert
Professional Programmer
 
Eggbert's Avatar
 
Join Date: Nov 2004
Posts: 250
Rep Power: 4 Eggbert is on a distinguished road
>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.
Eggbert is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:08 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC