Jump to content

PrtDevIOCtl

From EDM2
Revision as of 20:02, 19 November 2019 by Martini (talk | contribs) (Created page with "PrtDevIOCtl passes device-specific commands to the device. PrtDevIOCtl is an emulation of DosDevIOCtl. ; Note: Under OS/2, PM port drivers are responsible for initializing p...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

PrtDevIOCtl passes device-specific commands to the device. PrtDevIOCtl is an emulation of DosDevIOCtl.

Note
Under OS/2, PM port drivers are responsible for initializing printer ports; presentation drivers should not need to use this function.

Syntax

PrtDevIOCtl(pData, pParms, ulFunction, ulCategory, hDevice);

Parameters

pData (PVOID) - input
A pointer to a data packet.
pParms (PVOID) - input
The parameter list.
ulFunction (ULONG) - input
The function number.
ulCategory (ULONG) - input
The category code.
hDevice (HFILE) - input
The device handle returned by PrtOpen.

Return Code

rc (ULONG) - returns
Return codes.

This function returns the same codes as DosDevIOCtl:

  • ERROR_BAD_DRIVER_LEVEL
  • ERROR_GEN_FAILURE
  • ERROR_INVALID_CATEGORY
  • ERROR_INVALID_DRIVE
  • ERROR_INVALID_FUNCTION
  • ERROR_INVALID_HANDLE
  • ERROR_INVALID_PARAMETER
  • ERROR_MONITORS_NOT_SUPPORTED
  • ERROR_PROTECTION_VIOLATION
  • ERROR_UNCERTAIN_MEDIA
  • NO_ERROR

Remarks

For a full description of the parameters, see the function "DosDevIOCtl" in the Presentation Manager Programming Reference. For further information about the IOCtl interface, see the chapter on generic IOCtl commands in the OS/2 Physical Device Driver Reference.

Example Code


#include <os2.h>

PVOID    pData;       /*  A pointer to a data packet. */
PVOID    pParms;      /*  The parameter list. */
ULONG    ulFunction;  /*  The function number. */
ULONG    ulCategory;  /*  The category code. */
HFILE    hDevice;     /*  The device handle returned by PrtOpen. */
ULONG    rc;          /*  Return codes. */

rc = PrtDevIOCtl(pData, pParms, ulFunction,
       ulCategory, hDevice);