Using a mutex in a Windows 10 device driver resulting in code 39

0

I'm developing a Windows 10 device driver for a virtual camera based off the avstream/avscamera example in the windows driver samples repository. The driver will gets its frames from a separately run Windows app via shared memory synchronized by a Mutex.

I can build the driver without errors, but when I try to install it with Hdwwiz.exe, I get the following error:

Windows cannot load the device driver for this hardware. The driver may be corrupted or missing (Code 39).

Any ideas/suggestions?

If I comment out all the Mutex and Shared memory methods, there are no problems in installing the driver. If I uncomment just the line that does the CreateMutexA call so it reads as:

void myinitfunction() {
mutex = CreateMutexA(&securityAttributes, false, "mymutexname"); }

I again get the Code 39 error.

This suggests that I'm linking the runtime incorrectly.

Possibly relevant info: I'm trying to install the 64 bit version of the driver on a laptop that has a 64 bit build version of 17134.rs4_release.180410-1804 I've got the Windows SDK Version set to 10.0.17763.0. (the build failed when the SDK version was set to 17134 because the Windows Kits/10/bin/10.0.17134.0 directory didn't contain an instance of stampinf.exe file).

My library directories are:

C:\Program Files %28x86%29\Windows Kits\10\Lib\10.0.17763.0\um\x64; C:\Program Files %28x86%29\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64\store; $(LibraryPath)

The Windows/inf/setupapi.dev.log file doesn't tell me much more. It has the text:

Device Status: 0x01802001, Problem: 0x0 (0x00000000) dvi: {Restarting Devices} 11:09:38.030 dvi: Start: ROOT\AVSCAMERA\0000 !!! dvi: Device not started: Device has problem: 0x27 (CM_PROB_DRIVER_FAILED_LOAD), problem status: 0xc0000034. dvi: {Restarting Devices exit} 11:09:38.064 dvi: {Configure Device - exit(0x00000000)} 11:09:38.065 dvi: Device Status: 0x01802401, Problem: 0x27 Device Status: 0x01802001, Problem: 0x0 (0x00000000) dvi: {Restarting Devices} 11:09:38.030 dvi: Start: ROOT\AVSCAMERA\0000 !!! dvi: Device not started: Device has problem: 0x27 (CM_PROB_DRIVER_FAILED_LOAD), problem status: 0xc0000034. dvi: {Restarting Devices exit} 11:09:38.064 dvi: {Configure Device - exit(0x00000000)} 11:09:38.065 dvi: Device Status: 0x01802401, Problem: 0x27

windows
installation
driver
device
code39
asked on Stack Overflow Dec 19, 2018 by Eric Davies

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0