how to enable/disable access to USB/Serial/Parallel port for process?

Hi all!

Question is very simple: how to enable/disable access to USB/Serial/Parallel
port for process?
They means just control access to the correspondent devices, IMHO.

As for file systems it’s well-known question, to enable/disable access to
the file, CDROM, etc: this list exactly for that. But for Win32 API access
to the COM? port actually the same as to the usual files. I know that by
using CreateFile its possible to open COMx and LPTx.

I’m not sure, but I think, CreateFile(“COM1”) routes in the Kernel32 user
mode part and this IRP_MJ_CREATE IRP goes to the correspondent COM port
device object. Same with other Win32 API, like ReadFile/WriteFile with
handle from such CreateFile(“COM1”). Please, confirm that or correct me.
By this reason I ask: What device objects shell I hook for that? Is it
\DosDevices\COM1:\ or smth like that? And what steps requires to hook
this devices, are they the same as for hooking, for example, local drives?

Finally, what about USB ports - I haven’t experience here. What should I do
to enable/disable access to USB port for process?

Valery


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com