' ########################################################################################
' Microsoft Windows
' File: WinSpool.inc
' Contents: Header file for Print APIs
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_WinSpool_PBI)
#DEFINE PBX_WinSpool_PBI
%EQUATE `WINSPOOL_INC = 1
#INCLUDE ONCE "Core/Windows.inc"
'#IF %DEF(%WINUSER)
' #INCLUDE ONCE "prsht.inc"
'#ENDIF
#IF NOT %DEF(%OSVERSION_MASK)
%EQUATE `OSVERSION_MASK = &HFFFF0000
%EQUATE `SPVERSION_MASK = &H0000FF00
%EQUATE `SUBVERSION_MASK = &H000000FF
'//
'// macros to extract various version fields from the NTDDI version
'//
'//
'// macros to extract various version fields from the NTDDI version
'//
'#define OSVER(Version) ((Version) & OSVERSION_MASK)
MACRO OSVER(Version) = Version AND %OSVERSION_MASK
'#define SPVER(Version) ( ((Version) & SPVERSION_MASK) >> 8)
MACRO SPVER(Version) = (Version AND %SPVERSION_MASK) \ &H100
'#define SUBVER(Version) ( ((Version) & SUBVERSION_MASK) )
MACRO SUBVER(Version) = Version AND %SUBVERSION_MASK
#ENDIF ' // OSVERSION_MASK
' // Size = 16 bytes
TYPE PRINTER_INFO_1A DWORD
 flags AS DWORD
 pDescription AS ASCIIZ PTR
 pName AS ASCIIZ PTR
 pComment AS ASCIIZ PTR
END TYPE
' // Size = 16 bytes
TYPE PRINTER_INFO_1W DWORD
 flags AS DWORD
 pDescription AS WSTRINGZ PTR
 pName AS WSTRINGZ PTR
 pComment AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTER_INFO_1 = PRINTER_INFO_1W
#ELSE
 MACRO PRINTER_INFO_1 = PRINTER_INFO_1A
#ENDIF
' // Size = 84 bytes
TYPE PRINTER_INFO_2A DWORD
 pServerName AS ASCIIZ PTR
 pPrinterName AS ASCIIZ PTR
 pShareName AS ASCIIZ PTR
 pPortName AS ASCIIZ PTR
 pDriverName AS ASCIIZ PTR
 pComment AS ASCIIZ PTR
 pLocation AS ASCIIZ PTR
 pDevMode AS DEVMODE PTR
 pSepFile AS ASCIIZ PTR
 pPrintProcessor AS ASCIIZ PTR
 pDatatype AS ASCIIZ PTR
 pParameters AS ASCIIZ PTR
 pSecurityDescriptor AS SECURITY_DESCRIPTOR PTR ' PSECURITY_DESCRIPTOR
 Attributes AS DWORD
 Priority AS DWORD
 DefaultPriority AS DWORD
 StartTime AS DWORD
 UntilTime AS DWORD
 Status AS DWORD
 cJobs AS DWORD
 AveragePPM AS DWORD
END TYPE
' // Size = 84 bytes
TYPE PRINTER_INFO_2W DWORD
 pServerName AS WSTRINGZ PTR
 pPrinterName AS WSTRINGZ PTR
 pShareName AS WSTRINGZ PTR
 pPortName AS WSTRINGZ PTR
 pDriverName AS WSTRINGZ PTR
 pComment AS WSTRINGZ PTR
 pLocation AS WSTRINGZ PTR
 pDevMode AS DEVMODEW PTR
 pSepFile AS WSTRINGZ PTR
 pPrintProcessor AS WSTRINGZ PTR
 pDatatype AS WSTRINGZ PTR
 pParameters AS WSTRINGZ PTR
 pSecurityDescriptor AS SECURITY_DESCRIPTOR PTR ' PSECURITY_DESCRIPTOR
 Attributes AS DWORD
 Priority AS DWORD
 DefaultPriority AS DWORD
 StartTime AS DWORD
 UntilTime AS DWORD
 Status AS DWORD
 cJobs AS DWORD
 AveragePPM AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTER_INFO_2 = PRINTER_INFO_2W
#ELSE
 MACRO PRINTER_INFO_2 = PRINTER_INFO_2A
#ENDIF
' // Size = 4 bytes
TYPE PRINTER_INFO_3 DWORD
 pSecurityDescriptor AS SECURITY_DESCRIPTOR PTR
END TYPE
' // Size = 12 bytes
TYPE PRINTER_INFO_4A DWORD
 pPrinterName AS ASCIIZ PTR
 pServerName AS ASCIIZ PTR
 Attributes AS DWORD
END TYPE
' // Size = 12 bytes
TYPE PRINTER_INFO_4W DWORD
 pPrinterName AS WSTRINGZ PTR
 pServerName AS WSTRINGZ PTR
 Attributes AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTER_INFO_4 = PRINTER_INFO_4W
#ELSE
 MACRO PRINTER_INFO_4 = PRINTER_INFO_4A
#ENDIF
' // Size = 20 bytes
TYPE PRINTER_INFO_5A DWORD
 pPrinterName AS ASCIIZ PTR
 pPortName AS ASCIIZ PTR
 Attributes AS DWORD
 DeviceNotSelectedTimeout AS DWORD
 TransmissionRetryTimeout AS DWORD
END TYPE
' // Size = 20 bytes
TYPE PRINTER_INFO_5W DWORD
 pPrinterName AS WSTRINGZ PTR
 pPortName AS WSTRINGZ PTR
 Attributes AS DWORD
 DeviceNotSelectedTimeout AS DWORD
 TransmissionRetryTimeout AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTER_INFO_5 = PRINTER_INFO_5W
#ELSE
 MACRO PRINTER_INFO_5 = PRINTER_INFO_5A
#ENDIF
' // Size = 4 bytes
TYPE PRINTER_INFO_6 DWORD
 dwStatus AS DWORD
END TYPE
' // Size = 8 bytes
TYPE PRINTER_INFO_7A DWORD
 pszObjectGUID AS ASCIIZ PTR
 dwAction AS DWORD
END TYPE
' // Size = 8 bytes
TYPE PRINTER_INFO_7W DWORD
 pszObjectGUID AS WSTRINGZ PTR
 dwAction AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTER_INFO_7 = PRINTER_INFO_7W
#ELSE
 MACRO PRINTER_INFO_7 = PRINTER_INFO_7A
#ENDIF
%EQUATE `DSPRINT_PUBLISH = &H00000001
%EQUATE `DSPRINT_UPDATE = &H00000002
%EQUATE `DSPRINT_UNPUBLISH = &H00000004
%EQUATE `DSPRINT_REPUBLISH = &H00000008
%EQUATE `DSPRINT_PENDING = &H80000000
' // Size = 4 bytes
TYPE PRINTER_INFO_8A DWORD
 pDevMode AS DEVMODE PTR
END TYPE
' // Size = 4 bytes
TYPE PRINTER_INFO_8W DWORD
 pDevMode AS DEVMODEW PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTER_INFO_8 = PRINTER_INFO_8W
#ELSE
 MACRO PRINTER_INFO_8 = PRINTER_INFO_8A
#ENDIF
' // Size = 4 bytes
TYPE PRINTER_INFO_9A DWORD
 pDevMode AS DEVMODE PTR
END TYPE
' // Size = 4 bytes
TYPE PRINTER_INFO_9W DWORD
 pDevMode AS DEVMODEW PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTER_INFO_9 = PRINTER_INFO_9W
#ELSE
 MACRO PRINTER_INFO_9 = PRINTER_INFO_9A
#ENDIF
%EQUATE `PRINTER_CONTROL_PAUSE = 1
%EQUATE `PRINTER_CONTROL_RESUME = 2
%EQUATE `PRINTER_CONTROL_PURGE = 3
%EQUATE `PRINTER_CONTROL_SET_STATUS = 4
%EQUATE `PRINTER_STATUS_PAUSED = &H00000001
%EQUATE `PRINTER_STATUS_ERROR = &H00000002
%EQUATE `PRINTER_STATUS_PENDING_DELETION = &H00000004
%EQUATE `PRINTER_STATUS_PAPER_JAM = &H00000008
%EQUATE `PRINTER_STATUS_PAPER_OUT = &H00000010
%EQUATE `PRINTER_STATUS_MANUAL_FEED = &H00000020
%EQUATE `PRINTER_STATUS_PAPER_PROBLEM = &H00000040
%EQUATE `PRINTER_STATUS_OFFLINE = &H00000080
%EQUATE `PRINTER_STATUS_IO_ACTIVE = &H00000100
%EQUATE `PRINTER_STATUS_BUSY = &H00000200
%EQUATE `PRINTER_STATUS_PRINTING = &H00000400
%EQUATE `PRINTER_STATUS_OUTPUT_BIN_FULL = &H00000800
%EQUATE `PRINTER_STATUS_NOT_AVAILABLE = &H00001000
%EQUATE `PRINTER_STATUS_WAITING = &H00002000
%EQUATE `PRINTER_STATUS_PROCESSING = &H00004000
%EQUATE `PRINTER_STATUS_INITIALIZING = &H00008000
%EQUATE `PRINTER_STATUS_WARMING_UP = &H00010000
%EQUATE `PRINTER_STATUS_TONER_LOW = &H00020000
%EQUATE `PRINTER_STATUS_NO_TONER = &H00040000
%EQUATE `PRINTER_STATUS_PAGE_PUNT = &H00080000
%EQUATE `PRINTER_STATUS_USER_INTERVENTION = &H00100000
%EQUATE `PRINTER_STATUS_OUT_OF_MEMORY = &H00200000
%EQUATE `PRINTER_STATUS_DOOR_OPEN = &H00400000
%EQUATE `PRINTER_STATUS_SERVER_UNKNOWN = &H00800000
%EQUATE `PRINTER_STATUS_POWER_SAVE = &H01000000
%EQUATE `PRINTER_STATUS_SERVER_OFFLINE = &H02000000
%EQUATE `PRINTER_STATUS_DRIVER_UPDATE_NEEDED = &H04000000
%EQUATE `PRINTER_ATTRIBUTE_QUEUED = &H00000001
%EQUATE `PRINTER_ATTRIBUTE_DIRECT = &H00000002
%EQUATE `PRINTER_ATTRIBUTE_DEFAULT = &H00000004
%EQUATE `PRINTER_ATTRIBUTE_SHARED = &H00000008
%EQUATE `PRINTER_ATTRIBUTE_NETWORK = &H00000010
%EQUATE `PRINTER_ATTRIBUTE_HIDDEN = &H00000020
%EQUATE `PRINTER_ATTRIBUTE_LOCAL = &H00000040
%EQUATE `PRINTER_ATTRIBUTE_ENABLE_DEVQ = &H00000080
%EQUATE `PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS = &H00000100
%EQUATE `PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST = &H00000200
%EQUATE `PRINTER_ATTRIBUTE_WORK_OFFLINE = &H00000400
%EQUATE `PRINTER_ATTRIBUTE_ENABLE_BIDI = &H00000800
%EQUATE `PRINTER_ATTRIBUTE_RAW_ONLY = &H00001000
%EQUATE `PRINTER_ATTRIBUTE_PUBLISHED = &H00002000
'#if (NTDDI_VERSION >= NTDDI_WINXP)
%EQUATE `PRINTER_ATTRIBUTE_FAX = &H00004000
'#endif // (NTDDI_VERSION >= NTDDI_WINXP)
'#if ((NTDDI_VERSION >= NTDDI_WS03) ||\
' ((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (SPVER(NTDDI_VERSION) >= 4)))
%EQUATE `PRINTER_ATTRIBUTE_TS = &H00008000
'#endif // ((NTDDI_VERSION >= NTDDI_WS03) ||\ ...
'#if (NTDDI_VERSION >= NTDDI_VISTA)
' //
' // The printer attribute pushed xxx bits below are used by the
' // pushing printer connection code to keep track of the type
' // of printer connection. These bits are per user resources
' // hence the local print provider has no knowledge about these
' // bit and will not accepts them. The remote print provider
' // is responsible for storeing and persisting these bits.
' //
%EQUATE `PRINTER_ATTRIBUTE_PUSHED_USER = &H00020000
%EQUATE `PRINTER_ATTRIBUTE_PUSHED_MACHINE = &H00040000
%EQUATE `PRINTER_ATTRIBUTE_MACHINE = &H00080000
%EQUATE `PRINTER_ATTRIBUTE_FRIENDLY_NAME = &H00100000
' //
' // If the redirected TS printer is installed with generic
' // TS printer driver (TSPRINT.dll) then this attribute is set
' // by the UMRDP service and passed on to the spooler
' //
%EQUATE `PRINTER_ATTRIBUTE_TS_GENERIC_DRIVER = &H00200000
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `NO_PRIORITY = 0
%EQUATE `MAX_PRIORITY = 99
%EQUATE `MIN_PRIORITY = 1
%EQUATE `DEF_PRIORITY = 1
' // Size = 64 bytes
TYPE JOB_INFO_1A DWORD
 JobId AS DWORD
 pPrinterName AS ASCIIZ PTR
 pMachineName AS ASCIIZ PTR
 pUserName AS ASCIIZ PTR
 pDocument AS ASCIIZ PTR
 pDatatype AS ASCIIZ PTR
 pStatus AS ASCIIZ PTR
 Status AS DWORD
 Priority AS DWORD
 Position AS DWORD
 TotalPages AS DWORD
 PagesPrinted AS DWORD
 Submitted AS SYSTEMTIME ' SYSTEMTIME
END TYPE
' // Size = 64 bytes
TYPE JOB_INFO_1W DWORD
 JobId AS DWORD
 pPrinterName AS WSTRINGZ PTR
 pMachineName AS WSTRINGZ PTR
 pUserName AS WSTRINGZ PTR
 pDocument AS WSTRINGZ PTR
 pDatatype AS WSTRINGZ PTR
 pStatus AS WSTRINGZ PTR
 Status AS DWORD
 Priority AS DWORD
 Position AS DWORD
 TotalPages AS DWORD
 PagesPrinted AS DWORD
 Submitted AS SYSTEMTIME ' SYSTEMTIME
END TYPE
#IF %DEF(%UNICODE)
 MACRO JOB_INFO_1 = JOB_INFO_1W
#ELSE
 MACRO JOB_INFO_1 = JOB_INFO_1A
#ENDIF
' // Size = 104 bytes
TYPE JOB_INFO_2A DWORD
 JobId AS DWORD
 pPrinterName AS ASCIIZ PTR
 pMachineName AS ASCIIZ PTR
 pUserName AS ASCIIZ PTR
 pDocument AS ASCIIZ PTR
 pNotifyName AS ASCIIZ PTR
 pDatatype AS ASCIIZ PTR
 pPrintProcessor AS ASCIIZ PTR
 pParameters AS ASCIIZ PTR
 pDriverName AS ASCIIZ PTR
 pDevMode AS DEVMODE PTR
 pStatus AS ASCIIZ PTR
 pSecurityDescriptor AS SECURITY_DESCRIPTOR PTR ' PSECURITY_DESCRIPTOR
 Status AS DWORD
 Priority AS DWORD
 Position AS DWORD
 StartTime AS DWORD
 UntilTime AS DWORD
 TotalPages AS DWORD
 Size AS DWORD
 Submitted AS SYSTEMTIME ' SYSTEMTIME
 Time AS DWORD
 PagesPrinted AS DWORD
END TYPE
' // Size = 104 bytes
TYPE JOB_INFO_2W DWORD
 JobId AS DWORD
 pPrinterName AS WSTRINGZ PTR
 pMachineName AS WSTRINGZ PTR
 pUserName AS WSTRINGZ PTR
 pDocument AS WSTRINGZ PTR
 pNotifyName AS WSTRINGZ PTR
 pDatatype AS WSTRINGZ PTR
 pPrintProcessor AS WSTRINGZ PTR
 pParameters AS WSTRINGZ PTR
 pDriverName AS WSTRINGZ PTR
 pDevMode AS DEVMODEW PTR
 pStatus AS WSTRINGZ PTR
 pSecurityDescriptor AS SECURITY_DESCRIPTOR PTR ' PSECURITY_DESCRIPTOR
 Status AS DWORD
 Priority AS DWORD
 Position AS DWORD
 StartTime AS DWORD
 UntilTime AS DWORD
 TotalPages AS DWORD
 Size AS DWORD
 Submitted AS SYSTEMTIME ' SYSTEMTIME
 Time AS DWORD
 PagesPrinted AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO JOB_INFO_2 = JOB_INFO_2W
#ELSE
 MACRO JOB_INFO_2 = JOB_INFO_2A
#ENDIF
' // Size = 12 bytes
TYPE JOB_INFO_3 DWORD
 JobId AS DWORD
 NextJobId AS DWORD
 Reserved AS DWORD
END TYPE
' // Size = 108 bytes
TYPE JOB_INFO_4A DWORD
 JobId AS DWORD
 pPrinterName AS ASCIIZ PTR
 pMachineName AS ASCIIZ PTR
 pUserName AS ASCIIZ PTR
 pDocument AS ASCIIZ PTR
 pNotifyName AS ASCIIZ PTR
 pDatatype AS ASCIIZ PTR
 pPrintProcessor AS ASCIIZ PTR
 pParameters AS ASCIIZ PTR
 pDriverName AS ASCIIZ PTR
 pDevMode AS DEVMODE PTR
 pStatus AS ASCIIZ PTR
 pSecurityDescriptor AS SECURITY_DESCRIPTOR PTR ' PSECURITY_DESCRIPTOR
 Status AS DWORD
 Priority AS DWORD
 Position AS DWORD
 StartTime AS DWORD
 UntilTime AS DWORD
 TotalPages AS DWORD
 Size AS DWORD
 Submitted AS SYSTEMTIME ' SYSTEMTIME
 Time AS DWORD
 PagesPrinted AS DWORD
 SizeHigh AS LONG
END TYPE
' // Size = 108 bytes
TYPE JOB_INFO_4W DWORD
 JobId AS DWORD
 pPrinterName AS WSTRINGZ PTR
 pMachineName AS WSTRINGZ PTR
 pUserName AS WSTRINGZ PTR
 pDocument AS WSTRINGZ PTR
 pNotifyName AS WSTRINGZ PTR
 pDatatype AS WSTRINGZ PTR
 pPrintProcessor AS WSTRINGZ PTR
 pParameters AS WSTRINGZ PTR
 pDriverName AS WSTRINGZ PTR
 pDevMode AS DEVMODEW PTR
 pStatus AS WSTRINGZ PTR
 pSecurityDescriptor AS SECURITY_DESCRIPTOR PTR ' PSECURITY_DESCRIPTOR
 Status AS DWORD
 Priority AS DWORD
 Position AS DWORD
 StartTime AS DWORD
 UntilTime AS DWORD
 TotalPages AS DWORD
 Size AS DWORD
 Submitted AS SYSTEMTIME ' SYSTEMTIME
 Time AS DWORD
 PagesPrinted AS DWORD
 SizeHigh AS LONG
END TYPE
#IF %DEF(%UNICODE)
 MACRO JOB_INFO_4 = JOB_INFO_4W
#ELSE
 MACRO JOB_INFO_4 = JOB_INFO_4A
#ENDIF
%EQUATE `JOB_CONTROL_PAUSE = 1
%EQUATE `JOB_CONTROL_RESUME = 2
%EQUATE `JOB_CONTROL_CANCEL = 3
%EQUATE `JOB_CONTROL_RESTART = 4
%EQUATE `JOB_CONTROL_DELETE = 5
%EQUATE `JOB_CONTROL_SENT_TO_PRINTER = 6
%EQUATE `JOB_CONTROL_LAST_PAGE_EJECTED = 7
'#if (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `JOB_CONTROL_RETAIN = 8
%EQUATE `JOB_CONTROL_RELEASE = 9
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `JOB_STATUS_PAUSED = &H00000001
%EQUATE `JOB_STATUS_ERROR = &H00000002
%EQUATE `JOB_STATUS_DELETING = &H00000004
%EQUATE `JOB_STATUS_SPOOLING = &H00000008
%EQUATE `JOB_STATUS_PRINTING = &H00000010
%EQUATE `JOB_STATUS_OFFLINE = &H00000020
%EQUATE `JOB_STATUS_PAPEROUT = &H00000040
%EQUATE `JOB_STATUS_PRINTED = &H00000080
%EQUATE `JOB_STATUS_DELETED = &H00000100
%EQUATE `JOB_STATUS_BLOCKED_DEVQ = &H00000200
%EQUATE `JOB_STATUS_USER_INTERVENTION = &H00000400
%EQUATE `JOB_STATUS_RESTART = &H00000800
'#if (NTDDI_VERSION >= NTDDI_WINXP)
%EQUATE `JOB_STATUS_COMPLETE = &H00001000
'#endif // (NTDDI_VERSION >= NTDDI_WINXP)
'#if (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `JOB_STATUS_RETAINED = &H00002000
%EQUATE `JOB_STATUS_RENDERING_LOCALLY = &H00004000
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `JOB_POSITION_UNSPECIFIED = 0
' // Size = 8 bytes
TYPE ADDJOB_INFO_1A DWORD
 Path AS ASCIIZ PTR
 JobId AS DWORD
END TYPE
' // Size = 8 bytes
TYPE ADDJOB_INFO_1W DWORD
 Path AS WSTRINGZ PTR
 JobId AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO ADDJOB_INFO_1 = ADDJOB_INFO_1W
#ELSE
 MACRO ADDJOB_INFO_1 = ADDJOB_INFO_1A
#ENDIF
'typedef struct _DRIVER_INFO_1A {
' LPSTR pName; // QMS 810
'} DRIVER_INFO_1A, *PDRIVER_INFO_1A, *LPDRIVER_INFO_1A;
' // Size = 4 bytes
TYPE DRIVER_INFO_1A DWORD
 pName AS ASCIIZ PTR
END TYPE
' // Size = 4 bytes
TYPE DRIVER_INFO_1W DWORD
 pName AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO DRIVER_INFO_1 = DRIVER_INFO_1W
#ELSE
 MACRO DRIVER_INFO_1 = DRIVER_INFO_1A
#ENDIF
' // Size = 24 bytes
TYPE DRIVER_INFO_2A DWORD
 cVersion AS DWORD
 pName AS ASCIIZ PTR
 pEnvironment AS ASCIIZ PTR
 pDriverPath AS ASCIIZ PTR
 pDataFile AS ASCIIZ PTR
 pConfigFile AS ASCIIZ PTR
END TYPE
' // Size = 24 bytes
TYPE DRIVER_INFO_2W DWORD
 cVersion AS DWORD
 pName AS WSTRINGZ PTR
 pEnvironment AS WSTRINGZ PTR
 pDriverPath AS WSTRINGZ PTR
 pDataFile AS WSTRINGZ PTR
 pConfigFile AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO DRIVER_INFO_2 = DRIVER_INFO_2W
#ELSE
 MACRO DRIVER_INFO_2 = DRIVER_INFO_2A
#ENDIF
' // Size = 40 bytes
TYPE DRIVER_INFO_3A DWORD
 cVersion AS DWORD
 pName AS ASCIIZ PTR
 pEnvironment AS ASCIIZ PTR
 pDriverPath AS ASCIIZ PTR
 pDataFile AS ASCIIZ PTR
 pConfigFile AS ASCIIZ PTR
 pHelpFile AS ASCIIZ PTR
 pDependentFiles AS ASCIIZ PTR
 pMonitorName AS ASCIIZ PTR
 pDefaultDataType AS ASCIIZ PTR
END TYPE
' // Size = 40 bytes
TYPE DRIVER_INFO_3W DWORD
 cVersion AS DWORD
 pName AS WSTRINGZ PTR
 pEnvironment AS WSTRINGZ PTR
 pDriverPath AS WSTRINGZ PTR
 pDataFile AS WSTRINGZ PTR
 pConfigFile AS WSTRINGZ PTR
 pHelpFile AS WSTRINGZ PTR
 pDependentFiles AS WSTRINGZ PTR
 pMonitorName AS WSTRINGZ PTR
 pDefaultDataType AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO DRIVER_INFO_3 = DRIVER_INFO_3W
#ELSE
 MACRO DRIVER_INFO_3 = DRIVER_INFO_3A
#ENDIF
' // Size = 44 bytes
TYPE DRIVER_INFO_4A DWORD
 cVersion AS DWORD
 pName AS ASCIIZ PTR
 pEnvironment AS ASCIIZ PTR
 pDriverPath AS ASCIIZ PTR
 pDataFile AS ASCIIZ PTR
 pConfigFile AS ASCIIZ PTR
 pHelpFile AS ASCIIZ PTR
 pDependentFiles AS ASCIIZ PTR
 pMonitorName AS ASCIIZ PTR
 pDefaultDataType AS ASCIIZ PTR
 pszzPreviousNames AS ASCIIZ PTR
END TYPE
' // Size = 44 bytes
TYPE DRIVER_INFO_4W DWORD
 cVersion AS DWORD
 pName AS WSTRINGZ PTR
 pEnvironment AS WSTRINGZ PTR
 pDriverPath AS WSTRINGZ PTR
 pDataFile AS WSTRINGZ PTR
 pConfigFile AS WSTRINGZ PTR
 pHelpFile AS WSTRINGZ PTR
 pDependentFiles AS WSTRINGZ PTR
 pMonitorName AS WSTRINGZ PTR
 pDefaultDataType AS WSTRINGZ PTR
 pszzPreviousNames AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO DRIVER_INFO_4 = DRIVER_INFO_4W
#ELSE
 MACRO DRIVER_INFO_4 = DRIVER_INFO_4A
#ENDIF
' // Size = 36 bytes
TYPE DRIVER_INFO_5A DWORD
 cVersion AS DWORD
 pName AS ASCIIZ PTR
 pEnvironment AS ASCIIZ PTR
 pDriverPath AS ASCIIZ PTR
 pDataFile AS ASCIIZ PTR
 pConfigFile AS ASCIIZ PTR
 dwDriverAttributes AS DWORD
 dwConfigVersion AS DWORD
 dwDriverVersion AS DWORD
END TYPE
' // Size = 36 bytes
TYPE DRIVER_INFO_5W DWORD
 cVersion AS DWORD
 pName AS WSTRINGZ PTR
 pEnvironment AS WSTRINGZ PTR
 pDriverPath AS WSTRINGZ PTR
 pDataFile AS WSTRINGZ PTR
 pConfigFile AS WSTRINGZ PTR
 dwDriverAttributes AS DWORD
 dwConfigVersion AS DWORD
 dwDriverVersion AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO DRIVER_INFO_5 = DRIVER_INFO_5W
#ELSE
 MACRO DRIVER_INFO_5 = DRIVER_INFO_5A
#ENDIF
' // Size = 80 bytes
TYPE DRIVER_INFO_6A QWORD FILL ' Must be 8 byte aligned
 cVersion AS DWORD
 pName AS ASCIIZ PTR
 pEnvironment AS ASCIIZ PTR
 pDriverPath AS ASCIIZ PTR
 pDataFile AS ASCIIZ PTR
 pConfigFile AS ASCIIZ PTR
 pHelpFile AS ASCIIZ PTR
 pDependentFiles AS ASCIIZ PTR
 pMonitorName AS ASCIIZ PTR
 pDefaultDataType AS ASCIIZ PTR
 pszzPreviousNames AS ASCIIZ PTR
 ftDriverDate AS FILETIME ' FILETIME
 dwlDriverVersion AS QUAD ' DWORDLONG
 pszMfgName AS ASCIIZ PTR
 pszOEMUrl AS ASCIIZ PTR
 pszHardwareID AS ASCIIZ PTR
 pszProvider AS ASCIIZ PTR
END TYPE
' // Size = 80 bytes
TYPE DRIVER_INFO_6W QWORD FILL ' Must be 8 byte aligned
 cVersion AS DWORD
 pName AS WSTRINGZ PTR
 pEnvironment AS WSTRINGZ PTR
 pDriverPath AS WSTRINGZ PTR
 pDataFile AS WSTRINGZ PTR
 pConfigFile AS WSTRINGZ PTR
 pHelpFile AS WSTRINGZ PTR
 pDependentFiles AS WSTRINGZ PTR
 pMonitorName AS WSTRINGZ PTR
 pDefaultDataType AS WSTRINGZ PTR
 pszzPreviousNames AS WSTRINGZ PTR
 ftDriverDate AS FILETIME ' FILETIME
 dwlDriverVersion AS QUAD ' DWORDLONG
 pszMfgName AS WSTRINGZ PTR
 pszOEMUrl AS WSTRINGZ PTR
 pszHardwareID AS WSTRINGZ PTR
 pszProvider AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO DRIVER_INFO_6 = DRIVER_INFO_6W
#ELSE
 MACRO DRIVER_INFO_6 = DRIVER_INFO_6A
#ENDIF
%EQUATE `PRINTER_DRIVER_PACKAGE_AWARE = &H00000001
%EQUATE `PRINTER_DRIVER_SANDBOX_ENABLED = &H00000004
' // Size = 120 bytes
TYPE DRIVER_INFO_8A QWORD FILL ' Must be 8 byte aligned
 cVersion AS DWORD
 pName AS ASCIIZ PTR ' LPSTR // QMS 810
 pEnvironment AS ASCIIZ PTR ' LPSTR // Win32 x86
 pDriverPath AS ASCIIZ PTR ' LPSTR // c:\drivers\pscript.dll
 pDataFile AS ASCIIZ PTR ' LPSTR // c:\drivers\QMS810.PPD
 pConfigFile AS ASCIIZ PTR ' LPSTR // c:\drivers\PSCRPTUI.DLL
 pHelpFile AS ASCIIZ PTR ' LPSTR // c:\drivers\PSCRPTUI.HLP
 pDependentFiles AS ASCIIZ PTR ' LPSTR // PSCRIPT.DLL\0QMS810.PPD\0PSCRIPTUI.DLL\0PSCRIPTUI.HLP\0PSTEST.TXT\0\0
 pMonitorName AS ASCIIZ PTR ' LPSTR // "PJL monitor"
 pDefaultDataType AS ASCIIZ PTR ' LPSTR // "EMF"
 pszzPreviousNames AS ASCIIZ PTR ' LPSTR // "OldName1\0OldName2\0\0
 ftDriverDate AS FILETIME ' FILETIME
 dwlDriverVersion AS QUAD ' DWORDLONG
 pszMfgName AS ASCIIZ PTR
 pszOEMUrl AS ASCIIZ PTR
 pszHardwareID AS ASCIIZ PTR
 pszProvider AS ASCIIZ PTR
 pszPrintProcessor AS ASCIIZ PTR
 pszVendorSetup AS ASCIIZ PTR
 pszzColorProfiles AS ASCIIZ PTR
 pszInfPath AS ASCIIZ PTR
 dwPrinterDriverAttributes AS DWORD
 pszzCoreDriverDependencies AS ASCIIZ PTR
 ftMinInboxDriverVerDate AS FILETIME ' FILETIME
 dwlMinInboxDriverVerVersion AS QUAD ' DWORDLONG
END TYPE
' // Size = 120 bytes
TYPE DRIVER_INFO_8W QWORD FILL ' Must be 8 byte aligned
 cVersion AS DWORD
 pName AS WSTRINGZ PTR ' LPWSTR // QMS 810
 pEnvironment AS WSTRINGZ PTR ' LPWSTR // Win32 x86
 pDriverPath AS WSTRINGZ PTR ' LPWSTR // c:\drivers\pscript.dll
 pDataFile AS WSTRINGZ PTR ' LPWSTR // c:\drivers\QMS810.PPD
 pConfigFile AS WSTRINGZ PTR ' LPWSTR // c:\drivers\PSCRPTUI.DLL
 pHelpFile AS WSTRINGZ PTR ' LPWSTR // c:\drivers\PSCRPTUI.HLP
 pDependentFiles AS WSTRINGZ PTR ' LPWSTR // PSCRIPT.DLL\0QMS810.PPD\0PSCRIPTUI.DLL\0PSCRIPTUI.HLP\0PSTEST.TXT\0\0
 pMonitorName AS WSTRINGZ PTR ' LPWSTR // "PJL monitor"
 pDefaultDataType AS WSTRINGZ PTR ' LPWSTR // "EMF"
 pszzPreviousNames AS WSTRINGZ PTR ' LPWSTR // "OldName1\0OldName2\0\0
 ftDriverDate AS FILETIME ' FILETIME
 dwlDriverVersion AS QUAD ' DWORDLONG
 pszMfgName AS WSTRINGZ PTR
 pszOEMUrl AS WSTRINGZ PTR
 pszHardwareID AS WSTRINGZ PTR
 pszProvider AS WSTRINGZ PTR
 pszPrintProcessor AS WSTRINGZ PTR
 pszVendorSetup AS WSTRINGZ PTR
 pszzColorProfiles AS WSTRINGZ PTR
 pszInfPath AS WSTRINGZ PTR
 dwPrinterDriverAttributes AS DWORD
 pszzCoreDriverDependencies AS WSTRINGZ PTR
 ftMinInboxDriverVerDate AS FILETIME ' FILETIME
 dwlMinInboxDriverVerVersion AS QUAD ' DWORDLONG
END TYPE
#IF %DEF(%UNICODE)
 MACRO DRIVER_INFO_8 = DRIVER_INFO_8W
#ELSE
 MACRO DRIVER_INFO_8 = DRIVER_INFO_8A
#ENDIF
'// FLAGS for dwDriverAttributes
%EQUATE `DRIVER_KERNELMODE = &H00000001
%EQUATE `DRIVER_USERMODE = &H00000002
'// FLAGS for DeletePrinterDriverEx.
%EQUATE `DPD_DELETE_UNUSED_FILES = &H00000001
%EQUATE `DPD_DELETE_SPECIFIC_VERSION = &H00000002
%EQUATE `DPD_DELETE_ALL_FILES = &H00000004
'// FLAGS for AddPrinterDriverEx.
%EQUATE `APD_STRICT_UPGRADE = &H00000001
%EQUATE `APD_STRICT_DOWNGRADE = &H00000002
%EQUATE `APD_COPY_ALL_FILES = &H00000004
%EQUATE `APD_COPY_NEW_FILES = &H00000008
'#if (NTDDI_VERSION >= NTDDI_WINXP)
%EQUATE `APD_COPY_FROM_DIRECTORY = &H00000010
'#endif // (NTDDI_VERSION >= NTDDI_WINXP)
'// String for EnumPrinterDrivers. Used by Windows Update
' // Size = 12 bytes
TYPE DOC_INFO_1A DWORD
 pDocName AS ASCIIZ PTR
 pOutputFile AS ASCIIZ PTR
 pDatatype AS ASCIIZ PTR
END TYPE
' // Size = 12 bytes
TYPE DOC_INFO_1W DWORD
 pDocName AS WSTRINGZ PTR
 pOutputFile AS WSTRINGZ PTR
 pDatatype AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO DOC_INFO_1 = DOC_INFO_1W
#ELSE
 MACRO DOC_INFO_1 = DOC_INFO_1A
#ENDIF
' // Size = 32 bytes
TYPE FORM_INFO_1A DWORD
 Flags AS DWORD
 pName AS ASCIIZ PTR
 Size AS SIZEL ' SIZEL
 ImageableArea AS RECTL ' RECTL
END TYPE
' // Size = 32 bytes
TYPE FORM_INFO_1W DWORD
 Flags AS DWORD
 pName AS WSTRINGZ PTR
 Size AS SIZEL ' SIZEL
 ImageableArea AS RECTL ' RECTL
END TYPE
#IF %DEF(%UNICODE)
 MACRO FORM_INFO_1 = FORM_INFO_1W
#ELSE
 MACRO FORM_INFO_1 = FORM_INFO_1A
#ENDIF
'#if (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `STRING_NONE = &H00000001
%EQUATE `STRING_MUIDLL = &H00000002
%EQUATE `STRING_LANGPAIR = &H00000004
%EQUATE `MAX_FORM_KEYWORD_LENGTH = 63+1
' // Size = 56 bytes
TYPE FORM_INFO_2A DWORD
 Flags AS DWORD
 pName AS ASCIIZ PTR
 Size AS SIZEL ' SIZEL
 ImageableArea AS RECTL ' RECTL
 pKeyword AS ASCIIZ PTR
 StringType AS DWORD
 pMuiDll AS ASCIIZ PTR
 dwResourceId AS DWORD
 pDisplayName AS ASCIIZ PTR
 wLangId AS WORD
END TYPE
' // Size = 56 bytes
TYPE FORM_INFO_2W DWORD
 Flags AS DWORD
 pName AS WSTRINGZ PTR
 Size AS SIZEL ' SIZEL
 ImageableArea AS RECTL ' RECTL
 pKeyword AS WSTRINGZ PTR
 StringType AS DWORD
 pMuiDll AS WSTRINGZ PTR
 dwResourceId AS DWORD
 pDisplayName AS WSTRINGZ PTR
 wLangId AS WORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO FORM_INFO_2 = FORM_INFO_2W
#ELSE
 MACRO FORM_INFO_2 = FORM_INFO_2A
#ENDIF
' // Size = 20 bytes
TYPE DOC_INFO_2A DWORD
 pDocName AS ASCIIZ PTR
 pOutputFile AS ASCIIZ PTR
 pDatatype AS ASCIIZ PTR
 dwMode AS DWORD
 JobId AS DWORD
END TYPE
' // Size = 20 bytes
TYPE DOC_INFO_2W DWORD
 pDocName AS WSTRINGZ PTR
 pOutputFile AS WSTRINGZ PTR
 pDatatype AS WSTRINGZ PTR
 dwMode AS DWORD
 JobId AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO DOC_INFO_2 = DOC_INFO_2W
#ELSE
 MACRO DOC_INFO_2 = DOC_INFO_2A
#ENDIF
%EQUATE `DI_CHANNEL = 1 ' start direct read/write channel,
%EQUATE `DI_READ_SPOOL_JOB = 3
' // Size = 16 bytes
TYPE DOC_INFO_3A DWORD
 pDocName AS ASCIIZ PTR
 pOutputFile AS ASCIIZ PTR
 pDataType AS ASCIIZ PTR
 dwFlags AS DWORD
END TYPE
' // Size = 16 bytes
TYPE DOC_INFO_3W DWORD
 pDocName AS WSTRINGZ PTR
 pOutputFile AS WSTRINGZ PTR
 pDataType AS WSTRINGZ PTR
 dwFlags AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO DOC_INFO_3 = DOC_INFO_3W
#ELSE
 MACRO DOC_INFO_3 = DOC_INFO_3A
#ENDIF
%EQUATE `DI_MEMORYMAP_WRITE = &H00000001
%EQUATE `FORM_USER = &H00000000
%EQUATE `FORM_BUILTIN = &H00000001
%EQUATE `FORM_PRINTER = &H00000002
' // Size = 4 bytes
TYPE PRINTPROCESSOR_INFO_1A DWORD
 pName AS ASCIIZ PTR
END TYPE
' // Size = 4 bytes
TYPE PRINTPROCESSOR_INFO_1W DWORD
 pName AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTPROCESSOR_INFO_1 = PRINTPROCESSOR_INFO_1W
#ELSE
 MACRO PRINTPROCESSOR_INFO_1 = PRINTPROCESSOR_INFO_1A
#ENDIF
'#if (NTDDI_VERSION >= NTDDI_WINXP)
' // Size = 16 bytes
TYPE PRINTPROCESSOR_CAPS_1 DWORD
 dwLevel AS DWORD
 dwNupOptions AS DWORD
 dwPageOrderFlags AS DWORD
 dwNumberOfCopies AS DWORD
END TYPE
%EQUATE `NORMAL_PRINT = &H00000000
%EQUATE `REVERSE_PRINT = &H00000001
'#endif // (NTDDI_VERSION >= NTDDI_WINXP)
'#if (NTDDI_VERSION >= NTDDI_VISTA)
' // Size = 36 bytes
TYPE PRINTPROCESSOR_CAPS_2 DWORD
 dwLevel AS DWORD
 dwNupOptions AS DWORD
 dwPageOrderFlags AS DWORD
 dwNumberOfCopies AS DWORD
 '// _PRINTPROCESSOR_CAPS_2 specific fields.
 dwDuplexHandlingCaps AS DWORD
 dwNupDirectionCaps AS DWORD
 dwNupBorderCaps AS DWORD
 dwBookletHandlingCaps AS DWORD
 dwScalingCaps AS DWORD
END TYPE
'//Flags for dwNupDirectionCaps.
%EQUATE `PPCAPS_RIGHT_THEN_DOWN = &H00000001 ' ( 0x00000001 ) // 0x00000001
%EQUATE `PPCAPS_DOWN_THEN_RIGHT = &H00000002 ' ( 0x00000001 << 1 ) // 0x00000002
%EQUATE `PPCAPS_LEFT_THEN_DOWN = &H00000004 ' ( 0x00000001 << 2 ) // 0x00000004
%EQUATE `PPCAPS_DOWN_THEN_LEFT = &H00000008 ' ( 0x00000001 << 3 ) // 0x00000008
'//dwNupBorderCaps
%EQUATE `PPCAPS_BORDER_PRINT = &H00000001
'//dwBookletHandlingCaps
%EQUATE `PPCAPS_BOOKLET_EDGE = &H00000001
'//dwDuplexHandlingCaps
'// The below flag tells that print processor can flip page order within sheet
'// while printing reverse duplex.
'// e.g. Instead of playing pages in order 4,3,2,1, print processor can play them 3,4,1,2
%EQUATE `PPCAPS_REVERSE_PAGES_FOR_REVERSE_DUPLEX = &H00000001
%EQUATE `PPCAPS_DONT_SEND_EXTRA_PAGES_FOR_DUPLEX = &H00000002 ' ( 0x00000001 << 1 )
'//dwScalingCaps
%EQUATE `PPCAPS_SQUARE_SCALING = &H00000001
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
' // Size = 4 bytes
TYPE PORT_INFO_1A DWORD
 pName AS ASCIIZ PTR
END TYPE
' // Size = 4 bytes
TYPE PORT_INFO_1W DWORD
 pName AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO PORT_INFO_1 = PORT_INFO_1W
#ELSE
 MACRO PORT_INFO_1 = PORT_INFO_1A
#ENDIF
' // Size = 20 bytes
TYPE PORT_INFO_2A DWORD
 pPortName AS ASCIIZ PTR
 pMonitorName AS ASCIIZ PTR
 pDescription AS ASCIIZ PTR
 fPortType AS DWORD
 Reserved AS DWORD
END TYPE
' // Size = 20 bytes
TYPE PORT_INFO_2W DWORD
 pPortName AS WSTRINGZ PTR
 pMonitorName AS WSTRINGZ PTR
 pDescription AS WSTRINGZ PTR
 fPortType AS DWORD
 Reserved AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO PORT_INFO_2 = PORT_INFO_2W
#ELSE
 MACRO PORT_INFO_2 = PORT_INFO_2A
#ENDIF
%EQUATE `PORT_TYPE_WRITE = &H0001
%EQUATE `PORT_TYPE_READ = &H0002
%EQUATE `PORT_TYPE_REDIRECTED = &H0004
%EQUATE `PORT_TYPE_NET_ATTACHED = &H0008
' // Size = 12 bytes
TYPE PORT_INFO_3A DWORD
 dwStatus AS DWORD
 pszStatus AS ASCIIZ PTR
 dwSeverity AS DWORD
END TYPE
' // Size = 12 bytes
TYPE PORT_INFO_3W DWORD
 dwStatus AS DWORD
 pszStatus AS WSTRINGZ PTR
 dwSeverity AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO PORT_INFO_3 = PORT_INFO_3W
#ELSE
 MACRO PORT_INFO_3 = PORT_INFO_3A
#ENDIF
%EQUATE `PORT_STATUS_TYPE_ERROR = 1
%EQUATE `PORT_STATUS_TYPE_WARNING = 2
%EQUATE `PORT_STATUS_TYPE_INFO = 3
%EQUATE `PORT_STATUS_OFFLINE = 1
%EQUATE `PORT_STATUS_PAPER_JAM = 2
%EQUATE `PORT_STATUS_PAPER_OUT = 3
%EQUATE `PORT_STATUS_OUTPUT_BIN_FULL = 4
%EQUATE `PORT_STATUS_PAPER_PROBLEM = 5
%EQUATE `PORT_STATUS_NO_TONER = 6
%EQUATE `PORT_STATUS_DOOR_OPEN = 7
%EQUATE `PORT_STATUS_USER_INTERVENTION = 8
%EQUATE `PORT_STATUS_OUT_OF_MEMORY = 9
%EQUATE `PORT_STATUS_TONER_LOW = 10
%EQUATE `PORT_STATUS_WARMING_UP = 11
%EQUATE `PORT_STATUS_POWER_SAVE = 12
' // Size = 4 bytes
TYPE MONITOR_INFO_1A DWORD
 pName AS ASCIIZ PTR
END TYPE
' // Size = 4 bytes
TYPE MONITOR_INFO_1W DWORD
 pName AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO MONITOR_INFO_1 = MONITOR_INFO_1W
#ELSE
 MACRO MONITOR_INFO_1 = MONITOR_INFO_1A
#ENDIF
' // Size = 12 bytes
TYPE MONITOR_INFO_2A DWORD
 pName AS ASCIIZ PTR
 pEnvironment AS ASCIIZ PTR
 pDLLName AS ASCIIZ PTR
END TYPE
' // Size = 12 bytes
TYPE MONITOR_INFO_2W DWORD
 pName AS WSTRINGZ PTR
 pEnvironment AS WSTRINGZ PTR
 pDLLName AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO MONITOR_INFO_2 = MONITOR_INFO_2W
#ELSE
 MACRO MONITOR_INFO_2 = MONITOR_INFO_2A
#ENDIF
' // Size = 4 bytes
TYPE DATATYPES_INFO_1A DWORD
 pName AS ASCIIZ PTR
END TYPE
' // Size = 4 bytes
TYPE DATATYPES_INFO_1W DWORD
 pName AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO DATATYPES_INFO_1 = DATATYPES_INFO_1W
#ELSE
 MACRO DATATYPES_INFO_1 = DATATYPES_INFO_1A
#ENDIF
' // Size = 12 bytes
TYPE PRINTER_DEFAULTSA DWORD
 pDatatype AS ASCIIZ PTR
 pDevMode AS DEVMODE PTR
 DesiredAccess AS DWORD ' ACCESS_MASK
END TYPE
' // Size = 12 bytes
TYPE PRINTER_DEFAULTSW DWORD
 pDatatype AS WSTRINGZ PTR
 pDevMode AS DEVMODEW PTR
 DesiredAccess AS DWORD ' ACCESS_MASK
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTER_DEFAULTS = PRINTER_DEFAULTSW
#ELSE
 MACRO PRINTER_DEFAULTS = PRINTER_DEFAULTSA
#ENDIF
' // Size = 20 bytes
TYPE PRINTER_ENUM_VALUESA DWORD
 pValueName AS ASCIIZ PTR
 cbValueName AS DWORD
 dwType AS DWORD
 pData AS BYTE PTR
 cbData AS DWORD
END TYPE
' // Size = 20 bytes
TYPE PRINTER_ENUM_VALUESW DWORD
 pValueName AS WSTRINGZ PTR
 cbValueName AS DWORD
 dwType AS DWORD
 pData AS BYTE PTR
 cbData AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTER_ENUM_VALUES = PRINTER_ENUM_VALUESW
#ELSE
 MACRO PRINTER_ENUM_VALUES = PRINTER_ENUM_VALUESA
#ENDIF
' Undocumented - Not in Vista SDK
DECLARE FUNCTION EnumPrinterPropertySheets LIB "winspool.drv" ALIAS "EnumPrinterPropertySheets" ( BYREF phPrinter AS QUAD ) AS QUAD ' phPrinter , BYREF hWnd AS QUAD ' hWnd , BYREF lpfnAdd AS QUAD ' lpfnAdd , BYVAL lParam AS LONG ' lParam
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrintersA LIB "WinSpool.drv" ALIAS "EnumPrintersA" ( BYVAL Flags AS QUAD, sName AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pPrinterEnum AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumPrintersA LIB "winspool.drv" ALIAS "EnumPrintersA" ( BYVAL Flags AS QUAD , BYREF Name AS ASCIIZ , BYVAL Level AS QUAD , BYREF pPrinterEnum AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrintersW LIB "WinSpool.drv" ALIAS "EnumPrintersW" ( BYVAL Flags AS QUAD, sName AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pPrinterEnum AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumPrintersW LIB "winspool.drv" ALIAS "EnumPrintersW" ( BYVAL Flags AS QUAD , BYREF Name AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pPrinterEnum AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO EnumPrinters = EnumPrintersW
#ELSE
 MACRO EnumPrinters = EnumPrintersA
#ENDIF
%EQUATE `PRINTER_ENUM_DEFAULT = &H00000001
%EQUATE `PRINTER_ENUM_LOCAL = &H00000002
%EQUATE `PRINTER_ENUM_CONNECTIONS = &H00000004
%EQUATE `PRINTER_ENUM_FAVORITE = &H00000004
%EQUATE `PRINTER_ENUM_NAME = &H00000008
%EQUATE `PRINTER_ENUM_REMOTE = &H00000010
%EQUATE `PRINTER_ENUM_SHARED = &H00000020
%EQUATE `PRINTER_ENUM_NETWORK = &H00000040
%EQUATE `PRINTER_ENUM_EXPAND = &H00004000
%EQUATE `PRINTER_ENUM_CONTAINER = &H00008000
%EQUATE `PRINTER_ENUM_ICONMASK = &H00ff0000
%EQUATE `PRINTER_ENUM_ICON1 = &H00010000
%EQUATE `PRINTER_ENUM_ICON2 = &H00020000
%EQUATE `PRINTER_ENUM_ICON3 = &H00040000
%EQUATE `PRINTER_ENUM_ICON4 = &H00080000
%EQUATE `PRINTER_ENUM_ICON5 = &H00100000
%EQUATE `PRINTER_ENUM_ICON6 = &H00200000
%EQUATE `PRINTER_ENUM_ICON7 = &H00400000
%EQUATE `PRINTER_ENUM_ICON8 = &H00800000
%EQUATE `PRINTER_ENUM_HIDE = &H01000000
%EQUATE `SPOOL_FILE_PERSISTENT = &H00000001
%EQUATE `SPOOL_FILE_TEMPORARY = &H00000002
DECLARE FUNCTION GetSpoolFileHandle LIB "winspool.drv" ALIAS "GetSpoolFileHandle" ( BYVAL hPrinter AS QUAD ) AS QUAD
DECLARE FUNCTION CommitSpoolData LIB "winspool.drv" ALIAS "CommitSpoolData" ( BYVAL hPrinter AS QUAD
 , BYVAL hSpoolFile AS DWORD
 , BYVAL cbCommit AS DWORD
 ) AS DWORD
DECLARE FUNCTION CloseSpoolFileHandle LIB "winspool.drv" ALIAS "CloseSpoolFileHandle" ( BYVAL hPrinter AS DWORD
 , BYVAL hSpoolFile AS DWORD
 ) AS LONG
DECLARE FUNCTION OpenPrinterA LIB "winspool.drv" ALIAS "OpenPrinterA" ( BYREF pPrinterName AS ASCIIZ
 , BYREF phPrinter AS DWORD
 , OPTIONAL BYREF pDefault AS PRINTER_DEFAULTSA
 ) AS LONG
DECLARE FUNCTION OpenPrinterW LIB "winspool.drv" ALIAS "OpenPrinterW" ( BYREF pPrinterName AS WSTRINGZ
 , BYREF phPrinter AS DWORD
 , OPTIONAL BYREF pDefault AS PRINTER_DEFAULTSW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO OpenPrinter = OpenPrinterW
#ELSE
 MACRO OpenPrinter = OpenPrinterA
#ENDIF
DECLARE FUNCTION ResetPrinterA LIB "winspool.drv" ALIAS "ResetPrinterA" ( BYVAL hPrinter AS QUAD , OPTIONAL BYREF pDefault AS PRINTER_DEFAULTSA ) AS LONG
DECLARE FUNCTION ResetPrinterW LIB "winspool.drv" ALIAS "ResetPrinterW" ( BYVAL hPrinter AS QUAD
 , OPTIONAL BYREF pDefault AS PRINTER_DEFAULTSW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO ResetPrinter = ResetPrinterW
#ELSE
 MACRO ResetPrinter = ResetPrinterA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetJobA LIB "WinSpool.drv" ALIAS "SetJobA" ( BYVAL hPrinter AS QUAD,
 BYVAL JobId AS QUAD, BYVAL Level AS QUAD, BYVAL pJob AS BYTE PTR, BYVAL COMMAND AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION SetJobA LIB "winspool.drv" ALIAS "SetJobA" ( BYVAL hPrinter AS QUAD , BYVAL JobId AS QUAD , BYVAL Level AS QUAD , BYREF pJob AS ANY , BYVAL Command AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetJobW LIB "WinSpool.drv" ALIAS "SetJobW" ( BYVAL hPrinter AS QUAD,
 BYVAL JobId AS QUAD, BYVAL Level AS QUAD, BYVAL pJob AS BYTE PTR, BYVAL COMMAND AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION SetJobW LIB "winspool.drv" ALIAS "SetJobW" ( BYVAL hPrinter AS QUAD , BYVAL JobId AS QUAD , BYVAL Level AS QUAD , BYREF pJob AS ANY , BYVAL Command AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO SetJob = SetJobW
#ELSE
 MACRO SetJob = SetJobA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetJobA LIB "WinSpool.drv" ALIAS "GetJobA" ( BYVAL hPrinter AS QUAD,
 BYVAL JobId AS QUAD, BYVAL Level AS QUAD, BYVAL pJob AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetJobA LIB "winspool.drv" ALIAS "GetJobA" ( BYVAL hPrinter AS QUAD , BYVAL JobId AS QUAD , BYVAL Level AS QUAD , BYREF pJob AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetJobW LIB "WinSpool.drv" ALIAS "GetJobW" ( BYVAL hPrinter AS QUAD,
 BYVAL JobId AS QUAD, BYVAL Level AS QUAD, BYVAL pJob AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetJobW LIB "winspool.drv" ALIAS "GetJobW" ( BYVAL hPrinter AS QUAD , BYVAL JobId AS QUAD , BYVAL Level AS QUAD , BYREF pJob AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetJob = GetJobW
#ELSE
 MACRO GetJob = GetJobA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumJobsA LIB "WinSpool.drv" ALIAS "EnumJobsA" ( BYVAL hPrinter AS QUAD,
 BYVAL FirstJob AS QUAD, BYVAL NoJobs AS QUAD, BYVAL Level AS QUAD, BYVAL pJob AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumJobsA LIB "winspool.drv" ALIAS "EnumJobsA" ( BYVAL hPrinter AS QUAD , BYVAL FirstJob AS QUAD , BYVAL NoJobs AS QUAD , BYVAL Level AS QUAD , BYREF pJob AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumJobsW LIB "WinSpool.drv" ALIAS "EnumJobsW" ( BYVAL hPrinter AS QUAD,
 BYVAL FirstJob AS QUAD, BYVAL NoJobs AS QUAD, BYVAL Level AS QUAD, BYVAL pJob AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumJobsW LIB "winspool.drv" ALIAS "EnumJobsW" ( BYVAL hPrinter AS QUAD , BYVAL FirstJob AS QUAD , BYVAL NoJobs AS QUAD , BYVAL Level AS QUAD , BYREF pJob AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO EnumJobs = EnumJobsW
#ELSE
 MACRO EnumJobs = EnumJobsA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddPrinterA LIB "WinSpool.drv" ALIAS "AddPrinterA" ( pName AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pPrinter AS BYTE PTR ) AS QUAD
#ELSE
DECLARE FUNCTION AddPrinterA LIB "winspool.drv" ALIAS "AddPrinterA" ( BYREF pName AS ASCIIZ , BYVAL Level AS QUAD , BYREF pPrinter AS ANY ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddPrinterW LIB "WinSpool.drv" ALIAS "AddPrinterW" ( pName AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pPrinter AS BYTE PTR ) AS QUAD
#ELSE
DECLARE FUNCTION AddPrinterW LIB "winspool.drv" ALIAS "AddPrinterW" ( BYREF pName AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pPrinter AS ANY ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO AddPrinter = AddPrinterW
#ELSE
 MACRO AddPrinter = AddPrinterA
#ENDIF
DECLARE FUNCTION DeletePrinter LIB "winspool.drv" ALIAS "DeletePrinter" ( BYVAL hPrinter AS QUAD ) AS LONG
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetPrinterA LIB "WinSpool.drv" ALIAS "SetPrinterA" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pPrinter AS BYTE PTR, BYVAL COMMAND AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION SetPrinterA LIB "winspool.drv" ALIAS "SetPrinterA" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pPrinter AS ANY , BYVAL Command AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetPrinterW LIB "WinSpool.drv" ALIAS "SetPrinterW" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pPrinter AS BYTE PTR, BYVAL COMMAND AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION SetPrinterW LIB "winspool.drv" ALIAS "SetPrinterW" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pPrinter AS ANY , BYVAL Command AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO SetPrinter = SetPrinterW
#ELSE
 MACRO SetPrinter = SetPrinterA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterA LIB "WinSpool.drv" ALIAS "GetPrinterA" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pPrinter AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetPrinterA LIB "winspool.drv" ALIAS "GetPrinterA" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pPrinter AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterW LIB "WinSpool.drv" ALIAS "GetPrinterW" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pPrinter AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetPrinterW LIB "winspool.drv" ALIAS "GetPrinterW" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pPrinter AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetPrinter = GetPrinterW
#ELSE
 MACRO GetPrinter = GetPrinterA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddPrinterDriverA LIB "WinSpool.drv" ALIAS "AddPrinterDriverA" ( pName AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pDriverInfo AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION AddPrinterDriverA LIB "winspool.drv" ALIAS "AddPrinterDriverA" ( BYREF pName AS ASCIIZ , BYVAL Level AS QUAD , BYREF pDriverInfo AS ANY ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddPrinterDriverW LIB "WinSpool.drv" ALIAS "AddPrinterDriverW" ( pName AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pDriverInfo AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION AddPrinterDriverW LIB "winspool.drv" ALIAS "AddPrinterDriverW" ( BYREF pName AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pDriverInfo AS ANY ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO AddPrinterDriver = AddPrinterDriverW
#ELSE
 MACRO AddPrinterDriver = AddPrinterDriverA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddPrinterDriverExA LIB "WinSpool.drv" ALIAS "AddPrinterDriverExA" ( pName AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pDriverInfo AS BYTE PTR, BYVAL dwFileCopyFlags AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION AddPrinterDriverExA LIB "winspool.drv" ALIAS "AddPrinterDriverExA" ( BYREF pName AS ASCIIZ , BYVAL Level AS QUAD , BYREF pDriverInfo AS ANY , BYVAL dwFileCopyFlags AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddPrinterDriverExW LIB "WinSpool.drv" ALIAS "AddPrinterDriverExW" ( pName AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pDriverInfo AS BYTE PTR, BYVAL dwFileCopyFlags AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION AddPrinterDriverExW LIB "winspool.drv" ALIAS "AddPrinterDriverExW" ( BYREF pName AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pDriverInfo AS ANY , BYVAL dwFileCopyFlags AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO AddPrinterDriverEx = AddPrinterDriverExW
#ELSE
 MACRO AddPrinterDriverEx = AddPrinterDriverExA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrinterDriversA LIB "WinSpool.drv" ALIAS "EnumPrinterDriversA" ( pName AS ASCIIZ, pEnvironment AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pDriverInfo AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumPrinterDriversA LIB "winspool.drv" ALIAS "EnumPrinterDriversA" ( BYREF pName AS ASCIIZ , BYREF pEnvironment AS ASCIIZ , BYVAL Level AS QUAD , BYREF pDriverInfo AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrinterDriversW LIB "WinSpool.drv" ALIAS "EnumPrinterDriversW" ( pName AS WSTRINGZ, pEnvironment AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pDriverInfo AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumPrinterDriversW LIB "winspool.drv" ALIAS "EnumPrinterDriversW" ( BYREF pName AS WSTRINGZ , BYVAL pEnvironment AS QUAD , BYVAL Level AS QUAD , BYREF pDriverInfo AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO EnumPrinterDrivers = EnumPrinterDriversW
#ELSE
 MACRO EnumPrinterDrivers = EnumPrinterDriversA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterDriverA LIB "WinSpool.drv" ALIAS "GetPrinterDriverA" ( BYVAL hPrinter AS QUAD,
 pEnvironment AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pDriverInfo AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetPrinterDriverA LIB "winspool.drv" ALIAS "GetPrinterDriverA" ( BYVAL hPrinter AS QUAD , BYREF pEnvironment AS ASCIIZ , BYVAL Level AS QUAD , BYREF pDriverInfo AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterDriverW LIB "WinSpool.drv" ALIAS "GetPrinterDriverW" ( BYVAL hPrinter AS QUAD,
 pEnvironment AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pDriverInfo AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetPrinterDriverW LIB "winspool.drv" ALIAS "GetPrinterDriverW" ( BYVAL hPrinter AS QUAD , BYREF pEnvironment AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pDriverInfo AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetPrinterDriver = GetPrinterDriverW
#ELSE
 MACRO GetPrinterDriver = GetPrinterDriverA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterDriverDirectoryA LIB "WinSpool.drv" ALIAS "GetPrinterDriverDirectoryA" ( pName AS ASCIIZ, pEnvironment AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pDriverDirectory AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetPrinterDriverDirectoryA LIB "winspool.drv" ALIAS "GetPrinterDriverDirectoryA" ( BYREF pName AS ASCIIZ , BYREF pEnvironment AS ASCIIZ , BYVAL Level AS QUAD , BYREF pDriverDirectory AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterDriverDirectoryW LIB "WinSpool.drv" ALIAS "GetPrinterDriverDirectoryW" ( pName AS WSTRINGZ, pEnvironment AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pDriverDirectory AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetPrinterDriverDirectoryW LIB "winspool.drv" ALIAS "GetPrinterDriverDirectoryW" ( BYREF pName AS WSTRINGZ , BYREF pEnvironment AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pDriverDirectory AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetPrinterDriverDirectory = GetPrinterDriverDirectoryW
#ELSE
 MACRO GetPrinterDriverDirectory = GetPrinterDriverDirectoryA
#ENDIF
DECLARE FUNCTION DeletePrinterDriverA LIB "winspool.drv" ALIAS "DeletePrinterDriverA" ( BYREF pName AS ASCIIZ , BYREF pEnvironment AS ASCIIZ , BYREF pDriverName AS ASCIIZ ) AS LONG
DECLARE FUNCTION DeletePrinterDriverW LIB "winspool.drv" ALIAS "DeletePrinterDriverW" ( BYREF pName AS WSTRINGZ
 , BYREF pEnvironment AS WSTRINGZ
 , BYREF pDriverName AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DeletePrinterDriver = DeletePrinterDriverW
#ELSE
 MACRO DeletePrinterDriver = DeletePrinterDriverA
#ENDIF
DECLARE FUNCTION DeletePrinterDriverExA LIB "winspool.drv" ALIAS "DeletePrinterDriverExA" ( BYREF pName AS ASCIIZ , BYREF pEnvironment AS ASCIIZ , BYREF pDriverName AS ASCIIZ , BYVAL dwDeleteFlag AS QUAD , BYVAL dwVersionFlag AS QUAD ) AS LONG
DECLARE FUNCTION DeletePrinterDriverExW LIB "winspool.drv" ALIAS "DeletePrinterDriverExW" ( BYREF pName AS WSTRINGZ
 , BYREF pEnvironment AS WSTRINGZ
 , BYREF pDriverName AS WSTRINGZ
 , BYVAL dwDeleteFlag AS DWORD
 , BYVAL dwVersionFlag AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DeletePrinterDriverEx = DeletePrinterDriverExW
#ELSE
 MACRO DeletePrinterDriverEx = DeletePrinterDriverExA
#ENDIF
DECLARE FUNCTION AddPrintProcessorA LIB "winspool.drv" ALIAS "AddPrintProcessorA" ( BYREF pName AS ASCIIZ , BYREF pEnvironment AS ASCIIZ , BYREF pPathName AS ASCIIZ , BYREF pPrintProcessorName AS ASCIIZ ) AS LONG
DECLARE FUNCTION AddPrintProcessorW LIB "winspool.drv" ALIAS "AddPrintProcessorW" ( BYREF pName AS WSTRINGZ
 , BYREF pEnvironment AS WSTRINGZ
 , BYREF pPathName AS WSTRINGZ
 , BYREF pPrintProcessorName AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO AddPrintProcessor = AddPrintProcessorW
#ELSE
 MACRO AddPrintProcessor = AddPrintProcessorA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrintProcessorsA LIB "WinSpool.drv" ALIAS "EnumPrintProcessorsA" ( pName AS ASCIIZ, pEnvironment AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pPrintProcessorInfo AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumPrintProcessorsA LIB "winspool.drv" ALIAS "EnumPrintProcessorsA" ( BYREF pName AS ASCIIZ , BYREF pEnvironment AS ASCIIZ , BYVAL Level AS QUAD , BYREF pPrintProcessorInfo AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrintProcessorsW LIB "WinSpool.drv" ALIAS "EnumPrintProcessorsW" ( pName AS WSTRINGZ, pEnvironment AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pPrintProcessorInfo AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumPrintProcessorsW LIB "winspool.drv" ALIAS "EnumPrintProcessorsW" ( BYREF pName AS WSTRINGZ , BYREF pEnvironment AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pPrintProcessorInfo AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO EnumPrintProcessors = EnumPrintProcessorsW
#ELSE
 MACRO EnumPrintProcessors = EnumPrintProcessorsA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrintProcessorDirectoryA LIB "WinSpool.drv" ALIAS "GetPrintProcessorDirectoryA" ( pName AS ASCIIZ, pEnvironment AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pPrintProcessorInfo AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetPrintProcessorDirectoryA LIB "winspool.drv" ALIAS "GetPrintProcessorDirectoryA" ( BYREF pName AS ASCIIZ , BYREF pEnvironment AS ASCIIZ , BYVAL Level AS QUAD , BYREF pPrintProcessorInfo AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrintProcessorDirectoryW LIB "WinSpool.drv" ALIAS "GetPrintProcessorDirectoryW" ( pName AS WSTRINGZ, pEnvironment AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pPrintProcessorInfo AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetPrintProcessorDirectoryW LIB "winspool.drv" ALIAS "GetPrintProcessorDirectoryW" ( BYREF pName AS WSTRINGZ , BYREF pEnvironment AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pPrintProcessorInfo AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetPrintProcessorDirectory = GetPrintProcessorDirectoryW
#ELSE
 MACRO GetPrintProcessorDirectory = GetPrintProcessorDirectoryA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrintProcessorDatatypesA LIB "WinSpool.drv" ALIAS "EnumPrintProcessorDatatypesA" ( pName AS ASCIIZ, pPrintProcessorName AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pDatatypes AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumPrintProcessorDatatypesA LIB "winspool.drv" ALIAS "EnumPrintProcessorDatatypesA" ( BYREF pName AS ASCIIZ , BYREF pPrintProcessorName AS ASCIIZ , BYVAL Level AS QUAD , BYREF pDatatypes AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrintProcessorDatatypesW LIB "WinSpool.drv" ALIAS "EnumPrintProcessorDatatypesW" ( pName AS WSTRINGZ, pPrintProcessorName AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pDatatypes AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumPrintProcessorDatatypesW LIB "winspool.drv" ALIAS "EnumPrintProcessorDatatypesW" ( BYREF pName AS WSTRINGZ , BYREF pPrintProcessorName AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pDatatypes AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO EnumPrintProcessorDatatypes = EnumPrintProcessorDatatypesW
#ELSE
 MACRO EnumPrintProcessorDatatypes = EnumPrintProcessorDatatypesA
#ENDIF
DECLARE FUNCTION DeletePrintProcessorA LIB "winspool.drv" ALIAS "DeletePrintProcessorA" ( BYREF pName AS ASCIIZ , BYREF pEnvironment AS ASCIIZ , BYREF pPrintProcessorName AS ASCIIZ ) AS LONG
DECLARE FUNCTION DeletePrintProcessorW LIB "winspool.drv" ALIAS "DeletePrintProcessorW" ( BYREF pName AS WSTRINGZ
 , BYREF pEnvironment AS WSTRINGZ
 , BYREF pPrintProcessorName AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DeletePrintProcessor = DeletePrintProcessorW
#ELSE
 MACRO DeletePrintProcessor = DeletePrintProcessorA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION StartDocPrinterA LIB "WinSpool.drv" ALIAS "StartDocPrinterA" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pDocInfo AS BYTE PTR ) AS QUAD
#ELSE
DECLARE FUNCTION StartDocPrinterA LIB "winspool.drv" ALIAS "StartDocPrinterA" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pDocInfo AS ANY ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION StartDocPrinterW LIB "WinSpool.drv" ALIAS "StartDocPrinterW" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pDocInfo AS BYTE PTR ) AS QUAD
#ELSE
DECLARE FUNCTION StartDocPrinterW LIB "winspool.drv" ALIAS "StartDocPrinterW" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pDocInfo AS ANY ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO StartDocPrinter = StartDocPrinterW
#ELSE
 MACRO StartDocPrinter = StartDocPrinterA
#ENDIF
DECLARE FUNCTION StartPagePrinter LIB "winspool.drv" ALIAS "StartPagePrinter" ( BYVAL hPrinter AS QUAD ) AS LONG
DECLARE FUNCTION WritePrinter LIB "winspool.drv" ALIAS "WritePrinter" ( BYVAL hPrinter AS QUAD
 , BYREF pBuf AS ANY
 , BYVAL cbBuf AS DWORD
 , BYREF pcWritten AS DWORD
 ) AS LONG
DECLARE FUNCTION FlushPrinter LIB "winspool.drv" ALIAS "FlushPrinter" ( BYVAL hPrinter AS DWORD
 , BYREF pBuf AS ANY
 , BYVAL cbBuf AS DWORD
 , BYREF pcWritten AS DWORD
 , BYVAL cSleep AS DWORD
 ) AS LONG
DECLARE FUNCTION EndPagePrinter LIB "winspool.drv" ALIAS "EndPagePrinter" ( BYVAL hPrinter AS DWORD
 ) AS LONG
DECLARE FUNCTION AbortPrinter LIB "winspool.drv" ALIAS "AbortPrinter" ( BYVAL hPrinter AS DWORD
 ) AS LONG
DECLARE FUNCTION ReadPrinter LIB "winspool.drv" ALIAS "ReadPrinter" ( BYVAL hPrinter AS DWORD
 , BYREF pBuf AS ANY
 , BYVAL cbBuf AS DWORD
 , BYREF pNoBytesRead AS DWORD
 ) AS LONG
DECLARE FUNCTION EndDocPrinter LIB "winspool.drv" ALIAS "EndDocPrinter" ( BYVAL hPrinter AS DWORD
 ) AS LONG
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddJobA LIB "WinSpool.drv" ALIAS "AddJobA" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pData AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION AddJobA LIB "winspool.drv" ALIAS "AddJobA" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pData AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddJobW LIB "WinSpool.drv" ALIAS "AddJobW" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pData AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION AddJobW LIB "winspool.drv" ALIAS "AddJobW" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pData AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO AddJob = AddJobW
#ELSE
 MACRO AddJob = AddJobA
#ENDIF
DECLARE FUNCTION ScheduleJob LIB "winspool.drv" ALIAS "ScheduleJob" ( BYVAL hPrinter AS QUAD , BYVAL JobId AS QUAD ) AS LONG
DECLARE FUNCTION PrinterProperties LIB "winspool.drv" ALIAS "PrinterProperties" ( BYVAL hWnd AS QUAD
 , BYVAL hPrinter AS DWORD
 ) AS LONG
DECLARE FUNCTION DocumentPropertiesA LIB "winspool.drv" ALIAS "DocumentPropertiesA" ( BYVAL hWnd AS DWORD
 , BYVAL hPrinter AS DWORD
 , BYREF pDeviceName AS ASCIIZ
 , BYREF pDevModeOutput AS DEVMODEA
 , BYREF pDevModeInput AS DEVMODEA
 , BYVAL fMode AS DWORD
 ) AS LONG
DECLARE FUNCTION DocumentPropertiesW LIB "winspool.drv" ALIAS "DocumentPropertiesW" ( BYVAL hWnd AS DWORD
 , BYVAL hPrinter AS DWORD
 , BYREF pDeviceName AS WSTRINGZ
 , BYREF pDevModeOutput AS DEVMODEW
 , BYREF pDevModeInput AS DEVMODEW
 , BYVAL fMode AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DocumentProperties = DocumentPropertiesW
#ELSE
 MACRO DocumentProperties = DocumentPropertiesA
#ENDIF
DECLARE FUNCTION AdvancedDocumentPropertiesA LIB "winspool.drv" ALIAS "AdvancedDocumentPropertiesA" ( BYVAL hWnd AS QUAD , BYVAL hPrinter AS QUAD , BYREF pDeviceName AS ASCIIZ , OPTIONAL BYREF pDevModeOutput AS DEVMODEA , OPTIONAL BYREF pDevModeInput AS DEVMODEA ) AS LONG
DECLARE FUNCTION AdvancedDocumentPropertiesW LIB "winspool.drv" ALIAS "AdvancedDocumentPropertiesW" ( BYVAL hWnd AS QUAD
 , BYVAL hPrinter AS DWORD
 , BYREF pDeviceName AS WSTRINGZ
 , OPTIONAL BYREF pDevModeOutput AS DEVMODEW
 , OPTIONAL BYREF pDevModeInput AS DEVMODEW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO AdvancedDocumentProperties = AdvancedDocumentPropertiesW
#ELSE
 MACRO AdvancedDocumentProperties = AdvancedDocumentPropertiesA
#ENDIF
' The ExtDeviceMode function is provided only for compatibility with 16-bit
' applications. Printer drivers without this requirement should instead use the
' DocumentProperties function, which is described in the Microsoft Windows SDK
' documentation.
'#if (NTDDI_VERSION >= NTDDI_WINXPSP1)
'ExtDeviceMode (
');
'#endif // (NTDDI_VERSION >= NTDDI_WINXPSP1)
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterDataA LIB "WinSpool.drv" ALIAS "GetPrinterDataA" ( BYVAL hPrinter AS QUAD,
 pValueName AS ASCIIZ, pType AS QUAD, BYVAL pData AS BYTE PTR, BYVAL nSize AS QUAD, pcbNeeded AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION GetPrinterDataA LIB "winspool.drv" ALIAS "GetPrinterDataA" ( BYVAL hPrinter AS QUAD , BYREF pValueName AS ASCIIZ , BYREF pType AS QUAD , BYREF pData AS ANY , BYVAL nSize AS QUAD , BYREF pcbNeeded AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterDataW LIB "WinSpool.drv" ALIAS "GetPrinterDataW" ( BYVAL hPrinter AS QUAD,
 pValueName AS WSTRINGZ, pType AS QUAD, BYVAL pData AS BYTE PTR, BYVAL nSize AS QUAD, pcbNeeded AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION GetPrinterDataW LIB "winspool.drv" ALIAS "GetPrinterDataW" ( BYVAL hPrinter AS QUAD , BYREF pValueName AS WSTRINGZ , BYREF pType AS QUAD , BYREF pData AS ANY , BYVAL nSize AS QUAD , BYREF pcbNeeded AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetPrinterData = GetPrinterDataW
#ELSE
 MACRO GetPrinterData = GetPrinterDataA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterDataExA LIB "WinSpool.drv" ALIAS "GetPrinterDataExA" ( BYVAL hPrinter AS QUAD,
 pKeyName AS ASCIIZ, pValueName AS ASCIIZ, pType AS QUAD, BYVAL pData AS BYTE PTR, BYVAL nSize AS QUAD, pcbNeeded AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION GetPrinterDataExA LIB "winspool.drv" ALIAS "GetPrinterDataExA" ( BYVAL hPrinter AS QUAD , BYREF pKeyName AS ASCIIZ , BYREF pValueName AS ASCIIZ , BYREF pType AS QUAD , BYREF pData AS ANY , BYVAL nSize AS QUAD , BYREF pcbNeeded AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterDataExW LIB "WinSpool.drv" ALIAS "GetPrinterDataExW" ( BYVAL hPrinter AS QUAD,
 pKeyName AS WSTRINGZ, pValueName AS WSTRINGZ, pType AS QUAD, BYVAL pData AS BYTE PTR, BYVAL nSize AS QUAD, pcbNeeded AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION GetPrinterDataExW LIB "winspool.drv" ALIAS "GetPrinterDataExW" ( BYVAL hPrinter AS QUAD , BYREF pKeyName AS WSTRINGZ , BYREF pValueName AS WSTRINGZ , BYREF pType AS QUAD , BYREF pData AS ANY , BYVAL nSize AS QUAD , BYREF pcbNeeded AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetPrinterDataEx = GetPrinterDataExW
#ELSE
 MACRO GetPrinterDataEx = GetPrinterDataExA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrinterDataA LIB "WinSpool.drv" ALIAS "EnumPrinterDataA" ( BYVAL hPrinter AS QUAD,
 BYVAL dwIndex AS QUAD, pValueName AS ASCIIZ, BYVAL cbValueName AS QUAD, pcbValueName AS QUAD, pType AS QUAD, BYVAL pData AS BYTE PTR, BYVAL cbData AS QUAD, pcbData AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION EnumPrinterDataA LIB "winspool.drv" ALIAS "EnumPrinterDataA" ( BYVAL hPrinter AS QUAD , BYVAL dwIndex AS QUAD , BYREF pValueName AS ASCIIZ , BYVAL cbValueName AS QUAD , BYREF pcbValueName AS QUAD , BYREF pType AS QUAD , BYREF pData AS ANY , BYVAL cbData AS QUAD , BYREF pcbData AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrinterDataW LIB "WinSpool.drv" ALIAS "EnumPrinterDataW" ( BYVAL hPrinter AS QUAD,
 BYVAL dwIndex AS QUAD, pValueName AS WSTRINGZ, BYVAL cbValueName AS QUAD, pcbValueName AS QUAD, pType AS QUAD, BYVAL pData AS BYTE PTR, BYVAL cbData AS QUAD, pcbData AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION EnumPrinterDataW LIB "winspool.drv" ALIAS "EnumPrinterDataW" ( BYVAL hPrinter AS QUAD , BYVAL dwIndex AS QUAD , BYREF pValueName AS WSTRINGZ , BYVAL cbValueName AS QUAD , BYREF pcbValueName AS QUAD , BYREF pType AS QUAD , BYREF pData AS ANY , BYVAL cbData AS QUAD , BYREF pcbData AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO EnumPrinterData = EnumPrinterDataW
#ELSE
 MACRO EnumPrinterData = EnumPrinterDataA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrinterDataExA LIB "WinSpool.drv" ALIAS "EnumPrinterDataExA" ( BYVAL hPrinter AS QUAD,
 pKeyName AS ASCIIZ, BYVAL pEnumValues AS BYTE PTR, BYVAL cbEnumValues AS QUAD, pcbEnumValues AS QUAD, pnEnumValues AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION EnumPrinterDataExA LIB "winspool.drv" ALIAS "EnumPrinterDataExA" ( BYVAL hPrinter AS QUAD , BYREF pKeyName AS ASCIIZ , BYREF pEnumValues AS ANY , BYVAL cbEnumValues AS QUAD , BYREF pcbEnumValues AS QUAD , BYREF pnEnumValues AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPrinterDataExW LIB "WinSpool.drv" ALIAS "EnumPrinterDataExW" ( BYVAL hPrinter AS QUAD,
 pKeyName AS WSTRINGZ, BYVAL pEnumValues AS BYTE PTR, BYVAL cbEnumValues AS QUAD, pcbEnumValues AS QUAD, pnEnumValues AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION EnumPrinterDataExW LIB "winspool.drv" ALIAS "EnumPrinterDataExW" ( BYVAL hPrinter AS QUAD , BYREF pKeyName AS WSTRINGZ , BYREF pEnumValues AS ANY , BYVAL cbEnumValues AS QUAD , BYREF pcbEnumValues AS QUAD , BYREF pnEnumValues AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO EnumPrinterDataEx = EnumPrinterDataExW
#ELSE
 MACRO EnumPrinterDataEx = EnumPrinterDataExA
#ENDIF
DECLARE FUNCTION EnumPrinterKeyA LIB "winspool.drv" ALIAS "EnumPrinterKeyA" ( BYVAL hPrinter AS QUAD , BYREF pKeyName AS ASCIIZ , BYREF pSubkey AS ASCIIZ , BYVAL cbSubkey AS QUAD , BYREF pcbSubkey AS QUAD ) AS QUAD
DECLARE FUNCTION EnumPrinterKeyW LIB "winspool.drv" ALIAS "EnumPrinterKeyW" ( BYVAL hPrinter AS QUAD
 , BYREF pKeyName AS WSTRINGZ
 , BYREF pSubkey AS WSTRINGZ
 , BYVAL cbSubkey AS DWORD
 , BYREF pcbSubkey AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO EnumPrinterKey = EnumPrinterKeyW
#ELSE
 MACRO EnumPrinterKey = EnumPrinterKeyA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetPrinterDataA LIB "WinSpool.drv" ALIAS "SetPrinterDataA" ( BYVAL hPrinter AS QUAD,
 pValueName AS ASCIIZ, BYVAL TYPE AS QUAD, BYVAL pData AS BYTE PTR, BYVAL cbData AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION SetPrinterDataA LIB "winspool.drv" ALIAS "SetPrinterDataA" ( BYVAL hPrinter AS QUAD , BYREF pValueName AS ASCIIZ , BYVAL Type AS QUAD , BYREF pData AS ANY , BYVAL cbData AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetPrinterDataW LIB "WinSpool.drv" ALIAS "SetPrinterDataW" ( BYVAL hPrinter AS QUAD,
 pValueName AS WSTRINGZ, BYVAL TYPE AS QUAD, BYVAL pData AS BYTE PTR, BYVAL cbData AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION SetPrinterDataW LIB "winspool.drv" ALIAS "SetPrinterDataW" ( BYVAL hPrinter AS QUAD , BYREF pValueName AS WSTRINGZ , BYVAL Type AS QUAD , BYREF pData AS ANY , BYVAL cbData AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO SetPrinterData = SetPrinterDataW
#ELSE
 MACRO SetPrinterData = SetPrinterDataA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetPrinterDataExA LIB "WinSpool.drv" ALIAS "SetPrinterDataExA" ( BYVAL hPrinter AS QUAD,
 pKeyName AS ASCIIZ, pValueName AS ASCIIZ, BYVAL TYPE AS QUAD, BYVAL pData AS BYTE PTR, BYVAL cbData AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION SetPrinterDataExA LIB "winspool.drv" ALIAS "SetPrinterDataExA" ( BYVAL hPrinter AS QUAD , BYREF pKeyName AS ASCIIZ , BYREF pValueName AS ASCIIZ , BYVAL Type AS QUAD , BYREF pData AS ANY , BYVAL cbData AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetPrinterDataExW LIB "WinSpool.drv" ALIAS "SetPrinterDataExW" ( BYVAL hPrinter AS QUAD,
 pKeyName AS WSTRINGZ, pValueName AS WSTRINGZ, BYVAL TYPE AS QUAD, BYVAL pData AS BYTE PTR, BYVAL cbData AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION SetPrinterDataExW LIB "winspool.drv" ALIAS "SetPrinterDataExW" ( BYVAL hPrinter AS QUAD , BYREF pKeyName AS WSTRINGZ , BYREF pValueName AS WSTRINGZ , BYVAL Type AS QUAD , BYREF pData AS ANY , BYVAL cbData AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
 MACRO SetPrinterDataEx = SetPrinterDataExW
#ELSE
 MACRO SetPrinterDataEx = SetPrinterDataExA
#ENDIF
DECLARE FUNCTION DeletePrinterDataA LIB "winspool.drv" ALIAS "DeletePrinterDataA" ( BYVAL hPrinter AS QUAD , BYREF pValueName AS ASCIIZ ) AS QUAD
DECLARE FUNCTION DeletePrinterDataW LIB "winspool.drv" ALIAS "DeletePrinterDataW" ( BYVAL hPrinter AS QUAD
 , BYREF pValueName AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO DeletePrinterData = DeletePrinterDataW
#ELSE
 MACRO DeletePrinterData = DeletePrinterDataA
#ENDIF
DECLARE FUNCTION DeletePrinterDataExA LIB "winspool.drv" ALIAS "DeletePrinterDataExA" ( BYVAL hPrinter AS QUAD , BYREF pKeyName AS ASCIIZ , BYREF pValueName AS ASCIIZ ) AS QUAD
DECLARE FUNCTION DeletePrinterDataExW LIB "winspool.drv" ALIAS "DeletePrinterDataExW" ( BYVAL hPrinter AS QUAD
 , BYREF pKeyName AS WSTRINGZ
 , BYREF pValueName AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO DeletePrinterDataEx = DeletePrinterDataExW
#ELSE
 MACRO DeletePrinterDataEx = DeletePrinterDataExA
#ENDIF
DECLARE FUNCTION DeletePrinterKeyA LIB "winspool.drv" ALIAS "DeletePrinterKeyA" ( BYVAL hPrinter AS QUAD , BYREF pKeyName AS ASCIIZ ) AS QUAD
DECLARE FUNCTION DeletePrinterKeyW LIB "winspool.drv" ALIAS "DeletePrinterKeyW" ( BYVAL hPrinter AS QUAD
 , BYREF pKeyName AS WSTRINGZ
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO DeletePrinterKey = DeletePrinterKeyW
#ELSE
 MACRO DeletePrinterKey = DeletePrinterKeyA
#ENDIF
%EQUATE `PRINTER_NOTIFY_TYPE = &H00
%EQUATE `JOB_NOTIFY_TYPE = &H01
%EQUATE `SERVER_NOTIFY_TYPE = &H02
%EQUATE `PRINTER_NOTIFY_FIELD_SERVER_NAME = &H00
%EQUATE `PRINTER_NOTIFY_FIELD_PRINTER_NAME = &H01
%EQUATE `PRINTER_NOTIFY_FIELD_SHARE_NAME = &H02
%EQUATE `PRINTER_NOTIFY_FIELD_PORT_NAME = &H03
%EQUATE `PRINTER_NOTIFY_FIELD_DRIVER_NAME = &H04
%EQUATE `PRINTER_NOTIFY_FIELD_COMMENT = &H05
%EQUATE `PRINTER_NOTIFY_FIELD_LOCATION = &H06
%EQUATE `PRINTER_NOTIFY_FIELD_DEVMODE = &H07
%EQUATE `PRINTER_NOTIFY_FIELD_SEPFILE = &H08
%EQUATE `PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR = &H09
%EQUATE `PRINTER_NOTIFY_FIELD_PARAMETERS = &H0A
%EQUATE `PRINTER_NOTIFY_FIELD_DATATYPE = &H0B
%EQUATE `PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR = &H0C
%EQUATE `PRINTER_NOTIFY_FIELD_ATTRIBUTES = &H0D
%EQUATE `PRINTER_NOTIFY_FIELD_PRIORITY = &H0E
%EQUATE `PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY = &H0F
%EQUATE `PRINTER_NOTIFY_FIELD_START_TIME = &H10
%EQUATE `PRINTER_NOTIFY_FIELD_UNTIL_TIME = &H11
%EQUATE `PRINTER_NOTIFY_FIELD_STATUS = &H12
%EQUATE `PRINTER_NOTIFY_FIELD_STATUS_STRING = &H13
%EQUATE `PRINTER_NOTIFY_FIELD_CJOBS = &H14
%EQUATE `PRINTER_NOTIFY_FIELD_AVERAGE_PPM = &H15
%EQUATE `PRINTER_NOTIFY_FIELD_TOTAL_PAGES = &H16
%EQUATE `PRINTER_NOTIFY_FIELD_PAGES_PRINTED = &H17
%EQUATE `PRINTER_NOTIFY_FIELD_TOTAL_BYTES = &H18
%EQUATE `PRINTER_NOTIFY_FIELD_BYTES_PRINTED = &H19
%EQUATE `PRINTER_NOTIFY_FIELD_OBJECT_GUID = &H1A
'#if (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `PRINTER_NOTIFY_FIELD_FRIENDLY_NAME = &H1B
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `JOB_NOTIFY_FIELD_PRINTER_NAME = &H00
%EQUATE `JOB_NOTIFY_FIELD_MACHINE_NAME = &H01
%EQUATE `JOB_NOTIFY_FIELD_PORT_NAME = &H02
%EQUATE `JOB_NOTIFY_FIELD_USER_NAME = &H03
%EQUATE `JOB_NOTIFY_FIELD_NOTIFY_NAME = &H04
%EQUATE `JOB_NOTIFY_FIELD_DATATYPE = &H05
%EQUATE `JOB_NOTIFY_FIELD_PRINT_PROCESSOR = &H06
%EQUATE `JOB_NOTIFY_FIELD_PARAMETERS = &H07
%EQUATE `JOB_NOTIFY_FIELD_DRIVER_NAME = &H08
%EQUATE `JOB_NOTIFY_FIELD_DEVMODE = &H09
%EQUATE `JOB_NOTIFY_FIELD_STATUS = &H0A
%EQUATE `JOB_NOTIFY_FIELD_STATUS_STRING = &H0B
%EQUATE `JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR = &H0C
%EQUATE `JOB_NOTIFY_FIELD_DOCUMENT = &H0D
%EQUATE `JOB_NOTIFY_FIELD_PRIORITY = &H0E
%EQUATE `JOB_NOTIFY_FIELD_POSITION = &H0F
%EQUATE `JOB_NOTIFY_FIELD_SUBMITTED = &H10
%EQUATE `JOB_NOTIFY_FIELD_START_TIME = &H11
%EQUATE `JOB_NOTIFY_FIELD_UNTIL_TIME = &H12
%EQUATE `JOB_NOTIFY_FIELD_TIME = &H13
%EQUATE `JOB_NOTIFY_FIELD_TOTAL_PAGES = &H14
%EQUATE `JOB_NOTIFY_FIELD_PAGES_PRINTED = &H15
%EQUATE `JOB_NOTIFY_FIELD_TOTAL_BYTES = &H16
%EQUATE `JOB_NOTIFY_FIELD_BYTES_PRINTED = &H17
%EQUATE `JOB_NOTIFY_FIELD_REMOTE_JOB_ID = &H18
'#if (NTDDI_VERSION >= NTDDI_WIN7)
%EQUATE `SERVER_NOTIFY_FIELD_PRINT_DRIVER_ISOLATION_GROUP = &H00
'#endif
' // Size = 20 bytes
TYPE PRINTER_NOTIFY_OPTIONS_TYPE DWORD FILL
 Type AS WORD ' WORD
 Reserved0 AS WORD ' WORD
 Reserved1 AS DWORD
 Reserved2 AS DWORD
 Count AS DWORD
 pFields AS WORD PTR
END TYPE
%EQUATE `PRINTER_NOTIFY_OPTIONS_REFRESH = &H01
' // Size = 16 bytes
TYPE PRINTER_NOTIFY_OPTIONS DWORD
 Version AS DWORD
 Flags AS DWORD
 Count AS DWORD
 pTypes AS PRINTER_NOTIFY_OPTIONS_TYPE PTR ' PPRINTER_NOTIFY_OPTIONS_TYPE
END TYPE
%EQUATE `PRINTER_NOTIFY_INFO_DISCARDED = &H01
'typedef struct _PRINTER_NOTIFY_INFO_DATA {
' WORD Type;
' WORD Field;
' DWORD Reserved;
' DWORD Id;
' union {
' DWORD adwData[2];
' struct {
' DWORD cbBuf;
' LPVOID pBuf;
' } Data;
' } NotifyData;
'} PRINTER_NOTIFY_INFO_DATA, *PPRINTER_NOTIFY_INFO_DATA, *LPPRINTER_NOTIFY_INFO_DATA;
' // Size = 8 bytes
TYPE PRINTER_NOTIFY_INFO_DATA_UNION_DataStruct DWORD
 cbBuf AS DWORD
 pBuf AS DWORD
END TYPE
' // Size = 8 bytes
UNION PRINTER_NOTIFY_INFO_DATA_UNION DWORD
 adwData(1) AS DWORD
 Data AS PRINTER_NOTIFY_INFO_DATA_UNION_DataStruct
END UNION
' // Size = 20 bytes
TYPE PRINTER_NOTIFY_INFO_DATA DWORD FILL
 Type AS WORD
 Field AS WORD
 Reserved AS DWORD
 Id AS DWORD
 NotifyData AS PRINTER_NOTIFY_INFO_DATA_UNION
END TYPE
' // Size = 32 bytes
TYPE PRINTER_NOTIFY_INFO DWORD
 Version AS DWORD
 Flags AS DWORD
 Count AS DWORD
 aData(0) AS PRINTER_NOTIFY_INFO_DATA ' PRINTER_NOTIFY_INFO_DATA aData[1]
END TYPE
'#if (NTDDI_VERSION >= NTDDI_WINXP)
' // Size = 8 bytes
TYPE BINARY_CONTAINER DWORD
 cbBuf AS DWORD
 pData AS BYTE PTR
END TYPE
' // Size = 8 bytes
UNION BIDI_DATA_UNION DWORD
 bData AS LONG
 iData AS LONG
 sData AS WSTRINGZ PTR
 fData AS SINGLE ' FLOAT
 biData AS BINARY_CONTAINER ' BINARY_CONTAINER
END UNION
UNION BIDI_DATA_U_UNION DWORD
 BIDI_DATA_UNION
 u AS BIDI_DATA_UNION
END UNION
' // Size = 12 bytes
TYPE BIDI_DATA DWORD
 dwBidiType AS DWORD
 BIDI_DATA_U_UNION
END TYPE
' // Size = 20 bytes
TYPE BIDI_REQUEST_DATA DWORD
 dwReqNumber AS DWORD
 pSchema AS WSTRINGZ PTR
 data AS BIDI_DATA ' BIDI_DATA
END TYPE
' // Size = 32 bytes
TYPE BIDI_REQUEST_CONTAINER DWORD
 Version AS DWORD
 Flags AS DWORD
 Count AS DWORD
 aData(0) AS BIDI_REQUEST_DATA ' BIDI_REQUEST_DATA aData[ 1 ]
END TYPE
' // Size = 24 bytes
TYPE BIDI_RESPONSE_DATA DWORD
 dwResult AS DWORD
 dwReqNumber AS DWORD
 pSchema AS WSTRINGZ PTR
 data AS BIDI_DATA ' BIDI_DATA
END TYPE
' // Size = 36 bytes
TYPE BIDI_RESPONSE_CONTAINER DWORD
 Version AS DWORD
 Flags AS DWORD
 Count AS DWORD
 aData(0) AS BIDI_RESPONSE_DATA ' BIDI_RESPONSE_DATA aData[ 1 ]
END TYPE
$$BIDI_ACTION_ENUM_SCHEMA = "EnumSchema"$$
$$BIDI_ACTION_GET = "Get"$$
$$BIDI_ACTION_SET = "Set"$$
$$BIDI_ACTION_GET_ALL = "GetAll"$$
' BIDI_TYPE enum
%EQUATE `BIDI_NULL = 0
%EQUATE `BIDI_INT = 1
%EQUATE `BIDI_FLOAT = 2
%EQUATE `BIDI_BOOL = 3
%EQUATE `BIDI_STRING = 4
%EQUATE `BIDI_TEXT = 5
%EQUATE `BIDI_ENUM = 6
%EQUATE `BIDI_BLOB = 7
%EQUATE `BIDI_ACCESS_ADMINISTRATOR = &H1
%EQUATE `BIDI_ACCESS_USER = &H2
'/*
' Error code for bidi apis
'*/
%EQUATE `ERROR_BIDI_STATUS_OK = 0
%EQUATE `ERROR_BIDI_NOT_SUPPORTED = %ERROR_NOT_SUPPORTED
%EQUATE `ERROR_BIDI_ERROR_BASE = 13000
%EQUATE `ERROR_BIDI_STATUS_WARNING = %ERROR_BIDI_ERROR_BASE + 1
%EQUATE `ERROR_BIDI_SCHEMA_READ_ONLY = %ERROR_BIDI_ERROR_BASE + 2
%EQUATE `ERROR_BIDI_SERVER_OFFLINE = %ERROR_BIDI_ERROR_BASE + 3
%EQUATE `ERROR_BIDI_DEVICE_OFFLINE = %ERROR_BIDI_ERROR_BASE + 4
%EQUATE `ERROR_BIDI_SCHEMA_NOT_SUPPORTED = %ERROR_BIDI_ERROR_BASE + 5
'#endif // (NTDDI_VERSION >= NTDDI_WINXP)
DECLARE FUNCTION WaitForPrinterChange LIB "winspool.drv" ALIAS "WaitForPrinterChange" ( BYVAL hPrinter AS QUAD , BYVAL Flags AS QUAD ) AS QUAD
DECLARE FUNCTION FindFirstPrinterChangeNotification LIB "winspool.drv" ALIAS "FindFirstPrinterChangeNotification" ( BYVAL hPrinter AS QUAD
 , BYVAL fdwFlags AS DWORD
 , BYVAL fdwOptions AS DWORD
 , OPTIONAL BYREF pPrinterNotifyOptions AS ANY
 ) AS DWORD
DECLARE FUNCTION FindNextPrinterChangeNotification LIB "winspool.drv" ALIAS "FindNextPrinterChangeNotification" ( BYVAL hChange AS DWORD
 , BYREF pdwChange AS DWORD
 , BYREF pPrinterNotifyOptions AS ANY
 , OPTIONAL BYREF ppPrinterNotifyInfo AS ANY
 ) AS LONG
DECLARE FUNCTION FreePrinterNotifyInfo LIB "winspool.drv" ALIAS "FreePrinterNotifyInfo" ( BYREF pPrinterNotifyInfo AS PRINTER_NOTIFY_INFO
 ) AS LONG
DECLARE FUNCTION FindClosePrinterChangeNotification LIB "winspool.drv" ALIAS "FindClosePrinterChangeNotification" ( BYVAL hChange AS DWORD
 ) AS LONG
%EQUATE `PRINTER_CHANGE_ADD_PRINTER = &H00000001
%EQUATE `PRINTER_CHANGE_SET_PRINTER = &H00000002
%EQUATE `PRINTER_CHANGE_DELETE_PRINTER = &H00000004
%EQUATE `PRINTER_CHANGE_PRINTER = &H000000FF
%EQUATE `PRINTER_CHANGE_ADD_JOB = &H00000100
%EQUATE `PRINTER_CHANGE_SET_JOB = &H00000200
%EQUATE `PRINTER_CHANGE_DELETE_JOB = &H00000400
%EQUATE `PRINTER_CHANGE_WRITE_JOB = &H00000800
%EQUATE `PRINTER_CHANGE_JOB = &H0000FF00
%EQUATE `PRINTER_CHANGE_ADD_FORM = &H00010000
%EQUATE `PRINTER_CHANGE_SET_FORM = &H00020000
%EQUATE `PRINTER_CHANGE_DELETE_FORM = &H00040000
%EQUATE `PRINTER_CHANGE_FORM = &H00070000
%EQUATE `PRINTER_CHANGE_ADD_PORT = &H00100000
%EQUATE `PRINTER_CHANGE_CONFIGURE_PORT = &H00200000
%EQUATE `PRINTER_CHANGE_DELETE_PORT = &H00400000
%EQUATE `PRINTER_CHANGE_PORT = &H00700000
%EQUATE `PRINTER_CHANGE_ADD_PRINT_PROCESSOR = &H01000000
%EQUATE `PRINTER_CHANGE_DELETE_PRINT_PROCESSOR = &H04000000
%EQUATE `PRINTER_CHANGE_PRINT_PROCESSOR = &H07000000
'#if (NTDDI_VERSION >= NTDDI_WIN7)
%EQUATE `PRINTER_CHANGE_SERVER = &H08000000
'#endif
%EQUATE `PRINTER_CHANGE_ADD_PRINTER_DRIVER = &H10000000
%EQUATE `PRINTER_CHANGE_DELETE_PRINTER_DRIVER = &H40000000
%EQUATE `PRINTER_CHANGE_PRINTER_DRIVER = &H70000000
%EQUATE `PRINTER_CHANGE_TIMEOUT = &H80000000
%EQUATE `PRINTER_CHANGE_ALL = &H7777FFFF
DECLARE FUNCTION PrinterMessageBoxA LIB "winspool.drv" ALIAS "PrinterMessageBoxA" ( BYVAL hPrinter AS QUAD , BYVAL Error AS QUAD , BYVAL hWnd AS QUAD , BYREF pText AS ASCIIZ , BYREF pCaption AS ASCIIZ , BYVAL dwType AS QUAD ) AS QUAD
DECLARE FUNCTION PrinterMessageBoxW LIB "winspool.drv" ALIAS "PrinterMessageBoxW" ( BYVAL hPrinter AS QUAD
 , BYVAL Error AS DWORD
 , BYVAL hWnd AS DWORD
 , BYREF pText AS WSTRINGZ
 , BYREF pCaption AS WSTRINGZ
 , BYVAL dwType AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO PrinterMessageBox = PrinterMessageBoxW
#ELSE
 MACRO PrinterMessageBox = PrinterMessageBoxA
#ENDIF
%EQUATE `PRINTER_ERROR_INFORMATION = &H80000000
%EQUATE `PRINTER_ERROR_WARNING = &H40000000
%EQUATE `PRINTER_ERROR_SEVERE = &H20000000
%EQUATE `PRINTER_ERROR_OUTOFPAPER = &H00000001
%EQUATE `PRINTER_ERROR_JAM = &H00000002
%EQUATE `PRINTER_ERROR_OUTOFTONER = &H00000004
DECLARE FUNCTION ClosePrinter LIB "winspool.drv" ALIAS "ClosePrinter" ( BYVAL hPrinter AS QUAD ) AS LONG
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddFormA LIB "WinSpool.drv" ALIAS "AddFormA" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pForm AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION AddFormA LIB "winspool.drv" ALIAS "AddFormA" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pForm AS ANY ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddFormW LIB "WinSpool.drv" ALIAS "AddFormW" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pForm AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION AddFormW LIB "winspool.drv" ALIAS "AddFormW" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pForm AS ANY ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO AddForm = AddFormW
#ELSE
 MACRO AddForm = AddFormA
#ENDIF
DECLARE FUNCTION DeleteFormA LIB "winspool.drv" ALIAS "DeleteFormA" ( BYVAL hPrinter AS QUAD , BYREF pFormName AS ASCIIZ ) AS LONG
DECLARE FUNCTION DeleteFormW LIB "winspool.drv" ALIAS "DeleteFormW" ( BYVAL hPrinter AS QUAD
 , BYREF pFormName AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DeleteForm = DeleteFormW
#ELSE
 MACRO DeleteForm = DeleteFormA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetFormA LIB "WinSpool.drv" ALIAS "GetFormA" ( BYVAL hPrinter AS QUAD,
 pFormName AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pForm AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetFormA LIB "winspool.drv" ALIAS "GetFormA" ( BYVAL hPrinter AS QUAD , BYREF pFormName AS ASCIIZ , BYVAL Level AS QUAD , BYREF pForm AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetFormW LIB "WinSpool.drv" ALIAS "GetFormW" ( BYVAL hPrinter AS QUAD,
 pFormName AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pForm AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetFormW LIB "winspool.drv" ALIAS "GetFormW" ( BYVAL hPrinter AS QUAD , BYREF pFormName AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pForm AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetForm = GetFormW
#ELSE
 MACRO GetForm = GetFormA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetFormA LIB "WinSpool.drv" ALIAS "SetFormA" ( BYVAL hPrinter AS QUAD,
 pFormName AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pForm AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION SetFormA LIB "winspool.drv" ALIAS "SetFormA" ( BYVAL hPrinter AS QUAD , BYREF pFormName AS ASCIIZ , BYVAL Level AS QUAD , BYREF pForm AS ANY ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetFormW LIB "WinSpool.drv" ALIAS "SetFormW" ( BYVAL hPrinter AS QUAD,
 pFormName AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pForm AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION SetFormW LIB "winspool.drv" ALIAS "SetFormW" ( BYVAL hPrinter AS QUAD , BYREF pFormName AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pForm AS ANY ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO SetForm = SetFormW
#ELSE
 MACRO SetForm = SetFormA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumFormsA LIB "WinSpool.drv" ALIAS "EnumFormsA" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pForm AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumFormsA LIB "winspool.drv" ALIAS "EnumFormsA" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pForm AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumFormsW LIB "WinSpool.drv" ALIAS "EnumFormsW" ( BYVAL hPrinter AS QUAD,
 BYVAL Level AS QUAD, BYVAL pForm AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumFormsW LIB "winspool.drv" ALIAS "EnumFormsW" ( BYVAL hPrinter AS QUAD , BYVAL Level AS QUAD , BYREF pForm AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO EnumForms = EnumFormsW
#ELSE
 MACRO EnumForms = EnumFormsA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumMonitorsA LIB "WinSpool.drv" ALIAS "EnumMonitorsA" ( pName AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pMonitor AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumMonitorsA LIB "winspool.drv" ALIAS "EnumMonitorsA" ( BYREF pName AS ASCIIZ , BYVAL Level AS QUAD , BYREF pMonitor AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumMonitorsW LIB "WinSpool.drv" ALIAS "EnumMonitorsW" ( pName AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pMonitor AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumMonitorsW LIB "winspool.drv" ALIAS "EnumMonitorsW" ( BYREF pName AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pMonitor AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO EnumMonitors = EnumMonitorsW
#ELSE
 MACRO EnumMonitors = EnumMonitorsA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddMonitorA LIB "WinSpool.drv" ALIAS "AddMonitorA" ( pName AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pMonitors AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION AddMonitorA LIB "winspool.drv" ALIAS "AddMonitorA" ( BYREF pName AS ASCIIZ , BYVAL Level AS QUAD , OPTIONAL BYREF pMonitorInfo AS ANY ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddMonitorW LIB "WinSpool.drv" ALIAS "AddMonitorW" ( pName AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pMonitors AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION AddMonitorW LIB "winspool.drv" ALIAS "AddMonitorW" ( BYREF pName AS WSTRINGZ , BYVAL Level AS QUAD , OPTIONAL BYREF pMonitorInfo AS ANY ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO AddMonitor = AddMonitorW
#ELSE
 MACRO AddMonitor = AddMonitorA
#ENDIF
DECLARE FUNCTION DeleteMonitorA LIB "winspool.drv" ALIAS "DeleteMonitorA" ( BYREF pName AS ASCIIZ , BYREF pEnvironment AS ASCIIZ , BYREF pMonitorName AS ASCIIZ ) AS LONG
DECLARE FUNCTION DeleteMonitorW LIB "winspool.drv" ALIAS "DeleteMonitorW" ( BYREF pName AS WSTRINGZ
 , BYREF pEnvironment AS WSTRINGZ
 , BYREF pMonitorName AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DeleteMonitor = DeleteMonitorW
#ELSE
 MACRO DeleteMonitor = DeleteMonitorA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPortsA LIB "WinSpool.drv" ALIAS "EnumPortsA" ( pName AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pPort AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumPortsA LIB "winspool.drv" ALIAS "EnumPortsA" ( BYREF pName AS ASCIIZ , BYVAL Level AS QUAD , BYREF pPorts AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION EnumPortsW LIB "WinSpool.drv" ALIAS "EnumPortsW" ( pName AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pPort AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD, pcReturned AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION EnumPortsW LIB "winspool.drv" ALIAS "EnumPortsW" ( BYREF pName AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pPorts AS ANY , BYVAL cbBuf AS QUAD , BYREF pcbNeeded AS QUAD , BYREF pcReturned AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO EnumPorts = EnumPortsW
#ELSE
 MACRO EnumPorts = EnumPortsA
#ENDIF
DECLARE FUNCTION AddPortA LIB "winspool.drv" ALIAS "AddPortA" ( BYREF pName AS ASCIIZ , BYVAL hWnd AS QUAD , BYREF pMonitorName AS ASCIIZ ) AS LONG
DECLARE FUNCTION AddPortW LIB "winspool.drv" ALIAS "AddPortW" ( BYREF pName AS WSTRINGZ
 , BYVAL hWnd AS DWORD
 , BYREF pMonitorName AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO AddPort = AddPortW
#ELSE
 MACRO AddPort = AddPortA
#ENDIF
DECLARE FUNCTION ConfigurePortA LIB "winspool.drv" ALIAS "ConfigurePortA" ( BYREF pName AS ASCIIZ , BYVAL hWnd AS QUAD , BYREF pPortName AS ASCIIZ ) AS LONG
DECLARE FUNCTION ConfigurePortW LIB "winspool.drv" ALIAS "ConfigurePortW" ( BYREF pName AS WSTRINGZ
 , BYVAL hWnd AS DWORD
 , BYREF pPortName AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO ConfigurePort = ConfigurePortW
#ELSE
 MACRO ConfigurePort = ConfigurePortA
#ENDIF
DECLARE FUNCTION DeletePortA LIB "winspool.drv" ALIAS "DeletePortA" ( BYREF pName AS ASCIIZ , BYVAL hWnd AS QUAD , BYREF pPortName AS ASCIIZ ) AS LONG
DECLARE FUNCTION DeletePortW LIB "winspool.drv" ALIAS "DeletePortW" ( BYREF pName AS WSTRINGZ
 , BYVAL hWnd AS DWORD
 , BYREF pPortName AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DeletePort = DeletePortW
#ELSE
 MACRO DeletePort = DeletePortA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION XcvDataW LIB "WinSpool.drv" ALIAS "XcvDataW" ( BYVAL hXcv AS QUAD,
 pszDataName AS WSTRINGZ, BYVAL pInputData AS BYTE PTR, BYVAL cbInputData AS QUAD, BYVAL pOutputData AS BYTE PTR, BYVAL cbOutputData AS QUAD, pcbOutputNeeded AS QUAD, pdwStatus AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION XcvDataW LIB "winspool.drv" ALIAS "XcvDataW" ( BYVAL hXcv AS QUAD , BYREF pszDataName AS WSTRINGZ , BYVAL pInputData AS BYTE PTR , BYVAL cbInputData AS QUAD , BYREF pOutputData AS ANY , BYVAL cbOutputData AS QUAD , BYREF pcbOutputNeeded AS QUAD , BYREF pdwStatus AS QUAD ) AS LONG
#ENDIF
'#define XcvData XcvDataW
MACRO XcvData = XcvDataW
DECLARE FUNCTION GetDefaultPrinterA LIB "winspool.drv" ALIAS "GetDefaultPrinterA" ( BYREF pszBuffer AS ASCIIZ , BYREF pcchBuffer AS QUAD ) AS LONG
DECLARE FUNCTION GetDefaultPrinterW LIB "winspool.drv" ALIAS "GetDefaultPrinterW" ( BYREF pszBuffer AS WSTRINGZ
 , BYREF pcchBuffer AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetDefaultPrinter = GetDefaultPrinterW
#ELSE
 MACRO GetDefaultPrinter = GetDefaultPrinterA
#ENDIF
DECLARE FUNCTION SetDefaultPrinterA LIB "winspool.drv" ALIAS "SetDefaultPrinterA" ( BYREF pszPrinter AS ASCIIZ ) AS LONG
DECLARE FUNCTION SetDefaultPrinterW LIB "winspool.drv" ALIAS "SetDefaultPrinterW" ( BYREF pszPrinter AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO SetDefaultPrinter = SetDefaultPrinterW
#ELSE
 MACRO SetDefaultPrinter = SetDefaultPrinterA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetPortA LIB "WinSpool.drv" ALIAS "SetPortA" ( pName AS ASCIIZ, pPortName AS ASCIIZ, BYVAL dwLevel AS QUAD, BYVAL pPortInfo AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION SetPortA LIB "winspool.drv" ALIAS "SetPortA" ( BYREF pName AS ASCIIZ , BYREF pPortName AS ASCIIZ , BYVAL dwLevel AS QUAD , BYREF pPortInfo AS ANY ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetPortW LIB "WinSpool.drv" ALIAS "SetPortW" ( pName AS WSTRINGZ, pPortName AS WSTRINGZ, BYVAL dwLevel AS QUAD, BYVAL pPortInfo AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION SetPortW LIB "winspool.drv" ALIAS "SetPortW" ( BYREF pName AS WSTRINGZ , BYREF pPortName AS WSTRINGZ , BYVAL dwLevel AS QUAD , BYREF pPortInfo AS ANY ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO SetPort = SetPortW
#ELSE
 MACRO SetPort = SetPortA
#ENDIF
DECLARE FUNCTION AddPrinterConnectionA LIB "winspool.drv" ALIAS "AddPrinterConnectionA" ( BYREF pName AS ASCIIZ ) AS LONG
DECLARE FUNCTION AddPrinterConnectionW LIB "winspool.drv" ALIAS "AddPrinterConnectionW" ( BYREF pName AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO AddPrinterConnection = AddPrinterConnectionW
#ELSE
 MACRO AddPrinterConnection = AddPrinterConnectionA
#ENDIF
DECLARE FUNCTION DeletePrinterConnectionA LIB "winspool.drv" ALIAS "DeletePrinterConnectionA" ( BYREF pName AS ASCIIZ ) AS LONG
DECLARE FUNCTION DeletePrinterConnectionW LIB "winspool.drv" ALIAS "DeletePrinterConnectionW" ( BYREF pName AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DeletePrinterConnection = DeletePrinterConnectionW
#ELSE
 MACRO DeletePrinterConnection = DeletePrinterConnectionA
#ENDIF
DECLARE FUNCTION ConnectToPrinterDlg LIB "winspool.drv" ALIAS "ConnectToPrinterDlg" ( BYVAL hWnd AS QUAD , BYVAL Flags AS QUAD ) AS QUAD
' // Size = 12 bytes
TYPE PROVIDOR_INFO_1A DWORD
 pName AS ASCIIZ PTR
 pEnvironment AS ASCIIZ PTR
 pDLLName AS ASCIIZ PTR
END TYPE
' // Size = 12 bytes
TYPE PROVIDOR_INFO_1W DWORD
 pName AS WSTRINGZ PTR
 pEnvironment AS WSTRINGZ PTR
 pDLLName AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO PROVIDOR_INFO_1 = PROVIDOR_INFO_1W
#ELSE
 MACRO PROVIDOR_INFO_1 = PROVIDOR_INFO_1A
#ENDIF
' // Size = 4 bytes
TYPE PROVIDOR_INFO_2A DWORD
 pOrder AS ASCIIZ PTR
END TYPE
' // Size = 4 bytes
TYPE PROVIDOR_INFO_2W DWORD
 pOrder AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO PROVIDOR_INFO_2 = PROVIDOR_INFO_2W
#ELSE
 MACRO PROVIDOR_INFO_2 = PROVIDOR_INFO_2A
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddPrintProvidorA LIB "WinSpool.drv" ALIAS "AddPrintProvidorA" ( pName AS ASCIIZ, BYVAL level AS QUAD, BYVAL pProvidorInfo AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION AddPrintProvidorA LIB "winspool.drv" ALIAS "AddPrintProvidorA" ( BYREF pName AS ASCIIZ , BYVAL Level AS QUAD , BYREF pProvidorInfo AS ANY ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION AddPrintProvidorW LIB "WinSpool.drv" ALIAS "AddPrintProvidorW" ( pName AS WSTRINGZ, BYVAL level AS QUAD, BYVAL pProvidorInfo AS BYTE PTR ) AS LONG
#ELSE
DECLARE FUNCTION AddPrintProvidorW LIB "winspool.drv" ALIAS "AddPrintProvidorW" ( BYREF pName AS WSTRINGZ , BYVAL Level AS QUAD , BYREF pProvidorInfo AS ANY ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO AddPrintProvidor = AddPrintProvidorW
#ELSE
 MACRO AddPrintProvidor = AddPrintProvidorA
#ENDIF
DECLARE FUNCTION DeletePrintProvidorA LIB "winspool.drv" ALIAS "DeletePrintProvidorA" ( BYREF pName AS ASCIIZ , BYREF pEnvironment AS ASCIIZ , BYREF pPrintProvidorName AS ASCIIZ ) AS LONG
DECLARE FUNCTION DeletePrintProvidorW LIB "winspool.drv" ALIAS "DeletePrintProvidorW" ( BYREF pName AS WSTRINGZ
 , BYREF pEnvironment AS WSTRINGZ
 , BYREF pPrintProvidorName AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DeletePrintProvidor = DeletePrintProvidorW
#ELSE
 MACRO DeletePrintProvidor = DeletePrintProvidorA
#ENDIF
'#if (NTDDI_VERSION >= NTDDI_WINXPSP2)
DECLARE FUNCTION IsValidDevmodeA LIB "winspool.drv" ALIAS "IsValidDevmodeA" ( BYREF pDevmode AS DEVMODEA , BYVAL DevmodeSize AS QUAD ) AS LONG
DECLARE FUNCTION IsValidDevmodeW LIB "winspool.drv" ALIAS "IsValidDevmodeW" ( BYREF pDevmode AS DEVMODEW
 , BYVAL DevmodeSize AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO IsValidDevmode = IsValidDevmodeW
#ELSE
 MACRO IsValidDevmode = IsValidDevmodeA
#ENDIF
'#endif // (NTDDI_VERSION >= NTDDI_WINXPSP2)
'/*
' * SetPrinterData and GetPrinterData Server Handle Key values
' */
'#define SPLREG_DEFAULT_SPOOL_DIRECTORY TEXT("DefaultSpoolDirectory")
'#define SPLREG_PORT_THREAD_PRIORITY_DEFAULT TEXT("PortThreadPriorityDefault")
'#define SPLREG_PORT_THREAD_PRIORITY TEXT("PortThreadPriority")
'#define SPLREG_SCHEDULER_THREAD_PRIORITY_DEFAULT TEXT("SchedulerThreadPriorityDefault")
'#define SPLREG_SCHEDULER_THREAD_PRIORITY TEXT("SchedulerThreadPriority")
'#define SPLREG_BEEP_ENABLED TEXT("BeepEnabled")
'#define SPLREG_NET_POPUP TEXT("NetPopup")
'#define SPLREG_RETRY_POPUP TEXT("RetryPopup")
'#define SPLREG_NET_POPUP_TO_COMPUTER TEXT("NetPopupToComputer")
'#define SPLREG_EVENT_LOG TEXT("EventLog")
'#define SPLREG_MAJOR_VERSION TEXT("MajorVersion")
'#define SPLREG_MINOR_VERSION TEXT("MinorVersion")
'#define SPLREG_ARCHITECTURE TEXT("Architecture")
'#if (NTDDI_VERSION >= NTDDI_WINXP)
' #define SPLREG_OS_VERSION TEXT("OSVersion")
'#endif // (NTDDI_VERSION >= NTDDI_WINXP)
'#define SPLREG_OS_VERSIONEX TEXT("OSVersionEx")
'#define SPLREG_DS_PRESENT TEXT("DsPresent")
'#define SPLREG_DS_PRESENT_FOR_USER TEXT("DsPresentForUser")
'#define SPLREG_REMOTE_FAX TEXT("RemoteFax")
'#define SPLREG_RESTART_JOB_ON_POOL_ERROR TEXT("RestartJobOnPoolError")
'#define SPLREG_RESTART_JOB_ON_POOL_ENABLED TEXT("RestartJobOnPoolEnabled")
'#define SPLREG_DNS_MACHINE_NAME TEXT("DNSMachineName")
'#if ((OSVER(NTDDI_VERSION) == NTDDI_WINXP) && (SPVER(NTDDI_VERSION) >= 2) || \
' (NTDDI_VERSION >= NTDDI_WS03SP1))
' #define SPLREG_ALLOW_USER_MANAGEFORMS TEXT("AllowUserManageForms")
'#endif // ((OSVER(NTDDI_VERSION) == NTDDI_WINXP) ...
'#if (NTDDI_VERSION >= NTDDI_WS03)
' #define SPLREG_WEBSHAREMGMT TEXT("WebShareMgmt")
'#endif // (NTDDI_VERSION >= NTDDI_WS03)
$SPLREG_DEFAULT_SPOOL_DIRECTORY = "DefaultSpoolDirectory"
$$SPLREG_DEFAULT_SPOOL_DIRECTORY = "DefaultSpoolDirectory"$$
$SPLREG_PORT_THREAD_PRIORITY_DEFAULT = "PortThreadPriorityDefault"
$$SPLREG_PORT_THREAD_PRIORITY_DEFAULT = "PortThreadPriorityDefault"$$
$SPLREG_PORT_THREAD_PRIORITY = "PortThreadPriority"
$$SPLREG_PORT_THREAD_PRIORITY = "PortThreadPriority"$$
$SPLREG_SCHEDULER_THREAD_PRIORITY_DEFAULT = "SchedulerThreadPriorityDefault"
$$SPLREG_SCHEDULER_THREAD_PRIORITY_DEFAULT = "SchedulerThreadPriorityDefault"$$
$SPLREG_SCHEDULER_THREAD_PRIORITY = "SchedulerThreadPriority"
$$SPLREG_SCHEDULER_THREAD_PRIORITY = "SchedulerThreadPriority"$$
$SPLREG_BEEP_ENABLED = "BeepEnabled"
$$SPLREG_BEEP_ENABLED = "BeepEnabled"$$
$SPLREG_NET_POPUP = "NetPopup"
$$SPLREG_NET_POPUP = "NetPopup"$$
$SPLREG_RETRY_POPUP = "RetryPopup"
$$SPLREG_RETRY_POPUP = "RetryPopup"$$
$SPLREG_NET_POPUP_TO_COMPUTER = "NetPopupToComputer"
$$SPLREG_NET_POPUP_TO_COMPUTER = "NetPopupToComputer"$$
$SPLREG_EVENT_LOG = "EventLog"
$$SPLREG_EVENT_LOG = "EventLog"$$
$SPLREG_MAJOR_VERSION = "MajorVersion"
$$SPLREG_MAJOR_VERSION = "MajorVersion"$$
$SPLREG_MINOR_VERSION = "MinorVersion"
$$SPLREG_MINOR_VERSION = "MinorVersion"$$
$SPLREG_ARCHITECTURE = "Architecture"
$$SPLREG_ARCHITECTURE = "Architecture"$$
'#if (NTDDI_VERSION >= NTDDI_WINXP)
$SPLREG_OS_VERSION = "OSVersion"
$$SPLREG_OS_VERSION = "OSVersion"$$
'#endif // (NTDDI_VERSION >= NTDDI_WINXP)
$SPLREG_OS_VERSIONEX = "OSVersionEx"
$$SPLREG_OS_VERSIONEX = "OSVersionEx"$$
$SPLREG_DS_PRESENT = "DsPresent"
$$SPLREG_DS_PRESENT = "DsPresent"$$
$SPLREG_DS_PRESENT_FOR_USER = "DsPresentForUser"
$$SPLREG_DS_PRESENT_FOR_USER = "DsPresentForUser"$$
$SPLREG_REMOTE_FAX = "RemoteFax"
$$SPLREG_REMOTE_FAX = "RemoteFax"$$
$SPLREG_RESTART_JOB_ON_POOL_ERROR = "RestartJobOnPoolError"
$$SPLREG_RESTART_JOB_ON_POOL_ERROR = "RestartJobOnPoolError"$$
$SPLREG_RESTART_JOB_ON_POOL_ENABLED = "RestartJobOnPoolEnabled"
$$SPLREG_RESTART_JOB_ON_POOL_ENABLED = "RestartJobOnPoolEnabled"$$
$SPLREG_DNS_MACHINE_NAME = "DNSMachineName"
$$SPLREG_DNS_MACHINE_NAME = "DNSMachineName"$$
'#if ((OSVER(NTDDI_VERSION) == NTDDI_WINXP) && (SPVER(NTDDI_VERSION) >= 2) || \
' (NTDDI_VERSION >= NTDDI_WS03SP1))
$SPLREG_ALLOW_USER_MANAGEFORMS = "AllowUserManageForms"
$$SPLREG_ALLOW_USER_MANAGEFORMS = "AllowUserManageForms"$$
'#endif // ((OSVER(NTDDI_VERSION) == NTDDI_WINXP) ...
'#if (NTDDI_VERSION >= NTDDI_WS03)
$SPLREG_WEBSHAREMGMT = "WebShareMgmt"
$$SPLREG_WEBSHAREMGMT = "WebShareMgmt"$$
'#endif // (NTDDI_VERSION >= NTDDI_WS03)
'#if (NTDDI_VERSION >= NTDDI_WIN7)
'#define SPLREG_PRINT_DRIVER_ISOLATION_GROUPS_SEPARATOR L'\\'
'#define SPLREG_PRINT_DRIVER_ISOLATION_GROUPS TEXT("PrintDriverIsolationGroups")
'#define SPLREG_PRINT_DRIVER_ISOLATION_TIME_BEFORE_RECYCLE TEXT("PrintDriverIsolationTimeBeforeRecycle")
'#define SPLREG_PRINT_DRIVER_ISOLATION_MAX_OBJECTS_BEFORE_RECYCLE TEXT("PrintDriverIsolationMaxobjsBeforeRecycle")
'#define SPLREG_PRINT_DRIVER_ISOLATION_IDLE_TIMEOUT TEXT("PrintDriverIsolationIdleTimeout")
'#define SPLREG_PRINT_DRIVER_ISOLATION_EXECUTION_POLICY TEXT("PrintDriverIsolationExecutionPolicy")
'#define SPLREG_PRINT_DRIVER_ISOLATION_OVERRIDE_POLICY TEXT("PrintDriverIsolationOverrideCompat")
$SPLREG_PRINT_DRIVER_ISOLATION_GROUPS_SEPARATOR = "\"
$$SPLREG_PRINT_DRIVER_ISOLATION_GROUPS_SEPARATOR = "\"$$
$SPLREG_PRINT_DRIVER_ISOLATION_GROUPS = "PrintDriverIsolationGroups"
$$SPLREG_PRINT_DRIVER_ISOLATION_GROUPS = "PrintDriverIsolationGroups"$$
$SPLREG_PRINT_DRIVER_ISOLATION_TIME_BEFORE_RECYCLE = "PrintDriverIsolationTimeBeforeRecycle"
$$SPLREG_PRINT_DRIVER_ISOLATION_TIME_BEFORE_RECYCLE = "PrintDriverIsolationTimeBeforeRecycle"$$
$SPLREG_PRINT_DRIVER_ISOLATION_MAX_OBJECTS_BEFORE_RECYCLE = "PrintDriverIsolationMaxobjsBeforeRecycle"
$$SPLREG_PRINT_DRIVER_ISOLATION_MAX_OBJECTS_BEFORE_RECYCLE = "PrintDriverIsolationMaxobjsBeforeRecycle"$$
$SPLREG_PRINT_DRIVER_ISOLATION_IDLE_TIMEOUT = "PrintDriverIsolationIdleTimeout"
$$SPLREG_PRINT_DRIVER_ISOLATION_IDLE_TIMEOUT = "PrintDriverIsolationIdleTimeout"$$
$SPLREG_PRINT_DRIVER_ISOLATION_EXECUTION_POLICY = "PrintDriverIsolationExecutionPolicy"
$$SPLREG_PRINT_DRIVER_ISOLATION_EXECUTION_POLICY = "PrintDriverIsolationExecutionPolicy"$$
$SPLREG_PRINT_DRIVER_ISOLATION_OVERRIDE_POLICY = "PrintDriverIsolationOverrideCompat"
$$SPLREG_PRINT_DRIVER_ISOLATION_OVERRIDE_POLICY = "PrintDriverIsolationOverrideCompat"$$
'#endif // (NTDDI_VERSION >= NTDDI_WIN7)
%EQUATE `SERVER_ACCESS_ADMINISTER = &H00000001
%EQUATE `SERVER_ACCESS_ENUMERATE = &H00000002
%EQUATE `PRINTER_ACCESS_ADMINISTER = &H00000004
%EQUATE `PRINTER_ACCESS_USE = &H00000008
%EQUATE `JOB_ACCESS_ADMINISTER = &H00000010
'#if ((NTDDI_VERSION >= NTDDI_WINXPSP1) || \
' ((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (SPVER(NTDDI_VERSION) >= 3)))
%EQUATE `JOB_ACCESS_READ = &H00000020
'#endif // ((NTDDI_VERSION >= NTDDI_WINXPSP1) ...
'/*
' * Access rights for print servers
' */
%EQUATE `SERVER_READ = %STANDARD_RIGHTS_READ OR %SERVER_ACCESS_ENUMERATE
%EQUATE `SERVER_WRITE = %STANDARD_RIGHTS_WRITE OR %SERVER_ACCESS_ADMINISTER OR %SERVER_ACCESS_ENUMERATE
%EQUATE `SERVER_EXECUTE = %STANDARD_RIGHTS_EXECUTE OR %SERVER_ACCESS_ENUMERATE
%EQUATE `SERVER_ALL_ACCESS = %STANDARD_RIGHTS_REQUIRED OR %SERVER_ACCESS_ADMINISTER OR %SERVER_ACCESS_ENUMERATE
'/*
' * Access rights for printers
' */
%EQUATE `PRINTER_READ = %STANDARD_RIGHTS_READ OR %PRINTER_ACCESS_USE
%EQUATE `PRINTER_WRITE = %STANDARD_RIGHTS_WRITE OR %PRINTER_ACCESS_USE
%EQUATE `PRINTER_EXECUTE = %STANDARD_RIGHTS_EXECUTE OR %PRINTER_ACCESS_USE
%EQUATE `PRINTER_ALL_ACCESS = %STANDARD_RIGHTS_REQUIRED OR %PRINTER_ACCESS_ADMINISTER OR %PRINTER_ACCESS_USE
'/*
' * Access rights for jobs
' */
'#if ((NTDDI_VERSION >= NTDDI_WINXPSP1) || \
' ((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (SPVER(NTDDI_VERSION) >= 3)))
' #define JOB_READ (STANDARD_RIGHTS_READ |\
' JOB_ACCESS_READ)
'#else
' #define JOB_READ (STANDARD_RIGHTS_READ |\
' JOB_ACCESS_ADMINISTER)
'#endif
%EQUATE `JOB_READ = %STANDARD_RIGHTS_READ OR %JOB_ACCESS_READ
%EQUATE `JOB_WRITE = %STANDARD_RIGHTS_WRITE OR %JOB_ACCESS_ADMINISTER
%EQUATE `JOB_EXECUTE = %STANDARD_RIGHTS_EXECUTE OR %JOB_ACCESS_ADMINISTER
'#if ((NTDDI_VERSION >= NTDDI_WINXPSP1) || \
' ((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (SPVER(NTDDI_VERSION) >= 3)))
' #define JOB_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
' JOB_ACCESS_ADMINISTER |\
' JOB_ACCESS_READ)
'#else
' #define JOB_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
' JOB_ACCESS_ADMINISTER)
'#endif
%EQUATE `JOB_ALL_ACCESS = %STANDARD_RIGHTS_REQUIRED OR %JOB_ACCESS_ADMINISTER OR %JOB_ACCESS_READ
'/*
' * DS Print-Queue property tables
' */
'// Predefined Registry Keys used by Set/GetPrinterDataEx
'#define SPLDS_SPOOLER_KEY TEXT("DsSpooler")
'#define SPLDS_DRIVER_KEY TEXT("DsDriver")
'#define SPLDS_USER_KEY TEXT("DsUser")
$SPLDS_SPOOLER_KEY = "DsSpooler"
$$SPLDS_SPOOLER_KEY = "DsSpooler"$$
$SPLDS_DRIVER_KEY = "DsDriver"
$$SPLDS_DRIVER_KEY = "DsDriver"$$
$SPLDS_USER_KEY = "DsUser"
$$SPLDS_USER_KEY = "DsUser"$$
'// DS Print-Queue properties
'#define SPLDS_ASSET_NUMBER TEXT("assetNumber")
'#define SPLDS_BYTES_PER_MINUTE TEXT("bytesPerMinute")
'#define SPLDS_DESCRIPTION TEXT("description")
'#define SPLDS_DRIVER_NAME TEXT("driverName")
'#define SPLDS_DRIVER_VERSION TEXT("driverVersion")
'#define SPLDS_LOCATION TEXT("location")
'#define SPLDS_PORT_NAME TEXT("portName")
'#define SPLDS_PRINT_ATTRIBUTES TEXT("printAttributes")
'#define SPLDS_PRINT_BIN_NAMES TEXT("printBinNames")
'#define SPLDS_PRINT_COLLATE TEXT("printCollate")
'#define SPLDS_PRINT_COLOR TEXT("printColor")
'#define SPLDS_PRINT_DUPLEX_SUPPORTED TEXT("printDuplexSupported")
'#define SPLDS_PRINT_END_TIME TEXT("printEndTime")
'#define SPLDS_PRINTER_CLASS TEXT("printQueue")
'#define SPLDS_PRINTER_NAME TEXT("printerName")
'#define SPLDS_PRINT_KEEP_PRINTED_JOBS TEXT("printKeepPrintedJobs")
'#define SPLDS_PRINT_LANGUAGE TEXT("printLanguage")
'#define SPLDS_PRINT_MAC_ADDRESS TEXT("printMACAddress")
'#define SPLDS_PRINT_MAX_X_EXTENT TEXT("printMaxXExtent")
'#define SPLDS_PRINT_MAX_Y_EXTENT TEXT("printMaxYExtent")
'#define SPLDS_PRINT_MAX_RESOLUTION_SUPPORTED TEXT("printMaxResolutionSupported")
'#define SPLDS_PRINT_MEDIA_READY TEXT("printMediaReady")
'#define SPLDS_PRINT_MEDIA_SUPPORTED TEXT("printMediaSupported")
'#define SPLDS_PRINT_MEMORY TEXT("printMemory")
'#define SPLDS_PRINT_MIN_X_EXTENT TEXT("printMinXExtent")
'#define SPLDS_PRINT_MIN_Y_EXTENT TEXT("printMinYExtent")
'#define SPLDS_PRINT_NETWORK_ADDRESS TEXT("printNetworkAddress")
'#define SPLDS_PRINT_NOTIFY TEXT("printNotify")
'#define SPLDS_PRINT_NUMBER_UP TEXT("printNumberUp")
'#define SPLDS_PRINT_ORIENTATIONS_SUPPORTED TEXT("printOrientationsSupported")
'#define SPLDS_PRINT_OWNER TEXT("printOwner")
'#define SPLDS_PRINT_PAGES_PER_MINUTE TEXT("printPagesPerMinute")
'#define SPLDS_PRINT_RATE TEXT("printRate")
'#define SPLDS_PRINT_RATE_UNIT TEXT("printRateUnit")
'#define SPLDS_PRINT_SEPARATOR_FILE TEXT("printSeparatorFile")
'#define SPLDS_PRINT_SHARE_NAME TEXT("printShareName")
'#define SPLDS_PRINT_SPOOLING TEXT("printSpooling")
'#define SPLDS_PRINT_STAPLING_SUPPORTED TEXT("printStaplingSupported")
'#define SPLDS_PRINT_START_TIME TEXT("printStartTime")
'#define SPLDS_PRINT_STATUS TEXT("printStatus")
'#define SPLDS_PRIORITY TEXT("priority")
'#define SPLDS_SERVER_NAME TEXT("serverName")
'#define SPLDS_SHORT_SERVER_NAME TEXT("shortServerName")
'#define SPLDS_UNC_NAME TEXT("uNCName")
'#define SPLDS_URL TEXT("url")
'#define SPLDS_FLAGS TEXT("flags")
'#define SPLDS_VERSION_NUMBER TEXT("versionNumber")
$SPLDS_ASSET_NUMBER = "assetNumber"
$SPLDS_BYTES_PER_MINUTE = "bytesPerMinute"
$SPLDS_DESCRIPTION = "description"
$SPLDS_DRIVER_NAME = "driverName"
$SPLDS_DRIVER_VERSION = "driverVersion"
$SPLDS_LOCATION = "location"
$SPLDS_PORT_NAME = "portName"
$SPLDS_PRINT_ATTRIBUTES = "printAttributes"
$SPLDS_PRINT_BIN_NAMES = "printBinNames"
$SPLDS_PRINT_COLLATE = "printCollate"
$SPLDS_PRINT_COLOR = "printColor"
$SPLDS_PRINT_DUPLEX_SUPPORTED = "printDuplexSupported"
$SPLDS_PRINT_END_TIME = "printEndTime"
$SPLDS_PRINTER_CLASS = "printQueue"
$SPLDS_PRINTER_NAME = "printerName"
$SPLDS_PRINT_KEEP_PRINTED_JOBS = "printKeepPrintedJobs"
$SPLDS_PRINT_LANGUAGE = "printLanguage"
$SPLDS_PRINT_MAC_ADDRESS = "printMACAddress"
$SPLDS_PRINT_MAX_X_EXTENT = "printMaxXExtent"
$SPLDS_PRINT_MAX_Y_EXTENT = "printMaxYExtent"
$SPLDS_PRINT_MAX_RESOLUTION_SUPPORTED = "printMaxResolutionSupported"
$SPLDS_PRINT_MEDIA_READY = "printMediaReady"
$SPLDS_PRINT_MEDIA_SUPPORTED = "printMediaSupported"
$SPLDS_PRINT_MEMORY = "printMemory"
$SPLDS_PRINT_MIN_X_EXTENT = "printMinXExtent"
$SPLDS_PRINT_MIN_Y_EXTENT = "printMinYExtent"
$SPLDS_PRINT_NETWORK_ADDRESS = "printNetworkAddress"
$SPLDS_PRINT_NOTIFY = "printNotify"
$SPLDS_PRINT_NUMBER_UP = "printNumberUp"
$SPLDS_PRINT_ORIENTATIONS_SUPPORTED = "printOrientationsSupported"
$SPLDS_PRINT_OWNER = "printOwner"
$SPLDS_PRINT_PAGES_PER_MINUTE = "printPagesPerMinute"
$SPLDS_PRINT_RATE = "printRate"
$SPLDS_PRINT_RATE_UNIT = "printRateUnit"
$SPLDS_PRINT_SEPARATOR_FILE = "printSeparatorFile"
$SPLDS_PRINT_SHARE_NAME = "printShareName"
$SPLDS_PRINT_SPOOLING = "printSpooling"
$SPLDS_PRINT_STAPLING_SUPPORTED = "printStaplingSupported"
$SPLDS_PRINT_START_TIME = "printStartTime"
$SPLDS_PRINT_STATUS = "printStatus"
$SPLDS_PRIORITY = "priority"
$SPLDS_SERVER_NAME = "serverName"
$SPLDS_SHORT_SERVER_NAME = "shortServerName"
$SPLDS_UNC_NAME = "uNCName"
$SPLDS_URL = "url"
$SPLDS_FLAGS = "flags"
$SPLDS_VERSION_NUMBER = "versionNumber"
$$SPLDS_ASSET_NUMBER = "assetNumber"$$
$$SPLDS_BYTES_PER_MINUTE = "bytesPerMinute"$$
$$SPLDS_DESCRIPTION = "description"$$
$$SPLDS_DRIVER_NAME = "driverName"$$
$$SPLDS_DRIVER_VERSION = "driverVersion"$$
$$SPLDS_LOCATION = "location"$$
$$SPLDS_PORT_NAME = "portName"$$
$$SPLDS_PRINT_ATTRIBUTES = "printAttributes"$$
$$SPLDS_PRINT_BIN_NAMES = "printBinNames"$$
$$SPLDS_PRINT_COLLATE = "printCollate"$$
$$SPLDS_PRINT_COLOR = "printColor"$$
$$SPLDS_PRINT_DUPLEX_SUPPORTED = "printDuplexSupported"$$
$$SPLDS_PRINT_END_TIME = "printEndTime"$$
$$SPLDS_PRINTER_CLASS = "printQueue"$$
$$SPLDS_PRINTER_NAME = "printerName"$$
$$SPLDS_PRINT_KEEP_PRINTED_JOBS = "printKeepPrintedJobs"$$
$$SPLDS_PRINT_LANGUAGE = "printLanguage"$$
$$SPLDS_PRINT_MAC_ADDRESS = "printMACAddress"$$
$$SPLDS_PRINT_MAX_X_EXTENT = "printMaxXExtent"$$
$$SPLDS_PRINT_MAX_Y_EXTENT = "printMaxYExtent"$$
$$SPLDS_PRINT_MAX_RESOLUTION_SUPPORTED = "printMaxResolutionSupported"$$
$$SPLDS_PRINT_MEDIA_READY = "printMediaReady"$$
$$SPLDS_PRINT_MEDIA_SUPPORTED = "printMediaSupported"$$
$$SPLDS_PRINT_MEMORY = "printMemory"$$
$$SPLDS_PRINT_MIN_X_EXTENT = "printMinXExtent"$$
$$SPLDS_PRINT_MIN_Y_EXTENT = "printMinYExtent"$$
$$SPLDS_PRINT_NETWORK_ADDRESS = "printNetworkAddress"$$
$$SPLDS_PRINT_NOTIFY = "printNotify"$$
$$SPLDS_PRINT_NUMBER_UP = "printNumberUp"$$
$$SPLDS_PRINT_ORIENTATIONS_SUPPORTED = "printOrientationsSupported"$$
$$SPLDS_PRINT_OWNER = "printOwner"$$
$$SPLDS_PRINT_PAGES_PER_MINUTE = "printPagesPerMinute"$$
$$SPLDS_PRINT_RATE = "printRate"$$
$$SPLDS_PRINT_RATE_UNIT = "printRateUnit"$$
$$SPLDS_PRINT_SEPARATOR_FILE = "printSeparatorFile"$$
$$SPLDS_PRINT_SHARE_NAME = "printShareName"$$
$$SPLDS_PRINT_SPOOLING = "printSpooling"$$
$$SPLDS_PRINT_STAPLING_SUPPORTED = "printStaplingSupported"$$
$$SPLDS_PRINT_START_TIME = "printStartTime"$$
$$SPLDS_PRINT_STATUS = "printStatus"$$
$$SPLDS_PRIORITY = "priority"$$
$$SPLDS_SERVER_NAME = "serverName"$$
$$SPLDS_SHORT_SERVER_NAME = "shortServerName"$$
$$SPLDS_UNC_NAME = "uNCName"$$
$$SPLDS_URL = "url"$$
$$SPLDS_FLAGS = "flags"$$
$$SPLDS_VERSION_NUMBER = "versionNumber"$$
'/*
' -- Additional Print-Queue properties --
' These properties are not defined in the default Directory Services Schema,
' but should be used when extending the Schema so a consistent interface is maintained.
'*/
'#define SPLDS_PRINTER_NAME_ALIASES TEXT("printerNameAliases") // MULTI_SZ
'#define SPLDS_PRINTER_LOCATIONS TEXT("printerLocations") // MULTI_SZ
'#define SPLDS_PRINTER_MODEL TEXT("printerModel") // SZ
$SPLDS_PRINTER_NAME_ALIASES = "printerNameAliases" ' MULTI_SZ
$SPLDS_PRINTER_LOCATIONS = "printerLocations" ' MULTI_SZ
$SPLDS_PRINTER_MODEL = "printerModel" ' SZ
$$SPLDS_PRINTER_NAME_ALIASES = "printerNameAliases"$$ ' MULTI_SZ
$$SPLDS_PRINTER_LOCATIONS = "printerLocations"$$ ' MULTI_SZ
$$SPLDS_PRINTER_MODEL = "printerModel"$$ ' SZ
'#if (NTDDI_VERSION >= NTDDI_VISTA)
'//
'// Printer option flags that can be passed to OpenPrinter2 for
'// controlling whether the cached or non cached handle is used.
'//
' enum _PRINTER_OPTION_FLAGS
%EQUATE `PRINTER_OPTION_NO_CACHE = 1 ' 1 << 0
%EQUATE `PRINTER_OPTION_CACHE = 2 ' 1 << 1
%EQUATE `PRINTER_OPTION_CLIENT_CHANGE = 4 ' 1 << 2
%EQUATE `PRINTER_OPTION_NO_CLIENT_DATA = 8 ' 1 << 3
' // Size = 8 bytes
TYPE PRINTER_OPTIONSA DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
END TYPE
' // Size = 8 bytes
TYPE PRINTER_OPTIONSW DWORD
 cbSize AS DWORD ' UINT
 dwFlags AS DWORD
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTER_OPTIONS = PRINTER_OPTIONSW
#ELSE
 MACRO PRINTER_OPTIONS = PRINTER_OPTIONSA
#ENDIF
DECLARE FUNCTION OpenPrinter2A LIB "winspool.drv" ALIAS "OpenPrinter2A" ( BYREF pPrinterName AS ASCIIZ , BYREF phPrinter AS QUAD , OPTIONAL BYREF pDefault AS PRINTER_DEFAULTSA , OPTIONAL BYREF pOptions AS PRINTER_OPTIONSA ) AS LONG
DECLARE FUNCTION OpenPrinter2W LIB "winspool.drv" ALIAS "OpenPrinter2W" ( BYREF pPrinterName AS WSTRINGZ
 , BYREF phPrinter AS DWORD
 , OPTIONAL BYREF pDefault AS PRINTER_DEFAULTSW
 , OPTIONAL BYREF pOptions AS PRINTER_OPTIONSW
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO OpenPrinter2 = OpenPrinter2W
#ELSE
 MACRO OpenPrinter2 = OpenPrinter2A
#ENDIF
%EQUATE `PRINTER_CONNECTION_MISMATCH = &H00000020 ' // printer should be mismatched
%EQUATE `PRINTER_CONNECTION_NO_UI = &H00000040 ' // Fail call if UI is needed in order to install printer driver
' // Size = 8 bytes
TYPE PRINTER_CONNECTION_INFO_1A DWORD
 dwFlags AS DWORD
 pszDriverName AS ASCIIZ PTR
END TYPE
' // Size = 8 bytes
TYPE PRINTER_CONNECTION_INFO_1W DWORD
 dwFlags AS DWORD
 pszDriverName AS WSTRINGZ PTR
END TYPE
#IF %DEF(%UNICODE)
 MACRO PRINTER_CONNECTION_INFO_1 = PRINTER_CONNECTION_INFO_1W
#ELSE
 MACRO PRINTER_CONNECTION_INFO_1 = PRINTER_CONNECTION_INFO_1A
#ENDIF
DECLARE FUNCTION AddPrinterConnection2A LIB "winspool.drv" ALIAS "AddPrinterConnection2A" ( BYVAL hWnd AS QUAD , BYREF pszName AS ASCIIZ , BYVAL dwLevel AS QUAD , BYREF pConnectionInfo AS ANY ) AS LONG
DECLARE FUNCTION AddPrinterConnection2W LIB "winspool.drv" ALIAS "AddPrinterConnection2W" ( BYVAL hWnd AS QUAD
 , BYREF pszName AS WSTRINGZ
 , BYVAL dwLevel AS DWORD
 , BYREF pConnectionInfo AS ANY
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO AddPrinterConnection2 = AddPrinterConnection2W
#ELSE
 MACRO AddPrinterConnection2 = AddPrinterConnection2A
#ENDIF
'//
'// Unless IPDFP_COPY_ALL_FILES is specified it is always
'// assumed that we use the latest files (APD_COPY_NEW_FILES)
'//
%EQUATE `IPDFP_COPY_ALL_FILES = &H00000001
DECLARE FUNCTION InstallPrinterDriverFromPackageA LIB "winspool.drv" ALIAS "InstallPrinterDriverFromPackageA" ( BYREF pszServer AS ASCIIZ , BYREF pszInfPath AS ASCIIZ , BYREF pszDriverName AS ASCIIZ , BYREF pszEnvironment AS ASCIIZ , BYVAL dwFlags AS QUAD ) AS LONG
DECLARE FUNCTION InstallPrinterDriverFromPackageW LIB "winspool.drv" ALIAS "InstallPrinterDriverFromPackageW" ( BYREF pszServer AS WSTRINGZ
 , BYREF pszInfPath AS WSTRINGZ
 , BYREF pszDriverName AS WSTRINGZ
 , BYREF pszEnvironment AS WSTRINGZ
 , BYVAL dwFlags AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO InstallPrinterDriverFromPackage = InstallPrinterDriverFromPackageW
#ELSE
 MACRO InstallPrinterDriverFromPackage = InstallPrinterDriverFromPackageA
#ENDIF
%EQUATE `UPDP_SILENT_UPLOAD = &H00000001 ' // If specified we will not show UI during UploadPrinterDriverPackage API.
%EQUATE `UPDP_UPLOAD_ALWAYS = &H00000002 ' // Will not do the optimization of not uploading the files if the
 ' // driver package is already present on remote machine.
%EQUATE `UPDP_CHECK_DRIVERSTORE = &H00000004 ' // Check whether the given package exists in driver store or not.
DECLARE FUNCTION UploadPrinterDriverPackageA LIB "winspool.drv" ALIAS "UploadPrinterDriverPackageA" ( BYREF pszServer AS ASCIIZ , BYREF pszInfPath AS ASCIIZ , BYREF pszEnvironment AS ASCIIZ , BYVAL dwFlags AS QUAD , BYVAL hwnd AS QUAD , BYREF pszDestInfPath AS ASCIIZ , BYREF pcchDestInfPath AS QUAD ) AS LONG
DECLARE FUNCTION UploadPrinterDriverPackageW LIB "winspool.drv" ALIAS "UploadPrinterDriverPackageW" ( BYREF pszServer AS WSTRINGZ
 , BYREF pszInfPath AS WSTRINGZ
 , BYREF pszEnvironment AS WSTRINGZ
 , BYVAL dwFlags AS DWORD
 , BYVAL hwnd AS DWORD
 , BYREF pszDestInfPath AS WSTRINGZ
 , BYREF pcchDestInfPath AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO UploadPrinterDriverPackage = UploadPrinterDriverPackageW
#ELSE
 MACRO UploadPrinterDriverPackage = UploadPrinterDriverPackageA
#ENDIF
TYPE CORE_PRINTER_DRIVERA
 CoreDriverGUID AS GUID ' GUID
 ftDriverDate AS FILETIME ' FILETIME
 dwlDriverVersion AS QUAD ' DWORDLONG
 szPackageID AS ASCIIZ * %MAX_PATH ' CHAR
END TYPE
' // Size = 552 bytes
TYPE CORE_PRINTER_DRIVERW ' Must be 8 byte aligned
 CoreDriverGUID AS GUID ' GUID
 ftDriverDate AS FILETIME ' FILETIME
 dwlDriverVersion AS QUAD ' DWORDLONG
 szPackageID AS WSTRINGZ * %MAX_PATH ' WCHAR
END TYPE
#IF %DEF(%UNICODE)
 MACRO CORE_PRINTER_DRIVER = CORE_PRINTER_DRIVERW
#ELSE
 MACRO CORE_PRINTER_DRIVER = CORE_PRINTER_DRIVERA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetCorePrinterDriversA LIB "WinSpool.drv" ALIAS "GetCorePrinterDriversA" ( pszServer AS ASCIIZ, pszEnvironment AS ASCIIZ, pszzCoreDriverDependencies AS ASCIIZ, BYVAL cCorePrinterDrivers AS QUAD, BYVAL pCorePrinterDrivers AS CORE_PRINTER_DRIVERA PTR ) AS LONG
#ELSE
DECLARE FUNCTION GetCorePrinterDriversA LIB "winspool.drv" ALIAS "GetCorePrinterDriversA" ( BYREF pszServer AS ASCIIZ , BYREF pszEnvironment AS ASCIIZ , BYREF pszzCoreDriverDependencies AS ASCIIZ , BYVAL cCorePrinterDrivers AS QUAD , BYREF pCorePrinterDrivers AS CORE_PRINTER_DRIVERA ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetCorePrinterDriversW LIB "WinSpool.drv" ALIAS "GetCorePrinterDriversW" ( pszServer AS WSTRINGZ, pszEnvironment AS WSTRINGZ, pszzCoreDriverDependencies AS WSTRINGZ, BYVAL cCorePrinterDrivers AS QUAD, BYVAL pCorePrinterDrivers AS CORE_PRINTER_DRIVERW PTR ) AS LONG
#ELSE
DECLARE FUNCTION GetCorePrinterDriversW LIB "winspool.drv" ALIAS "GetCorePrinterDriversW" ( BYREF pszServer AS WSTRINGZ , BYREF pszEnvironment AS WSTRINGZ , BYREF pszzCoreDriverDependencies AS WSTRINGZ , BYVAL cCorePrinterDrivers AS QUAD , BYREF pCorePrinterDrivers AS CORE_PRINTER_DRIVERW ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetCorePrinterDrivers = GetCorePrinterDriversW
#ELSE
 MACRO GetCorePrinterDrivers = GetCorePrinterDriversA
#ENDIF
DECLARE FUNCTION CorePrinterDriverInstalledA LIB "winspool.drv" ALIAS "CorePrinterDriverInstalledA" ( BYREF pszServer AS ASCIIZ , BYREF pszEnvironment AS ASCIIZ , BYVAL CoreDriverGUID AS GUID , BYVAL ftDriverDate AS FILETIME , BYVAL dwlDriverVersion AS QUAD , BYREF pbDriverInstalled AS LONG ) AS LONG
DECLARE FUNCTION CorePrinterDriverInstalledW LIB "winspool.drv" ALIAS "CorePrinterDriverInstalledW" ( BYREF pszServer AS WSTRINGZ
 , BYREF pszEnvironment AS WSTRINGZ
 , BYVAL CoreDriverGUID AS GUID
 , BYVAL ftDriverDate AS FILETIME
 , BYVAL dwlDriverVersion AS QUAD
 , BYREF pbDriverInstalled AS LONG
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO CorePrinterDriverInstalled = CorePrinterDriverInstalledW
#ELSE
 MACRO CorePrinterDriverInstalled = CorePrinterDriverInstalledA
#ENDIF
DECLARE FUNCTION GetPrinterDriverPackagePathA LIB "winspool.drv" ALIAS "GetPrinterDriverPackagePathA" ( BYREF pszServer AS ASCIIZ , BYREF pszEnvironment AS ASCIIZ , BYREF pszLanguage AS ASCIIZ , BYREF pszPackageID AS ASCIIZ , BYREF pszDriverPackageCab AS ASCIIZ , BYVAL cchDriverPackageCab AS QUAD , BYREF pcchRequiredSize AS QUAD ) AS LONG
DECLARE FUNCTION GetPrinterDriverPackagePathW LIB "winspool.drv" ALIAS "GetPrinterDriverPackagePathW" ( BYREF pszServer AS WSTRINGZ
 , BYREF pszEnvironment AS WSTRINGZ
 , BYREF pszLanguage AS WSTRINGZ
 , BYREF pszPackageID AS WSTRINGZ
 , BYREF pszDriverPackageCab AS WSTRINGZ
 , BYVAL cchDriverPackageCab AS DWORD
 , BYREF pcchRequiredSize AS DWORD
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO GetPrinterDriverPackagePath = GetPrinterDriverPackagePathW
#ELSE
 MACRO GetPrinterDriverPackagePath = GetPrinterDriverPackagePathA
#ENDIF
DECLARE FUNCTION DeletePrinterDriverPackageA LIB "winspool.drv" ALIAS "DeletePrinterDriverPackageA" ( BYREF pszServer AS ASCIIZ , BYREF pszInfPath AS ASCIIZ , OPTIONAL BYREF pszEnvironment AS ASCIIZ ) AS LONG
DECLARE FUNCTION DeletePrinterDriverPackageW LIB "winspool.drv" ALIAS "DeletePrinterDriverPackageW" ( BYREF pszServer AS WSTRINGZ
 , BYREF pszInfPath AS WSTRINGZ
 , OPTIONAL BYREF pszEnvironment AS WSTRINGZ
 ) AS LONG
#IF %DEF(%UNICODE)
 MACRO DeletePrinterDriverPackage = DeletePrinterDriverPackageW
#ELSE
 MACRO DeletePrinterDriverPackage = DeletePrinterDriverPackageA
#ENDIF
' enum EPrintPropertyType
%EQUATE `kPropertyTypeString = 1
%EQUATE `kPropertyTypeInt32 = 2
%EQUATE `kPropertyTypeInt64 = 3
%EQUATE `kPropertyTypeByte = 4
%EQUATE `kPropertyTypeTime = 5
%EQUATE `kPropertyTypeDevMode = 6
%EQUATE `kPropertyTypeSD = 7
%EQUATE `kPropertyTypeNotificationReply = 8
%EQUATE `kPropertyTypeNotificationOptions = 9
%EQUATE `kPropertyTypeBuffer = 10
' enum EPrintXPSJobProgress
%EQUATE `kAddingDocumentSequence = 0
%EQUATE `kDocumentSequenceAdded = 1
%EQUATE `kAddingFixedDocument = 2
%EQUATE `kFixedDocumentAdded = 3
%EQUATE `kAddingFixedPage = 4
%EQUATE `kFixedPageAdded = 5
%EQUATE `kResourceAdded = 6
%EQUATE `kFontAdded = 7
%EQUATE `kImageAdded = 8
%EQUATE `kXpsDocumentCommitted = 9
' enum EPrintXPSJobOperation
%EQUATE `kJobProduction = 1
%EQUATE `kJobConsumption = 2
' // Size = 8 bytes
TYPE PrintPropertyValue_UNION_STRUCT DWORD
 cbBuf AS DWORD
 pBuf AS DWORD
END TYPE
' // Size = 8 bytes
UNION PrintPropertyValue_UNION ' Must be 8 byte aligned
 propertyByte AS BYTE ' BYTE
 propertyString AS WSTRINGZ PTR
 propertyInt32 AS LONG
 propertyInt64 AS QUAD ' LONGLONG
 propertyBlob AS PrintPropertyValue_UNION_STRUCT
END UNION
' // Size = 16 bytes
TYPE PrintPropertyValue QWORD FILL ' Must be 8 byte aligned
 ePropertyType AS DWORD ' EPrintPropertyType enum
 value AS PrintPropertyValue_UNION
END TYPE
' // Size = 24 bytes
TYPE PrintNamedProperty QWORD FILL ' Must be 8 byte aligned
 propertyName AS WSTRINGZ PTR ' WCHAR*
 propertyValue AS PrintPropertyValue
END TYPE
' // Size = 8 bytes
TYPE PrintPropertiesCollection DWORD
 numberOfProperties AS DWORD ' ULONG
 propertiesCollection AS PrintNamedProperty PTR ' PrintNamedProperty*
END TYPE
DECLARE FUNCTION ReportJobProcessingProgress LIB "winspool.drv" ALIAS "ReportJobProcessingProgress" ( BYVAL printerHandle AS QUAD , BYVAL jobId AS QUAD , BYVAL jobOperation AS QUAD , BYVAL jobProgress AS QUAD ) AS LONG
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterDriver2A LIB "WinSpool.drv" ALIAS "GetPrinterDriver2A" ( BYVAL hWnd AS QUAD,
 BYVAL hPrinter AS QUAD,
 pEnvironment AS ASCIIZ, BYVAL Level AS QUAD, BYVAL pDriverInfo AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
DECLARE FUNCTION GetPrinterDriver2A LIB "winspool.drv" ALIAS "GetPrinterDriver2A" ( BYVAL hwnd AS QUAD , BYVAL hPrinter AS QUAD , BYREF pEnvironment AS ASCIIZ , BYVAL Level AS QUAD , BYREF pDriverInfo AS ANY , BYVAL cBuf AS QUAD , BYREF pcbNeeded AS QUAD ) AS LONG
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetPrinterDriver2W LIB "WinSpool.drv" ALIAS "GetPrinterDriver2W" ( BYVAL hWnd AS QUAD,
 BYVAL hPrinter AS QUAD,
 pEnvironment AS WSTRINGZ, BYVAL Level AS QUAD, BYVAL pDriverInfo AS BYTE PTR, BYVAL cbBuf AS QUAD, pcbNeeded AS QUAD ) AS LONG
#ELSE
2DECLARE FUNCTION GetPrinterDriver2W LIB "winspool.drv" ALIAS "GetPrinterDriver2W" ( BYVAL hwnd AS DWORD
 , BYVAL hPrinter AS DWORD
 , BYREF pEnvironment AS WSTRINGZ
 , BYVAL Level AS DWORD
 , BYREF pDriverInfo AS ANY
 , BYVAL cBuf AS DWORD
 , BYREF pcbNeeded AS DWORD
 ) AS LONG
#ENDIF
#IF %DEF(%UNICODE)
 MACRO GetPrinterDriver2 = GetPrinterDriver2W
#ELSE
 MACRO GetPrinterDriver2 = GetPrinterDriver2A
#ENDIF
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
'#if (NTDDI_VERSION >= NTDDI_WIN7)
' enum PRINT_EXECUTION_CONTEXT
%EQUATE `PRINT_EXECUTION_CONTEXT_APPLICATION = 0
%EQUATE `PRINT_EXECUTION_CONTEXT_SPOOLER_SERVICE = 1
%EQUATE `PRINT_EXECUTION_CONTEXT_SPOOLER_ISOLATION_HOST = 2
%EQUATE `PRINT_EXECUTION_CONTEXT_FILTER_PIPELINE = 3
%EQUATE `PRINT_EXECUTION_CONTEXT_WOW64 = 4
' // Size = 8 bytes
TYPE PRINT_EXECUTION_DATA DWORD
 context AS LONG ' PRINT_EXECUTION_CONTEXT
 clientAppPID AS DWORD
END TYPE
DECLARE FUNCTION GetPrintExecutionData LIB "winspool.drv" ALIAS "GetPrintExecutionData" ( BYREF pData AS PRINT_EXECUTION_DATA ) AS LONG
'#endif // (NTDDI_VERSION >= NTDDI_WIN7)
#ENDIF
