Bewerken

Delen via


DrvSplDeviceCaps function (winddiui.h)

A printer interface DLL's DrvSplDeviceCaps function queries a printer for its capabilities.

Syntax

DWORD DrvSplDeviceCaps(
                  HANDLE   hPrinter,
  [in]            PWSTR    pszDeviceName,
                  WORD     Capability,
  [out, optional] PVOID    pOutput,
                  DWORD    cchBufSize,
  [in, optional]  PDEVMODE pDevmode
);

Parameters

hPrinter

Caller-supplied handle to the printer.

[in] pszDeviceName

Caller-supplied pointer to a Unicode string that contains the printer name.

Capability

Caller-supplied bit flag that indicates the capability to query for. (The flags are defined in header file wingdi.h.) This function is not required to support all of the DC_XXX flags, but it must support those listed in the following table.

Flag Definition
DC_MEDIAREADY The pOutput parameter points to a buffer that the function should fill with an array of string buffers, each 64 characters in length. Each array element should contain a NULL-terminated string representing a name for a paper form that is available for use. The function's return value should be the number of elements in the returned array. If pOutput is NULL, the function should just return the number of array elements required.
DC_PAPERNAMES The pOutput parameter points to a buffer that the function should fill with an array of string buffers, each 64 characters in length. Each array element should contain a NULL-terminated string representing a name for a paper form. The function's return value should be the number of elements in the returned array. If pOutput is NULL, the function should just return the number of array elements required.

[out, optional] pOutput

Caller-supplied pointer to a buffer that receives function-supplied information. The buffer's use depends on the value of the Capability parameter. The caller is responsible for allocating and freeing this buffer.

cchBufSize

Caller-supplied size (in characters) of the buffer pointed to by the pOutput parameter.

[in, optional] pDevmode

Caller-supplied pointer to a DEVMODEW structure that describes the current print job characteristics. If NULL, the function should use the driver's internal default DEVMODEW structure.

Return value

The return value depends on the Capability parameter. If Capability indicates a capability that the driver does not support, or if an error is encountered, the function should return GDI_ERROR.

Remarks

For descriptions of the DC_XXX flags, see DrvDeviceCapabilities.

This function must be defined in the .def file as DrvSplDeviceCaps @ 254, because the spooler uses the ordinal number 254 to obtain the driver function pointer.

Requirements

Requirement Value
Target Platform Desktop
Header winddiui.h (include Winddiui.h)

See also

DrvDeviceCapabilities