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.

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