Wednesday, August 21, 2013

Wireless - No networks available (a windows services story)

This morning, I was turning on the company laptop to get ready to start my working day.  Sadly my wifi connection icon was not detecting networks at all (not even trying).  Digging around in the services, I found Wireless autoconfig not running due to Extensible Authentication Protocol dependency failure.  EAP wouldn't start either due to CNG Key Isolation dependency failure.  CNG wouldn't start due to:

Service Control Manager Event 7000
The CNG Key Isolation service failed to start due to the following error:
The service did not respond to the start or control request in a timely fashion.

After this it occurred to me that I may have broken by system while connected to a LAN wire the day before.  I had been trying to troubleshoot show smartcard -> mstsc.exe client device redirection interactions, and part of this effort had me isolating windows services to separate processes.  So with this, two things learned

1) CNG Key Isolation service needs to be in a shared process and not its own process
2) EAP needs to be in its own process, and won't allow you to configure it as shared.

For those that may have no idea what I'm talking about with shared/own process in related to service, you can see what I'm talking about in task manager, or tasklist /svc.  In task manager you see processes called svchost.exe, which when you right click and say "go to services", it flips you to the services tab and shows some highlighted service names.  These are the services that are attached to that process.  Windows will often stuff several service processes into a single process id.  In some cases this can be a problem, where one service failing can cause multiple services to enter a stopped state of the process crashes.  But in my case, I was trying to isolate activity to individual services using Sysinternal's ProcMon tool.  When you isolate the processes to their "own" process, you can see them as individual PID's here and also in netmon, or other tools that do process monitoring/debugging.  If you ever find yourself wanting to play around with this, you can use:

sc.exe config [servicename] type= own
sc.exe config [servicename] type= shared

Servicename is the actual service name, not the cute display name that most people know the service by.  I add the whole sc.exe (with extension) in case you run it from powershell [sc is an alias for set-content, alias has priority over exe files in the %path%].  Also, mind the space between the equals sign and the process type.  There are a few other service type's which may have some use in other ways, but don't ask me what they do.

No comments:

Post a Comment