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.

73 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1992,1993 Microsoft Corporation
  3. Module Name:
  4. psshmem.h
  5. Abstract:
  6. This module defines the interface format for the shared memory region
  7. that psprint and psexe use together.
  8. Author:
  9. James Bratsanos (v-jimbr,mcrafts!jamesb) 6-Dec-1992
  10. --*/
  11. #define PSEXE_OK_EXIT 0
  12. #define PSEXE_ERROR_EXIT 99
  13. //
  14. // Define some bits that tells us about the aborted and paused/un-paused
  15. // state of the current job
  16. //
  17. #define PS_SHAREDMEM_PAUSED 0x00000001
  18. #define PS_SHAREDMEM_ABORTED 0x00000002
  19. #define PS_SHAREDMEM_SECURITY_ABORT 0x00000004
  20. typedef struct {
  21. DWORD dwSize;
  22. DWORD dwFlags;
  23. DWORD dwNextOffset;
  24. DWORD dwPrinterName;
  25. DWORD dwDocumentName;
  26. DWORD dwPrintDocumentDocName;
  27. DWORD dwDevmode;
  28. DWORD dwControlName;
  29. DWORD dwJobId;
  30. } PSPRINT_SHARED_MEMORY;
  31. typedef PSPRINT_SHARED_MEMORY *PPSPRINT_SHARED_MEMORY;
  32. //
  33. // Define some macros that make copying stuff to /from shared memory
  34. // simple. The item passed in pItem is actually stuffed with the offset
  35. // of the data from the base of the structure. This has to be done becuase
  36. // processes sharing this data will not have this data at the same virtual
  37. // address
  38. //
  39. #define UTLPSCOPYTOSHARED( pBase, pSrc, pItem, dwLen ) \
  40. { \
  41. DWORD dwRealSize; \
  42. PBYTE pDest; \
  43. if (pSrc != NULL) { \
  44. dwRealSize = (dwLen + 3) & ~0x03; \
  45. pDest = (LPBYTE) (pBase) + pBase->dwNextOffset; \
  46. memcpy( (LPVOID) pDest, (LPVOID) pSrc, dwLen ); \
  47. pItem = pBase->dwNextOffset; \
  48. pBase->dwNextOffset += dwRealSize; \
  49. } else { \
  50. pItem = 0; \
  51. } \
  52. }
  53. #define UTLPSRETURNPTRFROMITEM( pBase, pItem ) \
  54. ( pItem ? ( (LPBYTE) ( (LPBYTE)pBase + pItem )) : (LPBYTE) NULL )
  55.