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

模拟服务器

开发平台:

C/C++

  1. //////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  FileName    :   UpdatePublic.h
  4. //  Version     :   1.0
  5. //  Creater     :   Cheng Bitao
  6. //  Date        :   2002-1-17 11:14:17
  7. //  Comment     :   Define the comment interface of update system
  8. //
  9. //////////////////////////////////////////////////////////////////////////////////////
  10. #ifndef __UPDATE_PUBLIC_H__
  11. #define __UPDATE_PUBLIC_H__ 1
  12. #include "DataDefine.h"
  13. #include "ProcessIndex.h" 
  14. extern CProcessIndex g_ProcessIndex;
  15. //------------------------------------------------------------------------------------
  16. int GetSerialNumberFromRegistry(HKEY hKey, const char cszKeyName[]);
  17. int CheckSerialNumberValidity();
  18. int GetInstallComponetInfo(const char cszIndexTxtFile[]);
  19. int ProcessIndexFile(const char cszFileName[]);
  20. int UpdateFiles();
  21. int UpdateSelf();
  22. int GetHostURL(const char cszFileName[], const char cszHostName[], char szHostURL[]);
  23. ///////////////////////////////////////////////////////////////////////////////
  24. //更新包合并 Add By Fellow 2003.08.11
  25. //一个Pack文件具有下面的结构:
  26. //首先是四个字节的文件的头标志:字符串'PACK',然后是项的数目然后是索引开始的偏移量数据开始的偏移量,然后是校验和,然后是保留的字节:
  27. typedef struct {
  28. unsigned char signature[4]; //"PACK"
  29. unsigned long count; //数据的条目数
  30. unsigned long index_offset; //索引的偏移量
  31. unsigned long data_offset; //数据的偏移量
  32. unsigned long crc32;
  33. unsigned char reserved[12];
  34. } t_pack_header;
  35. typedef struct { //索引信息
  36. unsigned long id;
  37. unsigned long offset;
  38. long size;
  39. long compress_size;
  40. } t_index_info;
  41. void GetHeader(t_pack_header* aHeader, FILE* aFile);
  42. void GetIndexInfo(t_index_info* aIndexInfo, const t_pack_header* aHeader, FILE* aFile);
  43. bool PackComb(const char* stdFilePath,const char* addFilePath);
  44. ///////////////////////////////////////////////////////////////////////////
  45. #endif  //__UPDATE_PUBLIC_H__