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.

85 lines
2.3 KiB

  1. #ifndef __GLOBAL_
  2. #define __GLOBAL_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif // __cplusplus
  6. //////////////////////////////////////////////////////////////////////////////////////////////
  7. #include <windows.h>
  8. //
  9. // Defines
  10. //
  11. #define MAX_FILENAME_LEN 13
  12. #define COMPONENT_COUNT 6
  13. #define COMPONENT_ON_SYSTEM 0x00000001
  14. #define COMPONENT_OLDER_VERSION 0x00000002
  15. #define COMPONENT_SAME_VERSION 0x00000004
  16. #define COMPONENT_NEWER_VERSION 0x00000008
  17. #define COMPONENT_NOT_IDENTICAL 0x00000010
  18. #define COMPONENT_IN_USE 0x00000020
  19. #define COMPONENT_SUCCESS 0x00000040
  20. #define OS_VERSION_WIN32S 0x00000000
  21. #define OS_VERSION_WIN95 0x00000001
  22. #define OS_VERSION_WIN98 0x00000002
  23. #define OS_VERSION_WINNT 0x00000004
  24. #define OS_VERSION_WIN2000 0x00000008
  25. #define OS_VERSION_WIN9X (OS_VERSION_WIN95 | OS_VERSION_WIN98)
  26. #define OS_VERSION_WIN2K (OS_VERSION_WIN2000)
  27. #define _EXIT_SUCCESS 0x00000001
  28. #define _EXIT_SUCCESS_REBOOT 0x00000002
  29. #define _EXIT_FAIL 0xffffffff
  30. typedef HRESULT (STDAPICALLTYPE * LPFNDLLREGISTERSERVER) (void);
  31. typedef HRESULT (STDAPICALLTYPE * LPFNDLLUNREGISTERSERVER) (void);
  32. //
  33. // Structure used to track component information used during installation
  34. //
  35. typedef struct
  36. {
  37. TCHAR strFilename[MAX_FILENAME_LEN];
  38. BOOL fDebugVersion;
  39. BOOL fRegister;
  40. DWORD dwTargetOS;
  41. DWORD dwResourceId;
  42. DWORD dwStatus;
  43. VS_FIXEDFILEINFO sCurrentVersionInfo;
  44. VS_FIXEDFILEINFO sTargetVersionInfo;
  45. } COMPONENT_INFO, LPCOMPONENT_INFO;
  46. //
  47. // Global variables
  48. //
  49. extern HINSTANCE g_hInstance;
  50. extern DWORD g_dwOSVersion;
  51. extern BOOL g_fInstallDebug;
  52. extern DWORD g_dwSuccessCode;
  53. extern COMPONENT_INFO g_sComponentInfo[COMPONENT_COUNT];
  54. //
  55. // Global methods
  56. //
  57. extern BOOL FileExists(LPCTSTR strFilename);
  58. extern DWORD GetOSVersion(void);
  59. extern DWORD StrLen(LPCTSTR strString);
  60. extern BOOL GenerateUniqueFilename(LPCTSTR strRootPath, LPCTSTR strExtension, LPTSTR strFilename);
  61. //////////////////////////////////////////////////////////////////////////////////////////////
  62. #ifdef __cplusplus
  63. }
  64. #endif // __cplusplus
  65. #endif // __GLOBAL_