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.

91 lines
2.4 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. WBEMQ.H
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef __WBEM_QUEUE__H_
  9. #define __WBEM_QUEUE__H_
  10. class CWbemQueue;
  11. class CWbemRequest : public CCoreExecReq
  12. {
  13. protected:
  14. IWbemContext* m_pContext;
  15. IWbemCausalityAccess* m_pCA;
  16. IWbemCallSecurity *m_pCallSec;
  17. //
  18. // This flag was added to allow requests to be run immediately rather than being
  19. // enqueued and serviced at a later point. This is done
  20. // by bumping the priority of the request up.
  21. //
  22. // CAUTION!!!IF THIS FLAG IS SET TO > 0 THE REQUEST WILL RUN NO MATTER WHAT!
  23. // IF WE'RE OUT OF THREADS ANOTHER THREAD WILL BE CREATED TO HANDLE
  24. // THE REQUEST! ****** USE CAUTION ******
  25. //
  26. // By default this flag is 0.
  27. //
  28. ULONG m_ulForceRun;
  29. public:
  30. CWbemRequest(IWbemContext* pContext, BOOL bInternallyIssued);
  31. ~CWbemRequest();
  32. BOOL IsChildOf(CWbemRequest* pOther);
  33. BOOL IsChildOf(IWbemContext* pOther);
  34. public:
  35. virtual CWbemQueue* GetQueue() {return NULL;}
  36. INTERNAL IWbemContext* GetContext() {return m_pContext;}
  37. void GetHistoryInfo(long* plNumParents, long* plNumSiblings);
  38. INTERNAL IWbemCallSecurity *GetCallSecurity() { return m_pCallSec; }
  39. BOOL IsSpecial();
  40. BOOL IsCritical();
  41. BOOL IsDependee();
  42. BOOL IsAcceptableByParent();
  43. BOOL IsIssuedByProvider();
  44. VOID SetForceRun ( ULONG ulForce ) { m_ulForceRun = ulForce; }
  45. ULONG GetForceRun ( ) { return m_ulForceRun; }
  46. virtual BOOL IsLongRunning() {return FALSE;}
  47. virtual BOOL IsInternal() = 0;
  48. virtual void TerminateRequest(HRESULT hRes){return;};
  49. };
  50. class CWbemQueue : public CCoreQueue
  51. {
  52. protected:
  53. long m_lChildPenalty;
  54. long m_lSiblingPenalty;
  55. long m_lPassingPenalty;
  56. public:
  57. CWbemQueue();
  58. virtual BOOL IsSuitableThread(CThreadRecord* pRecord, CCoreExecReq* pReq);
  59. virtual LPCWSTR GetType() {return L"WBEMQ";}
  60. virtual void AdjustPriorityForPassing(CCoreExecReq* pReq);
  61. virtual void AdjustInitialPriority(CCoreExecReq* pReq);
  62. static CWbemRequest* GetCurrentRequest();
  63. void SetRequestPenalties(long lChildPenalty, long lSiblingPenalty,
  64. long lPassingPenalty);
  65. virtual BOOL Execute(CThreadRecord* pRecord);
  66. virtual BOOL DoesNeedNewThread(CCoreExecReq* pReq, bool bIgnoreNumRequests = false );
  67. };
  68. #endif
  69.