/*++ Copyright (c) 1999-2001 Microsoft Corporation Module Name: process.h Abstract: Definition of the process class Author: Vishnu Patankar (VishnuP) - Oct 2001 Environment: User mode only. Exported Functions: Revision History: Created - Oct 2001 --*/ #if !defined(AFX_PROCESS_H__139D0BA5_19A7_4AA2_AE2C_E18A5FFAAA0F__INCLUDED_) #define AFX_PROCESS_H__139D0BA5_19A7_4AA2_AE2C_E18A5FFAAA0F__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "resource.h" // main symbols #include "..\te\obj\i386\ssrte.h" #include #include #include ///////////////////////////////////////////////////////////////////////////// // process class process : public IDispatchImpl, public ISupportErrorInfo, public CComObjectRoot, public CComCoClass { public: process() { m_bDbg = FALSE; m_pSsrLogger = NULL; m_pXMLError = NULL; m_hScm = NULL; m_dwNumServices = 0; m_bArrServiceInKB = NULL; m_pInstalledServicesInfo = NULL; } ~process() { SsrpCleanup(); } BEGIN_COM_MAP(process) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(Iprocess) COM_INTERFACE_ENTRY(ISupportErrorInfo) END_COM_MAP() //DECLARE_NOT_AGGREGATABLE(process) // Remove the comment from the line above if you don't want your object to // support aggregation. DECLARE_REGISTRY_RESOURCEID(IDR_process) // ISupportsErrorInfo STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); // Iprocess public: // // data values used across most processor methods // BOOL m_bDbg; CComPtr m_pSsrLogger; CComPtr m_pXMLError; SC_HANDLE m_hScm; DWORD m_dwNumServices; DWORD *m_bArrServiceInKB; LPENUM_SERVICE_STATUS_PROCESS m_pInstalledServicesInfo; // // processor methods // STDMETHOD(preprocess) (BSTR pszKbFile, BSTR pszUIFile, BSTR pszKbMode, BSTR pszLogFile, BSTR pszMachineName, VARIANT vtFeedback); HRESULT SsrpCprocess(IN BSTR pszKbDir, IN BSTR pszUIFile, IN BSTR pszKbMode, IN BSTR pszLogFile, IN BSTR pszMachineName, IN VARIANT vtFeedback); // // utility methods // VOID SsrpCleanup(); VOID SsrpLogParseError(IN HRESULT hr); VOID SsrpLogWin32Error(IN DWORD rc); VOID SsrpLogError(IN PWSTR pszError); BOOL SsrpIsServiceInstalled(IN BSTR bstrService); VOID SsrpConvertBstrToPwstr(IN OUT BSTR bstrString); HRESULT SsrpDeleteChildren( IN CComPtr pParent); HRESULT SsrpDeleteComments(IN CComPtr pParent); DWORD SsrpQueryInstalledServicesInfo(IN PWSTR pszMachineName); DWORD SsrpQueryServiceDescription(IN PWSTR pszServiceName, OUT LPSERVICE_DESCRIPTION *ppServiceDescription); PWSTR SsrpQueryServiceDisplayName(IN BSTR bstrService); int SsrpICompareBstrPwstr(IN BSTR bstrString, IN PWSTR pszString); HRESULT SsrpCloneAllChildren(IN CComPtr pXMLDocSource, IN CComPtr pXMLDocDestination); HRESULT SsrpAddWhiteSpace(IN CComPtr pXMLDoc, IN CComPtr pXMLParent, IN BSTR bstrWhiteSpace); HRESULT SsrpGetRemoteOSVersionInfo(IN PWSTR pszMachineName, OUT OSVERSIONINFOEX *posVersionInfo); // // methods to process roles, tasks and services // HRESULT SsrpCreatePreprocessorSection(IN CComPtr pXMLDocElemRoot, IN CComPtr pXMLDocIn, IN PWSTR pszKbMode, IN PWSTR pszKbFile); HRESULT SsrpProcessRolesOrTasks(IN PWSTR pszMachineName, IN CComPtr pXMLDocElemRoot, IN CComPtr pXMLDoc, IN PWSTR pszKbMode, IN BOOL bRole); HRESULT SsrpProcessTasks(IN CComPtr pXMLDocElemRoot, IN CComPtr pXMLDoc, IN PWSTR pszKbMode ); HRESULT SsrpProcessService( IN CComPtr pXMLDocElemRoot, IN CComPtr pXMLServiceNode, IN PWSTR pszMode, OUT BOOL *pbRoleIsSatisfiable, OUT BOOL *pbSomeRequiredServiceDisabled); HRESULT SsrpAddExtraServices( IN CComPtr pXMLDoc, IN CComPtr pRolesNode); HRESULT SsrpAddOtherRole( IN CComPtr pXMLDocElemRoot, IN CComPtr pXMLDoc); HRESULT SsrpAddUnknownSection( IN CComPtr pXMLDocElemRoot, IN CComPtr pXMLDoc); HRESULT SsrpAddServiceStartup(IN CComPtr pXMLDocElemRoot, IN CComPtr pXMLDoc ); HRESULT SsrpAddUnknownServicesInfoToServiceLoc(IN CComPtr pElementRoot, IN CComPtr pXMLDoc ); HRESULT SsrpAddUnknownServicestoServices(IN CComPtr pXMLDocElemRoot, IN CComPtr pXMLDoc ); // // extension KBs merge methods // HRESULT SsrpProcessKBsMerge(IN PWSTR pszKBDir, IN PWSTR pszMachineName, OUT IXMLDOMElement **ppElementRoot, OUT IXMLDOMDocument **ppXMLDoc ); HRESULT SsrpMergeDOMTrees(OUT IXMLDOMElement **ppMergedKBElementRoot, OUT IXMLDOMDocument **ppMergedKBXMLDoc, IN WCHAR *szXMLFileName ); HRESULT SsrpMergeAccordingToPrecedence(IN PWSTR pszKBType, IN PWSTR pszKBDir, OUT IXMLDOMElement **ppElementRoot, OUT IXMLDOMDocument **ppXMLDoc, IN IXMLDOMNode *pKB ); HRESULT SsrpAppendOrReplaceMergeableEntities(IN PWSTR pszFullyQualifiedEntityName, IN IXMLDOMElement *pMergedKBElementRoot, IN IXMLDOMDocument *pMergedKBXMLDoc, IN IXMLDOMDocument *pCurrentKBDoc, IN IXMLDOMElement *pCurrentKBElemRoot, IN PWSTR pszKBName ); HRESULT SsrpOverwriteServiceLocalizationFromSystem(IN IXMLDOMElement *pMergedKBElementRoot, IN IXMLDOMDocument *pMergedKBXMLDoc ); // // methods to evaluate role/service conditionals // DWORD SsrpEvaluateCustomFunction(IN PWSTR pszMachineName, IN BSTR bstrDLLName, IN BSTR bstrFunctionName, OUT BOOL *pbSelect); HRESULT SsrpCheckIfOptionalService(IN CComPtr pXMLDocElemRoot, IN BSTR bstrServiceName, IN BOOL *pbOptional); DWORD SsrpQueryServiceStartupType(IN PWSTR pszServiceName, OUT BYTE *pbyStartupType); }; #endif // !defined(AFX_PROCESS_H__139D0BA5_19A7_4AA2_AE2C_E18A5FFAAA0F__INCLUDED_)