INFO: Possible Cause for ERROR_INVALID_FUNCTION (111838)



The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API), when used with:
    • the operating system: Microsoft Windows NT 3.1
    • the operating system: Microsoft Windows NT 3.5
    • the operating system: Microsoft Windows NT 3.51
    • the operating system: Microsoft Windows NT 4.0
    • the operating system: Microsoft Windows 2000
    • the operating system: Microsoft Windows XP

This article was previously published under Q111838

SUMMARY

The Win32 Tape API (application programming interface) functions may return an error code of
ERROR_INVALID_FUNCTION
if the operation being attempted is not supported by the tape device.

MORE INFORMATION

You can determine what operations are valid for a tape device by calling GetTapeParameters() to get the tape drive parameters. See the code fragment in the Sample Code section of this article for an example of how to call GetTapeParameters() for this information.

Once you have the TAPE_GET_DRIVE_PARAMETERS structure, you can check for a specific operation in the FeaturesLow and FeaturesHigh members of the TAPE_GET_DRIVE_PARAMETERS structure. This is also demonstrated in the Sample Code section.

Sample Code

   /*
   ** This is a code fragment only and will not compile and run as is.
   */ 

   DWORD dwRes, dwSize;
   TAPE_GET_DRIVE_PARAMETERS parmDrive;

   ...

   dwSize = sizeof(parmDrive);
   dwRes = GetTapeParameters(hTape, GET_TAPE_DRIVE_INFORMATION,
                   &dwSize, &parmDrive);
   if (dwRes != NO_ERROR) {
       /* place error handling code here */ 
       exit(-1);
   }

   if (parmDrive.FeaturesLow & TAPE_DRIVE_ERASE_LONG)
       printf("Device supports the long erase technique.\n");

   ...
				

Modification Type:MajorLast Reviewed:3/15/2004
Keywords:kbAPI kbBackUp kbcode kberrmsg kbinfo kbKernBase KB111838