Leaked source code of windows server 2003
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.

116 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. forms.h
  5. Abstract:
  6. Declaration of functions for dealing with forms
  7. Environment:
  8. Fax driver, user and kernel mode
  9. Revision History:
  10. 01/09/96 -davidx-
  11. Created it.
  12. dd-mm-yy -author-
  13. description
  14. --*/
  15. #ifndef _FORMS_H_
  16. #define _FORMS_H_
  17. //
  18. // This is defined in winspool.h but we cannot include it from
  19. // kernel mode source. Define it here until DDI header files are fixed.
  20. //
  21. #if defined(KERNEL_MODE) && !defined(USERMODE_DRIVER)
  22. typedef struct _FORM_INFO_1 {
  23. DWORD Flags;
  24. PWSTR pName;
  25. SIZEL Size;
  26. RECTL ImageableArea;
  27. } FORM_INFO_1, *PFORM_INFO_1;
  28. #define FORM_BUILTIN 0x00000001
  29. typedef struct _PRINTER_INFO_2 {
  30. PWSTR pServerName;
  31. PWSTR pPrinterName;
  32. PWSTR pShareName;
  33. PWSTR pPortName;
  34. PWSTR pDriverName;
  35. PWSTR pComment;
  36. PWSTR pLocation;
  37. PDEVMODEW pDevMode;
  38. PWSTR pSepFile;
  39. PWSTR pPrintProcessor;
  40. PWSTR pDatatype;
  41. PWSTR pParameters;
  42. PSECURITY_DESCRIPTOR pSecurityDescriptor;
  43. DWORD Attributes;
  44. DWORD Priority;
  45. DWORD DefaultPriority;
  46. DWORD StartTime;
  47. DWORD UntilTime;
  48. DWORD Status;
  49. DWORD cJobs;
  50. DWORD AveragePPM;
  51. } PRINTER_INFO_2, *PPRINTER_INFO_2;
  52. #endif // KERNEL_MODE && !USERMODE_DRIVER
  53. //
  54. // We use the highest order bit of FORM_INFO_1.Flags.
  55. // Make sure the spooler is not using this bits.
  56. //
  57. #define FORM_SUPPORTED 0x80000000
  58. #define IsSupportedForm(pForm) ((pForm)->Flags & FORM_SUPPORTED)
  59. #define SetSupportedForm(pForm) ((pForm)->Flags |= FORM_SUPPORTED)
  60. //
  61. // Our internal unit for measuring paper size and imageable area is microns.
  62. // Following macros converts between microns and pixels, given a resolution
  63. // measured in dots-per-inch.
  64. //
  65. #define MicronToPixel(micron, dpi) MulDiv(micron, dpi, 25400)
  66. //
  67. // Validate the form specification in a devmode
  68. //
  69. BOOL
  70. ValidDevmodeForm(
  71. HANDLE hPrinter,
  72. PDEVMODE pdm,
  73. PFORM_INFO_1 pFormInfo
  74. );
  75. //
  76. // Return a collection of forms in the system database
  77. //
  78. PFORM_INFO_1
  79. GetFormsDatabase(
  80. HANDLE hPrinter,
  81. PDWORD pCount
  82. );
  83. #endif // !_FORMS_H_