Error 0xC0000142 after opening a device (v3.0.21.329, Vista Home Premium, 32bit)

  1. Cpu x86, 32bit
  2. Os: Windows Vista Home Premium, 32bit, genuine
  3. Comodo Firewall v3.0.21.329
  4. Bug description follows:
    4.1 Create a device with a simple device driver (IoCreateDevice())
    4.2 From the userspace call CreateFile() to open the device
    4.3 Close the handle to the device with CloseHandle()
    4.4 Do NOT close the userspace application that opened the device
    4.5 Result: cannot shutdown, nor logoff, EACH executable called after
    attempting to shutdown/logoff results in a 0xC0000142 error (Application
    not initialized correctly)
  5. I wasn’t able to fix the problem, you have to close the application that
    uses the device before shutting the system down… But that’s not very
    handy if you’re dealing with a resident application (like my IR remote controller)
  6. Description follows:
    6.1 Firewall security level: Train with Safe Mode
    6.2 Defense+: Train with Safe Mode
    6.3 Other settings: left to default
    6.4 My executable has been allowed to run and load the driver
  7. Account: Administrator with full rights, UAC: enabled.

ps
I squeezed down my source code such that the driver ONLY creates the device
on load, and only destroy the device on unload. The usermode program just
open the device with CreateFile() and immediately close it calling CloseHandle()
without accessing or using the device in any way.