Source code of Windows XP (NT5)
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.

189 lines
4.5 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. PROVAUTO.H
  5. Abstract:
  6. Declares the classes necessary for the automation provider.
  7. History:
  8. a-davj 04-Mar-96 Created.
  9. --*/
  10. #ifndef _PROVAUTO_H_
  11. #define _PROVAUTO_H_
  12. #include "autoprov.h"
  13. #include "impdyn.h"
  14. #include "cfdyn.h"
  15. #include <occimpl.h>
  16. typedef enum {BOTH,PATH,NEWCLASS,RUNNINGCLASS} OBJTYPE;
  17. extern HANDLE ghAutoMutex;
  18. #define MAX_AUTO_WAIT 3000
  19. //***************************************************************************
  20. //
  21. // CLASS NAME:
  22. //
  23. // CCtlWnd
  24. //
  25. // DESCRIPTION:
  26. //
  27. //
  28. //***************************************************************************
  29. class CCtlWnd : public CFrameWnd
  30. {
  31. public:
  32. CCtlWnd();
  33. COleControlContainer * pGetCont(){return m_pCtrlCont;};
  34. };
  35. class CAutoCache : public CHandleCache {
  36. public:
  37. COleControlSite * pSite;
  38. TCHAR * pSavePath;
  39. CCtlWnd * pCtlWnd;
  40. CAutoCache();
  41. };
  42. //***************************************************************************
  43. //
  44. // CLASS NAME:
  45. //
  46. // CEnumAutoInfo
  47. //
  48. // DESCRIPTION:
  49. //
  50. //
  51. //***************************************************************************
  52. class CEnumAutoInfo : public CEnumInfo{
  53. public:
  54. CEnumAutoInfo(int iCount);
  55. ~CEnumAutoInfo();
  56. int GetCount(){return m_iCount;};
  57. private:
  58. int m_iCount;
  59. };
  60. // This defines the maximum number of arguments to a method. Note that if this
  61. // is changed, then the InvokeHelper CALLS MUST ALSO BE UPDATED!
  62. #define MAX_ARGS 5
  63. //***************************************************************************
  64. //
  65. // CLASS NAME:
  66. //
  67. // CImpAuto
  68. //
  69. // DESCRIPTION:
  70. //
  71. //
  72. //***************************************************************************
  73. class CImpAuto : public CImpDyn {
  74. public:
  75. // Standard provider routines
  76. CImpAuto();
  77. int iGetMinTokens(void){return 2;};
  78. SCODE StartBatch(long lFlags, IWbemClassObject FAR * pClassInt,CObject **pObj,BOOL bGet);
  79. void EndBatch(long lFlags, IWbemClassObject FAR * pClassInt,CObject *pObj,BOOL bGet);
  80. SCODE UpdateProperty(long lFlags, IWbemClassObject FAR * pClassInt,
  81. BSTR PropName,CProvObj & ProvObj,CObject * pPackage,
  82. CVariant * pVar);
  83. SCODE RefreshProperty(long lFlags, IWbemClassObject FAR * pClassInt,
  84. BSTR PropName,CProvObj & ProvObj,CObject * pPackage,
  85. CVariant * pVar);
  86. SCODE MakeEnum(IWbemClassObject * pClass, CProvObj & ProvObj,
  87. CEnumInfo ** ppInfo);
  88. SCODE GetKey(CEnumInfo * pInfo, int iIndex, LPWSTR * ppKey);
  89. SCODE MergeStrings(LPWSTR * ppOut,LPWSTR pClassContext,LPWSTR pKey,LPWSTR pPropContext);
  90. // Special routines for automation
  91. BOOL bIsControl(LPUNKNOWN lpTest);
  92. SCODE DoCall(WORD wOpt, CProvObj & ProvObj,int iIndex,
  93. LPDISPATCH pDisp,VARTYPE vt, void *pData,
  94. WCHAR * pProp = NULL);
  95. SCODE GetCFileStreamObj(const TCHAR * pPath, LPSTORAGE * ppStorage,
  96. COleStreamFile **ppFile,CAutoCache *pCache);
  97. SCODE ParsePathClass(const CString & sMix, CString & sPath,
  98. CString & sClass, OBJTYPE * type);
  99. void Free(int iStart, CAutoCache * pCache);
  100. LPDISPATCH pGetBoth(SCODE * psc, const TCHAR * pPath,
  101. const TCHAR * pClass,CAutoCache *pCache);
  102. LPDISPATCH pGetDispatch(SCODE * psc,CProvObj & ObjectPath,LPCTSTR pPathClass,
  103. CAutoCache *pCache, int iDepth);
  104. LPDISPATCH pGetPath(SCODE * psc, const TCHAR * pPath);
  105. LPDISPATCH pGetNewClass(SCODE * psc, const TCHAR * pClass,CAutoCache *pCache);
  106. LPDISPATCH pGetOCX(SCODE * psc, const TCHAR * pPath,CLSID & clsid,
  107. CAutoCache *pCache, LPUNKNOWN lpUnk);
  108. LPDISPATCH pGetRunningClass(SCODE * psc, const TCHAR * pClass,CAutoCache *pCache);
  109. LPDISPATCH pGetDispatchRoot(SCODE * psc,CProvObj & ObjectPath,LPCTSTR pPathClass,
  110. CAutoCache *pCache,int & iNumSkip);
  111. void StoreControl(CAutoCache *pCache);
  112. };
  113. class CCFAuto : public CCFDyn
  114. {
  115. public:
  116. IUnknown * CreateImpObj() {return (IWbemServices*) new CImpAuto;};
  117. } ;
  118. //***************************************************************************
  119. //
  120. // CLASS NAME:
  121. //
  122. // CImpAutoProp
  123. //
  124. // DESCRIPTION:
  125. //
  126. //
  127. //***************************************************************************
  128. class CImpAutoProp : public CImpDynProp {
  129. public:
  130. CImpAutoProp();
  131. ~CImpAutoProp();
  132. };
  133. //***************************************************************************
  134. //
  135. // CLASS NAME:
  136. //
  137. // CCFAutoProp
  138. //
  139. // DESCRIPTION:
  140. //
  141. //
  142. //***************************************************************************
  143. class CCFAutoProp : public CCFDyn
  144. {
  145. public:
  146. IUnknown * CreateImpObj() {return new CImpAutoProp();};
  147. } ;
  148. #endif //_PROVAUTO_H_