The GetPrinter function retrieves information about a specified printer.
BOOL GetPrinter(
HANDLE hPrinter, |
// handle to printer of interest |
DWORD Level, |
// version of printer info data structure |
LPBYTE pPrinter, |
// pointer to array of bytes that receives printer info. structure |
DWORD cbBuf, |
// size, in bytes, of array of bytes |
LPDWORD pcbNeeded |
// pointer to variable with count of bytes retrieved (or required) |
); |
Windows 95: This value can be 1, 2, or 5.
Windows NT: This value can be 1, 2, 3, 4, or 5.
Windows 95: The buffer can receive a PRINTER_INFO_1, PRINTER_INFO_2, PRINTER_INFO_5 structure.
Windows NT: The buffer can receive a PRINTER_INFO_1,
PRINTER_INFO_2, PRINTER_INFO_3,
PRINTER_INFO_4, or PRINTER_INFO_5
structure.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
If the structure returned in the buffer pointed to by the pPrinter parameter contains a pointer to a security descriptor, only those components of the security descriptor that the caller has permission to read will be present. An application that wants to retrieve particular security descriptor components must open the printer with sufficient access permission. The following table shows the security descriptor components that are retrieved for particular access permission values:
|
Security Descriptor Components Retrieved |
READ_CONTROL |
Owner, Primary Group, Discretionary access-control list (ACL) |
ACCESS_SYSTEM_SECURITY |
System ACL |
AbortPrinter, AddPrinter, ClosePrinter, DeletePrinter, EnumPrinters, PRINTER_INFO_1, PRINTER_INFO_2, PRINTER_INFO_3, PRINTER_INFO_4, PRINTER_INFO_5, OpenPrinter, SetPrinter
file: /Techref/os/win/api/win32/func/src/f36_11.htm, 5KB, , updated: 2000/4/7 11:19, local time: 2024/11/7 16:28,
3.149.23.247:LOG IN ©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/techref/os/win/api/win32/func/src/f36_11.htm"> GetPrinter</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.