After the application has called the function

DeviceIoControl( hDevice,
IOCTL_ISOCH_ATTACH_BUFFERS,
pIsochAttachBuffers,
ulBufferSize,
pIsochAttachBuffers,
ulBufferSize,
&dwBytesRet,
&overLapped);

the kernel (t1394_EvtIoDeviceControl function in
\WINDDK\6000\src\kmdf\1394\driver\ioctl.c)
retrieves the input buffer with

WdfRequestRetrieveInputBuffer(Request, 0, &ioBuffer, &bufLength) ; PVOID
ioBuffer;

I tried to get the output buffer, so I set

PVOID outputBuffer = NULL;

and used

WdfRequestRetrieveOutputBuffer(Request, 0, &outputBuffer, &bufLength);

With this function, I have got the buffer's adress in outputBuffer.
(*(PISCHO_ATTACH_BUFFER)outputBuffer shows the buffer's adress and it's the
same adress as input buffer)

Because I want to get some Information(pIsochDescriptor) in application, I
tried to write in the outputBuffer with

RtlCopyMemory((PISOCH_ATTACH_BUFFERS)outputBuffer, IsochAttachBuffers,
OutputBufferLength);
( I tried also with *((PISOCH_ATTACH_BUFFERS)outputBuffer) =
*IsochAttachBuffers; )

After that, I can see that the informations are written in the outputBuffer.
But if I try to get the Information in user-mode
(I mean after the calling DeviceIoControl function), it seems that the
informations got lost (pIsochAttachBuffers->pIsochDescriptor is still zero.)

Can somebody explain this? How can I bring some information from kernel to
user mode (application)?


thanks in advance
min.

Re: Retrieving the Buffer for EvtIoDeviceControl in a KMDF Driver by Abhishek

Abhishek
Tue Dec 11 12:43:22 PST 2007

When completing the request, did you remember to set the request information
to the number of bytes you transferred to the buffer?
See the MSDN documentation for WdfRequestCompleteWithInformation.

"min" <min@amo.de> wrote in message news:5s7rp8F16b6hdU1@mid.dfncis.de...
> After the application has called the function
>
> DeviceIoControl( hDevice,
> IOCTL_ISOCH_ATTACH_BUFFERS,
> pIsochAttachBuffers,
> ulBufferSize,
> pIsochAttachBuffers,
> ulBufferSize,
> &dwBytesRet,
> &overLapped);
>
> the kernel (t1394_EvtIoDeviceControl function in
> \WINDDK\6000\src\kmdf\1394\driver\ioctl.c)
> retrieves the input buffer with
>
> WdfRequestRetrieveInputBuffer(Request, 0, &ioBuffer, &bufLength) ;
> PVOID ioBuffer;
>
> I tried to get the output buffer, so I set
>
> PVOID outputBuffer = NULL;
>
> and used
>
> WdfRequestRetrieveOutputBuffer(Request, 0, &outputBuffer, &bufLength);
>
> With this function, I have got the buffer's adress in outputBuffer.
> (*(PISCHO_ATTACH_BUFFER)outputBuffer shows the buffer's adress and it's
> the same adress as input buffer)
>
> Because I want to get some Information(pIsochDescriptor) in application,
> I tried to write in the outputBuffer with
>
> RtlCopyMemory((PISOCH_ATTACH_BUFFERS)outputBuffer, IsochAttachBuffers,
> OutputBufferLength);
> ( I tried also with *((PISOCH_ATTACH_BUFFERS)outputBuffer) =
> *IsochAttachBuffers; )
>
> After that, I can see that the informations are written in the
> outputBuffer. But if I try to get the Information in user-mode
> (I mean after the calling DeviceIoControl function), it seems that the
> informations got lost (pIsochAttachBuffers->pIsochDescriptor is still
> zero.)
>
> Can somebody explain this? How can I bring some information from kernel to
> user mode (application)?
>
>
> thanks in advance
> min.
>
>



Re: Retrieving the Buffer for EvtIoDeviceControl in a KMDF Driver by min

min
Wed Dec 12 06:36:45 PST 2007

Thanks for your advice. :-)
I didn't think about that.



"Abhishek R" <abhishekr@online.microsoft.com> schrieb im Newsbeitrag
news:up0Q7ZDPIHA.4656@TK2MSFTNGP03.phx.gbl...
> When completing the request, did you remember to set the request
> information to the number of bytes you transferred to the buffer?
> See the MSDN documentation for WdfRequestCompleteWithInformation.
>
> "min" <min@amo.de> wrote in message news:5s7rp8F16b6hdU1@mid.dfncis.de...
>> After the application has called the function
>>
>> DeviceIoControl( hDevice,
>> IOCTL_ISOCH_ATTACH_BUFFERS,
>> pIsochAttachBuffers,
>> ulBufferSize,
>> pIsochAttachBuffers,
>> ulBufferSize,
>> &dwBytesRet,
>> &overLapped);
>>
>> the kernel (t1394_EvtIoDeviceControl function in
>> \WINDDK\6000\src\kmdf\1394\driver\ioctl.c)
>> retrieves the input buffer with
>>
>> WdfRequestRetrieveInputBuffer(Request, 0, &ioBuffer, &bufLength) ; PVOID
>> ioBuffer;
>>
>> I tried to get the output buffer, so I set
>>
>> PVOID outputBuffer = NULL;
>>
>> and used
>>
>> WdfRequestRetrieveOutputBuffer(Request, 0, &outputBuffer, &bufLength);
>>
>> With this function, I have got the buffer's adress in outputBuffer.
>> (*(PISCHO_ATTACH_BUFFER)outputBuffer shows the buffer's adress and it's
>> the same adress as input buffer)
>>
>> Because I want to get some Information(pIsochDescriptor) in application,
>> I tried to write in the outputBuffer with
>>
>> RtlCopyMemory((PISOCH_ATTACH_BUFFERS)outputBuffer, IsochAttachBuffers,
>> OutputBufferLength);
>> ( I tried also with *((PISOCH_ATTACH_BUFFERS)outputBuffer) =
>> *IsochAttachBuffers; )
>>
>> After that, I can see that the informations are written in the
>> outputBuffer. But if I try to get the Information in user-mode
>> (I mean after the calling DeviceIoControl function), it seems that the
>> informations got lost (pIsochAttachBuffers->pIsochDescriptor is still
>> zero.)
>>
>> Can somebody explain this? How can I bring some information from kernel
>> to user mode (application)?
>>
>>
>> thanks in advance
>> min.
>>
>>
>
>