DeviceIoControl and ERROR_MORE_DATA

Hi all,

I am trying to enhance my driver’s DeviceIoControl interface to be able to
return a variable-length structure back to the user.
The IOCtl is supposed to compute the required bytes, compare them against
the user-supplied buffer length and return, if appropriate the number of
required bytes.

The DeviceIoControl specification states that:

  1. Error code ERROR_INSUFFICIENT_BUFFER (122) returns a 0 in
    lpBytesReturned.
  2. Error code ERROR_MORE_DATA (234) and lpBytesReturned indicates the amount
    of data received.

I know that the kernel status code STATUS_BUFFER_TOO_SMALL (0xC0000023L)
maps to ERROR_INSUFFICIENT_BUFFER. However, which kernel status code maps
to ERROR_MORE_DATA so that I can pass to the caller the required number of
bytes?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/deviceiocontrol.asp

Thanks,

gy

STATUS_BUFFER_OVERFLOW

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

----- Original Message -----
From: “Ghassan Yammine”
Newsgroups: ntdev,ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Tuesday, December 21, 2004 3:14 AM
Subject: [ntfsd] DeviceIoControl and ERROR_MORE_DATA

> Hi all,
>
> I am trying to enhance my driver’s DeviceIoControl interface to be able to
> return a variable-length structure back to the user.
> The IOCtl is supposed to compute the required bytes, compare them against
> the user-supplied buffer length and return, if appropriate the number of
> required bytes.
>
> The DeviceIoControl specification states that:
> 1) Error code ERROR_INSUFFICIENT_BUFFER (122) returns a 0 in
> lpBytesReturned.
> 2) Error code ERROR_MORE_DATA (234) and lpBytesReturned indicates the amount
> of data received.
>
> I know that the kernel status code STATUS_BUFFER_TOO_SMALL (0xC0000023L)
> maps to ERROR_INSUFFICIENT_BUFFER. However, which kernel status code maps
> to ERROR_MORE_DATA so that I can pass to the caller the required number of
> bytes?
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/deviceiocontrol.asp
>
> Thanks,
>
> gy
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Thanks Maxim!

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntfsd…
> STATUS_BUFFER_OVERFLOW
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
> ----- Original Message -----
> From: “Ghassan Yammine”
> Newsgroups: ntdev,ntfsd
> To: “Windows File Systems Devs Interest List”
> Sent: Tuesday, December 21, 2004 3:14 AM
> Subject: [ntfsd] DeviceIoControl and ERROR_MORE_DATA
>
>
> > Hi all,
> >
> > I am trying to enhance my driver’s DeviceIoControl interface to be able
to
> > return a variable-length structure back to the user.
> > The IOCtl is supposed to compute the required bytes, compare them
against
> > the user-supplied buffer length and return, if appropriate the number of
> > required bytes.
> >
> > The DeviceIoControl specification states that:
> > 1) Error code ERROR_INSUFFICIENT_BUFFER (122) returns a 0 in
> > lpBytesReturned.
> > 2) Error code ERROR_MORE_DATA (234) and lpBytesReturned indicates the
amount
> > of data received.
> >
> > I know that the kernel status code STATUS_BUFFER_TOO_SMALL (0xC0000023L)
> > maps to ERROR_INSUFFICIENT_BUFFER. However, which kernel status code
maps
> > to ERROR_MORE_DATA so that I can pass to the caller the required number
of
> > bytes?
> >
> >
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/deviceiocontrol.asp
> >
> > Thanks,
> >
> > gy
> >
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>