Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

159 lines
5.7 KiB

  1. /*************************************************************************
  2. * Microsoft Windows NT *
  3. * *
  4. * Copyright(c) Microsoft Corp., 1994 *
  5. * *
  6. * Revision History: *
  7. * *
  8. * Jan. 22,94 Koti Created *
  9. * 23-Jan-97 MohsinA Fixes *
  10. * *
  11. * Description: *
  12. * *
  13. * This file contains structure and data type definitions used for LPD *
  14. * *
  15. *************************************************************************/
  16. // see rfc1179, section 7.0 and the following structure will be obvious
  17. struct _controlfile_info
  18. {
  19. PCHAR pchClass; // 'C'
  20. PCHAR pchHost; // 'H' (must exist)
  21. DWORD dwCount; // 'I'
  22. PCHAR pchJobName; // 'J'
  23. PCHAR pchBannerName; // 'L'
  24. PCHAR pchMailName; // 'M' (not implemented)
  25. PCHAR pchSrcFile; // 'N'
  26. PCHAR pchUserName; // 'P' (must exist)
  27. PCHAR pchSymLink; // 'S' (not implemented)
  28. PCHAR pchTitle; // 'T'
  29. PCHAR pchUnlink; // 'U' (not implemented)
  30. DWORD dwWidth; // 'W'
  31. PCHAR pchTrfRFile; // '1' (not implemented)
  32. PCHAR pchTrfIFile; // '2' (not implemented)
  33. PCHAR pchTrfBFile; // '3' (not implemented)
  34. PCHAR pchTrfSFile; // '4' (not implemented)
  35. PCHAR pchCIFFile; // 'c' (not implemented)
  36. PCHAR pchDVIFile; // 'd' (not implemented)
  37. PCHAR pchFrmtdFile; // 'f'
  38. PCHAR pchPlotFile; // 'g' (not implemented)
  39. PCHAR pchUnfrmtdFile; // 'l'
  40. PCHAR pchDitroffFile; // 'n' (not implemented)
  41. PCHAR pchPscrptFile; // 'o'
  42. PCHAR pchPRFrmtFile; // 'p' (not implemented)
  43. PCHAR pchFortranFile; // 'r' (not implemented)
  44. PCHAR pchTroffFile; // 't' (not implemented)
  45. PCHAR pchRasterFile; // 'v' (not implemented)
  46. // what did we conclude from the control file?
  47. PCHAR szPrintFormat;
  48. USHORT usNumCopies; // not in rfc, but we will put it in!
  49. };
  50. typedef struct _controlfile_info CFILE_INFO;
  51. typedef CFILE_INFO *PCFILE_INFO;
  52. // if client request status of jobs for specific users and/or jobs, then
  53. // he can only specify a max of these many users and a max of these many
  54. // job ids in one lpq command (yes, this should be ample!)
  55. #define LPD_SP_STATUSQ_LIMIT 10
  56. struct _qstatus
  57. {
  58. PCHAR pchUserName;
  59. PCHAR ppchUsers[LPD_SP_STATUSQ_LIMIT];
  60. DWORD cbActualUsers;
  61. DWORD adwJobIds[LPD_SP_STATUSQ_LIMIT];
  62. DWORD cbActualJobIds;
  63. };
  64. typedef struct _qstatus QSTATUS;
  65. typedef QSTATUS *PQSTATUS;
  66. struct _cfile_entry
  67. {
  68. LIST_ENTRY Link;
  69. PCHAR pchCFileName; // 0x20 name of control file
  70. PCHAR pchCFile; // 0x24 control file
  71. DWORD cbCFileLen; // 0x28 length of control file
  72. };
  73. typedef struct _cfile_entry CFILE_ENTRY;
  74. typedef CFILE_ENTRY *PCFILE_ENTRY;
  75. struct _dfile_entry
  76. {
  77. LIST_ENTRY Link;
  78. PCHAR pchDFileName; // 0xa0 name of data file
  79. DWORD cbDFileLen; // 0xa8 how many bytes in bufr are data
  80. HANDLE hDataFile;
  81. };
  82. typedef struct _dfile_entry DFILE_ENTRY;
  83. typedef DFILE_ENTRY *PDFILE_ENTRY;
  84. struct _sockconn
  85. {
  86. struct _sockconn *pNext;
  87. // WORD cbClients; // used only by the Head
  88. SOCKET sSock; // socket which connects us to client
  89. DWORD dwThread; // thread id of this thread
  90. WORD wState; // state of the connection
  91. BOOL fLogGenericEvent; // whether any specific event is logged
  92. PCHAR pchCommand; // request command from client
  93. DWORD cbCommandLen; // length of the request command
  94. LIST_ENTRY CFile_List; // Linked list of control files
  95. LIST_ENTRY DFile_List; // Linked list of data files
  96. PCHAR pchUserName; // name of user
  97. PCHAR pchPrinterName; // name of printer we have to print to
  98. HANDLE hPrinter; // handle to this printer
  99. DWORD dwJobId; // id of this job as spooler sees it
  100. LS_HANDLE LicenseHandle; // handle used in licensing approval
  101. BOOL fMustFreeLicense; // so that we know when to free it
  102. PQSTATUS pqStatus; // used only if client requests status
  103. CHAR szIPAddr[INET6_ADDRSTRLEN]; // ip address of the client
  104. BOOL bDataTypeOverride;// Whether or not we auto-sensed a job type
  105. CHAR szServerIPAddr[INET6_ADDRSTRLEN]; // ip address of the server
  106. struct _sockconn *pPrev; // doubly linked list, queue.
  107. #ifdef PROFILING
  108. time_t time_queued;
  109. time_t time_start;
  110. time_t time_done;
  111. #endif
  112. };
  113. typedef struct _sockconn SOCKCONN;
  114. typedef SOCKCONN *PSOCKCONN;
  115. //
  116. // All thread share this data.
  117. // Update to this always protected by CRITICAL_SECTION csConnSemGLB.
  118. //
  119. struct _common_lpd {
  120. int AliveThreads;
  121. int TotalAccepts;
  122. int MaxThreads;
  123. int TotalErrors;
  124. int IdleCounter;
  125. int QueueLength;
  126. };
  127. typedef struct _common_lpd COMMON_LPD;