home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / PMSPLP.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  14KB  |  425 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /****************************** Module Header ******************************\
  13. *
  14. * Module Name: PMSPLP.H
  15. *
  16. * OS/2 Presentation Manager Spooler PRIVATE function declarations
  17. *
  18. *
  19. *
  20. * ===========================================================================
  21. *
  22. * Comments at the end of each typedef line give the name tags used in
  23. * the assembler include version of this file.
  24. *
  25. * The assembler include version of this file excludes lines between NOINC
  26. * and INC comments.
  27. *
  28. #ifndef __IBMC__
  29.    * The 32-bit version of this file (as placed into the IBMH directory)
  30.    * excludes all non 32-bit material marked in this file as well
  31.    * as any areas specifically marked with __IBMC__ conditional
  32.    * sections - including this paragraph. The H2IBMH rexx command file
  33.    * removes these sections.
  34. #endif
  35. \***************************************************************************/
  36.  
  37. /* NOINC */
  38. #ifdef __IBMC__
  39.    #pragma checkout( suspend )
  40.       #ifndef __CHKHDR__
  41.          #pragma checkout( suspend )
  42.       #endif
  43.    #pragma checkout( resume )
  44. #endif
  45. /* INC */
  46.  
  47. #define PMSPLP_INCLUDED
  48.  
  49. #ifndef INCL_32         /* If neither INCL_32 or INCL_16 set already */
  50.    #ifndef INCL_16      /* find out from compiler if 32-bit or not.  */
  51.      #ifdef M_I386
  52.         #define INCL_32 /* Compiling for 32-bit */
  53.      #else
  54.         #define INCL_16 /* Compiling for 16-bit */
  55.      #endif
  56.   #endif
  57. #endif
  58.  
  59. /* IOctl for DosPrintJobGetId */
  60. #define SPOOL_LMCAT                     83
  61. #define SPOOL_LMGetPrintId              0x60
  62.  
  63.  
  64. #ifdef INCL_32
  65. #define SplQmInitialize        Spl32QmInitialize
  66. #define SplQmTerminate         Spl32QmTerminate
  67. #define SplQmSpoolerPresent    Spl32QmSpoolerPresent
  68. #define SplQmChooseLogAddr     Spl32QmChooseLogAddr
  69. #define SplPrmSpool            Spl32PrmSpool
  70. #define SplQmCancelPrintingJob Spl32QmCancelPrintingJob
  71. #define SplQmCancelWaitingJobs Spl32QmCancelWaitingJobs
  72. #define SplQmQueryPrintRes     Spl32QmQueryPrintRes
  73. #define SplVqIfInit            Spl32VqIfInit
  74. #define SplInit                Spl32Init
  75. #endif /*INCL_32*/
  76.  
  77.  
  78. /*** Spooler Initialization (called by PMSHELL at boot time) */
  79. #ifdef INCL_32
  80. BOOL   APIENTRY Spl32Init(VOID);
  81.  
  82. SPLERR APIENTRY SplQueryJobFile(PSZ   pszComputer,
  83.                                 PSZ   pszQname,
  84.                                 ULONG ulJobID,
  85.                                 PSZ   pszFile);
  86.  
  87. SPLERR APIENTRY SplRenameQueue (PSZ    pszComputerName,
  88.                                  PSZ    pszQueueName,
  89.                                  PSZ    pszNewQueueName);
  90. SPLERR APIENTRY SplQueryDriver(PSZ    pszComputerName,
  91.                                PSZ    pszDriverName,
  92.                                PSZ    pszPrinterName,
  93.                                ULONG  ulLevel,
  94.                                PVOID  pBuf,
  95.                                ULONG  cbBuf,
  96.                                PULONG pcbNeeded);
  97.  
  98. SPLERR APIENTRY SplSetDriver(PSZ   pszComputerName,
  99.                              PSZ   pszDriverName,
  100.                              PSZ   pszPrinterName,
  101.                              ULONG ulLevel,
  102.                              PVOID pBuf,
  103.                              ULONG cbBuf,
  104.                              ULONG ulParmNum);
  105.  
  106. #else
  107. BOOL   EXPENTRY SplInit(VOID);
  108.  
  109. SPLERR APIENTRY DosPrintJobAdd2(
  110.             PSZ     pszServer,
  111.             PSZ     pszQueueName,
  112.             USHORT  uLevel,
  113.             PBYTE   pbBuf,
  114.             USHORT  cbBuf,
  115.             PSZ     pszFileName,
  116.             PUSHORT puJobId);
  117.  
  118. SPLERR APIENTRY DosPrintJobSchedule(
  119.             PSZ     pszServer,
  120.             USHORT  uJobId);
  121.  
  122. SPLERR APIENTRY CorePrintJobEnum(
  123.         PSZ     pszServer,
  124.         PSZ     pszQueueName,
  125.         USHORT  uLevel,
  126.         PBYTE   pbBuf,
  127.         USHORT  cbBuf,
  128.         PUSHORT pcReturned,
  129.         PUSHORT pcTotal);
  130.  
  131. SPLERR APIENTRY Spl16EnumPrinter(PSZ     pszComputerName,
  132.                                  ULONG   uLevel,
  133.                                  ULONG   flType,
  134.                                  PVOID   pbBuf,
  135.                                  ULONG   cbBuf,
  136.                                  PULONG  pcReturned,
  137.                                  PULONG  pcTotal,
  138.                                  PULONG  pcbNeeded,
  139.                                  PVOID   pReserved);
  140.  
  141. SPLERR APIENTRY Spl16CopyJob(PSZ    pszSrcComputerName,
  142.                              PSZ    pszSrcQueue,
  143.                              ULONG  ulSrcJob,
  144.                              PSZ    pszTrgComputerName,
  145.                              PSZ    pszTrgQueueName,
  146.                              PULONG pulTrgJob);
  147.  
  148.  
  149. #endif
  150.  
  151. typedef char SPLLOGADDR[9];     /* ASCIIZ 8 char address               */
  152. typedef char SPLQUNAME[9];      /* ASCIIZ 8 char queue name            */
  153. typedef char SPLUNCQUNAME[28];  /* ASCIIZ 27 char UNC queue name -     */
  154.                                 /* \\server\queue (server<=16,queue<=8)*/
  155.  
  156. typedef struct _QNLIST {        /* qnlst */
  157.     USHORT    QueueCount;
  158.     SPLUNCQUNAME QueueName[1];
  159. } QNLIST;
  160. typedef QNLIST FAR *PQNLIST;
  161.  
  162. typedef struct _LOGADDRLIST {   /* lgadr */
  163.     USHORT      LogAddrCount;
  164.     SPLLOGADDR  LogAddr[1];
  165. } LOGADDRLIST;
  166. typedef LOGADDRLIST FAR *PLOGADDRLIST;
  167.  
  168. typedef struct _JOBTIMESTAMP {  /* jbt */
  169.     UCHAR  Hour;
  170.     UCHAR  Mins;
  171.     UCHAR  Secs;
  172.     UCHAR  Hsecs;
  173.     UCHAR  Day;
  174.     UCHAR  Month;
  175.     USHORT Year;
  176. } JOBTIMESTAMP;
  177. typedef JOBTIMESTAMP FAR *PJOBTIMESTAMP;
  178.  
  179. typedef struct _SPLCONTROL {    /* sctl */
  180.     USHORT DriverName;
  181.     USHORT DriverData;
  182.     USHORT LogAddr;
  183.     USHORT DataType;
  184.     USHORT Comment;
  185.     USHORT ProcName;
  186.     USHORT ProcParams;
  187.     USHORT SplParams;
  188.     USHORT NetParams;
  189.     USHORT DocName;
  190.     CHAR   CtrlData[1];
  191. } SPLCONTROL;
  192. typedef SPLCONTROL FAR *PSPLCONTROL;
  193.  
  194. /*** Spooler Job Control functions */
  195. BOOL   EXPENTRY SplQmHoldQueue(PSZ);
  196.  
  197. BOOL   EXPENTRY SplQmReleaseQueue(PSZ);
  198.  
  199. BOOL   EXPENTRY SplQmHoldJob(PSZ, USHORT);
  200.  
  201. BOOL   EXPENTRY SplQmReleaseJob(PSZ, USHORT);
  202.  
  203. BOOL   EXPENTRY SplQmCancelJob(PSZ, USHORT);
  204.  
  205. BOOL   EXPENTRY SplQmRestartJob(PSZ, USHORT);
  206.  
  207. USHORT EXPENTRY SplQmRepeatJob(PSZ, USHORT);
  208.  
  209. BOOL   EXPENTRY SplQmPrintJobNext(PSZ, USHORT);
  210.  
  211. BOOL   EXPENTRY SplQmListQueues(PQNLIST, PUSHORT);
  212.  
  213. BOOL   EXPENTRY SplQmListJobs(PSZ, PUSHORT, PUSHORT);
  214.  
  215. BOOL   EXPENTRY SplQmQueryJinfo(PSZ, USHORT, PUSHORT, PSZ,
  216.                                 PUSHORT, PUSHORT, PJOBTIMESTAMP, PSPLCONTROL,
  217.                                 PUSHORT, PSZ, PUSHORT);
  218.  
  219. USHORT EXPENTRY SplQmQueryPinfo(PSZ);
  220.  
  221. BOOL   EXPENTRY SplQmChangeJobPrty(PSZ, USHORT, USHORT);
  222.  
  223. BOOL   EXPENTRY SplQmWriteFile(HSPL, PSZ);
  224.  
  225. BOOL   EXPENTRY SplQmSetStatus(PSZ, USHORT, USHORT, PSZ);
  226.  
  227. typedef USHORT SPLVQ_QU_CALL;
  228.  
  229. #define SPLVQ_QU_CREATE         1
  230. #define SPLVQ_QU_DESTROY        2
  231. #define SPLVQ_QU_HOLD           3
  232. #define SPLVQ_QU_RELEASE        4
  233. #define SPLVQ_QU_WAITJOBSCANCEL 5
  234.  
  235. typedef USHORT SPLVQ_JB_CALL;
  236. #define SPLVQ_JB_ENQUEUE        1
  237. #define SPLVQ_JB_CANCEL         2
  238. #define SPLVQ_JB_STATUSSET      3
  239. #define SPLVQ_JB_HOLD           4
  240. #define SPLVQ_JB_RELEASE        5
  241. #define SPLVQ_JB_PRINTCANCEL    6
  242. #define SPLVQ_JB_RESTART        7
  243. #define SPLVQ_JB_START          8
  244. #define SPLVQ_JB_REPEAT         9
  245. #define SPLVQ_JB_PRINTNEXT      10
  246. #define SPLVQ_JB_DEQUEUE        11
  247.  
  248. #ifdef INCL_32
  249. BOOL  APIENTRY Spl32VqIfInit(HWND hWndNotify);
  250. #else
  251. /* Print Manager */
  252. BOOL  EXPENTRY SplVqIfInit(HWND hWndNotify);
  253. /* update message sent to the Print Manager */
  254. #endif
  255.  
  256. #define WM_SPOOLER_NOTIFY       (WM_SPLFIRST + 7)
  257.  
  258. #ifdef INCL_32
  259.  
  260. BOOL  APIENTRY Spl32QmInitialize(PULONG pusError);
  261.  
  262. BOOL  APIENTRY Spl32QmTerminate(VOID);
  263.  
  264. BOOL  APIENTRY Spl32QmSpoolerPresent(VOID);
  265.  
  266. ULONG APIENTRY Spl32QmChooseLogAddr(PSZ pszQueueName, PSZ pszLogAddr);
  267.  
  268. ULONG APIENTRY Spl32PrmSpool(PSZ pszInLogAddr, PSZ pszOutLogAddr);
  269.  
  270. ULONG APIENTRY Spl32QmCancelPrintingJob(PSZ pszDevice, PULONG pOS2ErrCode, PULONG pSeverity);
  271.  
  272. ULONG APIENTRY Spl32QmCancelWaitingJobs(PSZ pszDevice, PULONG pOS2ErrCode, PULONG pSeverity);
  273.  
  274. #else
  275.  
  276. /*** Spooler Process Identification (called by PMSPOOL at startup time) */
  277.  
  278. BOOL   EXPENTRY SplQmInitialize(PUSHORT pusError);
  279.  
  280. BOOL   EXPENTRY SplQmTerminate(VOID);
  281.  
  282.  
  283. /*** API call to determine if the PM spooler is running.  Returns TRUE  */
  284. /*** if SplSetSpoolerPID succeeded.  Used by DevOpenDC in PMGPI to see  */
  285. /*** if OD_QUEUED is a valid DC type.  If not, then mapped to OD_DIRECT */
  286.  
  287. BOOL   EXPENTRY SplQmSpoolerPresent(VOID);
  288.  
  289. /*** API call to map a queue name into a logical device name.  Used by  */
  290. /*** DevOpenDC in PMGPI to map the queue name specified by an app. into */
  291. /*** the appropriate logical name that is printer jobs for that queue.  */
  292.  
  293. USHORT EXPENTRY SplQmChooseLogAddr(PSZ pszQueueName, PSZ pszLogAddr);
  294.  
  295.  
  296. /*** API call to define a mapping from one logical device name to       */
  297. /*** another.                                                           */
  298. USHORT EXPENTRY SplPrmSpool(PSZ pszInLogAddr, PSZ pszOutLogAddr);
  299.  
  300.  
  301.  
  302. /*** API calls used by PRINT.COM to manipulate print queues             */
  303. USHORT EXPENTRY SplQmCancelPrintingJob(PSZ pszDevice, PUSHORT pOS2ErrCode, PUSHORT pSeverity);
  304.  
  305. USHORT EXPENTRY SplQmCancelWaitingJobs(PSZ pszDevice, PUSHORT pOS2ErrCode, PUSHORT pSeverity);
  306. #endif   /* INCL_32 */
  307.  
  308. /*  This change is specific to Cutter  --  Roc                          */
  309.  
  310. BOOL   EXPENTRY SplQmQueryQinfo(PSZ, PUSHORT, PUSHORT);         /* @D3C */
  311.  
  312.  
  313. /*** API call to retrieve the mapping associated with a logical device  */
  314. /*** (i.e. returns the name of the destination logical device)          */
  315. USHORT APIENTRY SplPrmRoute(PSZ pszInLogAddr, PSZ pszOutLogAddr);
  316.  
  317.  
  318. /* API to get the print resouces the user has access to (Print Manager) */
  319. typedef struct _PRINTRESINFO0 {             /* prres */
  320.       ULONG flType;
  321.       PSZ   pszName;
  322.       PSZ   pszDescription;
  323. } PRINTRESINFO0;
  324. typedef PRINTRESINFO0 FAR *PPRINTRESINFO0;
  325.  
  326. #define SPLQM_PR_QUEUE             0x0001
  327. #define SPLQM_PR_DIRECT_PRINTER    0x0002
  328. #define SPLQM_PR_SPOOLED_PRINTER   0x0004
  329. #define SPLQM_PR_DISPLAY_QUEUE     0x8000
  330.  
  331.  
  332. #ifdef INCL_32
  333. BOOL APIENTRY Spl32QmQueryPrintRes(HAB hab,
  334.                                  ULONG usLevel,
  335.                                  ULONG fsType,
  336.                                  PVOID pbBuf,
  337.                                  PULONG pcbBuf,
  338.                                  PULONG pcRes);
  339. #else
  340. BOOL EXPENTRY SplQmQueryPrintRes(HAB hab,
  341.                                  USHORT usLevel,
  342.                                  USHORT fsType,
  343.                                  PBYTE pbBuf,
  344.                                  PUSHORT pcbBuf,
  345.                                  PUSHORT pcRes);
  346. #endif
  347.  
  348. #define SPL_INI_QPROC              "PM_SPOOLER_QP"
  349. #define SPL_INI_DRIVER             "PM_SPOOLER_DD"
  350. #define SPL_INI_PORT               "PM_SPOOLER_PORT"
  351.  
  352. #define SPL_INI_QUEUE_STATUS       "PM_SPOOLER_QUEUE_STATUS"
  353. #define SPL_INI_QUEUE_TYPE         "PM_SPOOLER_QUEUE_TYPE"
  354. #define SPL_INI_QUEUE_COMPUTER     "PM_SPOOLER_QUEUE_COMPUTER"
  355. #define SPL_INI_QUEUE_REMOTEQNAME  "PM_SPOOLER_QUEUE_REMOTEQNAME"
  356.  
  357.  
  358. #define CINF struct caller_info
  359. #define PCINF struct caller_info FAR *
  360.  
  361.  
  362. /**
  363.  ** Defines for refresh messages for CP20 DCR 1499
  364.  **/
  365.  
  366. /* Parmnum - LOUSHORT(MP2) bits 0 - 4 */
  367.  
  368. #define SPLMSG_PARMNUM_MASK        0x001F
  369.  
  370. /* Added parameter number for changing port's port driver  @24904 */
  371. #define SPLMSG_PARMNUM_PORTDRIVER  0x0001
  372.  
  373. /* The Print destination is Direct(not connected to a Queue) */
  374. #define SPLMSG_DIRECT              0x0080
  375.  
  376. /* All jobs in given Queue are affected */
  377. #define SPLMSG_ALL                 0x0040
  378.  
  379. /* Object type - LOUSHORT(MP2) bits 8 - 11 */
  380.  
  381. #define SPLMSG_QUEUE               0x0100
  382. #define SPLMSG_JOB                 0x0200
  383. #define SPLMSG_PORT                0x0300
  384. #define SPLMSG_DEVICE              0x0400
  385. #define SPLMSG_PRINTER_DRIVER      0x0500
  386. #define SPLMSG_QUEUE_DRIVER        0x0600
  387. #define SPLMSG_QUEUE_APP_DEFAULT   0x0700
  388. #define SPLMSG_DEVICE_APP_DEFAULT  0x0800
  389. #define SPLMSG_OBJECT_MASK         0x0F00
  390.  
  391. /* Action type - LOUSHORT(MP2) bits 12 - 15 */
  392.  
  393. #define SPLMSG_ADD                 0x1000
  394. #define SPLMSG_CHANGE              0x2000
  395. #define SPLMSG_DELETE              0x3000
  396. #define SPLMSG_HOLD                0x4000
  397. #define SPLMSG_RELEASE             0x5000
  398. #define SPLMSG_ACTION_MASK         0xF000
  399.  
  400. typedef struct _PRQINFO90 {        /* prq90 */
  401.     PSZ     pszRemoteComputerName;
  402.     PSZ     pszRemoteQueueName;
  403. } PRQINFO90;
  404. typedef PRQINFO90  *PPRQINFO90;
  405.  
  406. typedef struct _PRDRIVINFO2 {  /* prdid */
  407.    PSZ     pszPrinterName;
  408.    PSZ     pszDriverName;
  409.    USHORT  usFlags;
  410.    USHORT  cDriverProps; /* Count of DRIVPROPS array that follows */
  411. } PRDRIVINFO2;
  412. typedef PRDRIVINFO2 FAR *PPRDRIVINFO2;
  413.  
  414. /* NOINC */
  415. #ifdef __IBMC__
  416.    #pragma checkout( suspend )
  417.       #ifndef __CHKHDR__
  418.          #pragma checkout( resume )
  419.       #endif
  420.    #pragma checkout( resume )
  421. #endif
  422. /* INC */
  423.  
  424. /**************************** end of file **********************************/
  425.