DrvDeviceCapabilities function

A printer interface DLL's DrvDeviceCapabilities function returns requested information about a printer's capabilities.

Syntax


DWORD DrvDeviceCapabilities(
        HANDLE   hPrinter,
  _In_  PWSTR    pDeviceName,
        WORD     iDevCap,
  _Out_ PVOID    pvOutput,
  _In_  PDEVMODE pDevMode
);

Parameters

hPrinter

Caller-supplied printer handle.

pDeviceName [in]

Caller-supplied pointer to a printer name string.

iDevCap

Caller-supplied bit flag indicating the information being requested. This can be one of the flags listed in the following table. (The flags are defined in header file Wingdi.h.)

FlagDefinition

DC_BINADJUST

Not used for NT-based operating systems.

DC_BINNAMES

The pvOutput parameter points to a buffer that the function should fill with an array of string buffers, each 24 characters in length. Each string buffer in the array should contain a wide-character, NULL-terminated string specifying the name of a paper source bin.

The function's return value should be the number of elements in the returned array.

If pvOutput is NULL, the function should just return the number of array elements required.

DC_BINS

The pvOutput parameter points to a buffer that the function should fill with a WORD array. Each array element should contain a DMBIN-prefixed constant (or customized value) representing a supported paper source bin.

The function's return value should be the number of elements in the returned array.

If pvOutput is NULL, the function should just return the number of array elements required.

DC_COLLATE

The pvOutput parameter is not used.

The function's return value should be 1 if the printer supports collating; otherwise, the return value should be zero.

DC_COLORDEVICE

The pvOutput parameter is not used.

The function's return value should be 1 if the printer supports color printing; otherwise, the return value should be zero.

DC_COPIES

The pvOutput parameter is not used.

The function's return value should be the maximum number of copies the printer can support.

DC_DATATYPE_PRODUCED

Not used for NT-based operating systems.

DC_DRIVER

The pvOutput parameter is not used.

The function's return value should be the dmDriverVersion member of the driver's internal DEVMODEW structure.

DC_DUPLEX

The pvOutput parameter is not used.

The function's return value should be 1 if the printer supports duplex printing; otherwise, the return value should be zero.

DC_EMF_COMPLIANT

Not used for NT-based operating systems.

DC_ENUMRESOLUTIONS

The pvOutput parameter points to a buffer that the function should fill with a LONG array. For each resolution supported by the printer, the function should return two long words (one for the x dimension and one for the y dimension) of the resolution, in dots per inch.

The function's return value should be the number of resolutions supported.

If pvOutput is NULL, the function should just return the number of resolutions supported.

DC_EXTRA

The pvOutput parameter is not used.

The function's return value should be the dmDriverExtra member of the driver's internal DEVMODEW structure.

DC_FIELDS

The pvOutput parameter is not used.

The function's return value should be the dmFields member of the driver's internal DEVMODEW structure. The dmFields member indicates which members in the device-independent portion of the DEVMODEW structure are supported by the printer driver.

DC_FILEDEPENDENCIES

The pvOutput parameter points to a buffer that the function should fill with an array of string buffers, each 64 characters in length. Each string buffer in the array should contain a wide-character, NULL-terminated string specifying the name of a file that must be installed with the driver.

The function's return value should be the number of elements in the returned array.

If pvOutput is NULL, the function should just return the number of array elements required.

DC_MANUFACTURER

Not used for NT-based operating systems.

DC_MAXEXTENT

The pvOutput parameter is not used.

The function should return a POINTS structure (described in the Microsoft Windows SDK documentation). The structure should contain the maximum allowable values for the dmPaperWidth (x dimension) and dmPaperLength (y dimension) members of the printer's DEVMODEW structure.

DC_MEDIAREADY

The pvOutput parameter points to a buffer that the function should fill with an array of string buffers, each 64 characters in length. Each string buffer in the array should contain a wide-character, NULL-terminated string specifying the name of a paper form that is available for use.

The function's return value should be the number of elements in the returned array.

If pvOutput is NULL, the function should just return the number of array elements required.

DC_MEDIATYPENAMES

The pvOutput parameter points to a buffer that the function should fill with an array of string buffers, each 64 characters in length. Each string buffer in the array should contain a wide-character, NULL-terminated string specifying the name of a supported media type.

The function's return value should be the number of elements in the returned array.

If pvOutput is NULL, the function should simply return the number of array elements required.

DC_MEDIATYPES

The pvOutput parameter points to a buffer that the function should fill with a DWORD array. Each array element should contain a DMMEDIA-prefixed constant (see the DEVMODEW structure) or customized value representing a supported media type.

The function's return value should be the number of elements in the returned array.

If pvOutput is NULL, the function should simply return the number of array elements required.

DC_MINEXTENT

The pvOutput parameter is not used.

The function should return a POINTS structure (described in the Windows SDK documentation). The structure should contain the minimum allowable values for the dmPaperWidth (x dimension) and dmPaperLength (y dimension) members of the printer's DEVMODEW structure.

DC_MODEL

Not used for NT-based operating systems.

DC_NUP

The pvOutput parameter points to a buffer that the function should fill with a DWORD array. Each array element should contain an integer representing an N-up option (that is, each integer should represent a supported number of document pages per physical page).

The function's return value should be the number of elements in the returned array.

If pvOutput is NULL, the function should just return the number of array elements required.

DC_ORIENTATION

The pvOutput parameter is not used.

The function's return value should be the number of degrees of rotation required to produce landscape orientation from portrait orientation. A value of zero indicates landscape orientation is not supported.

DC_PAPERNAMES

The pvOutput parameter points to a buffer that the function should fill with an array of string buffers, each 64 characters in length. Each string buffer in the array should contain a wide-character, NULL-terminated string specifying the name of a paper form.

The function's return value should be the number of elements in the returned array.

If pvOutput is NULL, the function should just return the number of array elements required.

DC_PAPERS

The pvOutput parameter points to a buffer that the function should fill with a WORD array. Each array element should contain a DMPAPER-prefixed constant (or customized value) representing a supported paper form.

The function's return value should be the number of elements in the returned array.

If pvOutput is NULL, the function should just return the number of array elements required.

DC_PAPERSIZE

The pvOutput parameter points to a buffer that the function should fill with a POINT array. Each array element should contain the x and y dimensions of a form's paper size, in 0.1 mm units, in portrait orientation.

The function's return value should be the number of elements in the returned array.

If pvOutput is NULL, the function should just return the number of array elements required.

DC_PERSONALITY

The pvOutput parameter points to a buffer that the function should fill with an array of string buffers, each 32 characters in length. Each string buffer in the array should contain a wide-character, NULL-terminated string specifying the printer description language supported by the printer (for example, L"HP-GL/2").

The function's return value should be the number of elements in the returned array.

If pvOutput is NULL, the function should just return the number of array elements required.

DC_PRINTERMEM

The pvOutput parameter is not used.

The function's return value should be an integer representing the amount of available printer memory, in kilobytes.

DC_PRINTRATE

The pvOutput parameter is not used.

The function's return value should be an integer representing the print rate, in the units specified for DC_PRINTRATEUNIT.

DC_PRINTRATEPPM

The pvOutput parameter is not used.

The function's return value should be an integer representing the print rate, in pages per minute.

DC_PRINTRATEUNIT

The pvOutput parameter is not used.

The function's return value should identify the units used for specifying the value returned for DC_PRINTRATE. One of the following constants must be specified:

PRINTRATEUNIT_PPM - pages/min.

PRINTRATEUNIT_CPS - chars./sec.

PRINTRATEUNIT_LPM - lines/min.

PRINTRATEUNIT_IPM - inches/min.

DC_SIZE

The pvOutput parameter is not used.

The function's return value should be the dmSize member of the driver's internal DEVMODEW structure.

DC_STAPLE

The pvOutput parameter is not used.

The function's return value should be TRUE if the printer supports stapling, and FALSE if the printer does not support stapling.

DC_TRUETYPE

The pvOutput parameter is not used.

The function's return value can be zero, one, or more of the following flags:

DCTT_BITMAP: The device can print TrueType fonts as graphics.

DCTT_DOWNLOAD: The device can accept downloaded TrueType fonts.

DCTT_DOWNLOAD_OUTLINE: (Windows 95/98/Me only) The device can download outline TrueType fonts.

DCTT_SUBDEV: The device can substitute device fonts for TrueType fonts.

DC_VERSION

The pvOutput parameter is not used.

The function's return value should be the dmSpecVersion member of the driver's internal DEVMODEW structure.

 

pvOutput [out]

A caller-supplied pointer to a buffer to receive function-supplied information. The buffer's use is dependent on the value received for the iDevCap parameter.

pDevMode [in]

A caller-supplied pointer to a DEVMODEW structure that describes the current print job characteristics. If this parameter is NULL, DrvDeviceCapabilities retrieves the current default initialization values for the specified printer driver, such as the user default DEVMODEW structure of the print queue.

Return value

The function's return value is dependent on the value received for the iDevCap parameter. If the received iDevCap value represents a capability that the driver does not support, or if an error is encountered, the function should return GDI_ERROR.

Requirements

Target platform

Desktop

Header

Winddiui.h (include Winddiui.h)

 

 

Send comments about this topic to Microsoft

Show: