1 /*==========================================================================
3 * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
6 * Content: DirectXSetup, error codes and flags
7 ***************************************************************************/
12 #include <windows.h> // windows stuff
15 #define COM_NO_WINDOWS_H
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
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 */
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 */
66 //******************************************************************
67 // DirectX Setup Callback mechanism
68 //******************************************************************
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
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
97 #define DSETUP_CB_UPGRADE_HASWARNINGS 0x0100
98 #define DSETUP_CB_UPGRADE_CANTBACKUP 0x0200
100 #define DSETUP_CB_UPGRADE_DEVICE_ACTIVE 0x0800
102 #define DSETUP_CB_UPGRADE_DEVICE_DISPLAY 0x1000
103 #define DSETUP_CB_UPGRADE_DEVICE_MEDIA 0x2000
106 typedef struct _DSETUP_CB_UPGRADEINFO
109 } DSETUP_CB_UPGRADEINFO;
111 typedef struct _DSETUP_CB_FILECOPYERROR
114 } DSETUP_CB_FILECOPYERROR;
122 typedef struct _DIRECTXREGISTERAPPA {
125 LPSTR lpszApplicationName;
128 LPSTR lpszCommandLine;
130 LPSTR lpszCurrentDirectory;
131 } DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA;
132 #endif //!UNICODE_ONLY
134 typedef struct _DIRECTXREGISTERAPPW {
137 LPWSTR lpszApplicationName;
140 LPWSTR lpszCommandLine;
142 LPWSTR lpszCurrentDirectory;
143 } DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW;
146 typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP;
147 typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP;
148 typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP;
150 typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP;
151 typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP;
152 typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP;
167 #endif //!UNICODE_ONLY
178 #define DirectXSetup DirectXSetupW
180 #define DirectXSetup DirectXSetupA
186 DirectXDeviceDriverSetupA(
188 LPSTR lpszDriverClass,
189 LPSTR lpszDriverPath,
192 #endif //!UNICODE_ONLY
196 DirectXDeviceDriverSetupW(
198 LPWSTR lpszDriverClass,
199 LPWSTR lpszDriverPath,
204 #define DirectXDeviceDriverSetup DirectXDeviceDriverSetupW
206 #define DirectXDeviceDriverSetup DirectXDeviceDriverSetupA
212 DirectXRegisterApplicationA(
214 LPDIRECTXREGISTERAPPA lpDXRegApp
216 #endif //!UNICODE_ONLY
220 DirectXRegisterApplicationW(
222 LPDIRECTXREGISTERAPPW lpDXRegApp
226 #define DirectXRegisterApplication DirectXRegisterApplicationW
228 #define DirectXRegisterApplication DirectXRegisterApplicationA
233 DirectXUnRegisterApplication(
242 typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD);
243 typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPWSTR, LPSTR, DWORD);
244 typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPDIRECTXREGISTERAPPW);
246 typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD);
247 typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPSTR, LPSTR, DWORD);
248 typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPDIRECTXREGISTERAPPA);
251 typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason,
252 DWORD MsgType, /* Same as flags to MessageBox */
257 INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback);
258 INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion);