I am implementing a windows service. The service handles PRESHUTDOWN notification from service control manager. Notification is being received while the device goes to shutdown. Now I need to access a particular driver on receiving the this notification.
I am using CreateFile() API to get handle to the driver and send an IOCTL using the handle. But I am getting an error from CreateFile() (error code 2;parameter invalid). But same procedure works when I move the driver access code to a stand alone application.
Is there a limitation that services cannot access driver with CreateFile? (http://stackoverflow.com/questions/8263380/send-ioctl-to-windows-device-driver-createfile-fails)
How this can be avoided?