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.

52 lines
1.7 KiB

  1. /*---------------------------------------------------------------------------
  2. File: StatusObj.h
  3. Comments: COM object used internally by the engine to track whether a job
  4. is running, or finished, and to provide a mechanism for aborting a job.
  5. This COM object simply has a single property which reflects the state of a
  6. migration job (Not started, Running, Aborted, Finished, etc.)
  7. The agent will set the status to running, or finished, as appropriate.
  8. If the client cancels the job, the engine's CancelJob function will change the
  9. status to 'Aborting'.
  10. Each helper object that performs a lengthy operation, such as account replication, or
  11. security translation is responsible for periodically checking the status object to see
  12. if it needs to abort the task in progress. The engine itself will check between migration
  13. tasks to see if the job has been aborted.
  14. (c) Copyright 1999, Mission Critical Software, Inc., All Rights Reserved
  15. Proprietary and confidential to Mission Critical Software, Inc.
  16. REVISION LOG ENTRY
  17. Revision By: Christy Boles
  18. Revised on 05/18/99
  19. ---------------------------------------------------------------------------
  20. */
  21. // StatusObj.cpp : Implementation of CStatusObj
  22. #include "stdafx.h"
  23. #include "WorkObj.h"
  24. #include "StatObj.h"
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CStatusObj
  27. STDMETHODIMP CStatusObj::get_Status(LONG *pVal)
  28. {
  29. m_cs.Lock();
  30. (*pVal) = m_Status;
  31. m_cs.Unlock();
  32. return S_OK;
  33. }
  34. STDMETHODIMP CStatusObj::put_Status(LONG newVal)
  35. {
  36. m_cs.Lock();
  37. m_Status = newVal;
  38. m_cs.Unlock();
  39. return S_OK;
  40. }