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.

84 lines
2.0 KiB

  1. /*****************************************************************************
  2. * Copyright (c) 1998-2001 Microsoft Corporation, All Rights Reserved
  3. *
  4. * All Rights Reserved
  5. *
  6. * This software is furnished under a license and may be used and copied
  7. * only in accordance with the terms of such license and with the inclusion
  8. * of the above copyright notice. This software or any other copies thereof
  9. * may not be provided or otherwise made available to any other person. No
  10. * title to and ownership of the software is hereby transferred.
  11. *****************************************************************************/
  12. //============================================================================
  13. //
  14. // CKernal.h -- Wraper for Kernal functions
  15. //
  16. // Copyright (c) 1998-2001 Microsoft Corporation, All Rights Reserved
  17. //
  18. // Revisions: 6/26/98 a-kevhu Created
  19. //
  20. //============================================================================
  21. #ifndef __CKERNEL_H__
  22. #define __CKERNEL_H__
  23. #include "CGlobal.h"
  24. #include "CWaitableObject.h"
  25. class CKernel : public CWaitableObject
  26. {
  27. protected:
  28. HANDLE m_hHandle;
  29. DWORD m_dwStatus;
  30. protected:
  31. // constructor...
  32. CKernel();
  33. // error handling...
  34. void ThrowError(DWORD dwStatus);
  35. public:
  36. // destructor is virtual to make CKernel an abstract base class...
  37. virtual ~CKernel() = 0;
  38. // read the creation status of the internal kernel object...
  39. DWORD Status() const;
  40. // wait on the current kernel object...
  41. DWORD Wait(DWORD dwMilliseconds);
  42. // wait on the current object and one other...
  43. DWORD WaitForTwo(CWaitableObject &rCWaitableObject,
  44. BOOL bWaitAll,
  45. DWORD dwMilliseconds);
  46. // get the internal handle...
  47. HANDLE GetHandle() const;
  48. // another way to get the internal handle...
  49. operator HANDLE() const;
  50. };
  51. #endif