ProcessIndex.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:4k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  FileName    :   ProcessIndex.h
  4. //  Version     :   1.0
  5. //  Creater     :   Cheng Bitao
  6. //  Date        :   2002-6-25 10:07:15
  7. //  Comment     :   
  8. //
  9. //////////////////////////////////////////////////////////////////////////////////////
  10. // ProcessIndex.h: interface for the CProcessIndex class.
  11. //
  12. //////////////////////////////////////////////////////////////////////
  13. #if !defined(AFX_PROCESSINDEX_H__11959E05_CF66_4A40_81F4_D13ED5311C27__INCLUDED_)
  14. #define AFX_PROCESSINDEX_H__11959E05_CF66_4A40_81F4_D13ED5311C27__INCLUDED_
  15. #include "DataDefine.h"
  16. #include <string>
  17. using namespace std;
  18. #if _MSC_VER > 1000
  19. #pragma once
  20. #endif // _MSC_VER > 1000
  21. #define defEXIT_TYPE_DIRECTORY        0x00000000       // Exit directory by parameter
  22. #define defEXIT_TYPE_IPC              0x00000001       // Exit by parameter and IPC
  23. #define defEXIT_TYPE_SERVICE          0x00000002       // Service
  24. #define defEXIT_TYPE_RPC   0x00000003       // Exit by parameter and RPC
  25. typedef struct tagKModuleExitInfo
  26. {
  27.     char szFileName[MAX_PATH];   // Module Name : file name or service name
  28. char szReleaseFileName[MAX_PATH]; // Release Module Name : File Name or service name
  29.     int nExitType;
  30.     unsigned uID;
  31.     char szStopParam[MAX_PATH];
  32.     char szStartParam[MAX_PATH];  
  33. } KModuleExitInfo, *PKModuleExitInfo;
  34. typedef struct tagKModuleExitInfoList
  35. {
  36.     tagKModuleExitInfoList *pNext;
  37.     KModuleExitInfo MouleExitInfo;
  38. } KModuleExitInfoList, *PKModuleExitInfoList;
  39. #define defVersion_ValueSize                512
  40. #define defVersionNotenough                 100
  41. #define defVersionMore 101
  42. class CProcessIndex  
  43. {
  44. private:
  45.     char m_szFileName[MAX_PATH];
  46.     char m_szTxtFileName[MAX_PATH];
  47.     bool m_bInitFlag;
  48.     int m_nVersion_ValueCount;
  49. int m_nMajorVersionValueCount;
  50. string m_sWebDownAddress;
  51.    // KVERSION_VALUE m_Version_Value[defVersion_ValueSize];
  52.     bool m_bVersionError;
  53.     int m_nMaxDATFileNum;
  54.     int m_nMaxUPDFileNum;
  55.     CString m_sVirusNames;
  56.     CString m_sReadme;
  57.     CString m_sAnnounce;   
  58.     PKModuleExitInfoList m_pModuleExitInfoList;
  59.     
  60.     int FreeModuleExitInfoList();
  61.     int FreeUpdateItemList();
  62.     int InitModuleExitInfo();
  63.     int InitFileTypeInfo();
  64.     int InitVersionInfo();
  65.     int CheckIsNeedUpdate(
  66.         PKUPDATE_ITEM pUpdateItem,
  67.         int nMainVersion
  68.     );
  69.     int GetItemInfo(
  70.         PKUPDATE_ITEM pUpdateItem, 
  71.         int nUpdateMethod, char szLocalPath[]
  72.     );
  73.     int AddItemInfoToList(
  74.         const char cszSectionName[], int nUpdateMethod,
  75.         char szLocalPath[],
  76.         int nMainVersion
  77.     );    
  78. public:
  79. char url[MAX_PATH];
  80. int Uninit();
  81. int Init(const char cszFileName[], const char cszTxtFileName[]);
  82. int AnalysisUpdateFiles(
  83.         int nMethod, 
  84.         char szLocalPath[],
  85.         int nMainVersion
  86.     );    
  87.     
  88.     int GetExitType(PKModuleExitInfo pModuleExitInfo);
  89.     int GetDownloadFileTypeInfo(CString &sMsg, int nDownloadFileType);
  90.     int GetHost(char szHostName[], int *pnNameSize, char szHostURL[], int *pnURLSize);
  91.     int GetPath(char szPath[], int nSize);
  92.     int GetDubaVersion();
  93.     bool IsVersionError();
  94.     bool IsNeedUpdateSelf();
  95.     bool IsNotUpdateItem();    
  96.     CString GetVirusNames();
  97.     CString GetReadme();
  98.     CString GetAnnounce();
  99. CProcessIndex();
  100. virtual ~CProcessIndex();
  101.     PKUPDATE_ITEM m_pUpdateItemList;
  102. char m_szCallBy[2048];
  103.     bool m_bNeedUpdateSelfFirst;
  104.     bool m_bFileError;
  105.     
  106.     
  107. };
  108. #endif // !defined(AFX_PROCESSINDEX_H__11959E05_CF66_4A40_81F4_D13ED5311C27__INCLUDED_)