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.

48 lines
1.1 KiB

  1. // Transport.h
  2. // This is the base class for event transport classes.
  3. #pragma once
  4. #include "buffer.h"
  5. #include "NCDefs.h"
  6. class CConnection;
  7. class CTransport
  8. {
  9. public:
  10. CTransport() :
  11. m_iRef(1)
  12. {
  13. InitializeCriticalSection(&m_cs);
  14. }
  15. virtual ~CTransport()
  16. {
  17. DeleteCriticalSection(&m_cs);
  18. }
  19. void SetConnection(CConnection *pConnection)
  20. {
  21. m_pConnection = pConnection;
  22. }
  23. // Overrideables
  24. virtual IsReady()=0;
  25. virtual BOOL SendData(LPBYTE pBuffer, DWORD dwSize)=0;
  26. virtual void Deinit()=0;
  27. virtual BOOL InitCallback()=0;
  28. virtual BOOL Init(LPCWSTR szBasePipeName, LPCWSTR szBaseProviderName)=0;
  29. virtual BOOL SignalProviderDisabled()=0;
  30. virtual void SendMsgReply(NC_SRVMSG_REPLY *pReply)=0;
  31. // Critical section functions
  32. void Lock() { EnterCriticalSection(&m_cs); }
  33. void Unlock() { LeaveCriticalSection(&m_cs); }
  34. protected:
  35. LONG m_iRef;
  36. CRITICAL_SECTION m_cs;
  37. CConnection *m_pConnection;
  38. };