Link to home
Start Free TrialLog in
Avatar of juberti
juberti

asked on

How can i list or detect active mailslots?

Hello,
I'm trying to detect active mailslots running on system.I normally can detect if i know the exact name of mailslot that active but if its having some randomly generated characters to extend that name i can't detect it.
So I'm curious if is there a way to detect or list active mailslots running on the system?
Regards
Avatar of tampnic
tampnic
Flag of United Kingdom of Great Britain and Northern Ireland image

I am assuming we are talking about Windows here. Don't know if mailslots are used on *NIX systems.

Get a copy of "process explorer"  from sysinternals http://www.sysinternals.com/Utilities/ProcessExplorer.html

Start PE and search (File Handle) for \Device\Mailslot:

Alternatively, if you need to do this from code you can enumerate the files in the \\.\mailslot directory.

Cheers,
  Chris
Corrected link for Process Explorer - the one above is dead

http://technet.microsoft.com/en-us/sysinternals/bb896653

Cheers,
   Chris
Avatar of juberti
juberti

ASKER

Hello tampnic,
I'm trying to add such check for my local security program which im using for my own usage, So basically i need a code sample for it:)
Thanks for your help.
ASKER CERTIFIED SOLUTION
Avatar of tampnic
tampnic
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of juberti

ASKER

Hello,
Somehow it doesnt list or detect mailslots in vista :/, I dunno why or whats wrong...
Regards
You might need elevated privileges to view the mailslots. Try altering the option Linker-> Manifest File -> UAC Execution Level to "requireAdministator". This will cause your program to ask for elevated privileges before executing.

Cheers,
  Chris