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.

85 lines
1.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows NT Security
  4. // Copyright (C) Microsoft Corporation, 1997 - 1998
  5. //
  6. // File: prtctx.h
  7. //
  8. // Contents: NT Marta printer context class
  9. //
  10. // History: 4-1-1999 kirtd Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #if !defined(__PRTCTX_H__)
  14. #define __PRTCTX_H__
  15. #include <windows.h>
  16. #include <printer.h>
  17. #include <assert.h>
  18. #include <winspool.h>
  19. //
  20. // CPrinterContext. This represents a printer object to the NT Marta
  21. // infrastructure
  22. //
  23. class CPrinterContext
  24. {
  25. public:
  26. //
  27. // Construction
  28. //
  29. CPrinterContext ();
  30. ~CPrinterContext ();
  31. DWORD InitializeByName (LPCWSTR pObjectName, ACCESS_MASK AccessMask);
  32. DWORD InitializeByHandle (HANDLE Handle);
  33. //
  34. // Dispatch methods
  35. //
  36. DWORD AddRef ();
  37. DWORD Release ();
  38. DWORD GetPrinterProperties (
  39. PMARTA_OBJECT_PROPERTIES pProperties
  40. );
  41. DWORD GetPrinterRights (
  42. SECURITY_INFORMATION SecurityInfo,
  43. PSECURITY_DESCRIPTOR* ppSecurityDescriptor
  44. );
  45. DWORD SetPrinterRights (
  46. SECURITY_INFORMATION SecurityInfo,
  47. PSECURITY_DESCRIPTOR pSecurityDescriptor
  48. );
  49. private:
  50. //
  51. // Reference count
  52. //
  53. DWORD m_cRefs;
  54. //
  55. // Printer handles
  56. //
  57. HANDLE m_hPrinter;
  58. //
  59. // Were we initialized by name or handle?
  60. //
  61. BOOL m_fNameInitialized;
  62. };
  63. #endif
  64.