ERROR_INVALID_FUNCTION

My DeviceIoControl fails and when I use GetLastError I get ‘1’ which I see is ERROR_INVALID_FUNCTION. The problem is that this error does not happen on any other system I have tried. According to the user it happened after updating the bios. What does this error actually mean? It seems as if the DeviceIoControl is calling a function that does not exist but the device works on many other machines with the same driver and application. There is only an error on this call. What does this error actually mean and what might possibly cause this on one machine but not another? And ideas? Is there anything I can do to get more information about the error?

You didn’t write us what ioctl code and device you’ve used in DeviceIoControl. This error is usually received when IOCTL code may not be supported for the current device, driver is not started on your system, disk was unmounted, etc…

wrote in message news:xxxxx@ntdev…
> My DeviceIoControl fails and when I use GetLastError I get ‘1’ which I see is ERROR_INVALID_FUNCTION. The problem is that this error does not happen on any other system I have tried. According to the user it happened after updating the bios. What does this error actually mean? It seems as if the DeviceIoControl is calling a function that does not exist but the device works on many other machines with the same driver and application. There is only an error on this call. What does this error actually mean and what might possibly cause this on one machine but not another? And ideas? Is there anything I can do to get more information about the error?
>

The device is a PCI card IOCTL is a custom control code used to do direct accesses. The card has no problems on any other system I have tried. The driver loads fine and all other functionality works fine. The driver call merely writes a few values to the device for later use.

Is there no clear definition for this error? I assumed that it meant the function call doesn’t exist but the driver works otherwise and it works on all other machines.

Maybe a stupid question: do you have the source code of the driver that is
failing the IOCTL request? If so, can you provide your user with an
instrumented version of the driver that prints out where it actually fails
(e.g. using DbgPrint and catching the messages with DebugView)?

Hope it helps
GV


Gianluca Varenni, Windows DDK MVP

CACE Technologies
http://www.cacetech.com

----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Monday, March 24, 2008 3:05 PM
Subject: RE:[ntdev] ERROR_INVALID_FUNCTION

> The device is a PCI card IOCTL is a custom control code used to do direct
> accesses. The card has no problems on any other system I have tried. The
> driver loads fine and all other functionality works fine. The driver call
> merely writes a few values to the device for later use.
>
> Is there no clear definition for this error? I assumed that it meant the
> function call doesn’t exist but the driver works otherwise and it works on
> all other machines.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

The OP should be looking (assuming he has source) for STATUS_NOT_IMPLEMENTED
in the device Ioctl dispatch routine.

On Mon, Mar 24, 2008 at 7:00 PM, Gianluca Varenni <
xxxxx@gmail.com> wrote:

Maybe a stupid question: do you have the source code of the driver that is
failing the IOCTL request? If so, can you provide your user with an
instrumented version of the driver that prints out where it actually fails
(e.g. using DbgPrint and catching the messages with DebugView)?

Hope it helps
GV


Gianluca Varenni, Windows DDK MVP

CACE Technologies
http://www.cacetech.com

----- Original Message -----
From:
> To: “Windows System Software Devs Interest List”
> Sent: Monday, March 24, 2008 3:05 PM
> Subject: RE:[ntdev] ERROR_INVALID_FUNCTION
>
>
> > The device is a PCI card IOCTL is a custom control code used to do
> direct
> > accesses. The card has no problems on any other system I have tried.
> The
> > driver loads fine and all other functionality works fine. The driver
> call
> > merely writes a few values to the device for later use.
> >
> > Is there no clear definition for this error? I assumed that it meant
> the
> > function call doesn’t exist but the driver works otherwise and it works
> on
> > all other machines.
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > For our schedule of WDF, WDM, debugging and other seminars visit:
> > http://www.osr.com/seminars
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Mark Roddy