Windows CE Networking Team WebLog

Windows CE Networking - from NDIS to TCP to SOAP to VOIP and everything in between.

Overlooked features of Windows CE services.exe

The main job of services.exe on Windows CE is to host service DLLs and provide a nice interprocess communication mechanism between them and applications.  To a large extent it's very much like device.exe and in fact we've tried to make it easy to move dlls back and forth between them.

There are 3 services/networking/COM type features that are specific to services.exe since we think that they reflect what people are doing in services and make their lives easier.

Super services -- services.exe can be configured to listen on a TCP port or ports, IPV4+V6, for incoming network connections.  This allows it to spin up one thread for all listening sockets in a process rather than having each process spin up its own thread.

http://msdn.microsoft.com/library/en-us/wcecomm5/html/wce50conSuperServices.asp?frame=true

Local Address Change Notification -- If your service needs to take some special action when the CE device's IP address becomes available or unavailable, rather than spinning up a worker thread to listen for the various events it can instead rely upon the IOCTL_SERVICE_NOTIFY_ADDR_CHANGE.  Services.exe already spins up a thread to detect IP addr notifications and automatically calls your service with this IOCTL when such a change occurs.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecomm5/html/wce50lrfioctlservicenotifyaddrchange.asp

CoFreeUnusedLibraries - Again to try and minimize the number of worker threads and/or maintenance done per service, services.exe spins up a thread that every few minutes calls CoFreeUnusedLibraries().  (CE4.0->5.0 it's every 2 minutes, CE 6.0 it'll be every 15 minutes.)  So a service never needs to make this call itself.

[Author: John Spaith]

Published Tuesday, August 15, 2006 2:52 PM by cenet
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Windows CE Networking Team WebLog said:

Note: This is more of a geeky article for people who want to know how stuff works under the hood in Windows

November 7, 2006 2:17 PM

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Submit

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker