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.

215 lines
3.5 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. migdbp.h
  5. Abstract:
  6. Header file for implementing old AppDb functionality
  7. Author:
  8. Calin Negreanu (calinn) 07-Ian-1998
  9. Revision History:
  10. <alias> <date> <comments>
  11. --*/
  12. #include <cpl.h>
  13. #include "dbattrib.h"
  14. extern INT g_RegKeyPresentIndex;
  15. extern HASHTABLE g_PerUserRegKeys;
  16. typedef struct _MIGDB_REQ_FILE;
  17. typedef struct _MIGDB_CONTEXT;
  18. typedef struct _MIGDB_SECTION {
  19. BOOL Satisfied;
  20. struct _MIGDB_CONTEXT *Context;
  21. struct _MIGDB_SECTION *Next;
  22. } MIGDB_SECTION, *PMIGDB_SECTION;
  23. typedef struct _MIGDB_CONTEXT {
  24. INT ActionIndex;
  25. UINT TriggerCount;
  26. BOOL VirtualFile;
  27. PCSTR SectName;
  28. PCSTR SectLocalizedName;
  29. PCSTR SectNameForDisplay; // SectLocalizedName, or SectName if not localized
  30. PCSTR Message;
  31. PCSTR Arguments;
  32. GROWBUFFER FileList;
  33. PMIGDB_SECTION Sections;
  34. struct _MIGDB_CONTEXT *Next;
  35. } MIGDB_CONTEXT, *PMIGDB_CONTEXT;
  36. typedef struct _MIGDB_FILE {
  37. PMIGDB_SECTION Section;
  38. PMIGDB_ATTRIB Attributes;
  39. struct _MIGDB_FILE *Next;
  40. } MIGDB_FILE, *PMIGDB_FILE;
  41. typedef struct _MIGDB_REQ_FILE {
  42. PCSTR ReqFilePath;
  43. PMIGDB_ATTRIB FileAttribs;
  44. struct _MIGDB_REQ_FILE *Next;
  45. } MIGDB_REQ_FILE, *PMIGDB_REQ_FILE;
  46. typedef struct {
  47. PMIGDB_FILE First;
  48. PMIGDB_FILE Last;
  49. } FILE_LIST_STRUCT, *PFILE_LIST_STRUCT;
  50. //
  51. // Declare the action functions prototype
  52. //
  53. typedef BOOL (ACTION_PROTOTYPE) (PMIGDB_CONTEXT Context);
  54. typedef ACTION_PROTOTYPE * PACTION_PROTOTYPE;
  55. //
  56. // Declare MigDb hook function prototype
  57. //
  58. typedef BOOL (MIGDB_HOOK_PROTOTYPE) (PCSTR FileName, PMIGDB_CONTEXT Context, PMIGDB_SECTION Section, PMIGDB_FILE File, PMIGDB_ATTRIB Attrib);
  59. typedef MIGDB_HOOK_PROTOTYPE * PMIGDB_HOOK_PROTOTYPE;
  60. extern HINF g_MigDbInf;
  61. extern BOOL g_InAnyDir;
  62. PACTION_PROTOTYPE
  63. MigDb_GetActionAddr (
  64. IN INT ActionIdx
  65. );
  66. INT
  67. MigDb_GetActionIdx (
  68. IN PCSTR ActionStr
  69. );
  70. PCSTR
  71. MigDb_GetActionName (
  72. IN INT ActionIdx
  73. );
  74. BOOL
  75. MigDb_CallWhenTriggered (
  76. IN INT ActionIdx
  77. );
  78. BOOL
  79. MigDb_CanHandleVirtualFiles (
  80. IN INT ActionIdx
  81. );
  82. BOOL
  83. MigDb_CallAlways (
  84. IN INT ActionIdx
  85. );
  86. PMIGDB_HOOK_PROTOTYPE
  87. SetMigDbHook (
  88. PMIGDB_HOOK_PROTOTYPE HookFunction
  89. );
  90. PSTR
  91. QueryVersionEntry (
  92. IN PCSTR FileName,
  93. IN PCSTR VersionEntry
  94. );
  95. UINT
  96. ComputeCheckSum (
  97. PFILE_HELPER_PARAMS Params
  98. );
  99. #define UNKNOWN_MODULE 0
  100. #define DOS_MODULE 1
  101. #define W16_MODULE 2
  102. #define W32_MODULE 3
  103. DWORD
  104. GetModuleType (
  105. IN PCSTR ModuleName
  106. );
  107. PCSTR
  108. Get16ModuleDescription (
  109. IN PCSTR ModuleName
  110. );
  111. ULONG
  112. GetPECheckSum (
  113. IN PCSTR ModuleName
  114. );
  115. BOOL
  116. DeleteFileWithWarning (
  117. IN PCTSTR FileName
  118. );
  119. PSTR
  120. GetHlpFileTitle (
  121. IN PCSTR FileName
  122. );
  123. BOOL
  124. ReportControlPanelApplet (
  125. IN PCTSTR FileName,
  126. IN PMIGDB_CONTEXT Context, OPTIONAL
  127. IN DWORD ActType
  128. );
  129. BOOL
  130. IsDisplayableCPL (
  131. IN PCTSTR FileName
  132. );
  133. ULONGLONG
  134. GetBinFileVer (
  135. IN PCSTR FileName
  136. );
  137. ULONGLONG
  138. GetBinProductVer (
  139. IN PCSTR FileName
  140. );
  141. DWORD
  142. GetFileDateHi (
  143. IN PCSTR FileName
  144. );
  145. DWORD
  146. GetFileDateLo (
  147. IN PCSTR FileName
  148. );
  149. DWORD
  150. GetFileVerOs (
  151. IN PCSTR FileName
  152. );
  153. DWORD
  154. GetFileVerType (
  155. IN PCSTR FileName
  156. );
  157. BOOL
  158. GlobalVersionCheck (
  159. IN PCSTR FileName,
  160. IN PCSTR NameToCheck,
  161. IN PCSTR ValueToCheck
  162. );