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.

118 lines
4.0 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: imkrinst.h
  3. *
  4. * Copyright (c) 2000, Microsoft Corporation
  5. *
  6. * IMKRINST, main header file
  7. *
  8. \***************************************************************************/
  9. #if !defined (_IMKRINST_H__INCLUDED_)
  10. #define _IMKRINST_H__INCLUDED_
  11. /////////////////////////////////////////////////////////////////////////////
  12. // Global constants
  13. /////////////////////////////////////////////////////////////////////////////
  14. // Line buffer length for script file.
  15. const int _cchBuffer = 1024;
  16. // Error code returned from ProcessScriptFile.
  17. enum
  18. {
  19. errNoError,
  20. errNoFile,
  21. errFileList,
  22. errSetDefaultParameters,
  23. errSetVersion,
  24. errPreSetupCheck,
  25. errRenameFile,
  26. errRegisterIME,
  27. errRegisterIMEandTIP,
  28. errRegisterInterface,
  29. errRegisterInterfaceWow64,
  30. errAddToPreload,
  31. errPrepareMigration,
  32. errRegisterPackageVersion,
  33. errRegisterPadOrder,
  34. errCmdCreateDirectory,
  35. errCmdRegisterHelpDirs
  36. };
  37. /////////////////////////////////////////////////////////////////////////////
  38. // Utility classes
  39. /////////////////////////////////////////////////////////////////////////////
  40. //
  41. // FileListElement. Constructs FileListSet.
  42. //
  43. class FLE
  44. { // I use short incomprehensible name such as "FLE"
  45. public: // since we'll meet many C4786 warnings when I use
  46. BOOL fRemoved; // longer name.
  47. TCHAR szFileName[MAX_PATH];
  48. };
  49. // binary operator required to construct a set of this class.
  50. bool operator < (const FLE &fle1, const FLE &fle2)
  51. {
  52. return(0 > lstrcmpi(fle1.szFileName, fle2.szFileName));
  53. };
  54. //
  55. // VersionComparison. Used to compare two version info. Used for IsNewer.
  56. //
  57. class VersionComparison2
  58. {
  59. public:
  60. VersionComparison2(const DWORD arg_dwMajorVersion, const DWORD arg_dwMinorVersion)
  61. : dwMajorVersion(arg_dwMajorVersion), dwMinorVersion(arg_dwMinorVersion){};
  62. virtual bool operator <(const VersionComparison2 &vc2)
  63. {
  64. if((dwMajorVersion < vc2.dwMajorVersion) ||
  65. ((dwMajorVersion == vc2.dwMajorVersion) && (dwMinorVersion < vc2.dwMinorVersion)))
  66. return(true);
  67. else
  68. return(false);
  69. }
  70. virtual bool operator ==(const VersionComparison2 &vc2)
  71. {
  72. return((dwMajorVersion == vc2.dwMajorVersion) && (dwMinorVersion == vc2.dwMinorVersion));
  73. }
  74. private:
  75. DWORD dwMajorVersion;
  76. DWORD dwMinorVersion;
  77. };
  78. class VersionComparison4
  79. {
  80. public:
  81. VersionComparison4(const DWORD arg_dwMajorVersion, const DWORD arg_dwMiddleVersion, const DWORD arg_dwMinorVersion, const DWORD arg_dwBuildNumber)
  82. : dwMajorVersion(arg_dwMajorVersion), dwMiddleVersion(arg_dwMiddleVersion), dwMinorVersion(arg_dwMinorVersion), dwBuildNumber(arg_dwBuildNumber){};
  83. virtual bool operator <(const VersionComparison4 &vc4)
  84. {
  85. if((dwMajorVersion < vc4.dwMajorVersion) ||
  86. ((dwMajorVersion == vc4.dwMajorVersion) && (dwMiddleVersion < vc4.dwMiddleVersion)) ||
  87. ((dwMajorVersion == vc4.dwMajorVersion) && (dwMiddleVersion == vc4.dwMiddleVersion) && (dwMinorVersion < vc4.dwMinorVersion)) ||
  88. ((dwMajorVersion == vc4.dwMajorVersion) && (dwMiddleVersion == vc4.dwMiddleVersion) && (dwMinorVersion == vc4.dwMinorVersion) && (dwBuildNumber < vc4.dwBuildNumber)))
  89. return(true);
  90. else
  91. return(false);
  92. }
  93. virtual bool operator ==(const VersionComparison4 &vc4)
  94. {
  95. return((dwMajorVersion == vc4.dwMajorVersion) && (dwMiddleVersion == vc4.dwMiddleVersion) &&
  96. (dwMinorVersion == vc4.dwMinorVersion) && (dwBuildNumber == vc4.dwBuildNumber));
  97. }
  98. private:
  99. DWORD dwMajorVersion;
  100. DWORD dwMiddleVersion;
  101. DWORD dwMinorVersion;
  102. DWORD dwBuildNumber;
  103. };
  104. #endif // !defined (_IMKRINST_H__INCLUDED_)