Prev: Removing standard Unidrv property sheets from printer preferences/properties
Next: WIA DRIVER QUESTIONS
From: Charles Gardiner on 15 Jan 2010 17:05 Hi, is there some issue in KMDF 1.9 with context spaces for WDFDMATRANSACTION objects? I cannot get WdfDmaTransactionCreate() to work if I give it a WDF_OBJECT_ATTRIBUTES field. After a lot of tracing I found that I always get a response of c000000D or STATUS_INVALID_PARAMETER, which in itself doesn't really help. Might as well say 'Error in program' And yes, I have set ParentObject to 'NULL' like it says in the docs. I used the WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE way of initialising the attributes. I finally got it working by omitting the attributes and specifying WDF_NO_OBJECT_ATTRIBUTES. Luckily, EVT_WDF_PROGRAM_DMA has a an extra optional context parameter which I used to pass the context with the needed info into the ProgramDma routine. It sort of worked under 1.7 but I always suspected there was some issue. My driver regularily crashed when starting (about 10% of the time) and the minidump always marked an empty code-line near the WdfDmaTransactionCreate() call. I'm currently running with all verifiers active. Interested in any feedback. Charles
From: Brandon Wilson [MSFT] on 15 Jan 2010 17:52 Run "!wdflogdump <yourdrivername>" in a debugger after the call fails and that should give more of an indication as to why the call failed. "Charles Gardiner" <invalid(a)invalid.invalid> wrote in message news:hiqoqv$v1c$02$1(a)news.t-online.com... > Hi, > > is there some issue in KMDF 1.9 with context spaces for > WDFDMATRANSACTION objects? > > I cannot get WdfDmaTransactionCreate() to work if I give it a > WDF_OBJECT_ATTRIBUTES field. After a lot of tracing I found that I > always get a response of c000000D or STATUS_INVALID_PARAMETER, which in > itself doesn't really help. Might as well say 'Error in program' > > And yes, I have set ParentObject to 'NULL' like it says in the docs. I > used the WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE way of initialising the > attributes. > > I finally got it working by omitting the attributes and specifying > WDF_NO_OBJECT_ATTRIBUTES. Luckily, EVT_WDF_PROGRAM_DMA has a an extra > optional context parameter which I used to pass the context with the > needed info into the ProgramDma routine. > > It sort of worked under 1.7 but I always suspected there was some issue. > My driver regularily crashed when starting (about 10% of the time) and > the minidump always marked an empty code-line near the > WdfDmaTransactionCreate() call. > > I'm currently running with all verifiers active. > > Interested in any feedback. > Charles
From: Charles Gardiner on 17 Jan 2010 11:44 Brandon Wilson [MSFT] schrieb: > Run "!wdflogdump <yourdrivername>" in a debugger after the call fails > and that should give more of an indication as to why the call failed. > My code is as simple as: WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributesDmaAdmin, VIB_TRANSACTION_CONTEXT); attributesDmaAdmin.ParentObject = NULL; status = WdfDmaTransactionCreate(devExt->dmaEnabler, &attributesDmaAdmin, // WDF_NO_OBJECT_ATTRIBUTES, &bufferContext->adminTransaction); if (status != STATUS_SUCCESS) { TraceEvents(TRACE_LEVEL_ERROR, DBG_INIT, " Could not create admin DMA Transaction. Status %!STATUS!", status); WdfDmaTransactionRelease(bufferContext->pendedTransaction); WdfRequestComplete(Request, STATUS_INSUFFICIENT_RESOURCES); VibLogEventDpc(WdfIoQueueGetDevice(Queue), status, VMPCI_MSG_CREATE_ADMIN_DMA_REJECT_ERR, bufSel); return; } Error code was 0xC000000D which is defined in ntstatus.h as #define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL) // winnt All the docs say is that ParentObject must be NULL, which it is. I tried around with explicitly setting ExecutionLevel and SynchronizationScope as well but to no avail. Thanks for the suggestion, but since I found a solution (using the "IN WDFCONTEXT Context" parameter in the EVT_WDF_PROGRAM_DMA callback) it has already been relegated to at least prio 10 in my task list, since I'm currently pretty much up to my eyes. (i.e. maybe I'll get around to looking into it as a matter of interest when I retire in fifteen/twenty years ;) I was primarily interested in hearing whether it's a known issue. If not maybe Microsoft is interested in improving the docs or fixing it (if it is an issue) in an upcoming KMDF release. Thx.
From: Doron Holan [MSFT] on 18 Jan 2010 12:44
without the logdump, we can't tell you if the behavior is by design or if it is an issue with KMDF. If it is an issue with KMDF, it would be good to know so that we can document it and perhaps address it in a later version. please send the output of !wdflogdump in the failure case for your driver so we can triage this appropriately d -- This posting is provided "AS IS" with no warranties, and confers no rights. "Charles Gardiner" <invalid(a)invalid.invalid> wrote in message news:hivep2$jh7$02$1(a)news.t-online.com... > Brandon Wilson [MSFT] schrieb: >> Run "!wdflogdump <yourdrivername>" in a debugger after the call fails >> and that should give more of an indication as to why the call failed. >> > > My code is as simple as: > WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributesDmaAdmin, > VIB_TRANSACTION_CONTEXT); > attributesDmaAdmin.ParentObject = NULL; > > status = WdfDmaTransactionCreate(devExt->dmaEnabler, > &attributesDmaAdmin, > // WDF_NO_OBJECT_ATTRIBUTES, > &bufferContext->adminTransaction); > > if (status != STATUS_SUCCESS) { > TraceEvents(TRACE_LEVEL_ERROR, DBG_INIT, > " Could not create admin DMA Transaction. Status > %!STATUS!", status); > WdfDmaTransactionRelease(bufferContext->pendedTransaction); > WdfRequestComplete(Request, STATUS_INSUFFICIENT_RESOURCES); > VibLogEventDpc(WdfIoQueueGetDevice(Queue), > status, VMPCI_MSG_CREATE_ADMIN_DMA_REJECT_ERR, > bufSel); > return; > } > > > Error code was 0xC000000D which is defined in ntstatus.h as > #define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL) // > winnt > > All the docs say is that ParentObject must be NULL, which it is. I tried > around with explicitly setting ExecutionLevel and SynchronizationScope > as well but to no avail. > > Thanks for the suggestion, but since I found a solution (using the "IN > WDFCONTEXT Context" parameter in the EVT_WDF_PROGRAM_DMA callback) it > has already been relegated to at least prio 10 in my task list, since > I'm currently pretty much up to my eyes. (i.e. maybe I'll get around to > looking into it as a matter of interest when I retire in fifteen/twenty > years ;) > > I was primarily interested in hearing whether it's a known issue. If not > maybe Microsoft is interested in improving the docs or fixing it (if it > is an issue) in an upcoming KMDF release. > > Thx. |