home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / dsetup.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  9KB  |  268 lines

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