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.

116 lines
2.6 KiB

  1. /*++
  2. Copyright (C) 1999-2001 Microsoft Corporation
  3. Module Name:
  4. PROTOQ.H
  5. Abstract:
  6. Prototype query support for WinMgmt Query Engine.
  7. This was split out from QENGINE.CPP for better source
  8. organization.
  9. History:
  10. raymcc 04-Jul-99 Created.
  11. raymcc 14-Aug-99 Resubmit due to VSS problem.
  12. --*/
  13. #ifndef _PROTOQ_H_
  14. #define _PROTOQ_H_
  15. HRESULT ExecPrototypeQuery(
  16. IN CWbemNamespace *pNs,
  17. IN LPWSTR pszQuery,
  18. IN IWbemContext* pContext,
  19. IN CBasicObjectSink *pSink
  20. );
  21. //***************************************************************************
  22. //
  23. // Local defs
  24. //
  25. //***************************************************************************
  26. HRESULT SelectColForClass(
  27. IN CWQLScanner & Parser,
  28. IN CFlexArray *pClassDefs,
  29. IN SWQLColRef *pColRef,
  30. IN int & nPosition
  31. );
  32. HRESULT AdjustClassDefs(
  33. IN CFlexArray *pClassDefs,
  34. OUT IWbemClassObject **pRetNewClass
  35. );
  36. HRESULT GetUnaryPrototype(
  37. IN CWQLScanner & Parser,
  38. IN LPWSTR pszClass,
  39. IN LPWSTR pszAlias,
  40. IN CWbemNamespace *pNs,
  41. IN IWbemContext *pContext,
  42. IN CBasicObjectSink *pSink
  43. );
  44. HRESULT RetrieveClassDefs(
  45. IN CWQLScanner & Parser,
  46. IN CWbemNamespace *pNs,
  47. IN IWbemContext *pContext,
  48. IN CWStringArray & aAliasNames,
  49. OUT CFlexArray *pDefs
  50. );
  51. HRESULT ReleaseClassDefs(
  52. IN CFlexArray *pDefs
  53. );
  54. //***************************************************************************
  55. //
  56. //***************************************************************************
  57. struct SelectedClass
  58. {
  59. IWbemClassObject *m_pClassDef;
  60. WString m_wsAlias;
  61. WString m_wsClass;
  62. CWStringArray m_aSelectedCols;
  63. BOOL m_bAll;
  64. CFlexArray m_aSelectedColsPos;
  65. int SetNamed(LPWSTR pName, int & nPos)
  66. {
  67. int SizeBeforeA = m_aSelectedCols.Size();
  68. int nRes;
  69. nRes = m_aSelectedCols.Add(pName);
  70. if (CFlexArray::no_error != nRes) return nRes;
  71. #ifdef _WIN64
  72. nRes = m_aSelectedColsPos.Add(IntToPtr(nPos++)); // ok since we are really using safearray for dword
  73. #else
  74. nRes = m_aSelectedColsPos.Add((void *)nPos++);
  75. #endif
  76. if (CFlexArray::no_error != nRes)
  77. {
  78. m_aSelectedCols.RemoveAt(SizeBeforeA);
  79. nPos--;
  80. return nRes;
  81. }
  82. return CFlexArray::no_error;
  83. };
  84. int SetAll(int & nPos);
  85. SelectedClass() { m_pClassDef = 0; m_bAll = FALSE; }
  86. ~SelectedClass() { if (m_pClassDef) m_pClassDef->Release(); }
  87. };
  88. #endif