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.

77 lines
1.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1997.
  5. //
  6. // File: pdaemon.hxx
  7. //
  8. // Contents: Abstract base class for out of process and in-process filter
  9. // daemon control class.
  10. //
  11. // Classes: PFilterDaemonControl
  12. //
  13. // History: 2-13-97 srikants Created
  14. //
  15. //----------------------------------------------------------------------------
  16. #pragma once
  17. #include <glbconst.hxx>
  18. //+---------------------------------------------------------------------------
  19. //
  20. // Class: PFilterDaemonControl
  21. //
  22. // Purpose: Abstract base class for in-process and out-of-process filter
  23. // daemon.
  24. //
  25. // History: 2-14-97 srikants Created
  26. //
  27. //----------------------------------------------------------------------------
  28. class PFilterDaemonControl
  29. {
  30. public:
  31. virtual void StartFiltering( BYTE const * pbStartupData,
  32. ULONG cbStartupData ) = 0;
  33. virtual void InitiateShutdown() = 0;
  34. virtual void WaitForDeath() = 0;
  35. virtual ~PFilterDaemonControl()
  36. {
  37. }
  38. protected:
  39. BOOL _IsResourceLowError( SCODE sc ) const;
  40. };
  41. //+---------------------------------------------------------------------------
  42. //
  43. // Function: _IsResourceLowError
  44. //
  45. // Synopsis: Tests if the error is a resource low error.
  46. //
  47. // History: 2-17-97 srikants Created
  48. //
  49. //----------------------------------------------------------------------------
  50. inline BOOL PFilterDaemonControl::_IsResourceLowError( SCODE sc ) const
  51. {
  52. BOOL fLow = STATUS_NO_MEMORY == sc ||
  53. ERROR_NOT_ENOUGH_MEMORY == sc ||
  54. HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY) == sc ||
  55. IsDiskLowError( sc );
  56. return fLow;
  57. }