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.

124 lines
3.0 KiB

  1. /*****************************************************************************\
  2. * MODULE: splapi.h
  3. *
  4. * PURPOSE: Implementation of COM interface for BidiSpooler
  5. *
  6. * Copyright (C) 2000 Microsoft Corporation
  7. *
  8. * History:
  9. *
  10. * 03/09/00 Weihai Chen (weihaic) Created
  11. *
  12. \*****************************************************************************/
  13. #ifndef _TBIDISPL
  14. #define _TBIDISPL
  15. #include "priv.h"
  16. class TBidiSpl : public IBidiSpl
  17. {
  18. public:
  19. // IUnknown
  20. STDMETHOD (QueryInterface) (
  21. REFIID iid,
  22. void** ppv) ;
  23. STDMETHOD_ (ULONG, AddRef) () ;
  24. STDMETHOD_ (ULONG, Release) () ;
  25. STDMETHOD (BindDevice) (
  26. IN CONST LPCWSTR pszDeviceName,
  27. IN CONST DWORD dwAccess);
  28. STDMETHOD (UnbindDevice) ();
  29. STDMETHOD (SendRecv) (
  30. IN CONST LPCWSTR pszAction,
  31. IN IBidiRequest * pRequest);
  32. STDMETHOD (MultiSendRecv) (
  33. IN CONST LPCWSTR pszAction,
  34. IN IBidiRequestContainer * pRequestContainer);
  35. // Constructor
  36. TBidiSpl() ;
  37. // Destructor
  38. ~TBidiSpl();
  39. inline BOOL bValid() CONST {return m_bValid;} ;
  40. private:
  41. class TRequestContainer {
  42. public:
  43. TRequestContainer (
  44. CONST DWORD dwCount);
  45. ~TRequestContainer ();
  46. BOOL
  47. AddRequest (
  48. IN CONST DWORD dwIndex,
  49. IN CONST LPCWSTR pszSchema,
  50. IN CONST BIDI_TYPE dwDataType,
  51. IN PBYTE pData,
  52. IN CONST DWORD dwSize);
  53. inline PBIDI_REQUEST_CONTAINER
  54. GetContainerPointer () CONST {return m_pContainer;};
  55. inline BOOL
  56. bValid () CONST {return m_bValid;};
  57. private:
  58. PBIDI_REQUEST_CONTAINER m_pContainer;
  59. BOOL m_bValid;
  60. };
  61. typedef DWORD (*PFN_ROUTERFREEBIDIRESPONSECONTAINER) (
  62. PBIDI_RESPONSE_CONTAINER pData);
  63. typedef DWORD (*PFN_SENDRECVBIDIDATA) (
  64. IN HANDLE hPrinter,
  65. IN LPCTSTR pAction,
  66. IN PBIDI_REQUEST_CONTAINER pReqData,
  67. OUT PBIDI_RESPONSE_CONTAINER* ppResData);
  68. HRESULT
  69. ValidateContext ();
  70. HRESULT
  71. ComposeRequestData (
  72. IN IBidiRequestContainer *pIReqContainer,
  73. OUT TRequestContainer **ppReqContainer);
  74. HRESULT
  75. SetData (
  76. IN IBidiRequestSpl *pISpl,
  77. IN PBIDI_RESPONSE_DATA pResponseData);
  78. HRESULT
  79. ComposeReponseData (
  80. IN IBidiRequestContainer *pIReqContainerSpl,
  81. IN PBIDI_RESPONSE_CONTAINER pResponse);
  82. BOOL m_bValid;
  83. LONG m_cRef;
  84. TCriticalSection m_CritSec;
  85. HANDLE m_hPrinter;
  86. PFN_SENDRECVBIDIDATA m_pfnSendRecvBidiData;
  87. PFN_ROUTERFREEBIDIRESPONSECONTAINER m_pfnRouterFreeBidiResponseContainer;
  88. } ;
  89. #endif