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.

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