Microsoft KB Archive/111838

From BetaArchive Wiki

INFO: Possible Cause for ERROR_INVALID_FUNCTION

Q111838



The information in this article applies to:


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





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");

   ... 

Additional query words:

Keywords : _IK kberrmsg kbAPI kbKernBase kbOSWin2000 kbTapeBackup kbDSupport kbGrpDSKernBase
Issue type : kbinfo
Technology : kbAudDeveloper kbWin32sSearch kbWin32API


Last Reviewed: October 27, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.