Expand Minimize

EngEnumForms function

The EngEnumForms function enumerates the forms supported by the specified printer.

Syntax


BOOL EngEnumForms(
  _In_       HANDLE hPrinter,
  _In_       DWORD Level,
  _Out_opt_  LPBYTE pForm,
  _In_       DWORD cbBuf,
  _Out_      LPDWORD pcbNeeded,
  _Out_      LPDWORD pcReturned
);

Parameters

hPrinter [in]

Handle to the printer for which the forms should be enumerated. This is the PDEV handle that is passed as the hDriver parameter of DrvEnablePDEV.

Level [in]

Specifies the version of the structure pointed to by pForm. This value must be 1, which indicates that the enumerated forms are to be returned in FORM_1_INFO structures.

pForm [out, optional]

Pointer to an array of bytes in which the enumerated FORM_INFO_1 structures are written.

cbBuf [in]

Specifies the size, in bytes, of lpbForms.

pcbNeeded [out]

Pointer to a DWORD that receives the number of bytes copied into pForm if the copy is completed successfully. If pForm is too small to contain all the enumerated forms' data, this DWORD specifies the number of bytes required.

pcReturned [out]

Pointer to a DWORD that receives the number of FORM_INFO_1 structures copied into pForm.

Return value

EngEnumForms returns TRUE if all parameters are valid and the enumerated form data is successfully copied into pForm. Otherwise, it returns FALSE and an error message is logged. To get error information, call EngGetLastError.

Remarks

A printer driver can call EngEnumForms to have GDI obtain the list of forms supported by a particular printer. The enumerated information is returned as an array of FORM_INFO_1 structures (declared in the Microsoft Windows SDK documentation) pointed to by pForm. If the array pointed to by pForm is not large enough to hold the enumerated data, the requisite array size is instead returned in pcbNeeded.

Requirements

Version

Available in Windows 2000 and later versions of the Windows operating systems.

Header

Winddi.h (include Winddi.h)

Library

Win32k.lib

DLL

Win32k.sys

See also

DrvEnablePDEV
EngGetLastError

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft