Answered WdfDeviceCreate generates an error...

  • Friday, March 09, 2012 4:45 PM
     
     

    I made some minor changes to the serial driver under winddk.  I got windbg working now.  During my kernal driver debug, I get an error when I make a call to WdfDeviceCreate.  After I get the error, I used !dbgprint and got the following:

    -->SerialEvtDeviceAdd
    SerialAddDevice - WdfDeviceCreate failed !STATUS!
    --> SerialEvtDriverContextCleanup
    <-- SerialEvtDriverContextCleanup
    ERROR: DavReadRegistryValues/RegQueryValueExW(4). WStatus = 127
    ERROR: DavReadRegistryValues/RegQueryValueExW(5). WStatus = 127
    ERROR: DavReadRegistryValues/RegQueryValueExW(6). WStatus = 127

    Unfortunately, when I tried google to determine what error 127 indicates, I do not get any valid values.  Can someone telll me why I cannot creates a framework device object using WdfDeviceCreate or why I am even getting an error?  Thanks!

All Replies

  • Friday, March 09, 2012 4:53 PM
     
     Answered

    What was the value that WdfDeviceCreate returned?  Status 127 is probably ERROR_PROC_NOT_FOUND since the error line referes to ReqQueryValueExW which means you would find the error code in winerror.h.  But that is not the problem, the failure of WdfDeviceCreate should be reflected in the status value it returns.  Please post that value as hex, or to get going look at ntstatus.h and find the value.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    • Marked As Answer by pham_tv Friday, March 09, 2012 5:29 PM
    •  
  • Friday, March 09, 2012 5:05 PM
     
     
    the hex value for 127 is 0x7F..  I looked at both ntstatus.h and http://msdn.microsoft.com/en-us/library/cc704588(v=prot.10).aspx but the error message does not make any sense.  Please advise...
  • Friday, March 09, 2012 5:25 PM
     
     

    I was not asking for the hex value of 127, I was asking for the value returned by WdfCreateDevice that you should be able to see in Windbg if you stepped through it. 


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

  • Friday, March 09, 2012 5:29 PM
     
     

    Hi Doron,

    I get what you are after...  You want me to get the status value during the function call.  When I did that, I get a hex value of 0xC0000035 indicating:

    0xC0000035

    The object name already exists.  Thanks for the tip...

  • Friday, March 09, 2012 5:29 PM
    Owner
     
     

    if read the OP correctly, this line

    ERROR: DavReadRegistryValues/RegQueryValueExW(4). WStatus = 127

    is just debugger output, probably from the dav service :), that is intermingled with his output. the problem the OP is facing is that you are taking a WPP tracing string which has %!STATUS! in it and using it with DbgPrint. DbgPrint has no idea how to use %!STATUS! as a format specifier. you need to use 0x%x instead.


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