none
Error 32: File is in use by another process when installing a driver RRS feed

  • Question

  • Hi,
    I've been developing a driver which creates a virtual COM port and redirects any data it receives over TCP/IP and vice versa.
    I was able to install the driver just fine for a while, with the "occasional" cleanup and system reboot (meaning I completely uninstalled the driver and rebooted the system every time I needed to test).
    Recently, however, my testing was put to a complete halt when installing the driver simply resulted in a "devcon.exe failed", and the following messages in %WINDIR%\inf\setupapi.dev.log:

        flq: {_commit_copyfile}
        flq:   CopyFile: 'c:\users\dominik.wandernoth\desktop\wdk8samples\c++\wdk 8.0 samples\virtual serial driver sample\solution\comport\x64\win7debug\WudfUpdate_01011.dll'
        flq:     to: 'C:\Users\DOMINI~1.WAN\AppData\Local\Temp\{7479e3d9-28ba-796c-8973-cd13a8479257}\SET1E4B.tmp'
        flq:   MoveFile: 'C:\Users\DOMINI~1.WAN\AppData\Local\Temp\{7479e3d9-28ba-796c-8973-cd13a8479257}\SET1E4B.tmp'
        flq:     to: 'C:\Users\DOMINI~1.WAN\AppData\Local\Temp\{7479e3d9-28ba-796c-8973-cd13a8479257}\WudfUpdate_01011.dll'
    !!! flq:   MoveFile: FAILED!
    !!! flq:   Error 32: The process cannot access the file because it is being used by another process.
    !!! flq:   Windows could not copy a boot file 'C:\Users\DOMINI~1.WAN\AppData\Local\Temp\{7479e3d9-28ba-796c-8973-cd13a8479257}\WudfUpdate_01011.dll' due to the presence of an in-use file.
    !!! flq:   Error installing file (0x00000005)
    !!! flq:   Error 5: Access is denied.
    !   flq:     SourceFile   - 'c:\users\dominik.wandernoth\desktop\wdk8samples\c++\wdk 8.0 samples\virtual serial driver sample\solution\comport\x64\win7debug\WudfUpdate_01011.dll'
        flq:     TempFile     - 'C:\Users\DOMINI~1.WAN\AppData\Local\Temp\{7479e3d9-28ba-796c-8973-cd13a8479257}\SET1E4B.tmp'
    !   flq:     TargetFile   - 'C:\Users\DOMINI~1.WAN\AppData\Local\Temp\{7479e3d9-28ba-796c-8973-cd13a8479257}\WudfUpdate_01011.dll'
        flq:   {SPFQNOTIFY_COPYERROR}
    !!! sto:     Failed to copy file 'c:\users\dominik.wandernoth\desktop\wdk8samples\c++\wdk 8.0 samples\virtual serial driver sample\solution\comport\x64\win7debug\WudfUpdate_01011.dll' to 'C:\Users\DOMINI~1.WAN\AppData\Local\Temp\{7479e3d9-28ba-796c-8973-cd13a8479257}\WudfUpdate_01011.dll'. Error = 0x00000005
        sto:     File 'c:\users\dominik.wandernoth\desktop\wdk8samples\c++\wdk 8.0 samples\virtual serial driver sample\solution\comport\x64\win7debug\WudfUpdate_01011.dll' is not in use by any processes.
        flq:   {SPFQNOTIFY_COPYERROR - returned 0x00000000}
    !!! flq:     SPFQNOTIFY_COPYERROR: returned SPFQOPERATION_ABORT.
    !!! flq:     Error 2: The system cannot find the file specified.
        flq: {_commit_copyfile exit(0x00000002)}

    Does anyone know why this error might be occurring? When I try to find the file that is apparently in use, it doesn't even exist.
    I run devcon.exe from a command line with elevated privileges (right click, run as administrator) and it used to work.
    Before installing the driver again, I removed the previous version by using devcon.exe remove *virtualserial*, and pnputil.exe -d oem108.inf (which was the *.inf file for the driver in question); then I rebooted the system and installed again. This was often necessary, because I would get the same error otherwise. I never quite understood why I was getting the error, but as long as I could work around it, I was fine with it.
    Any help is greatly appreciated. Thanks in advance!

    EDIT1: Turns out the file "SET1E4B.tmp" does exist, but it's not even remotely in use (I can rename, move and edit the file; Unlocker says that no processes are accessing the file). The reason I couldn't find it initially is that the User Account Control has 'hidden' it from the standard search until I became owner of the folder it's in.

    Monday, September 2, 2013 7:45 AM

Answers

All replies

  • There can be a zombie setup process still running. A reboot will address this. Run process explorer to see if you can find the process which has loaded the dll

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, September 2, 2013 2:48 PM
  • That seems unlikely though, since a reboot doesn't always fix this; and the file is only in use for a very short amount of time. The installer creates a new folder and a set of new files every time; the file in question is no longer in use by the time I can make an attempt to rename it, while the other temporary files are removed within a split second (I can't get in the new folder quickly enough to see them). Like I said, I tried a complete uninstall to remove any "zombie drivers" and a system reboot to end any "zombie processes" already. It didn't work.

    Regardless, I'll try figuring things out with the process explorer, and I'll keep this post updated with any new findings.


    EDIT: After several attempts, no dice at finding any process using the *.tmp OR the WudfUpdate01011.dll files. I'll continue investigating, and keep this post updated.
    Monday, September 2, 2013 3:09 PM
  • What is are you targeting ? It appears to be x64, W7

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, September 2, 2013 5:25 PM
  • I am targeting Win7 x64, correct.

    Tuesday, September 3, 2013 7:17 AM
  • we have the same issue, any news? sometimes a reboot helps... at the moment I don't have a chance to get the driver installed again. (win7x64 as well)

    Monday, February 10, 2014 10:57 PM
  • in my case it's the virus scanner...

    Tuesday, February 11, 2014 10:22 AM