How to create a service with dependency to a wifi adapter in Windows

42 Views Asked by At

We are creating a service which needs to extract the MAC address of the wifi adapter. This is done by CreateService for the type SERVICE_AUTO_START with dependency to group +NetworkProvider.

It works reliably for the startup of the system. However if Windows awakes after the sleep mode, the service starts right before the wifi adapter is recognized and therefor it fails to read its MAC address.

Is there any sort of dependency which can be specified to CreateService in order to wait for the wifi adapter?

Currently the workaround is to set the service to restart on fail which of course is an ugly solution.

0

There are 0 best solutions below