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.

231 lines
5.1 KiB

  1. // Database access structures
  2. typedef enum SHIMTYPE {
  3. SHIMTYPE_SHIM=0,
  4. SHIMTYPE_PATCH,
  5. SHIMTYPE_FORCEDWORD=0xFFFFFFFF
  6. } SHIMTYPE;
  7. typedef enum SHIMPURPOSE {
  8. SHIMPURPOSE_GENERAL=0,
  9. SHIMPURPOSE_APPSPECIFIC,
  10. SHIMPURPOSE_FORCEDWORD=0xFFFFFFFF
  11. } SHIMPURPOSE;
  12. typedef struct _tagAPPHELP{
  13. struct _tagAPPHELP *pNext;
  14. CSTRING strMsgName;
  15. CSTRING strMessage;
  16. CSTRING strURL;
  17. UINT HTMLHELPID;
  18. BOOL bBlock;
  19. } APPHELP, * PAPPHELP;
  20. typedef struct _tagDBE {
  21. UINT uType;
  22. UINT uIconID;
  23. struct _tagDBE * pNext;
  24. } DBENTRY, *PDBENTRY;
  25. typedef struct _tagShim {
  26. CSTRING szShimName;
  27. CSTRING szShimDLLName;
  28. CSTRING szShimCommandLine;
  29. CSTRING szShimDesc;
  30. BOOL bShim; // TRUE if shim, FALSE if patch.
  31. BOOL bGeneral;
  32. struct _tagShim * pNext;
  33. public:
  34. _tagShim()
  35. {
  36. szShimName.Init();
  37. szShimDLLName.Init();
  38. szShimCommandLine.Init();
  39. szShimDesc.Init();
  40. pNext = NULL;
  41. }
  42. ~_tagShim()
  43. {
  44. szShimName.Release();
  45. szShimDLLName.Release();
  46. szShimCommandLine.Release();
  47. szShimDesc.Release();
  48. }
  49. void operator = (_tagShim Old)
  50. {
  51. szShimName = Old.szShimName;
  52. szShimDLLName = Old.szShimDLLName;
  53. szShimCommandLine = Old.szShimCommandLine;
  54. szShimDesc = Old.szShimDesc;
  55. bShim = Old.bShim;
  56. bGeneral = Old.bGeneral;
  57. }
  58. } SHIMDESC, *PSHIMDESC;
  59. typedef struct _shimEntry {
  60. DBENTRY Entry;
  61. CSTRING szShimName;
  62. CSTRING szCmdLine;
  63. PSHIMDESC pDesc;
  64. public:
  65. _shimEntry()
  66. {
  67. szShimName.Init();
  68. szCmdLine.Init();
  69. pDesc = NULL;
  70. }
  71. ~_shimEntry()
  72. {
  73. szShimName.Release();
  74. szCmdLine.Release();
  75. }
  76. } SHIMENTRY, *PSHIMENTRY;
  77. typedef struct {
  78. DBENTRY Entry;
  79. UINT uSeverity;
  80. BOOL bBlock;
  81. UINT uHelpID;
  82. CSTRING strMessageName; //Not used at the moment
  83. CSTRING strURL;
  84. } HELPENTRY, *PHELPENTRY;
  85. typedef struct tagMatchEntry{
  86. DBENTRY Entry;
  87. CSTRING szMatchName;
  88. CSTRING szFullName;
  89. DWORD dwSize;
  90. DWORD dwChecksum;
  91. LARGE_INTEGER FileVersion;
  92. LARGE_INTEGER ProductVersion;
  93. CSTRING szCompanyName;
  94. CSTRING szDescription;
  95. CSTRING szFileVersion;
  96. CSTRING szProductVersion;
  97. BOOL operator == (struct tagMatchEntry &val)
  98. {
  99. BOOL b1 = this->szCompanyName == val.szCompanyName,
  100. b2 = this->szDescription == val.szDescription,
  101. b3 = this->szFileVersion == val.szFileVersion,
  102. b4 = this->szMatchName == val.szMatchName,
  103. b5= this->szProductVersion == val.szProductVersion,
  104. b6 = this->FileVersion.QuadPart == val.FileVersion.QuadPart,
  105. b7 = this->ProductVersion.QuadPart == val.ProductVersion.QuadPart;
  106. return ( this->dwChecksum == val.dwChecksum &&
  107. this->dwSize == val.dwSize &&
  108. b1 &&
  109. b2 &&
  110. b3 &&
  111. b4 &&
  112. b5 &&
  113. b6 &&
  114. b7
  115. );
  116. }
  117. } MATCHENTRY, *PMATCHENTRY, **PPMATCHENTRY;
  118. typedef struct _tagLAYER {
  119. CSTRING szLayerName;
  120. BOOL bPermanent;
  121. PSHIMDESC pShimList;
  122. struct _tagLAYER * pNext;
  123. } DBLAYER, *PDBLAYER;
  124. typedef struct _tagDBR {
  125. CSTRING szEXEName;
  126. CSTRING szAppName;
  127. CSTRING szLayerName;
  128. GUID guidID;
  129. DWORD dwUserFlags;
  130. DWORD dwGlobalFlags;
  131. UINT uLayer;
  132. BOOL bGlobal;
  133. PDBENTRY pEntries;
  134. struct _tagDBR * pNext;
  135. struct _tagDBR * pDup;
  136. _tagDBR()
  137. {
  138. szEXEName.Init();
  139. szAppName.Init();
  140. szLayerName.Init();
  141. pNext = NULL;
  142. pDup = NULL;
  143. }
  144. ~_tagDBR()
  145. {
  146. szEXEName.Release();
  147. szAppName.Release();
  148. szLayerName.Release();
  149. }
  150. void DestroyAll()
  151. {
  152. //TODO: Implement this function.;
  153. }
  154. } DBRECORD, *PDBRECORD;
  155. enum {
  156. LAYER_APPHELP=1,
  157. LAYER_FORCEDWORD=0xFFFFFFFF
  158. };
  159. enum {
  160. ENTRY_SHIM=1,
  161. ENTRY_MATCH,
  162. ENTRY_APPHELP,
  163. ENTRY_UI,
  164. ENTRY_SUBMATCH,
  165. ENTRY_FORCEDWORD=0xFFFFFFFF
  166. };
  167. enum {
  168. MATCH_NAME=0,
  169. MATCH_SIZE,
  170. MATCH_CHECKSUM,
  171. MATCH_FILEVERSION,
  172. MATCH_PRODUCTVERSION,
  173. MATCH_COMPANY,
  174. MATCH_DESCRIPTION,
  175. MATCH_FILEVERSTRING,
  176. MATCH_PRODUCTVERSTRING,
  177. MATCH_FORCEDWORD=0xFFFFFFFF
  178. };
  179. #define DELRES_FAILED 0
  180. #define DELRES_RECORDREMOVED 1
  181. #define DELRES_DUPREMOVED 2
  182. BOOL CALLBACK NewDatabaseProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);