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