Click here to get back home

detect dead processes

 HomeNewsGroups | Search | About
 microsoft.public.smartphone.developer    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
Get Chitika Premium
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
running processes? April 11, 2007, 2:02 am
smartphone DNS.GeHostEntry() "dead network" error April 17, 2007, 11:54 am
detect SP from PPC November 15, 2007, 7:26 am
Detect incoming call in C#.net June 7, 2005, 6:21 am
how to detect an incoming call? December 5, 2005, 3:18 pm
How to detect changed Simcard March 29, 2007, 7:18 am
How to detect changed Simcard March 29, 2007, 7:18 am
How to detect if flash storage is removable? July 5, 2005, 9:25 am
How to detect connected Bluetooth headset? July 12, 2005, 10:08 am
how do you detect a phone call in progress? January 10, 2006, 12:41 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap