Hi everyone,
I'm running into a recurring issue (Code 38) while adapting a WDM driver for compatibility with Windows 10. To isolate the problem, I tested it with a simple WDF sample driver, but the issue persists.
Here’s the setup:
I have two .inf files:
-
bridge.inf – Installs a driver for a bridge chip (System class).
-
CustSerial.inf – Installs a driver for virtual serial ports (Ports class) on a UART over the local bus.
Both .inf files reference the same service name and .sys file. The installation process goes like this:
-
The bridge.inf installs without issues and enumerates the serial ports under "Other Devices" in Device Manager, as expected.
-
I then select one of the unknown devices, manually install the CustSerial.inf, and the system prompts for a reboot.
-
After rebooting, the device appears under "Ports" with the correct COMx assignment, but it shows:
"Code 38 – Windows cannot load the device driver for this hardware because a previous instance of the driver is still in memory."
It seems the issue stems from having another instance of the driver loaded (i.e., for the bridge device). This configuration worked fine with the old WDM driver on Windows XP, but it’s failing on Windows 10. Is this approach—using the same service and .sys for two .inf files—no longer supported in modern Windows?
To rule out other factors, I tested using a simple WDM driver with distinct names (to avoid conflicts), but the same Code 38 behavior occurs.
Has anyone encountered this or have insights into what might have changed between XP and Windows 10? Any suggestions for debugging or resolving this would be appreciated!
Thanks,