| 1 | USING RPUPortSet | 
|---|
| 2 |  | 
|---|
| 3 | The standard serial and parallel port drivers do not support the SplPdSet API. | 
|---|
| 4 |  | 
|---|
| 5 | The PAR1284 port driver takes a data structure with the following format: | 
|---|
| 6 |  | 
|---|
| 7 | ULONG   signature;           /* Must be 0x52464E49 ('INFR')               */ | 
|---|
| 8 | ULONG   ulVersion;           /* Must be 0x00000001                        */ | 
|---|
| 9 | ULONG   flStatus;            /* Status flags:                             */ | 
|---|
| 10 | /* 0x00000001  BIDI_Q_PORT set (bidi enabled)*/ | 
|---|
| 11 | /* 0x00000002  Set after 1st attempt at bidi */ | 
|---|
| 12 | /* 0x00000004  Port connected to print queue */ | 
|---|
| 13 | /* 0x00000008  Port already open             */ | 
|---|
| 14 | /* 0x00000010  Port open in progress         */ | 
|---|
| 15 | /* 0x00000020  SplPdOpen being processed     */ | 
|---|
| 16 | /* 0x00000040  SplPdClose being processed    */ | 
|---|
| 17 | /* 0x00000080  XlateCmd has more alerts left */ | 
|---|
| 18 | /* 0x00000100  New printer or powered off    */ | 
|---|
| 19 | /* 0x00000200  Set when deviceId was checked */ | 
|---|
| 20 | /*             after first good write to a   */ | 
|---|
| 21 | /*             unidirectional printer.       */ | 
|---|
| 22 | /* 0x00000400  Set when last write was sent  */ | 
|---|
| 23 | /*             using ECP mode cmd channel.   */ | 
|---|
| 24 | /* 0x00000800  Set when printer put in bidi  */ | 
|---|
| 25 | /*             mode and DeviceID received.   */ | 
|---|
| 26 | /* 0x00001000  Set when CommStatChange alert */ | 
|---|
| 27 | /*             was posted to spooler.        */ | 
|---|
| 28 | /*             Cleared after BIDI_Q_PORT     */ | 
|---|
| 29 | /* 0x00002000  Set when CommStatChange alert */ | 
|---|
| 30 | /*             should not be set             */ | 
|---|
| 31 | /* 0x00004000  Set when port has a network   */ | 
|---|
| 32 | /*             connection                    */ | 
|---|
| 33 | ULONG   flBidiCapabilities;  /* PRTPORT.flBidiCapabilities _CAPS_     */ | 
|---|
| 34 | ULONG   flBidiProtocol;      /* PRTPORT.flBidiProtocol _TYPE_         */ | 
|---|
| 35 | ULONG   flJob;               /* PRTSW.flJob flags                     */ | 
|---|
| 36 | ULONG   flDevice;            /* PRTSW.flDevice flags                  */ | 
|---|
| 37 | ULONG   ulModeSelected;      /* Mode selected by user(see PARMODE_)   */ | 
|---|
| 38 | ULONG   ulCurrentMode;       /* Current mode of port(see CURMODE_)    */ | 
|---|
| 39 | BOOL    fShareAccess;        /* Share port with DOS/Windows           */ | 
|---|
| 40 | ULONG   ulPrintTimeOut;      /* Seconds to continue to retry job      */ | 
|---|
| 41 | /*  write request in SplPdWrite().       */ | 
|---|
| 42 | /*  Default: 45 seconds                  */ | 
|---|
| 43 | ULONG   ulNoQueryTimeOut;    /* Seconds from last query until         */ | 
|---|
| 44 | /*  port drops printer connection        */ | 
|---|
| 45 | /*  Default: 180 seconds                 */ | 
|---|
| 46 | ULONG   ulNoJobTimeOut;      /* Seconds from last job sent until      */ | 
|---|
| 47 | /*  port drops printer connection        */ | 
|---|
| 48 | /*  NOTE: Connection can be dropped      */ | 
|---|
| 49 | /*        sooner if PDR receives         */ | 
|---|
| 50 | /*        BIDI_NOTIFY_ENDJOBCONNECT      */ | 
|---|
| 51 | /*        This is used if we lose        */ | 
|---|
| 52 | /*        a job acknowledgement so       */ | 
|---|
| 53 | /*        that other Apps can use the    */ | 
|---|
| 54 | /*        infrared port.                 */ | 
|---|
| 55 | /*  Default: 300 seconds                 */ | 
|---|
| 56 | /*                                       */ | 
|---|
| 57 | PPTIMEOUTCHANNEL TimeOut;    /* Read and Write timeouts               */ | 
|---|
| 58 | /*                                       */ | 
|---|
| 59 | /*                                       */ | 
|---|
| 60 | /* The following ulpsz fields are        */ | 
|---|
| 61 | /*  offsets from the beginning of        */ | 
|---|
| 62 | /*  this PORTSETTINGS structure to       */ | 
|---|
| 63 | /*  the variable length strings.         */ | 
|---|
| 64 | /* This allows us to pass the buffer     */ | 
|---|
| 65 | /*  intact to PrtQuery and PrtSet,       */ | 
|---|
| 66 | /*  even across the network.             */ | 
|---|
| 67 | /* All strings are packed immediately    */ | 
|---|
| 68 | /*  after the fixed-length PORTSETTINGS  */ | 
|---|
| 69 | /*  structure.                           */ | 
|---|
| 70 | /*                                       */ | 
|---|
| 71 | /* An offset of 0 means no string        */ | 
|---|
| 72 | /*                                       */ | 
|---|
| 73 | ULONG   ulpszPortName;       /* -> name of port info is for           */ | 
|---|
| 74 | ULONG   ulpszDeviceID;       /* -> 1284 deviceID for printer on port  */ | 
|---|
| 75 | } PORTSETTINGS, *PPORTSETTINGS; | 
|---|
| 76 | #define PAR12_SIGNATURE | 
|---|
| 77 |  | 
|---|
| 78 | typedef struct _PPTIMEOUTCHANNEL{ | 
|---|
| 79 | ULONG   ulReadIdleTimeOut;  // millisecs DD has to complete entire Read | 
|---|
| 80 | ULONG   ulReadIntTimeOut;   // millisecs DD waits for Read interrupt | 
|---|
| 81 | ULONG   ulWriteIdleTimeOut; // millisecs DD has to complete entire Write | 
|---|
| 82 | ULONG   ulWriteIntTimeOut;  // millisecs DD waits for Write interrupt | 
|---|
| 83 | ULONG   ulLogChannel;   // 1=use data channel, 2=use address channel | 
|---|
| 84 | } PPTIMEOUTCHANNEL, *PPPTIMEOUTCHANNEL; | 
|---|
| 85 |  | 
|---|
| 86 |  | 
|---|
| 87 |  | 
|---|
| 88 |  | 
|---|
| 89 | Port settings structure for CUPS.PDR: | 
|---|
| 90 |  | 
|---|
| 91 | typedef struct _PORTSETTINGS { | 
|---|
| 92 | CHAR     szHost[ 65 ];       // CUPS server hostname/IP | 
|---|
| 93 | CHAR     szQueue[ 65 ];      // CUPS printer queue name | 
|---|
| 94 | } PORTSETTINGS, *PPORTSETTINGS; | 
|---|
| 95 |  | 
|---|
| 96 |  | 
|---|
| 97 |  | 
|---|
| 98 | Port setting structure for SMB.PDR: | 
|---|
| 99 |  | 
|---|
| 100 | /* szPortData contains all of the port parameters in a single buffer:  */ | 
|---|
| 101 | /*   host                                                              */ | 
|---|
| 102 | /*   printer                                                           */ | 
|---|
| 103 | /*   workgroup                                                         */ | 
|---|
| 104 | /*   userid                                                            */ | 
|---|
| 105 | /*   copies                                                            */ | 
|---|
| 106 | /*   password                                                          */ | 
|---|
| 107 | /* All except 'password' are verbatim character strings; 'password' is */ | 
|---|
| 108 | /* a hexadecimal string.  Fields are separated by '#'.  All fields are */ | 
|---|
| 109 | /* required; those with unspecified values are left empty.             */ | 
|---|
| 110 |  | 
|---|
| 111 | typedef struct _PORTSETTINGS { | 
|---|
| 112 | CHAR  szPortData[ 256 ]; | 
|---|
| 113 | } PORTSETTINGS, *PPORTSETTINGS; | 
|---|