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.

190 lines
7.7 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. badapp.h
  5. Abstract:
  6. Declares the structures used for CheckBadApps data.
  7. Author:
  8. Calin Negreanu (calinn) 01/20/1999
  9. Revision History:
  10. --*/
  11. #pragma once
  12. #define APPTYPE_TYPE_MASK 0x000000FF
  13. #define APPTYPE_INC_NOBLOCK 0x00000001
  14. #define APPTYPE_INC_HARDBLOCK 0x00000002
  15. #define APPTYPE_MINORPROBLEM 0x00000003
  16. #define APPTYPE_REINSTALL 0x00000004
  17. #define APPTYPE_VERSIONSUB 0x00000005
  18. #define APPTYPE_SHIM 0x00000006
  19. #define APPTYPE_FLAG_MASK 0xFFFFFF00
  20. #define APPTYPE_FLAG_NONET 0x00000100
  21. #define APPTYPE_FLAG_FAT32 0x00000200
  22. #define APPTYPE_FLAG_NTFS 0x00000400
  23. typedef struct {
  24. DWORD Size;
  25. DWORD MsgId;
  26. DWORD AppType;
  27. } BADAPP_PROP, *PBADAPP_PROP;
  28. typedef struct {
  29. DWORD Size;
  30. PCTSTR FilePath;
  31. PBYTE Blob;
  32. DWORD BlobSize;
  33. } BADAPP_DATA, *PBADAPP_DATA;
  34. BOOL
  35. SHIsBadApp (
  36. IN PBADAPP_DATA Data,
  37. OUT PBADAPP_PROP Prop
  38. );
  39. #define EDIT TRUE
  40. #define NOEDIT FALSE
  41. // version allowances
  42. #define VA_ALLOWMAINFILE 0x01
  43. #define VA_ALLOWADDNLFILES 0x02
  44. #define VA_ALLOWALLFILES 0x03
  45. //
  46. // Do not change any values in this enum. You can only add new values
  47. // immediately above VTID_LASTID
  48. //
  49. typedef enum {
  50. VTID_BAD_VTID = 0, // do not use or change !!!
  51. VTID_REQFILE = 1, // this should never change !!!
  52. VTID_FILESIZE = VTID_REQFILE + 1,
  53. VTID_EXETYPE = VTID_REQFILE + 2,
  54. VTID_BINFILEVER = VTID_REQFILE + 3,
  55. VTID_BINPRODUCTVER = VTID_REQFILE + 4,
  56. VTID_FILEDATEHI = VTID_REQFILE + 5,
  57. VTID_FILEDATELO = VTID_REQFILE + 6,
  58. VTID_FILEVEROS = VTID_REQFILE + 7,
  59. VTID_FILEVERTYPE = VTID_REQFILE + 8,
  60. VTID_CHECKSUM = VTID_REQFILE + 9,
  61. VTID_PECHECKSUM = VTID_REQFILE +10,
  62. VTID_COMPANYNAME = VTID_REQFILE +11,
  63. VTID_PRODUCTVERSION = VTID_REQFILE +12,
  64. VTID_PRODUCTNAME = VTID_REQFILE +13,
  65. VTID_FILEDESCRIPTION = VTID_REQFILE +14,
  66. VTID_FILEVERSION = VTID_REQFILE +15,
  67. VTID_ORIGINALFILENAME = VTID_REQFILE +16,
  68. VTID_INTERNALNAME = VTID_REQFILE +17,
  69. VTID_LEGALCOPYRIGHT = VTID_REQFILE +18,
  70. VTID_16BITDESCRIPTION = VTID_REQFILE +19,
  71. VTID_UPTOBINPRODUCTVER = VTID_REQFILE +20,
  72. VTID_PREVOSMAJORVERSION = VTID_REQFILE +21,
  73. VTID_PREVOSMINORVERSION = VTID_REQFILE +22,
  74. VTID_PREVOSPLATFORMID = VTID_REQFILE +23,
  75. VTID_PREVOSBUILDNO = VTID_REQFILE +24,
  76. // add new versions here
  77. VTID_LASTID
  78. };
  79. #define VERSION_STAMPS \
  80. LIBARGS(VTID_FILESIZE, ShCheckFileSize) \
  81. TOOLARGS(TEXT("FILESIZE"), TEXT("File Size:"), VA_ALLOWALLFILES, NOEDIT, QueryFileSize, OutputHexValue)\
  82. \
  83. LIBARGS(VTID_EXETYPE, ShCheckModuleType) \
  84. TOOLARGS(TEXT("EXETYPE"), TEXT("Module Type:"), VA_ALLOWADDNLFILES, NOEDIT, QueryModuleType, OutputModuleTypeValue)\
  85. \
  86. LIBARGS(VTID_BINFILEVER, ShCheckBinFileVer) \
  87. TOOLARGS(TEXT("BINFILEVER"), TEXT("Binary File Version:"), VA_ALLOWALLFILES, EDIT, QueryBinFileVer, OutputBinVerValue)\
  88. \
  89. LIBARGS(VTID_BINPRODUCTVER, ShCheckBinProductVer) \
  90. TOOLARGS(TEXT("BINPRODUCTVER"), TEXT("Binary Product Version:"), VA_ALLOWALLFILES, EDIT, QueryBinProductVer, OutputBinVerValue)\
  91. \
  92. LIBARGS(VTID_FILEDATEHI, ShCheckFileDateHi) \
  93. TOOLARGS(TEXT("FILEDATEHI"), TEXT("File Date (HI):"), VA_ALLOWALLFILES, NOEDIT, QueryFileDateHi, OutputHexValue)\
  94. \
  95. LIBARGS(VTID_FILEDATELO, ShCheckFileDateLo) \
  96. TOOLARGS(TEXT("FILEDATELO"), TEXT("File Date (LO):"), VA_ALLOWALLFILES, NOEDIT, QueryFileDateLo, OutputHexValue)\
  97. \
  98. LIBARGS(VTID_FILEVEROS, ShCheckFileVerOs) \
  99. TOOLARGS(TEXT("FILEVEROS"), TEXT("File OS Version:"), VA_ALLOWALLFILES, NOEDIT, QueryFileVerOs, OutputHexValue)\
  100. \
  101. LIBARGS(VTID_FILEVERTYPE, ShCheckFileVerType) \
  102. TOOLARGS(TEXT("FILEVERTYPE"), TEXT("File Type:"), VA_ALLOWALLFILES, NOEDIT, QueryFileVerType, OutputHexValue)\
  103. \
  104. LIBARGS(VTID_CHECKSUM, ShCheckFileCheckSum) \
  105. TOOLARGS(TEXT("CHECKSUM"), TEXT("File CheckSum:"), VA_ALLOWALLFILES, NOEDIT, QueryFileCheckSum, OutputHexValue)\
  106. \
  107. LIBARGS(VTID_PECHECKSUM, ShCheckFilePECheckSum) \
  108. TOOLARGS(TEXT("PECHECKSUM"), TEXT("File Header CheckSum:"), VA_ALLOWALLFILES, NOEDIT, QueryFilePECheckSum, OutputHexValue)\
  109. \
  110. LIBARGS(VTID_COMPANYNAME, ShCheckCompanyName) \
  111. TOOLARGS(TEXT("COMPANYNAME"), TEXT("Company Name:"), VA_ALLOWALLFILES, EDIT, QueryCompanyName, OutputStrValue)\
  112. \
  113. LIBARGS(VTID_PRODUCTVERSION, ShCheckProductVersion) \
  114. TOOLARGS(TEXT("PRODUCTVERSION"), TEXT("Product Version:"), VA_ALLOWALLFILES, EDIT, QueryProductVersion, OutputStrValue)\
  115. \
  116. LIBARGS(VTID_PRODUCTNAME, ShCheckProductName) \
  117. TOOLARGS(TEXT("PRODUCTNAME"), TEXT("Product Name:"), VA_ALLOWALLFILES, EDIT, QueryProductName, OutputStrValue)\
  118. \
  119. LIBARGS(VTID_FILEDESCRIPTION, ShCheckFileDescription) \
  120. TOOLARGS(TEXT("FILEDESCRIPTION"), TEXT("File Description:"), VA_ALLOWALLFILES, EDIT, QueryFileDescription, OutputStrValue)\
  121. \
  122. LIBARGS(VTID_FILEVERSION, ShCheckFileVersion) \
  123. TOOLARGS(TEXT("FILEVERSION"), TEXT("File Version:"), VA_ALLOWALLFILES, EDIT, QueryFileVersion, OutputStrValue)\
  124. \
  125. LIBARGS(VTID_ORIGINALFILENAME, ShCheckOriginalFileName) \
  126. TOOLARGS(TEXT("ORIGINALFILENAME"), TEXT("Original File Name:"), VA_ALLOWALLFILES, EDIT, QueryOriginalFileName, OutputStrValue)\
  127. \
  128. LIBARGS(VTID_INTERNALNAME, ShCheckInternalName) \
  129. TOOLARGS(TEXT("INTERNALNAME"), TEXT("Internal Name:"), VA_ALLOWALLFILES, EDIT, QueryInternalName, OutputStrValue)\
  130. \
  131. LIBARGS(VTID_LEGALCOPYRIGHT, ShCheckLegalCopyright) \
  132. TOOLARGS(TEXT("LEGALCOPYRIGHT"), TEXT("Legal Copyright:"), VA_ALLOWALLFILES, EDIT, QueryLegalCopyright, OutputStrValue)\
  133. \
  134. LIBARGS(VTID_16BITDESCRIPTION, ShCheck16BitDescription) \
  135. TOOLARGS(TEXT("DESCRIPTION"), TEXT("16 Bit Description:"), VA_ALLOWALLFILES, EDIT, Query16BitDescription, OutputStrValue)\
  136. \
  137. LIBARGS(VTID_UPTOBINPRODUCTVER, ShCheckUpToBinProductVer) \
  138. TOOLARGS(TEXT("UPTOBINPRODUCTVER"), TEXT("Up To Binary Product Version:"), VA_ALLOWALLFILES, EDIT, QueryBinProductVer, OutputUpToBinVerValue)\
  139. \
  140. LIBARGS(VTID_PREVOSMAJORVERSION, ShCheckPrevOsMajorVersion) \
  141. TOOLARGS(TEXT("PREVOSMAJORVERSION"), TEXT("Previous OS Major Version:"), VA_ALLOWMAINFILE, EDIT, QueryPrevOsMajorVersion, OutputDecValue)\
  142. \
  143. LIBARGS(VTID_PREVOSMINORVERSION, ShCheckPrevOsMinorVersion) \
  144. TOOLARGS(TEXT("PREVOSMINORVERSION"), TEXT("Previous OS Minor Version:"), VA_ALLOWMAINFILE, EDIT, QueryPrevOsMinorVersion, OutputDecValue)\
  145. \
  146. LIBARGS(VTID_PREVOSPLATFORMID, ShCheckPrevOsPlatformId) \
  147. TOOLARGS(TEXT("PREVOSPLATFORMID"), TEXT("Previous OS Platform Id:"), VA_ALLOWMAINFILE, EDIT, QueryPrevOsPlatformId, OutputDecValue)\
  148. \
  149. LIBARGS(VTID_PREVOSBUILDNO, ShCheckPrevOsBuildNo) \
  150. TOOLARGS(TEXT("PREVOSBUILDNR"), TEXT("Previous OS Build No:"), VA_ALLOWMAINFILE, EDIT, QueryPrevOsBuildNo, OutputDecValue)\
  151. \
  152. #define S_KEY_PREVOSVERSION TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\PrevOsVersion")
  153. #define S_VAL_BUILDNO TEXT("BuildNumber")
  154. #define S_VAL_MAJORVERSION TEXT("MajorVersion")
  155. #define S_VAL_MINORVERSION TEXT("MinorVersion")
  156. #define S_VAL_PLATFORMID TEXT("PlatformId")
  157. #define S_VER_COMPANYNAME TEXT("CompanyName")
  158. #define S_VER_PRODUCTVERSION TEXT("ProductVersion")
  159. #define S_VER_PRODUCTNAME TEXT("ProductName")
  160. #define S_VER_FILEDESCRIPTION TEXT("FileDescription")
  161. #define S_VER_FILEVERSION TEXT("FileVersion")
  162. #define S_VER_ORIGINALFILENAME TEXT("OriginalFileName")
  163. #define S_VER_INTERNALNAME TEXT("InternalName")
  164. #define S_VER_LEGALCOPYRIGHT TEXT("LegalCopyright")