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