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.

100 lines
3.0 KiB

  1. #ifndef _LOADER_H_
  2. #define _LOADER_H_
  3. // NOTE: Currently REQUIRED_DLLS contains only new DLLs that are required at
  4. // startup of migwiz. It does not contain DLLs that are required already
  5. // to start this loader. It does not currently contain DLLs that are
  6. // automatically dynamically linked when a function is called in them.
  7. // kernel32.dll
  8. // msvcrt.dll
  9. // user32.dll
  10. // comctl32.dll
  11. #define REQUIRED_DLLSA { \
  12. "advapi32.dll", \
  13. "comdlg32.dll", \
  14. "gdi32.dll", \
  15. "msvcrt.dll", \
  16. "ole32.dll", \
  17. "setupapi.dll", \
  18. "shell32.dll", \
  19. "shlwapi.dll", \
  20. }
  21. #define REQUIRED_DLLSW { \
  22. L"advapi32.dll", \
  23. L"comdlg32.dll", \
  24. L"gdi32.dll", \
  25. L"msvcrt.dll", \
  26. L"ole32.dll", \
  27. L"setupapi.dll", \
  28. L"shell32.dll", \
  29. L"shlwapi.dll", \
  30. }
  31. // Constants
  32. #define WM_USER_THREAD_COMPLETE (WM_APP + 1)
  33. #define WM_USER_HIDE_WINDOW (WM_APP + 2)
  34. #define WM_USER_THREAD_ERROR (WM_APP + 3)
  35. #define WM_USER_DIALOG_COMPLETE (WM_APP + 4)
  36. #define WM_USER_UNPACKING_FILE (WM_APP + 5)
  37. #define WM_USER_SUBTHREAD_CREATED (WM_APP + 6)
  38. typedef enum _ERRORCODE
  39. {
  40. E_OK,
  41. E_INVALID_PATH,
  42. E_INVALID_FILENAME,
  43. E_FILE_DOES_NOT_EXIST,
  44. E_PROCESS_CREATION_FAILED,
  45. E_THREAD_CREATION_FAILED,
  46. E_CAB_NOT_FOUND,
  47. E_CAB_CORRUPT,
  48. E_UNPACK_FAILED,
  49. E_DLL_NOT_FOUND,
  50. E_OLD_OS_VERSION,
  51. E_WRONG_LANGUAGE
  52. } ERRORCODE;
  53. #define ERROR_MAPPING { \
  54. { E_OK, IDS_MSG_SUCCESS }, \
  55. { E_INVALID_PATH, IDS_MSG_E_INVALID_PATH }, \
  56. { E_INVALID_FILENAME, IDS_MSG_E_INVALID_FILENAME }, \
  57. { E_FILE_DOES_NOT_EXIST, IDS_MSG_E_FILE_DOES_NOT_EXIST }, \
  58. { E_PROCESS_CREATION_FAILED, IDS_MSG_E_PROCESS_CREATION_FAILED }, \
  59. { E_THREAD_CREATION_FAILED, IDS_MSG_E_THREAD_CREATION_FAILED }, \
  60. { E_CAB_NOT_FOUND, IDS_MSG_E_CAB_NOT_FOUND }, \
  61. { E_CAB_CORRUPT, IDS_MSG_E_CAB_CORRUPT }, \
  62. { E_UNPACK_FAILED, IDS_MSG_E_UNPACK_FAILED }, \
  63. { E_DLL_NOT_FOUND, IDS_MSG_E_DLL_NOT_FOUND }, \
  64. { E_OLD_OS_VERSION, IDS_MSG_E_OLD_OS_VERSION }, \
  65. { E_WRONG_LANGUAGE, IDS_MSG_E_WRONG_LANGUAGE }, \
  66. }
  67. typedef struct _ERRORMAPPINGSTRUCT
  68. {
  69. UINT ecValue;
  70. UINT uResourceID;
  71. } ERRORMAPPINGSTRUCT, *LPERRORMAPPINGSTRUCT;
  72. typedef struct _THREADSTARTUPINFO
  73. {
  74. HWND hWnd;
  75. HINSTANCE hInstance;
  76. LPSTR lpCmdLine;
  77. } THREADSTARTUPINFO, *LPTHREADSTARTUPINFO;
  78. // Function prototypes
  79. #define ALLOC(size) HeapAlloc( GetProcessHeap (), 0, size )
  80. #define FREE(p) HeapFree( GetProcessHeap (), 0, p )
  81. BOOL InitLanguageDetection(VOID);
  82. // Globals
  83. extern OSVERSIONINFO g_VersionInfo;
  84. extern BOOL g_IsLanguageMatched;
  85. #endif /* _LOADER_H_ */