! winptr.def [100]  ! structures and defs for WINPTRLST.SBX
!------------------------------------------------------------------------
!EDIT HISTORY
!Version 1.0:-
! [100] 10-Nov-17 / jdm / created
!------------------------------------------------------------------------
!REQUIREMENTS
!
!NOTES
!   These structures and defs are used by WINPTRLST.SBX.
!   All but ST_WINPTR_INFO and PRINTER_ENUM_ATSD are specifically
!   designed to match the Windows EnumPrinters() function in 
!   WINSPOOL.DRV. That function supports multiple generations/variations
!   of printer information structures (narrowed down here to levels 1, 2
!   and 4). For ease of use, these are condensed down to the ST_WINPTR_INFO
!   structure passed back from WINPTRLST.SBX.  See WINPTRLST.BP for details.
!
!   Since the ST_PRINTER_INFO_# structures are only used internally by
!   WINPTRLST.SBX, they are processed only if the symbol WINPTRSBX is defined.
!------------------------------------------------------------------------

++ifndef PRINTER_ENUM_LOCAL

! flags passed to WINPTRLST
! these are standard Windows EnumPrinters() flags..
define PRINTER_ENUM_DEFAULT      = &h00000001   ! default printer
define PRINTER_ENUM_LOCAL        = &h00000002   ! local printers
define PRINTER_ENUM_CONNECTIONS  = &h00000004   ! printers to which user has connected previously
define PRINTER_ENUM_NAME         = &h00000008   ! enumerate by name (server,domain,provider)
define PRINTER_ENUM_REMOTE       = &h00000010   ! network printers and print servers on user's domain
define PRINTER_ENUM_REMOTE       = &h00000010   ! network printers and print servers on user's domain
define PRINTER_ENUM_SHARED       = &h00000020   ! shared printers
define PRINTER_ENUM_NETWORK      = &h00000040   ! network printers on user's domain
define PRINTER_ENUM_CATEGORY_ALL = &h02000000   ! all printers

! these are A-Shell extensions...
define PRINTER_ENUM_XFUNCS       = &h40000000   ! called via XFUNCS$() (set internally when redirecting to ATE)
define PRINTER_ENUM_ATSD         = &h80000000   ! enumerate relative to ATSD server (else ATE client if applic.)

! attributes returned (these are standard Windows flags)
define PRINTER_ATTRIBUTE_QUEUED             = &h00000001
define PRINTER_ATTRIBUTE_DIRECT             = &h00000002
define PRINTER_ATTRIBUTE_DEFAULT            = &h00000004
define PRINTER_ATTRIBUTE_SHARED             = &h00000008
define PRINTER_ATTRIBUTE_NETWORK            = &h00000010
define PRINTER_ATTRIBUTE_HIDDEN             = &h00000020
define PRINTER_ATTRIBUTE_LOCAL              = &h00000040
define PRINTER_ATTRIBUTE_ENABLE_DEVQ        = &h00000080
define PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS    = &h00000100
define PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST  = &h00000200
define PRINTER_ATTRIBUTE_WORK_OFFLINE       = &h00000400
define PRINTER_ATTRIBUTE_ENABLE_BIDI        = &h00000800
define PRINTER_ATTRIBUTE_RAW_ONLY           = &h00001000
define PRINTER_ATTRIBUTE_PUBLISHED          = &h00002000
define PRINTER_ATTRIBUTE_FAX                = &h00004000
define PRINTER_ATTRIBUTE_TS                 = &h00008000
define PRINTER_ATTRIBUTE_PUSHED_USER        = &h00020000
define PRINTER_ATTRIBUTE_PUSHED_MACHINE     = &h00040000
define PRINTER_ATTRIBUTE_MACHINE            = &h00080000
define PRINTER_ATTRIBUTE_FRIENDLY_NAME      = &h00100000
define PRINTER_ATTRIBUTE_TS_GENERIC_DRIVER  = &h00200000

defstruct ST_WINPTR_INFO            ! common array returned by WINPTRLST
    map2 Name,s,64    
    map2 Attributes,b,4             ! see PRINTER_ATTRIBUTE_                 
endstruct

++ifdef WINPTRSBX                   ! set by WINPTRSBX.BP to include the following...

defstruct ST_PRINTER_INFO_1         ! internal Windows Printer Info type 1
    map2 Flags,b,4
    map2 pDescription,b,4           ! -> description
    map2 pName,b,4                  ! -> name
    map2 pComment,b,4               ! -> comment
endstruct

defstruct ST_PRINTER_INFO_2         ! internal Windows Printer Info type 2
    map2 pServerName,b,4
    map2 pPrinterName,b,4
    map2 pShareName,b,4
    map2 pPortName,b,4
    map2 pDriverName,b,4
    map2 pComment,b,4
    map2 pLocation,b,4
    map2 pDevMode,b,4
    map2 pSepFile,b,4
    map2 pPrintProcessor,b,4
    map2 pDataType,b,4
    map2 pParameters,b,4
    map2 pSecurityDescriptor,b,4
    map2 Attributes,b,4
    map2 Priority,b,4
    map2 DefaultPriority,b,4
    map2 StartTime,b,4
    map2 UntilTime,b,4
    map2 Status,b,4
    map2 cJobs,b,4
    map2 AveragePPM,b,4
endstruct

defstruct ST_PRINTER_INFO_4         ! internal Windows Printer Info type 4
    map2 pPrinterName,b,4           ! -> name
    map2 pServerName,b,4            ! -> name
    map2 Attributes,b,4 
endstruct

++endif
++endif
