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.

125 lines
3.2 KiB

  1. #ifndef __UMPDHXX__
  2. #define __UMPDHXX__
  3. typedef struct ProxyPort
  4. {
  5. HANDLE PortHandle;
  6. HANDLE SectionHandle;
  7. RTL_CRITICAL_SECTION semPort;
  8. KPBYTE ClientMemoryBase;
  9. SIZE_T ClientMemorySize;
  10. KPBYTE ServerMemoryBase;
  11. KERNEL_INT_PTR ServerMemoryDelta;
  12. ULONG ClientMemoryAllocSize;
  13. } ProxyPort, *PProxyPort;
  14. class PROXYPORT
  15. {
  16. private:
  17. ProxyPort *pp;
  18. public:
  19. PROXYPORT(ULONGLONG inMaxSize);
  20. PROXYPORT(ProxyPort *ppIn) {pp = ppIn; AcquirePortAccess();}
  21. ~PROXYPORT() {ReleasePortAccess();}
  22. BOOL bValid() { return (pp != NULL); }
  23. ProxyPort *GetPort() { return pp; }
  24. void Close();
  25. void Shutdown() { DELETECRITICALSECTION(&pp->semPort); }
  26. void AcquirePortAccess()
  27. {
  28. ASSERTGDI(pp, "PROXYPORT:GetPortAccess() NULL psemPort\n");
  29. if (pp)
  30. {
  31. ENTERCRITICALSECTION(&pp->semPort);
  32. }
  33. }
  34. void ReleasePortAccess()
  35. {
  36. if (pp)
  37. {
  38. LEAVECRITICALSECTION(&pp->semPort);
  39. }
  40. }
  41. void HeapInit()
  42. {
  43. pp->ClientMemoryAllocSize = 0;
  44. }
  45. SERVERPTR HeapAlloc(ULONG inSize);
  46. CLIENTPTR ServerToClientPtr(SERVERPTR ptr)
  47. {
  48. return (ptr ? (CLIENTPTR)((PBYTE) ptr - pp->ServerMemoryDelta) : NULL);
  49. }
  50. BOOL ThunkMemBlock(KPBYTE * ptr, ULONG size);
  51. BOOL ThunkStr(LPWSTR * ioLpstr);
  52. PPORT_MESSAGE
  53. InitMsg(PPROXYMSG Msg, SERVERPTR pvIn, ULONG cjIn, SERVERPTR pvOut, ULONG cjOut);
  54. BOOL
  55. CheckMsg(NTSTATUS Status, PPROXYMSG Msg, SERVERPTR pvOut, ULONG cjOut);
  56. NTSTATUS
  57. SendRequest(SERVERPTR pvIn, ULONG cjIn, SERVERPTR pvOut, ULONG cjOut);
  58. KERNEL_PVOID
  59. LoadDriver(PDRIVER_INFO_5W pDriverInfo, LPWSTR pwstrPrinterName, PRINTER_DEFAULTSW *pdefaults, HANDLE hPrinter32);
  60. void
  61. UnloadDriver(KERNEL_PVOID umpdCookie, HANDLE hPrinter32, BOOL bNotifySpooler);
  62. int
  63. DocumentEvent(KERNEL_PVOID umpdCookie,
  64. HANDLE hPrinter32,
  65. HDC hdc,
  66. INT iEsc,
  67. ULONG cjIn,
  68. PVOID pulIn,
  69. ULONG cjOut,
  70. PVOID pulOut);
  71. DWORD
  72. StartDocPrinterW(KERNEL_PVOID umpdCookie,
  73. HANDLE hPrinter32,
  74. DWORD level,
  75. LPBYTE pDocInfo);
  76. BOOL
  77. StartPagePrinter(KERNEL_PVOID umpdCookie, HANDLE hPrinter32);
  78. BOOL
  79. EndPagePrinter(KERNEL_PVOID umpdCookie, HANDLE hPrinter32);
  80. BOOL
  81. EndDocPrinter(KERNEL_PVOID umpdCookie, HANDLE hPrinter32);
  82. BOOL
  83. AbortPrinter(KERNEL_PVOID umpdCookie, HANDLE hPrinter32);
  84. BOOL
  85. ResetPrinterW(KERNEL_PVOID umpdCookie,HANDLE hPrinter32,PRINTER_DEFAULTSW *pPtrDef);
  86. BOOL
  87. QueryColorProfile(KERNEL_PVOID umpdCookie,
  88. HANDLE hPrinter32,
  89. PDEVMODEW pDevMode,
  90. ULONG ulQueryMode,
  91. PVOID pvProfileData,
  92. ULONG* pcjProfileSize,
  93. FLONG* pflProfileFlag);
  94. };
  95. extern "C" void vUMPDWow64Shutdown();
  96. #endif