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.

66 lines
1.7 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1996.
  5. //
  6. // File: csrgt.hxx
  7. //
  8. // Contents: classes which implement ISurrogate:
  9. // CSurrgate
  10. //
  11. //
  12. // History: 03-Jun-96 t-AdamE Created
  13. // 09-Apr-98 WilfR Updated for Unified Surrogate
  14. //
  15. //--------------------------------------------------------------------------
  16. #if !defined(__CSRGT_HXX__)
  17. #define __CSRGT_HXX__
  18. #include <windows.h>
  19. #include <ole2.h>
  20. #include "debnot.h"
  21. //+-------------------------------------------------------------------------
  22. //
  23. // Class: CSurrogate
  24. //
  25. // Purpose: Implement the ISurrogate interface required by COM
  26. // for processes that act as surrogates for dll servers
  27. //
  28. // History: 21-May-96 t-Adame Created
  29. // 09-Apr-98 WilfR Removed loaded lib table
  30. //
  31. //--------------------------------------------------------------------------
  32. // forward declaration
  33. class CSurrogate;
  34. class CSurrogate : public ISurrogate
  35. {
  36. public:
  37. CSurrogate() : _cref( 0 ), _hEventSurrogateFree( NULL ) {}
  38. ~CSurrogate();
  39. // IUnknown methods
  40. STDMETHOD (QueryInterface)(REFIID iid, LPVOID FAR * ppv);
  41. STDMETHOD_(ULONG,AddRef)();
  42. STDMETHOD_(ULONG,Release)();
  43. // ISurrogate methods
  44. STDMETHOD (LoadDllServer)(/* [in] */ REFCLSID rclsid);
  45. STDMETHOD (FreeSurrogate)();
  46. // non-COM methods
  47. void WaitForSurrogateFree();
  48. BOOL Init();
  49. private:
  50. // signaled by a call to FreeSurrogate from OLE when its time
  51. // to terminate the surrogate process
  52. HANDLE _hEventSurrogateFree;
  53. ULONG _cref;
  54. };
  55. #endif // __CSRGT_HXX__