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.

99 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. --*/
  4. #ifndef _PDEV_H
  5. #define _PDEV_H
  6. // NTRAID#NTBUG9-553877-2002/02/28-yasuho-: Security: mandatory changes
  7. #include <minidrv.h>
  8. #include <stdio.h>
  9. #include <prcomoem.h>
  10. #include <strsafe.h>
  11. ////////////////////////////////////////////////////////
  12. // OEM UD Defines
  13. ////////////////////////////////////////////////////////
  14. #define VALID_PDEVOBJ(pdevobj) \
  15. ((pdevobj) && (pdevobj)->dwSize >= sizeof(DEVOBJ) && \
  16. (pdevobj)->hEngine && (pdevobj)->hPrinter && \
  17. (pdevobj)->pPublicDM && (pdevobj)->pDrvProcs )
  18. //
  19. // ASSERT_VALID_PDEVOBJ can be used to verify the passed in "pdevobj". However,
  20. // it does NOT check "pdevOEM" and "pOEMDM" fields since not all OEM DLL's create
  21. // their own pdevice structure or need their own private devmode. If a particular
  22. // OEM DLL does need them, additional checks should be added. For example, if
  23. // an OEM DLL needs a private pdevice structure, then it should use
  24. // ASSERT(VALID_PDEVOBJ(pdevobj) && pdevobj->pdevOEM && ...)
  25. //
  26. #define ASSERT_VALID_PDEVOBJ(pdevobj) ASSERT(VALID_PDEVOBJ(pdevobj))
  27. // Debug text.
  28. #define ERRORTEXT(s) "ERROR " DLLTEXT(s)
  29. ////////////////////////////////////////////////////////
  30. // OEM UD Type Defines
  31. ////////////////////////////////////////////////////////
  32. typedef struct tag_OEMUD_EXTRADATA {
  33. OEM_DMEXTRAHEADER dmExtraHdr;
  34. } OEMUD_EXTRADATA, *POEMUD_EXTRADATA;
  35. //
  36. // OEM Signature and version.
  37. //
  38. #define OEM_SIGNATURE 'ALPS' // ALPS MD Series
  39. #define DLLTEXT(s) "ALPSRES: " s
  40. #define OEM_VERSION 0x00010000L
  41. // ####
  42. //
  43. // Minidriver device data block which we maintain.
  44. // Its address is saved in the DEVOBJ.pdevOEM of
  45. // OEM customiztion I/F.
  46. //
  47. typedef struct {
  48. VOID *pData; // Minidriver private data.
  49. VOID *pIntf; // a.k.a. pOEMHelp
  50. } MINIDEV;
  51. //
  52. // Easy access to the OEM data and the printer
  53. // driver helper functions.
  54. //
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif // __cplusplus
  58. extern
  59. HRESULT
  60. XXXDrvWriteSpoolBuf(
  61. VOID *pIntf,
  62. PDEVOBJ pDevobj,
  63. PVOID pBuffer,
  64. DWORD cbSize,
  65. DWORD *pdwResult);
  66. #ifdef __cplusplus
  67. }
  68. #endif // __cplusplus
  69. #define MINIDEV_DATA(p) \
  70. (((MINIDEV *)(p)->pdevOEM)->pData)
  71. #define MINIDEV_INTF(p) \
  72. (((MINIDEV *)(p)->pdevOEM)->pIntf)
  73. #define WRITESPOOLBUF(pdevobj, cmd, len) \
  74. (pdevobj)->pDrvProcs->DrvWriteSpoolBuf(pdevobj, cmd, len)
  75. #endif // _PDEV_H