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.

86 lines
2.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: jqueue.cxx
  7. //
  8. // Contents: CJobQueue class implementation.
  9. //
  10. // Classes: CJobQueue
  11. //
  12. // Functions: None.
  13. //
  14. // History: 25-Oct-95 MarkBl Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #include "..\pch\headers.hxx"
  18. #pragma hdrstop
  19. #include "svc_core.hxx"
  20. //+---------------------------------------------------------------------------
  21. //
  22. // Member: CJobQueue::~CJobQueue
  23. //
  24. // Synopsis: Destructor. Destruct job info queue.
  25. //
  26. // Arguments: N/A
  27. //
  28. // Notes: None.
  29. //
  30. //----------------------------------------------------------------------------
  31. CJobQueue::~CJobQueue()
  32. {
  33. TRACE3(CJobQueue, ~CJobQueue);
  34. CRun * pRun, * pRunNext;
  35. pRun = (CRun *)CQueue::RemoveElement();
  36. // pRun = (CRun *)CQueue::GetFirstElement();
  37. while (pRun != NULL)
  38. {
  39. pRunNext = (CRun *)CQueue::RemoveElement();
  40. // pRunNext = pRun->Next();
  41. delete pRun;
  42. pRun = pRunNext;
  43. }
  44. }
  45. //+---------------------------------------------------------------------------
  46. //
  47. // Member: CJobQueue::FindJob
  48. //
  49. // Synopsis: Find the job with matching handle in the job queue.
  50. //
  51. // Arguments: [hJob] -- Job handle.
  52. //
  53. // Notes: None.
  54. //
  55. //----------------------------------------------------------------------------
  56. CRun *
  57. CJobQueue::FindJob(HANDLE hJob)
  58. {
  59. schDebugOut((DEB_USER3,
  60. "CJobQueue::FindJob(0x%x) hJob(0x%x)\n"));
  61. CRun * pRun = (CRun *)CQueue::GetFirstElement();
  62. while (pRun != NULL)
  63. {
  64. if (pRun->GetHandle() == hJob)
  65. {
  66. schDebugOut((DEB_USER3,
  67. "CJobQueue::FindJob(0x%x) hJob(0x%x) Found it\n"));
  68. return(pRun);
  69. }
  70. pRun = pRun->Next();
  71. }
  72. schDebugOut((DEB_USER3,
  73. "CJobQueue::FindJob(0x%x) hJob(0x%x) Not found\n"));
  74. return(NULL);
  75. }