From: SamCPP on
Hi,

I am trying to build a diagnostic utility for an application that I have
written in C++ (Win32). The application uses a COM port but on occasion, the
COM port may be locked by another application.

I can successfully retrieve all currently running PIDs (and their associated
image names) but is there any way to retrieve any open handles to COM ports
that they may have? The sysinternals program "handle" does not retrieve
handles to COM ports.

Thanks,
Sam
From: Kerem G�mr�kc� on
Hi Sam,

try "Process Explorer",...

Press Ctrl+H for handles in lower pane
and Ctrl+D for loaded libaries,...

You can also search for handles by
pressing Ctrl+F

Regards

Kerem

--
--
-----------------------
Beste Gr�sse / Best regards / Votre bien devoue
Kerem G�mr�kc�
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

"SamCPP" <SamCPP(a)discussions.microsoft.com> schrieb im Newsbeitrag
news:81901330-6456-4E6F-A8F6-9AF12F079D38(a)microsoft.com...
> Hi,
>
> I am trying to build a diagnostic utility for an application that I have
> written in C++ (Win32). The application uses a COM port but on occasion,
the
> COM port may be locked by another application.
>
> I can successfully retrieve all currently running PIDs (and their
associated
> image names) but is there any way to retrieve any open handles to COM
ports
> that they may have? The sysinternals program "handle" does not retrieve
> handles to COM ports.
>
> Thanks,
> Sam


From: SamCPP on
Hi Kerem,

Thanks for your reply. I see that I can locate the file through process
explorer but how can I obtain that information programmatically (in my Win32
application)?

Thanks,
Sam

"Kerem Gümrükcü" wrote:

> Hi Sam,
>
> try "Process Explorer",...
>
> Press Ctrl+H for handles in lower pane
> and Ctrl+D for loaded libaries,...
>
> You can also search for handles by
> pressing Ctrl+F
>
> Regards
>
> Kerem
>
> --
> --
> -----------------------
> Beste Grüsse / Best regards / Votre bien devoue
> Kerem Gümrükcü
> Microsoft Live Space: http://kerem-g.spaces.live.com/
> Latest Open-Source Projects: http://entwicklung.junetz.de
> -----------------------
> "This reply is provided as is, without warranty express or implied."
>
> "SamCPP" <SamCPP(a)discussions.microsoft.com> schrieb im Newsbeitrag
> news:81901330-6456-4E6F-A8F6-9AF12F079D38(a)microsoft.com...
> > Hi,
> >
> > I am trying to build a diagnostic utility for an application that I have
> > written in C++ (Win32). The application uses a COM port but on occasion,
> the
> > COM port may be locked by another application.
> >
> > I can successfully retrieve all currently running PIDs (and their
> associated
> > image names) but is there any way to retrieve any open handles to COM
> ports
> > that they may have? The sysinternals program "handle" does not retrieve
> > handles to COM ports.
> >
> > Thanks,
> > Sam
>
>
>
From: Kerem G�mr�kc� on
Hi Sam,

there are some "partially" undocumented apis for this:
http://www.woodmann.com/forum/showthread.php?t=6318
http://forum.sysinternals.com/forum_posts.asp?TID=14546&KW=open+handles
http://forum.sysinternals.com/forum_posts.asp?TID=14268&KW=open+handles

I see you are a member of sysinternals forum. You will
find a lot of information about this topic there, you also can
ask individuals there how they did something,...

But these examples are good enough,...

Hope this Helps,...

Regards

Kerem

--
--
-----------------------
Beste Gr�sse / Best regards / Votre bien devoue
Kerem G�mr�kc�
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

"SamCPP" <SamCPP(a)discussions.microsoft.com> schrieb im Newsbeitrag
news:C432B69C-8B68-41AC-BA32-577EAF0BD291(a)microsoft.com...
> Hi Kerem,
>
> Thanks for your reply. I see that I can locate the file through process
> explorer but how can I obtain that information programmatically (in my
Win32
> application)?
>
> Thanks,
> Sam
>
> "Kerem G�mr�kc�" wrote:
>
> > Hi Sam,
> >
> > try "Process Explorer",...
> >
> > Press Ctrl+H for handles in lower pane
> > and Ctrl+D for loaded libaries,...
> >
> > You can also search for handles by
> > pressing Ctrl+F
> >
> > Regards
> >
> > Kerem
> >
> > --
> > --
> > -----------------------
> > Beste Gr�sse / Best regards / Votre bien devoue
> > Kerem G�mr�kc�
> > Microsoft Live Space: http://kerem-g.spaces.live.com/
> > Latest Open-Source Projects: http://entwicklung.junetz.de
> > -----------------------
> > "This reply is provided as is, without warranty express or implied."
> >
> > "SamCPP" <SamCPP(a)discussions.microsoft.com> schrieb im Newsbeitrag
> > news:81901330-6456-4E6F-A8F6-9AF12F079D38(a)microsoft.com...
> > > Hi,
> > >
> > > I am trying to build a diagnostic utility for an application that I ha
ve
> > > written in C++ (Win32). The application uses a COM port but on
occasion,
> > the
> > > COM port may be locked by another application.
> > >
> > > I can successfully retrieve all currently running PIDs (and their
> > associated
> > > image names) but is there any way to retrieve any open handles to COM
> > ports
> > > that they may have? The sysinternals program "handle" does not
retrieve
> > > handles to COM ports.
> > >
> > > Thanks,
> > > Sam
> >
> >
> >


From: SamCPP on
Thanks Kerem. I obviously didn't find those threads but I think that is what
I was looking for.

Cheers,
Sam

"Kerem Gümrükcü" wrote:

> Hi Sam,
>
> there are some "partially" undocumented apis for this:
> http://www.woodmann.com/forum/showthread.php?t=6318
> http://forum.sysinternals.com/forum_posts.asp?TID=14546&KW=open+handles
> http://forum.sysinternals.com/forum_posts.asp?TID=14268&KW=open+handles
>
> I see you are a member of sysinternals forum. You will
> find a lot of information about this topic there, you also can
> ask individuals there how they did something,...
>
> But these examples are good enough,...
>
> Hope this Helps,...
>
> Regards
>
> Kerem
>
> --
> --
> -----------------------
> Beste Grüsse / Best regards / Votre bien devoue
> Kerem Gümrükcü
> Microsoft Live Space: http://kerem-g.spaces.live.com/
> Latest Open-Source Projects: http://entwicklung.junetz.de
> -----------------------
> "This reply is provided as is, without warranty express or implied."
>
> "SamCPP" <SamCPP(a)discussions.microsoft.com> schrieb im Newsbeitrag
> news:C432B69C-8B68-41AC-BA32-577EAF0BD291(a)microsoft.com...
> > Hi Kerem,
> >
> > Thanks for your reply. I see that I can locate the file through process
> > explorer but how can I obtain that information programmatically (in my
> Win32
> > application)?
> >
> > Thanks,
> > Sam
> >
> > "Kerem Gümrükcü" wrote:
> >
> > > Hi Sam,
> > >
> > > try "Process Explorer",...
> > >
> > > Press Ctrl+H for handles in lower pane
> > > and Ctrl+D for loaded libaries,...
> > >
> > > You can also search for handles by
> > > pressing Ctrl+F
> > >
> > > Regards
> > >
> > > Kerem
> > >
> > > --
> > > --
> > > -----------------------
> > > Beste Grüsse / Best regards / Votre bien devoue
> > > Kerem Gümrükcü
> > > Microsoft Live Space: http://kerem-g.spaces.live.com/
> > > Latest Open-Source Projects: http://entwicklung.junetz.de
> > > -----------------------
> > > "This reply is provided as is, without warranty express or implied."
> > >
> > > "SamCPP" <SamCPP(a)discussions.microsoft.com> schrieb im Newsbeitrag
> > > news:81901330-6456-4E6F-A8F6-9AF12F079D38(a)microsoft.com...
> > > > Hi,
> > > >
> > > > I am trying to build a diagnostic utility for an application that I ha
> ve
> > > > written in C++ (Win32). The application uses a COM port but on
> occasion,
> > > the
> > > > COM port may be locked by another application.
> > > >
> > > > I can successfully retrieve all currently running PIDs (and their
> > > associated
> > > > image names) but is there any way to retrieve any open handles to COM
> > > ports
> > > > that they may have? The sysinternals program "handle" does not
> retrieve
> > > > handles to COM ports.
> > > >
> > > > Thanks,
> > > > Sam
> > >
> > >
> > >
>
>
>