Windows NT 4.0 source code leak
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.

100 lines
2.5 KiB

4 years ago
  1. /*++
  2. Module Name:
  3. windows\spooler\prtprocs\winprint\journal.c
  4. Abstract:
  5. Routines to facilitate printing of journal jobs.
  6. Author:
  7. Tommy Evans (vtommye) 10-22-1993
  8. Revision History:
  9. --*/
  10. #include "stddef.h"
  11. #include <windef.h>
  12. #include <windows.h>
  13. #include <winspool.h>
  14. #include <winsplp.h>
  15. #include <wchar.h>
  16. #include "winprint.h"
  17. #include "wingdip.h"
  18. /*++
  19. *******************************************************************
  20. P r i n t J o u r n a l J o b
  21. Routine Description:
  22. Prints out a job with JOURNAL data type.
  23. Arguments:
  24. pData => Data structure for this job
  25. pDocumentName => Name of this document
  26. Return Value:
  27. TRUE if successful
  28. FALSE if failed - GetLastError() will return reason.
  29. *******************************************************************
  30. --*/
  31. BOOL
  32. PrintJournalJob(
  33. IN PPRINTPROCESSORDATA pData,
  34. IN LPWSTR pDocumentName)
  35. {
  36. ULONG Copies;
  37. DWORD Start = 0;
  38. DWORD End = 0xffffffff;
  39. INT Priority = 0;
  40. /** Print the data pData->Copies times **/
  41. Copies = pData->Copies;
  42. try {
  43. while (Copies--) {
  44. /**
  45. WORKWORK - There is a problem here. It seems that
  46. the graphics engine deletes the print job
  47. once it is done playing it. Because of this,
  48. only one copy is spit out. One fix would be to copy
  49. the file off if we will be doing copies, then copy it
  50. back for each copy. Another would be to add a flag to
  51. the play call specifying whether to delete the file
  52. or not. Finally, we could just not support copies
  53. for journal jobs.
  54. WORKWORK - We can now pass the priority of the GDI
  55. server thread to gdi. The value passed is relative
  56. to the background application priority. We could
  57. experiment with different values or just pull it from
  58. the registry.
  59. **/
  60. /** Call the graphics engine to print the job **/
  61. //!!! BUG BUG BUG - LPCWSTR
  62. if (!GdiPlayJournal(pData->hDC,
  63. pDocumentName,
  64. Start, End, Priority)) {
  65. return FALSE;
  66. }
  67. } /* While copies to print **/
  68. } except (TRUE) {
  69. OutputDebugString(L"GdiPlayJournal gave an exception\n");
  70. return FALSE;
  71. }
  72. return TRUE;
  73. }