Click here to get back home

detect dead processes

 HomeNewsGroups | Search | About
 microsoft.public.smartphone    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
detect dead processes jnasti 11-08-2007
Posted by jnasti on November 8, 2007, 4:34 pm
Please log in for more thread options
If my service dll generates HANDLEs to it's clients during a
XXX_Initialize call, then how can I detect if their process is dead
without polling? I need to do this if they aren't calling
XXX_Deinitialize, to free the handle and cleanup. Clients will
statically link to my library.

thanks


Posted by Bruce Eitman [eMVP] on November 8, 2007, 5:21 pm
Please log in for more thread options
You have a service AND the apps are statically linking to your library????
I don't think that makes sense. That would mean that they are not really
going through it as a service, but instead doing a LoadLibrary on your DLL.

What do you mean by "dead"?

What are XXX_Initialize and XXX_Deinitialize, do you mean XXX_Init and
XXX_Deinit. If they were actually using your dll as a service, the deinit
would be called automatically.

I think there is a lot you are not telling us about what you are really
doing.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

> If my service dll generates HANDLEs to it's clients during a
> XXX_Initialize call, then how can I detect if their process is dead
> without polling? I need to do this if they aren't calling
> XXX_Deinitialize, to free the handle and cleanup. Clients will
> statically link to my library.
>
> thanks
>



Posted by jnasti on November 8, 2007, 6:26 pm
Please log in for more thread options
Sorry, let me try this again. I tried sounding like I knew what I was
talking about, but that failed ;o. I'm new to the Windows
Environment, please bear with me.

I'm looking to create something similar to the RIL in terms of a proxy
and a service. Clients (applications, services, drivers, etc) would
link to the proxy dll to talk to the service through a set of APIs. A
client would call something like RIL_Initialize to get a HANDLE, as
well as set up callback functions, etc.

I'm just wondering how I could figure out if a client that was
registered successfully to my service and if that client's process was
killed in Task Manager or if the client crashed, how could my service
know so it could clean itself up? As you mention, if the process is
no longer running the Deinit would be called automatically when my
proxy dll was unloaded by the client? What component calls it? Is
this different if the client is in the application layer? Or if the
client is in the device.exe layer? or even in the services.exe layer
itself?

Hope that is a little better, I appreciate your help.

- Joe


Posted by Paul Monson on November 8, 2007, 9:05 pm
Please log in for more thread options
The handle count should be decremented by the OS when the OS cleans up
your process. When the handle count reaches zero I believe Deinit
should be called.

Paul Monson
Intrinsyc


jnasti wrote:
> Sorry, let me try this again. I tried sounding like I knew what I was
> talking about, but that failed ;o. I'm new to the Windows
> Environment, please bear with me.
>
> I'm looking to create something similar to the RIL in terms of a proxy
> and a service. Clients (applications, services, drivers, etc) would
> link to the proxy dll to talk to the service through a set of APIs. A
> client would call something like RIL_Initialize to get a HANDLE, as
> well as set up callback functions, etc.
>
> I'm just wondering how I could figure out if a client that was
> registered successfully to my service and if that client's process was
> killed in Task Manager or if the client crashed, how could my service
> know so it could clean itself up? As you mention, if the process is
> no longer running the Deinit would be called automatically when my
> proxy dll was unloaded by the client? What component calls it? Is
> this different if the client is in the application layer? Or if the
> client is in the device.exe layer? or even in the services.exe layer
> itself?
>
> Hope that is a little better, I appreciate your help.
>
> - Joe
>

Posted by Bruce Eitman [eMVP] on November 9, 2007, 8:35 am
Please log in for more thread options
Service has special meaning. I am beginning to think that you are applying
service to something that isn't really a service.

It seems to me that you have a DLL, nothing more than that. Not a service.
Since it isn't a service, you don't have the functionality defined or
managed for a service.

Is this correct?

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

> Sorry, let me try this again. I tried sounding like I knew what I was
> talking about, but that failed ;o. I'm new to the Windows
> Environment, please bear with me.
>
> I'm looking to create something similar to the RIL in terms of a proxy
> and a service. Clients (applications, services, drivers, etc) would
> link to the proxy dll to talk to the service through a set of APIs. A
> client would call something like RIL_Initialize to get a HANDLE, as
> well as set up callback functions, etc.
>
> I'm just wondering how I could figure out if a client that was
> registered successfully to my service and if that client's process was
> killed in Task Manager or if the client crashed, how could my service
> know so it could clean itself up? As you mention, if the process is
> no longer running the Deinit would be called automatically when my
> proxy dll was unloaded by the client? What component calls it? Is
> this different if the client is in the application layer? Or if the
> client is in the device.exe layer? or even in the services.exe layer
> itself?
>
> Hope that is a little better, I appreciate your help.
>
> - Joe
>



Similar ThreadsPosted
how do you detect a call is in progress? January 9, 2006, 1:09 am
Detect Silent/Vibrate Mode in Smartphone March 7, 2007, 4:13 am
how to detect system alarm/appointments events? July 3, 2007, 12:55 am
Bluetooth auto-detect / synchro on PC when approaching with SPV C500 September 5, 2005, 10:31 am
Windows Mobile 2005 does not sync email unless client processes email first July 5, 2006, 12:42 pm
USB dead on my Jasjar! January 24, 2006, 5:35 am
Dead Orange SPV m5000 March 18, 2006, 4:31 pm
"mark all" -- again......is this forum dead or something? March 12, 2008, 10:00 pm
DST 2007 Updates link for Windows Mobile 2005 PocketPC & Smartphones are DEAD! March 5, 2007, 11:41 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap