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.

362 lines
12 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. *@@BEGIN_MSINTERNAL
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 22-apr-95 ericeng initial release
  12. * 02-sep-95 ericeng added parsing and custom dlls for hardware detection
  13. * 23-sep-95 ericeng changed parameters to DirectXSetup et al to eliminate
  14. * windows paths. Add typedefs for funcion pointers.
  15. * 28-dec-95 ericeng added DSETUP_DVIDEO and DSETUP_DRVINFONLY flags to public
  16. * 02-feb-96 angusm changed DSETUP16_DLLNAME to dsetup6e.dll
  17. * 23-mar-96 ericeng merged manhatan bug fixes and J support into orion
  18. * 24-jun-96 twillie added dinput flag
  19. * 31-mar-97 andyraf begin rewrite for DX5Beta2
  20. *@@END_MSINTERNAL
  21. ***************************************************************************/
  22. #ifndef __DSETUP_H__
  23. #define __DSETUP_H__
  24. #include <windows.h> // windows stuff
  25. #ifdef _WIN32
  26. #define COM_NO_WINDOWS_H
  27. #include <objbase.h>
  28. #else
  29. #endif
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. #define FOURCC_VERS mmioFOURCC('v','e','r','s')
  34. // DSETUP Error Codes, must remain compatible with previous setup.
  35. #define DSETUPERR_SUCCESS_RESTART 1
  36. #define DSETUPERR_SUCCESS 0
  37. #define DSETUPERR_BADWINDOWSVERSION -1
  38. #define DSETUPERR_SOURCEFILENOTFOUND -2
  39. #define DSETUPERR_BADSOURCESIZE -3
  40. #define DSETUPERR_BADSOURCETIME -4
  41. #define DSETUPERR_NOCOPY -5
  42. #define DSETUPERR_OUTOFDISKSPACE -6
  43. #define DSETUPERR_CANTFINDINF -7
  44. #define DSETUPERR_CANTFINDDIR -8
  45. #define DSETUPERR_INTERNAL -9
  46. #define DSETUPERR_NTWITHNO3D -10 /* REM: obsolete, you'll never see this */
  47. #define DSETUPERR_UNKNOWNOS -11
  48. #define DSETUPERR_USERHITCANCEL -12
  49. #define DSETUPERR_NOTPREINSTALLEDONNT -13
  50. #define DSETUPERR_NEWERVERSION -14
  51. #define DSETUPERR_NOTADMIN -15
  52. #define DSETUPERR_UNSUPPORTEDPROCESSOR -16
  53. // DSETUP flags. DirectX 5.0 apps should use these flags only.
  54. #define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */
  55. #define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */
  56. #define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */
  57. #define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV)
  58. #define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */
  59. #define DSETUP_USEROLDERFLAG 0x02000000 /* enable return DSETUPERR_NEWERVERSION */
  60. // @@BEGIN_MSINTERNAL
  61. // Bug #22730
  62. // #define DSETUP_NTINSTALL 0x00080000 /* install on Win2K platform */
  63. // @@END_MSINTERNAL
  64. // These OBSOLETE flags are here for compatibility with pre-DX5 apps only.
  65. // They are present to allow DX3 apps to be recompiled with DX5 and still work.
  66. // DO NOT USE THEM for DX5. They will go away in future DX releases.
  67. #define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */
  68. #define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */
  69. #define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */
  70. #define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */
  71. #define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */
  72. #define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */
  73. #define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */
  74. #define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */
  75. #define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */
  76. #define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */
  77. #define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */
  78. // @@BEGIN_MSINTERNAL
  79. #define DSETUP_DEBUGMSG 0x00040000 /* send all messages to app */
  80. #define DSETUP_REINSTALL 0x00000080 /* install DirectX even if existing components have the same version */
  81. #define DSETUP_SDKSETUP 0x08000000 /* install DirectX for DX SDK SETUP */
  82. #define DSETUP_OVERWRITE 0x40000000 /* overwrite previous version of DirectX */
  83. #define DSETUP_INSTALLFLAT 0x80000000 /* Install in flat dir scenario */
  84. // @@END_MSINTERNAL
  85. //******************************************************************
  86. // DirectX Setup Callback mechanism
  87. //******************************************************************
  88. // DSETUP Message Info Codes, passed to callback as Reason parameter.
  89. #define DSETUP_CB_MSG_NOMESSAGE 0
  90. #define DSETUP_CB_MSG_CANTINSTALL_UNKNOWNOS 1
  91. #define DSETUP_CB_MSG_CANTINSTALL_NT 2
  92. #define DSETUP_CB_MSG_CANTINSTALL_BETA 3
  93. #define DSETUP_CB_MSG_CANTINSTALL_NOTWIN32 4
  94. #define DSETUP_CB_MSG_CANTINSTALL_WRONGLANGUAGE 5
  95. #define DSETUP_CB_MSG_CANTINSTALL_WRONGPLATFORM 6
  96. #define DSETUP_CB_MSG_PREINSTALL_NT 7
  97. #define DSETUP_CB_MSG_NOTPREINSTALLEDONNT 8
  98. #define DSETUP_CB_MSG_SETUP_INIT_FAILED 9
  99. #define DSETUP_CB_MSG_INTERNAL_ERROR 10
  100. #define DSETUP_CB_MSG_CHECK_DRIVER_UPGRADE 11
  101. #define DSETUP_CB_MSG_OUTOFDISKSPACE 12
  102. #define DSETUP_CB_MSG_BEGIN_INSTALL 13
  103. #define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14
  104. #define DSETUP_CB_MSG_BEGIN_INSTALL_DRIVERS 15
  105. #define DSETUP_CB_MSG_BEGIN_RESTORE_DRIVERS 16
  106. #define DSETUP_CB_MSG_FILECOPYERROR 17
  107. // @@BEGIN_MSINTERNAL
  108. // These messages are only sent up if DSETUP_DEBUGMSG specified in flags field
  109. #define DSETUP_CB_MSG_WARN_UNKNOWN 1000
  110. #define DSETUP_CB_MSG_WARN_LOF 1001
  111. #define DSETUP_CB_MSG_VERCHECK_START 1002
  112. #define DSETUP_CB_MSG_FILEVERSIONINFO 1003
  113. #define DSETUP_CB_MSG_VERCHECK_END 1004
  114. #define DSETUP_CB_MSG_GETFOCUS 1005
  115. // @@END_MSINTERNAL
  116. #define DSETUP_CB_UPGRADE_TYPE_MASK 0x000F
  117. #define DSETUP_CB_UPGRADE_KEEP 0x0001
  118. #define DSETUP_CB_UPGRADE_SAFE 0x0002
  119. #define DSETUP_CB_UPGRADE_FORCE 0x0004
  120. #define DSETUP_CB_UPGRADE_UNKNOWN 0x0008
  121. #define DSETUP_CB_UPGRADE_HASWARNINGS 0x0100
  122. #define DSETUP_CB_UPGRADE_CANTBACKUP 0x0200
  123. #define DSETUP_CB_UPGRADE_DEVICE_ACTIVE 0x0800
  124. #define DSETUP_CB_UPGRADE_DEVICE_DISPLAY 0x1000
  125. #define DSETUP_CB_UPGRADE_DEVICE_MEDIA 0x2000
  126. // @@BEGIN_MSINTERNAL
  127. #define DSETUP_CB_UPGRADE_EXISTING_CERTIFIED 0x00100000
  128. #define DSETUP_CB_UPGRADE_EXISTING_UNCERTIFIED 0x00200000
  129. #define DSETUP_CB_UPGRADE_EXISTING_OLDER 0x00010000
  130. #define DSETUP_CB_UPGRADE_EXISTING_SAME 0x00020000
  131. #define DSETUP_CB_UPGRADE_EXISTING_NEWER 0x00040000
  132. // @@END_MSINTERNAL
  133. typedef struct _DSETUP_CB_UPGRADEINFO
  134. {
  135. DWORD UpgradeFlags;
  136. } DSETUP_CB_UPGRADEINFO;
  137. typedef struct _DSETUP_CB_FILECOPYERROR
  138. {
  139. DWORD dwError;
  140. } DSETUP_CB_FILECOPYERROR;
  141. // @@BEGIN_MSINTERNAL
  142. typedef struct _DSETUP_CB_FILEVERSIONINFO
  143. {
  144. DWORD dwMajorVersion;
  145. DWORD dwMinorVersion;
  146. DWORD dwFileSize;
  147. DWORD dwUpgradeFlags;
  148. char szWarning[4096];
  149. } DSETUP_CB_FILEVERSIONINFO;
  150. // @@END_MSINTERNAL
  151. #ifdef _WIN32
  152. //
  153. // Data Structures
  154. //
  155. #ifndef UNICODE_ONLY
  156. typedef struct _DIRECTXREGISTERAPPA {
  157. DWORD dwSize;
  158. DWORD dwFlags;
  159. LPSTR lpszApplicationName;
  160. LPGUID lpGUID;
  161. LPSTR lpszFilename;
  162. LPSTR lpszCommandLine;
  163. LPSTR lpszPath;
  164. LPSTR lpszCurrentDirectory;
  165. } DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA;
  166. typedef struct _DIRECTXREGISTERAPP2A {
  167. DWORD dwSize;
  168. DWORD dwFlags;
  169. LPSTR lpszApplicationName;
  170. LPGUID lpGUID;
  171. LPSTR lpszFilename;
  172. LPSTR lpszCommandLine;
  173. LPSTR lpszPath;
  174. LPSTR lpszCurrentDirectory;
  175. LPSTR lpszLauncherName;
  176. } DIRECTXREGISTERAPP2A, *PDIRECTXREGISTERAPP2A, *LPDIRECTXREGISTERAPP2A;
  177. #endif //!UNICODE_ONLY
  178. #ifndef ANSI_ONLY
  179. typedef struct _DIRECTXREGISTERAPPW {
  180. DWORD dwSize;
  181. DWORD dwFlags;
  182. LPWSTR lpszApplicationName;
  183. LPGUID lpGUID;
  184. LPWSTR lpszFilename;
  185. LPWSTR lpszCommandLine;
  186. LPWSTR lpszPath;
  187. LPWSTR lpszCurrentDirectory;
  188. } DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW;
  189. typedef struct _DIRECTXREGISTERAPP2W {
  190. DWORD dwSize;
  191. DWORD dwFlags;
  192. LPWSTR lpszApplicationName;
  193. LPGUID lpGUID;
  194. LPWSTR lpszFilename;
  195. LPWSTR lpszCommandLine;
  196. LPWSTR lpszPath;
  197. LPWSTR lpszCurrentDirectory;
  198. LPWSTR lpszLauncherName;
  199. } DIRECTXREGISTERAPP2W, *PDIRECTXREGISTERAPP2W, *LPDIRECTXREGISTERAPP2W;
  200. #endif //!ANSI_ONLY
  201. #ifdef UNICODE
  202. typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP;
  203. typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP;
  204. typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP;
  205. typedef DIRECTXREGISTERAPP2W DIRECTXREGISTERAPP2;
  206. typedef PDIRECTXREGISTERAPP2W PDIRECTXREGISTERAPP2;
  207. typedef LPDIRECTXREGISTERAPP2W LPDIRECTXREGISTERAPP2;
  208. #else
  209. typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP;
  210. typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP;
  211. typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP;
  212. typedef DIRECTXREGISTERAPP2A DIRECTXREGISTERAPP2;
  213. typedef PDIRECTXREGISTERAPP2A PDIRECTXREGISTERAPP2;
  214. typedef LPDIRECTXREGISTERAPP2A LPDIRECTXREGISTERAPP2;
  215. #endif // UNICODE
  216. //
  217. // API
  218. //
  219. #ifndef UNICODE_ONLY
  220. INT
  221. WINAPI
  222. DirectXSetupA(
  223. HWND hWnd,
  224. LPSTR lpszRootPath,
  225. DWORD dwFlags
  226. );
  227. #endif //!UNICODE_ONLY
  228. #ifndef ANSI_ONLY
  229. INT
  230. WINAPI
  231. DirectXSetupW(
  232. HWND hWnd,
  233. LPWSTR lpszRootPath,
  234. DWORD dwFlags
  235. );
  236. #endif //!ANSI_ONLY
  237. #ifdef UNICODE
  238. #define DirectXSetup DirectXSetupW
  239. #else
  240. #define DirectXSetup DirectXSetupA
  241. #endif // !UNICODE
  242. #ifndef UNICODE_ONLY
  243. INT
  244. WINAPI
  245. DirectXDeviceDriverSetupA(
  246. HWND hWnd,
  247. LPSTR lpszDriverClass,
  248. LPSTR lpszDriverPath,
  249. DWORD dwFlags
  250. );
  251. #endif //!UNICODE_ONLY
  252. #ifndef ANSI_ONLY
  253. INT
  254. WINAPI
  255. DirectXDeviceDriverSetupW(
  256. HWND hWnd,
  257. LPWSTR lpszDriverClass,
  258. LPWSTR lpszDriverPath,
  259. DWORD dwFlags
  260. );
  261. #endif //!ANSI_ONLY
  262. #ifdef UNICODE
  263. #define DirectXDeviceDriverSetup DirectXDeviceDriverSetupW
  264. #else
  265. #define DirectXDeviceDriverSetup DirectXDeviceDriverSetupA
  266. #endif // !UNICODE
  267. #ifndef UNICODE_ONLY
  268. INT
  269. WINAPI
  270. DirectXRegisterApplicationA(
  271. HWND hWnd,
  272. LPVOID lpDXRegApp
  273. );
  274. #endif //!UNICODE_ONLY
  275. #ifndef ANSI_ONLY
  276. INT
  277. WINAPI
  278. DirectXRegisterApplicationW(
  279. HWND hWnd,
  280. LPVOID lpDXRegApp
  281. );
  282. #endif //!ANSI_ONLY
  283. #ifdef UNICODE
  284. #define DirectXRegisterApplication DirectXRegisterApplicationW
  285. #else
  286. #define DirectXRegisterApplication DirectXRegisterApplicationA
  287. #endif // !UNICODE
  288. INT
  289. WINAPI
  290. DirectXUnRegisterApplication(
  291. HWND hWnd,
  292. LPGUID lpGUID
  293. );
  294. //
  295. // Function Pointers
  296. //
  297. #ifdef UNICODE
  298. typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD);
  299. typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPWSTR, LPSTR, DWORD);
  300. typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
  301. #else
  302. typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD);
  303. typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPSTR, LPSTR, DWORD);
  304. typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
  305. #endif // UNICODE
  306. typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason,
  307. DWORD MsgType, /* Same as flags to MessageBox */
  308. LPSTR szMessage,
  309. LPSTR szName,
  310. void *pInfo);
  311. INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback);
  312. INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion);
  313. // @@BEGIN_MSINTERNAL
  314. INT WINAPI DirectXSetupShowEULA(HWND hWndParent);
  315. // @@END_MSINTERNAL
  316. #endif // WIN32
  317. #ifdef __cplusplus
  318. };
  319. #endif
  320. #endif