Leaked source code of windows server 2003
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.

209 lines
3.6 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. UINT
  91. ComputeCheckSum (
  92. PFILE_HELPER_PARAMS Params
  93. );
  94. #define UNKNOWN_MODULE 0
  95. #define DOS_MODULE 1
  96. #define W16_MODULE 2
  97. #define W32_MODULE 3
  98. DWORD
  99. GetModuleType (
  100. IN PCSTR ModuleName
  101. );
  102. PCSTR
  103. Get16ModuleDescription (
  104. IN PCSTR ModuleName
  105. );
  106. ULONG
  107. GetPECheckSum (
  108. IN PCSTR ModuleName
  109. );
  110. BOOL
  111. DeleteFileWithWarning (
  112. IN PCTSTR FileName
  113. );
  114. PSTR
  115. GetHlpFileTitle (
  116. IN PCSTR FileName
  117. );
  118. BOOL
  119. ReportControlPanelApplet (
  120. IN PCTSTR FileName,
  121. IN PMIGDB_CONTEXT Context, OPTIONAL
  122. IN DWORD ActType
  123. );
  124. BOOL
  125. IsDisplayableCPL (
  126. IN PCTSTR FileName
  127. );
  128. ULONGLONG
  129. GetBinFileVer (
  130. IN PCSTR FileName
  131. );
  132. ULONGLONG
  133. GetBinProductVer (
  134. IN PCSTR FileName
  135. );
  136. DWORD
  137. GetFileDateHi (
  138. IN PCSTR FileName
  139. );
  140. DWORD
  141. GetFileDateLo (
  142. IN PCSTR FileName
  143. );
  144. DWORD
  145. GetFileVerOs (
  146. IN PCSTR FileName
  147. );
  148. DWORD
  149. GetFileVerType (
  150. IN PCSTR FileName
  151. );
  152. BOOL
  153. GlobalVersionCheck (
  154. IN PCSTR FileName,
  155. IN PCSTR NameToCheck,
  156. IN PCSTR ValueToCheck
  157. );