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.

308 lines
9.9 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dsetup.h
  6. * Content: DirectXSetup, error codes and flags
  7. ***************************************************************************/
  8. #ifndef __DSETUP_H__
  9. #define __DSETUP_H__
  10. #include <windows.h> // windows stuff
  11. #ifdef _WIN32
  12. #define COM_NO_WINDOWS_H
  13. #include <objbase.h>
  14. #else
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #define FOURCC_VERS mmioFOURCC('v','e','r','s')
  20. // DSETUP Error Codes, must remain compatible with previous setup.
  21. #define DSETUPERR_SUCCESS_RESTART 1
  22. #define DSETUPERR_SUCCESS 0
  23. #define DSETUPERR_BADWINDOWSVERSION -1
  24. #define DSETUPERR_SOURCEFILENOTFOUND -2
  25. #define DSETUPERR_BADSOURCESIZE -3
  26. #define DSETUPERR_BADSOURCETIME -4
  27. #define DSETUPERR_NOCOPY -5
  28. #define DSETUPERR_OUTOFDISKSPACE -6
  29. #define DSETUPERR_CANTFINDINF -7
  30. #define DSETUPERR_CANTFINDDIR -8
  31. #define DSETUPERR_INTERNAL -9
  32. #define DSETUPERR_NTWITHNO3D -10 /* REM: obsolete, you'll never see this */
  33. #define DSETUPERR_UNKNOWNOS -11
  34. #define DSETUPERR_USERHITCANCEL -12
  35. #define DSETUPERR_NOTPREINSTALLEDONNT -13
  36. #define DSETUPERR_NEWERVERSION -14
  37. #define DSETUPERR_NOTADMIN -15
  38. #define DSETUPERR_UNSUPPORTEDPROCESSOR -16
  39. // DSETUP flags. DirectX 5.0 apps should use these flags only.
  40. #define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */
  41. #define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */
  42. #define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */
  43. #define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV)
  44. #define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */
  45. #define DSETUP_USEROLDERFLAG 0x02000000 /* enable return DSETUPERR_NEWERVERSION */
  46. // These OBSOLETE flags are here for compatibility with pre-DX5 apps only.
  47. // They are present to allow DX3 apps to be recompiled with DX5 and still work.
  48. // DO NOT USE THEM for DX5. They will go away in future DX releases.
  49. #define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */
  50. #define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */
  51. #define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */
  52. #define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */
  53. #define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */
  54. #define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */
  55. #define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */
  56. #define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */
  57. #define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */
  58. #define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */
  59. #define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */
  60. //******************************************************************
  61. // DirectX Setup Callback mechanism
  62. //******************************************************************
  63. // DSETUP Message Info Codes, passed to callback as Reason parameter.
  64. #define DSETUP_CB_MSG_NOMESSAGE 0
  65. #define DSETUP_CB_MSG_CANTINSTALL_UNKNOWNOS 1
  66. #define DSETUP_CB_MSG_CANTINSTALL_NT 2
  67. #define DSETUP_CB_MSG_CANTINSTALL_BETA 3
  68. #define DSETUP_CB_MSG_CANTINSTALL_NOTWIN32 4
  69. #define DSETUP_CB_MSG_CANTINSTALL_WRONGLANGUAGE 5
  70. #define DSETUP_CB_MSG_CANTINSTALL_WRONGPLATFORM 6
  71. #define DSETUP_CB_MSG_PREINSTALL_NT 7
  72. #define DSETUP_CB_MSG_NOTPREINSTALLEDONNT 8
  73. #define DSETUP_CB_MSG_SETUP_INIT_FAILED 9
  74. #define DSETUP_CB_MSG_INTERNAL_ERROR 10
  75. #define DSETUP_CB_MSG_CHECK_DRIVER_UPGRADE 11
  76. #define DSETUP_CB_MSG_OUTOFDISKSPACE 12
  77. #define DSETUP_CB_MSG_BEGIN_INSTALL 13
  78. #define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14
  79. #define DSETUP_CB_MSG_BEGIN_INSTALL_DRIVERS 15
  80. #define DSETUP_CB_MSG_BEGIN_RESTORE_DRIVERS 16
  81. #define DSETUP_CB_MSG_FILECOPYERROR 17
  82. #define DSETUP_CB_UPGRADE_TYPE_MASK 0x000F
  83. #define DSETUP_CB_UPGRADE_KEEP 0x0001
  84. #define DSETUP_CB_UPGRADE_SAFE 0x0002
  85. #define DSETUP_CB_UPGRADE_FORCE 0x0004
  86. #define DSETUP_CB_UPGRADE_UNKNOWN 0x0008
  87. #define DSETUP_CB_UPGRADE_HASWARNINGS 0x0100
  88. #define DSETUP_CB_UPGRADE_CANTBACKUP 0x0200
  89. #define DSETUP_CB_UPGRADE_DEVICE_ACTIVE 0x0800
  90. #define DSETUP_CB_UPGRADE_DEVICE_DISPLAY 0x1000
  91. #define DSETUP_CB_UPGRADE_DEVICE_MEDIA 0x2000
  92. typedef struct _DSETUP_CB_UPGRADEINFO
  93. {
  94. DWORD UpgradeFlags;
  95. } DSETUP_CB_UPGRADEINFO;
  96. typedef struct _DSETUP_CB_FILECOPYERROR
  97. {
  98. DWORD dwError;
  99. } DSETUP_CB_FILECOPYERROR;
  100. #ifdef _WIN32
  101. //
  102. // Data Structures
  103. //
  104. #ifndef UNICODE_ONLY
  105. typedef struct _DIRECTXREGISTERAPPA {
  106. DWORD dwSize;
  107. DWORD dwFlags;
  108. LPSTR lpszApplicationName;
  109. LPGUID lpGUID;
  110. LPSTR lpszFilename;
  111. LPSTR lpszCommandLine;
  112. LPSTR lpszPath;
  113. LPSTR lpszCurrentDirectory;
  114. } DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA;
  115. typedef struct _DIRECTXREGISTERAPP2A {
  116. DWORD dwSize;
  117. DWORD dwFlags;
  118. LPSTR lpszApplicationName;
  119. LPGUID lpGUID;
  120. LPSTR lpszFilename;
  121. LPSTR lpszCommandLine;
  122. LPSTR lpszPath;
  123. LPSTR lpszCurrentDirectory;
  124. LPSTR lpszLauncherName;
  125. } DIRECTXREGISTERAPP2A, *PDIRECTXREGISTERAPP2A, *LPDIRECTXREGISTERAPP2A;
  126. #endif //!UNICODE_ONLY
  127. #ifndef ANSI_ONLY
  128. typedef struct _DIRECTXREGISTERAPPW {
  129. DWORD dwSize;
  130. DWORD dwFlags;
  131. LPWSTR lpszApplicationName;
  132. LPGUID lpGUID;
  133. LPWSTR lpszFilename;
  134. LPWSTR lpszCommandLine;
  135. LPWSTR lpszPath;
  136. LPWSTR lpszCurrentDirectory;
  137. } DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW;
  138. typedef struct _DIRECTXREGISTERAPP2W {
  139. DWORD dwSize;
  140. DWORD dwFlags;
  141. LPWSTR lpszApplicationName;
  142. LPGUID lpGUID;
  143. LPWSTR lpszFilename;
  144. LPWSTR lpszCommandLine;
  145. LPWSTR lpszPath;
  146. LPWSTR lpszCurrentDirectory;
  147. LPWSTR lpszLauncherName;
  148. } DIRECTXREGISTERAPP2W, *PDIRECTXREGISTERAPP2W, *LPDIRECTXREGISTERAPP2W;
  149. #endif //!ANSI_ONLY
  150. #ifdef UNICODE
  151. typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP;
  152. typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP;
  153. typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP;
  154. typedef DIRECTXREGISTERAPP2W DIRECTXREGISTERAPP2;
  155. typedef PDIRECTXREGISTERAPP2W PDIRECTXREGISTERAPP2;
  156. typedef LPDIRECTXREGISTERAPP2W LPDIRECTXREGISTERAPP2;
  157. #else
  158. typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP;
  159. typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP;
  160. typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP;
  161. typedef DIRECTXREGISTERAPP2A DIRECTXREGISTERAPP2;
  162. typedef PDIRECTXREGISTERAPP2A PDIRECTXREGISTERAPP2;
  163. typedef LPDIRECTXREGISTERAPP2A LPDIRECTXREGISTERAPP2;
  164. #endif // UNICODE
  165. //
  166. // API
  167. //
  168. #ifndef UNICODE_ONLY
  169. INT
  170. WINAPI
  171. DirectXSetupA(
  172. HWND hWnd,
  173. LPSTR lpszRootPath,
  174. DWORD dwFlags
  175. );
  176. #endif //!UNICODE_ONLY
  177. #ifndef ANSI_ONLY
  178. INT
  179. WINAPI
  180. DirectXSetupW(
  181. HWND hWnd,
  182. LPWSTR lpszRootPath,
  183. DWORD dwFlags
  184. );
  185. #endif //!ANSI_ONLY
  186. #ifdef UNICODE
  187. #define DirectXSetup DirectXSetupW
  188. #else
  189. #define DirectXSetup DirectXSetupA
  190. #endif // !UNICODE
  191. #ifndef UNICODE_ONLY
  192. INT
  193. WINAPI
  194. DirectXDeviceDriverSetupA(
  195. HWND hWnd,
  196. LPSTR lpszDriverClass,
  197. LPSTR lpszDriverPath,
  198. DWORD dwFlags
  199. );
  200. #endif //!UNICODE_ONLY
  201. #ifndef ANSI_ONLY
  202. INT
  203. WINAPI
  204. DirectXDeviceDriverSetupW(
  205. HWND hWnd,
  206. LPWSTR lpszDriverClass,
  207. LPWSTR lpszDriverPath,
  208. DWORD dwFlags
  209. );
  210. #endif //!ANSI_ONLY
  211. #ifdef UNICODE
  212. #define DirectXDeviceDriverSetup DirectXDeviceDriverSetupW
  213. #else
  214. #define DirectXDeviceDriverSetup DirectXDeviceDriverSetupA
  215. #endif // !UNICODE
  216. #ifndef UNICODE_ONLY
  217. INT
  218. WINAPI
  219. DirectXRegisterApplicationA(
  220. HWND hWnd,
  221. LPVOID lpDXRegApp
  222. );
  223. #endif //!UNICODE_ONLY
  224. #ifndef ANSI_ONLY
  225. INT
  226. WINAPI
  227. DirectXRegisterApplicationW(
  228. HWND hWnd,
  229. LPVOID lpDXRegApp
  230. );
  231. #endif //!ANSI_ONLY
  232. #ifdef UNICODE
  233. #define DirectXRegisterApplication DirectXRegisterApplicationW
  234. #else
  235. #define DirectXRegisterApplication DirectXRegisterApplicationA
  236. #endif // !UNICODE
  237. INT
  238. WINAPI
  239. DirectXUnRegisterApplication(
  240. HWND hWnd,
  241. LPGUID lpGUID
  242. );
  243. //
  244. // Function Pointers
  245. //
  246. #ifdef UNICODE
  247. typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD);
  248. typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPWSTR, LPSTR, DWORD);
  249. typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
  250. #else
  251. typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD);
  252. typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPSTR, LPSTR, DWORD);
  253. typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
  254. #endif // UNICODE
  255. typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason,
  256. DWORD MsgType, /* Same as flags to MessageBox */
  257. LPSTR szMessage,
  258. LPSTR szName,
  259. void *pInfo);
  260. INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback);
  261. INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion);
  262. #endif // WIN32
  263. #ifdef __cplusplus
  264. };
  265. #endif
  266. #endif