Re: GetOverlappedResult() call in overlay I/O



It looks like something wrong with this API call. I don't modify my driver.
The following API can get the correct value but GetOverlappedResult()
cannot.


if ( GetQueuedCompletionStatus(pIoctlChan->m_hCompletionPort,
&numberOfBytesTransferred,
&key, &completedOv, INFINITE) == 0) {
ERRORLOGLEVEL0(TEXT("ReadPacketThread():: GetQueuedCompletionStatus
failed %d\n"),i, GetLastError());
goto Error;
}


"Angie" <kimojolin@xxxxxxxxx> wrote in message
news:eMfA8A8VIHA.4880@xxxxxxxxxxxxxxxxxxxxxxx
I did fill the value of "Irp->IoStatus.Information" before calling
IoCompleteRequest.

"Maxim S. Shatskih" <maxim@xxxxxxxxxxxxxxxx> wrote in message
news:%23ToDpL7VIHA.4740@xxxxxxxxxxxxxxxxxxxxxxx
Be sure you fill Irp->IoStatus.Information properly before calling
IoCompleteRequest.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com

"Angie" <kimojolin@xxxxxxxxx> wrote in message
news:OP%230976VIHA.4684@xxxxxxxxxxxxxxxxxxxxxxx
In the application, I tried to find out how many bytes was written by
the
driver by calling GetOverlappedResult() API.
I do not know why this API alwaysreturn 0 in length. Before calliing
GetOverlappedResult(), the application does wait the following API

dwRet = WaitForMultipleObjects(2, h, FALSE, INFINITE);

Does anybody have such problem in calling GetOverlappedResult()?


-----------------------Get the number of bytes written by
driver ---------------------------------------------------------

DWORD
UVPNDriverHelper::GetReturnedBytes(HANDLE hEvent)
{
OVERLAPPED Overlapped;
DWORD NumberOfBytesTransferred;

memset(&Overlapped, 0, sizeof(OVERLAPPED));
Overlapped.hEvent=hEvent;
if (!GetOverlappedResult(m_hDevice, &Overlapped,
&NumberOfBytesTransferred,
TRUE))
{
ERRORLOGLEVEL0(_T("GetOverlappedResult() fail
error=%x\n"),GetLastError());
return 0;
}
ERRORLOGLEVEL0(TEXT("GetReturnedBytes(): NumberOfBytesTransferred(%d)
error=%d!!!\n"),NumberOfBytesTransferred, GetLastError());
return NumberOfBytesTransferred;
}







.



Relevant Pages

  • Re: GetOverlappedResult() call in overlay I/O
    ... Be sure you fill Irp->IoStatus.Information properly before calling ... driver by calling GetOverlappedResult() API. ... I do not know why this API alwaysreturn 0 in length. ...
    (microsoft.public.development.device.drivers)
  • Re: GetOverlappedResult() call in overlay I/O
    ... You seem to be passing in a fresh OVERLAPPED structure to ... driver by calling GetOverlappedResult() API. ... I do not know why this API alwaysreturn 0 in length. ...
    (microsoft.public.development.device.drivers)
  • Re: GetOverlappedResult() call in overlay I/O
    ... I pass a different "OVERLAPPED " pointer even though the ... driver by calling GetOverlappedResult() API. ... I do not know why this API alwaysreturn 0 in length. ...
    (microsoft.public.development.device.drivers)
  • GetOverlappedResult() call in overlay I/O
    ... driver by calling GetOverlappedResult() API. ... I do not know why this API alwaysreturn 0 in length. ... ERRORLOGLEVEL0fail ...
    (microsoft.public.development.device.drivers)
  • Re: Digital-tv card drivers and API discussion
    ... Designing completely new api takes some time and I ... > driver development experience, I have a couple of questions for you. ... > 2) As linux kernel is GPL-licensed, I cannot just port the linux driver ... I'm able to watch DVB programs converted from MPEG TS substreams to MPEG ...
    (freebsd-arch)

Loading