GetPrinter

BOOL GetPrinter(
  HANDLE  hPrinter,   /* handle of printer object              */
  DWORD   dwLevel,    /* structure level                       */
  LPBYTE  lpbPrinter, /* address of structure array            */
  DWORD   cbBuf,      /* size, in bytes, of array              */
  LPDWORD lpdwNeeded  /* addr. of variable with count of bytes */
                      /* retrieved (or required)               */
);

Retrieves data for the specified printer.

hPrinter Identifies the printer for which data is requested.
dwLevel Specifies the version of the structure to which lpbPrinter points. This value must be 1, 2, or 3.
lpbPrinter Points to an array of bytes that receives a PRINTER_INFO_1, PRINTER_INFO_2, or PRINTER_INFO_3 structure.
cbBuf Specifies the size, in bytes, of the array to which lpbPrinter points.
lpdwNeeded Points to a value that specifies the number of bytes copied if the function succeeds or the number of bytes required if cbBuf was too small.