Counter Strike : Global Offensive Source Code
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.

283 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 __cplusplus
  12. extern "C" {
  13. #endif
  14. #define FOURCC_VERS mmioFOURCC('v','e','r','s')
  15. // DSETUP Error Codes, must remain compatible with previous setup.
  16. #define DSETUPERR_SUCCESS_RESTART 1
  17. #define DSETUPERR_SUCCESS 0
  18. #define DSETUPERR_BADWINDOWSVERSION -1
  19. #define DSETUPERR_SOURCEFILENOTFOUND -2
  20. #define DSETUPERR_NOCOPY -5
  21. #define DSETUPERR_OUTOFDISKSPACE -6
  22. #define DSETUPERR_CANTFINDINF -7
  23. #define DSETUPERR_CANTFINDDIR -8
  24. #define DSETUPERR_INTERNAL -9
  25. #define DSETUPERR_UNKNOWNOS -11
  26. #define DSETUPERR_NEWERVERSION -14
  27. #define DSETUPERR_NOTADMIN -15
  28. #define DSETUPERR_UNSUPPORTEDPROCESSOR -16
  29. #define DSETUPERR_MISSINGCAB_MANAGEDDX -17
  30. #define DSETUPERR_NODOTNETFRAMEWORKINSTALLED -18
  31. #define DSETUPERR_CABDOWNLOADFAIL -19
  32. #define DSETUPERR_DXCOMPONENTFILEINUSE -20
  33. #define DSETUPERR_UNTRUSTEDCABINETFILE -21
  34. // DSETUP flags. DirectX 5.0 apps should use these flags only.
  35. #define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */
  36. #define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */
  37. #define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */
  38. #define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV)
  39. #define DSETUP_MANAGEDDX 0x00004000 /* OBSOLETE. install managed DirectX */
  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_INTERNAL_ERROR 10
  61. #define DSETUP_CB_MSG_BEGIN_INSTALL 13
  62. #define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14
  63. #define DSETUP_CB_MSG_PROGRESS 18
  64. #define DSETUP_CB_MSG_WARNING_DISABLED_COMPONENT 19
  65. typedef struct _DSETUP_CB_PROGRESS
  66. {
  67. DWORD dwPhase;
  68. DWORD dwInPhaseMaximum;
  69. DWORD dwInPhaseProgress;
  70. DWORD dwOverallMaximum;
  71. DWORD dwOverallProgress;
  72. } DSETUP_CB_PROGRESS;
  73. enum _DSETUP_CB_PROGRESS_PHASE
  74. {
  75. DSETUP_INITIALIZING,
  76. DSETUP_EXTRACTING,
  77. DSETUP_COPYING,
  78. DSETUP_FINALIZING
  79. };
  80. #ifdef _WIN32
  81. //
  82. // Data Structures
  83. //
  84. #ifndef UNICODE_ONLY
  85. typedef struct _DIRECTXREGISTERAPPA {
  86. DWORD dwSize;
  87. DWORD dwFlags;
  88. LPSTR lpszApplicationName;
  89. LPGUID lpGUID;
  90. LPSTR lpszFilename;
  91. LPSTR lpszCommandLine;
  92. LPSTR lpszPath;
  93. LPSTR lpszCurrentDirectory;
  94. } DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA;
  95. typedef struct _DIRECTXREGISTERAPP2A {
  96. DWORD dwSize;
  97. DWORD dwFlags;
  98. LPSTR lpszApplicationName;
  99. LPGUID lpGUID;
  100. LPSTR lpszFilename;
  101. LPSTR lpszCommandLine;
  102. LPSTR lpszPath;
  103. LPSTR lpszCurrentDirectory;
  104. LPSTR lpszLauncherName;
  105. } DIRECTXREGISTERAPP2A, *PDIRECTXREGISTERAPP2A, *LPDIRECTXREGISTERAPP2A;
  106. #endif //!UNICODE_ONLY
  107. #ifndef ANSI_ONLY
  108. typedef struct _DIRECTXREGISTERAPPW {
  109. DWORD dwSize;
  110. DWORD dwFlags;
  111. LPWSTR lpszApplicationName;
  112. LPGUID lpGUID;
  113. LPWSTR lpszFilename;
  114. LPWSTR lpszCommandLine;
  115. LPWSTR lpszPath;
  116. LPWSTR lpszCurrentDirectory;
  117. } DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW;
  118. typedef struct _DIRECTXREGISTERAPP2W {
  119. DWORD dwSize;
  120. DWORD dwFlags;
  121. LPWSTR lpszApplicationName;
  122. LPGUID lpGUID;
  123. LPWSTR lpszFilename;
  124. LPWSTR lpszCommandLine;
  125. LPWSTR lpszPath;
  126. LPWSTR lpszCurrentDirectory;
  127. LPWSTR lpszLauncherName;
  128. } DIRECTXREGISTERAPP2W, *PDIRECTXREGISTERAPP2W, *LPDIRECTXREGISTERAPP2W;
  129. #endif //!ANSI_ONLY
  130. #ifdef UNICODE
  131. typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP;
  132. typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP;
  133. typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP;
  134. typedef DIRECTXREGISTERAPP2W DIRECTXREGISTERAPP2;
  135. typedef PDIRECTXREGISTERAPP2W PDIRECTXREGISTERAPP2;
  136. typedef LPDIRECTXREGISTERAPP2W LPDIRECTXREGISTERAPP2;
  137. #else
  138. typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP;
  139. typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP;
  140. typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP;
  141. typedef DIRECTXREGISTERAPP2A DIRECTXREGISTERAPP2;
  142. typedef PDIRECTXREGISTERAPP2A PDIRECTXREGISTERAPP2;
  143. typedef LPDIRECTXREGISTERAPP2A LPDIRECTXREGISTERAPP2;
  144. #endif // UNICODE
  145. //
  146. // API
  147. //
  148. #ifndef UNICODE_ONLY
  149. INT
  150. WINAPI
  151. DirectXSetupA(
  152. HWND hWnd,
  153. __in_opt LPSTR lpszRootPath,
  154. DWORD dwFlags
  155. );
  156. #endif //!UNICODE_ONLY
  157. #ifndef ANSI_ONLY
  158. INT
  159. WINAPI
  160. DirectXSetupW(
  161. HWND hWnd,
  162. __in_opt LPWSTR lpszRootPath,
  163. DWORD dwFlags
  164. );
  165. #endif //!ANSI_ONLY
  166. #ifdef UNICODE
  167. #define DirectXSetup DirectXSetupW
  168. #else
  169. #define DirectXSetup DirectXSetupA
  170. #endif // !UNICODE
  171. #ifndef UNICODE_ONLY
  172. INT
  173. WINAPI
  174. DirectXRegisterApplicationA(
  175. HWND hWnd,
  176. LPVOID lpDXRegApp
  177. );
  178. #endif //!UNICODE_ONLY
  179. #ifndef ANSI_ONLY
  180. INT
  181. WINAPI
  182. DirectXRegisterApplicationW(
  183. HWND hWnd,
  184. LPVOID lpDXRegApp
  185. );
  186. #endif //!ANSI_ONLY
  187. #ifdef UNICODE
  188. #define DirectXRegisterApplication DirectXRegisterApplicationW
  189. #else
  190. #define DirectXRegisterApplication DirectXRegisterApplicationA
  191. #endif // !UNICODE
  192. INT
  193. WINAPI
  194. DirectXUnRegisterApplication(
  195. HWND hWnd,
  196. LPGUID lpGUID
  197. );
  198. //
  199. // Function Pointers
  200. //
  201. #ifdef UNICODE
  202. typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD);
  203. typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
  204. #else
  205. typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD);
  206. typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
  207. #endif // UNICODE
  208. typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason,
  209. DWORD MsgType, /* Same as flags to MessageBox */
  210. LPSTR szMessage,
  211. LPSTR szName,
  212. void *pInfo);
  213. INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback);
  214. INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion);
  215. INT WINAPI DirectXSetupShowEULA(HWND hWndParent);
  216. #ifndef UNICODE_ONLY
  217. UINT
  218. WINAPI
  219. DirectXSetupGetEULAA(
  220. __out_ecount(cchEULA) LPSTR lpszEULA,
  221. UINT cchEULA,
  222. WORD LangID
  223. );
  224. #endif //!UNICODE_ONLY
  225. #ifndef ANSI_ONLY
  226. UINT
  227. WINAPI
  228. DirectXSetupGetEULAW(
  229. __out_ecount(cchEULA) LPWSTR lpszEULA,
  230. UINT cchEULA,
  231. WORD LangID
  232. );
  233. #endif //!ANSI_ONLY
  234. #ifdef UNICODE
  235. #define DirectXSetupGetEULA DirectXSetupGetEULAW
  236. typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPWSTR, UINT, WORD);
  237. #else
  238. #define DirectXSetupGetEULA DirectXSetupGetEULAA
  239. typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPSTR, UINT, WORD);
  240. #endif // !UNICODE
  241. #endif // WIN32
  242. #ifdef __cplusplus
  243. };
  244. #endif
  245. #endif