2 * Copyright 2000 Andreas Mohr for Codeweavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "wine/windef16.h"
24 typedef UINT16 HINF16
;
25 typedef UINT16 LOGDISKID16
;
30 /* error codes stuff */
32 typedef UINT16 RETERR16
;
34 #define IP_ERROR (UINT16)100
35 #define TP_ERROR (UINT16)200
36 #define VCP_ERROR (UINT16)300
37 #define GEN_ERROR (UINT16)400
38 #define DI_ERROR (UINT16)500
41 ERR_IP_INVALID_FILENAME
= IP_ERROR
+1,
43 ERR_IP_INVALID_SECT_NAME
,
44 ERR_IP_OUT_OF_HANDLES
,
46 ERR_IP_INVALID_INFFILE
,
49 ERR_IP_SECT_NOT_FOUND
,
50 ERR_IP_END_OF_SECTION
,
51 ERR_IP_PROFILE_NOT_FOUND
,
52 ERR_IP_LINE_NOT_FOUND
,
54 ERR_IP_TOOMANYINFFILES
,
55 ERR_IP_INVALID_SAVERESTORE
,
56 ERR_IP_INVALID_INFTYPE
59 /****** virtual copy operations ******/
61 typedef DWORD LPEXPANDVTBL
;
66 } VCPPROGRESS
, *LPVCPPROGRESS
;
72 VHSTR vhstrVolumeLabel
;
80 VCPPROGRESS prgFileRead
;
81 VCPPROGRESS prgByteRead
;
83 VCPPROGRESS prgFileWrite
;
84 VCPPROGRESS prgByteWrite
;
85 } VCPDISKINFO
, *LPVCPDISKINFO
;
91 } VCPFILESPEC
, *LPVCPFILESPEC
;
101 } VCPFATTR
, *LPVCPFATTR
;
107 } VCPFILESTAT
, *LPVCPFILESTAT
;
117 } VIRTNODEEX
, *LPVIRTNODEEX
;
125 LPEXPANDVTBL lpExpandVtbl
;
127 VHSTR vhstrDstFinalName
;
128 VCPFILESTAT vFileStat
;
129 } VIRTNODE
, *LPVIRTNODE
;
133 VCPPROGRESS prgDiskRead
;
134 VCPPROGRESS prgFileRead
;
135 VCPPROGRESS prgByteRead
;
137 VCPPROGRESS prgDiskWrite
;
138 VCPPROGRESS prgFileWrite
;
139 VCPPROGRESS prgByteWrite
;
141 LPVCPDISKINFO lpvdiIn
;
142 LPVCPDISKINFO lpvdiOut
;
144 } VCPSTATUS
, *LPVCPSTATUS
;
146 #define CNFL_BACKUP 0x0001
147 #define CNFL_DELETEONFAILURE 0x0002
148 #define CNFL_RENAMEONSUCCESS 0x0004
149 #define CNFL_CONTINUATION 0x0008
150 #define CNFL_SKIPPED 0x0010
151 #define CNFL_IGNOREERRORS 0x0020
152 #define CNFL_RETRYFILE 0x0040
153 #define CNFL_COPIED 0x0080
154 #define VNFL_UNIQUE 0x0000
155 #define VNFL_MULTIPLEOK 0x0100
156 #define VNFL_DESTROYOLD 0x0200
157 #define VNFL_COPY 0x0000
158 #define VNFL_DELETE 0x0800
159 #define VNFL_RENAME 0x1000
160 #define VNFL_NODE_TYPE (VNFL_RENAME|VNFL_DELETE|VNFL_COPY)
161 #define VNFL_CREATED 0x2000
162 #define VNFL_REJECTED 0x4000
163 #define VNFL_DEVICEINSTALLER 0x8000
166 ERR_VCP_IOFAIL
= VCP_ERROR
+1,
167 ERR_VCP_STRINGTOOLONG
,
186 ERR_VCP_LDDPATH_INVALID
,
189 ERR_VCP_NO_DIGITAL_SIGNATURE_CATALOG
,
190 ERR_VCP_NO_DIGITAL_SIGNATURE_FILE
194 #define VCPN_PROCEED 0
195 #define VCPN_ABORT -1
196 #define VCPN_RETRY -2
197 #define VCPN_IGNORE -3
199 #define VCPN_FORCE -5
200 #define VCPN_DEFER -6
202 #define VCPN_RETRYFILE -8
204 #define VCPFL_ABANDON 0x00
205 #define VCPFL_BACKUP 0x01
206 #define VCPFL_COPY 0x02
207 #define VCPFL_BACKUPANDCOPY (VCPFL_BACKUP|VCPFL_COPY)
208 #define VCPFL_INSPECIFIEDORDER 0x04
209 #define VCPFL_DELETE 0x08
210 #define VCPFL_RENAME 0x10
211 #define VCPFL_ALL (VCPFL_COPY|VCPFL_DELETE|VCPFL_RENAME)
213 #define CFNL_BACKUP 0x0001
214 #define CFNL_DELETEONFAILURE 0x0002
215 #define CFNL_RENAMEONSUCCESS 0x0004
216 #define CFNL_CONTINUATION 0x0008
217 #define CFNL_SKIPPED 0x0010
218 #define CFNL_IGNOREERRORS 0x0020
219 #define CFNL_RETRYFILE 0x0040
220 #define CFNL_COPIED 0x0080
221 #define VFNL_MULTIPLEOK 0x0100
222 #define VFNL_DESTROYOLD 0x0200
223 #define VFNL_NOW 0x0400
224 #define VFNL_COPY 0x0000
225 #define VFNL_DELETE 0x0800
226 #define VFNL_RENAME 0x1000
227 #define VFNL_CREATED 0x2000
228 #define VFNL_REJECTED 0x4000
229 #define VCPM_DISKCLASS 0x01
230 #define VCPM_DISKFIRST 0x0100
231 #define VCPM_DISKLAST 0x01ff
234 VCPM_DISKCREATEINFO
= VCPM_DISKFIRST
,
236 VCPM_DISKDESTROYINFO
,
240 VCPM_DISKFORMATBEGIN
,
245 #define VCPM_FILEINCLASS 0x02
246 #define VCPM_FILEOUTCLASS 0x03
247 #define VCPM_FILEFIRSTIN 0x0200
248 #define VCPM_FILEFIRSTOUT 0x0300
249 #define VCPM_FILELAST 0x03ff
252 VCPM_FILEOPENIN
= VCPM_FILEFIRSTIN
,
258 VCPM_FILEOPENOUT
= VCPM_FILEFIRSTOUT
,
266 #define VCPM_NODECLASS 0x04
267 #define VCPM_NODEFIRST 0x0400
268 #define VCPM_NODELAST 0x04ff
271 VCPM_NODECREATE
= VCPM_NODEFIRST
,
275 VCPM_NODECHANGEDESTDIR
,
279 #define VCPM_TALLYCLASS 0x05
280 #define VCPM_TALLYFIRST 0x0500
281 #define VCPM_TALLYLAST 0x05ff
284 VCPM_TALLYSTART
= VCPM_TALLYFIRST
,
290 #define VCPM_VERCLASS 0x06
291 #define VCPM_VERFIRST 0x0600
292 #define VCPM_VERLAST 0x06ff
295 VCPM_VERCHECK
= VCPM_VERFIRST
,
297 VCPM_VERRESOLVECONFLICT
300 #define VCPM_VSTATCLASS 0x07
301 #define VCPM_VSTATFIRST 0x0700
302 #define VCPM_VSTATLAST 0x07ff
305 VCPM_VSTATSTART
= VCPM_VSTATFIRST
,
310 VCPM_VSTATCLOSESTART
,
312 VCPM_VSTATBACKUPSTART
,
314 VCPM_VSTATRENAMESTART
,
318 VCPM_VSTATDELETESTART
,
320 VCPM_VSTATPATHCHECKSTART
,
321 VCPM_VSTATPATHCHECKEND
,
322 VCPM_VSTATCERTIFYSTART
,
323 VCPM_VSTATCERTIFYEND
,
328 #define VCPM_PATHCLASS 0x08
329 #define VCPM_PATHFIRST 0x0800
330 #define VCPM_PATHLAST 0x08ff
333 VCPM_BUILDPATH
= VCPM_PATHFIRST
,
338 #define VCPM_PATCHCLASS 0x09
339 #define VCPM_PATCHFIRST 0x0900
340 #define VCPM_PATCHLAST 0x09ff
343 VCPM_FILEPATCHBEFORECPY
= VCPM_PATCHFIRST
,
344 VCPM_FILEPATCHAFTERCPY
,
345 VCPM_FILEPATCHINFOPEN
,
346 VCPM_FILEPATCHINFCLOSE
349 #define VCPM_CERTCLASS 0x0a
350 #define VCPM_CERTFIRST 0x0a00
351 #define VCPM_CERTLAST 0x0aff
354 VCPM_FILECERTIFY
= VCPM_CERTFIRST
,
358 typedef LRESULT (CALLBACK
*VIFPROC
)(LPVOID lpvObj
, UINT16 uMsg
, WPARAM wParam
, LPARAM lParam
, LPARAM lparamRef
);
360 typedef int (CALLBACK
*VCPENUMPROC
)(LPVIRTNODE lpvn
, LPARAM lparamRef
);
362 RETERR16 WINAPI
VcpOpen16(VIFPROC vifproc
, LPARAM lparamMsgRef
);
364 /* VcpQueueCopy flags */
365 #define VNLP_SYSCRITICAL 0x0001
366 #define VNLP_SETUPCRITICAL 0x0002
367 #define VNLP_NOVERCHECK 0x0004
368 #define VNLP_FORCETEMP 0x0008
369 #define VNLP_IFEXISTS 0x0010
370 #define VNLP_KEEPNEWER 0x0020
371 #define VNLP_PATCHIFEXIST 0x0040
372 #define VNLP_NOPATCH 0x0080
373 #define VNLP_CATALOGCERT 0x0100
374 #define VNLP_NEEDCERTIFY 0x0200
375 #define VNLP_COPYIFEXISTS 0x0400
377 RETERR16 WINAPI
VcpQueueCopy16(
378 LPCSTR lpszSrcFileName
, LPCSTR lpszDstFileName
,
379 LPCSTR lpszSrcDir
, LPCSTR lpszDstDir
,
380 LOGDISKID16 ldidSrc
, LOGDISKID16 ldidDst
,
381 LPEXPANDVTBL lpExpandVtbl
,
382 WORD fl
, LPARAM lParam
384 RETERR16
VcpFlush16(WORD fl
, LPCSTR lpszBackupDest
);
385 RETERR16 WINAPI
VcpClose16(WORD fl
, LPCSTR lpszBackupDest
);
387 /* VcpExplain flags */
395 VCPEX_DST_FILE_FINAL
,
404 LPCSTR WINAPI
VcpExplain16(LPVIRTNODE lpVn
, DWORD dwWhat
);
406 /****** logical disk management ******/
408 typedef struct _LOGDISKDESC_S
{ /* ldd */
409 WORD cbSize
; /* struct size */
410 LOGDISKID16 ldid
; /* logical disk ID */
411 LPSTR pszPath
; /* path this descriptor points to */
412 LPSTR pszVolLabel
; /* volume label of the disk related to it */
413 LPSTR pszDiskName
; /* name of this disk */
414 WORD wVolTime
; /* modification time of volume label */
415 WORD wVolDate
; /* modification date */
416 DWORD dwSerNum
; /* serial number of disk */
418 } LOGDISKDESC_S
, *LPLOGDISKDESC
;
420 /** logical disk identifiers (LDID) **/
422 /* predefined LDIDs */
423 #define LDID_PREDEF_START 0x0001
424 #define LDID_PREDEF_END 0x7fff
426 /* registry-assigned LDIDs */
427 #define LDID_VAR_START 0x7000
428 #define LDID_VAR_END 0x7fff
430 /* dynamically assigned LDIDs */
431 #define LDID_ASSIGN_START 0x8000
432 #define LDID_ASSIGN_END 0xbfff
435 #define LDID_ABSOLUTE ((UINT)-1)
436 #define LDID_SRCPATH 1 /* setup source path */
437 #define LDID_SETUPTEMP 2 /* setup temp dir */
438 #define LDID_UNINSTALL 3 /* uninstall dir */
439 #define LDID_BACKUP 4 /* backup dir */
440 #define LDID_SETUPSCRATCH 5 /* setup scratch dir */
441 #define LDID_WIN 10 /* win dir */
442 #define LDID_SYS 11 /* win system dir */
443 #define LDID_IOS 12 /* win Iosubsys dir */
444 #define LDID_CMD 13 /* win command dir */
445 #define LDID_CPL 14 /* win control panel dir */
446 #define LDID_PRINT 15 /* win printer dir */
447 #define LDID_MAIL 16 /* win mail dir */
448 #define LDID_INF 17 /* win inf dir */
449 #define LDID_HELP 18 /* win help dir */
450 #define LDID_WINADMIN 19 /* admin dir */
451 #define LDID_FONTS 20 /* win fonts dir */
452 #define LDID_VIEWERS 21 /* win viewers dir */
453 #define LDID_VMM32 22 /* win VMM32 dir */
454 #define LDID_COLOR 23 /* win color mngment dir */
455 #define LDID_APPS 24 /* win apps dir */
456 #define LDID_SHARED 25 /* win shared dir */
457 #define LDID_WINBOOT 26 /* guaranteed win boot drive */
458 #define LDID_MACHINE 27 /* machine specific files */
459 #define LDID_HOST_WINBOOT 28
460 #define LDID_BOOT 30 /* boot drive root dir */
461 #define LDID_BOOT_HOST 31 /* boot drive host root dir */
462 #define LDID_OLD_WINBOOT 32 /* root subdir */
463 #define LDID_OLD_WIN 33 /* old windows dir */
465 /* flags for GenInstall() */
466 #define GENINSTALL_DO_FILES 1
467 #define GENINSTALL_DO_INI 2
468 #define GENINSTALL_DO_REG 4
469 #define GENINSTALL_DO_INI2REG 8
470 #define GENINSTALL_DO_CFGAUTO 16
471 #define GENINSTALL_DO_LOGCONFIG 32
472 #define GENINSTALL_DO_REGSRCPATH 64
473 #define GENINSTALL_DO_PERUSER 128
475 #define GEINISTALL_DO_INIREG 14
476 #define GENINSTALL_DO_ALL 255
479 * flags for InstallHinfSection()
480 * 128 can be added, too. This means that the .inf file is provided by you
481 * instead of being a 32 bit file (i.e. Windows .inf file).
482 * In this case all files you install must be in the same dir
483 * as your .inf file on the install disk.
485 #define HOW_NEVER_REBOOT 0
486 #define HOW_ALWAYS_SILENT_REBOOT 1
487 #define HOW_ALWAYS_PROMPT_REBOOT 2
488 #define HOW_SILENT_REBOOT 3
489 #define HOW_PROMPT_REBOOT 4
491 /****** device installation stuff ******/
493 #define MAX_CLASS_NAME_LEN 32
494 #define MAX_DEVNODE_ID_LEN 256
495 #define MAX_GUID_STR 50
497 typedef struct _DEVICE_INFO
500 struct _DEVICE_INFO
*lpNextDi
;
501 char szDescription
[LINE_LEN
];
504 char szRegSubkey
[MAX_DEVNODE_ID_LEN
];
505 char szClassName
[MAX_CLASS_NAME_LEN
];
508 /*LPDRIVER_NODE*/ LPVOID lpCompatDrvList
;
509 /*LPDRIVER_NODE*/ LPVOID lpClassDrvList
;
510 /*LPDRIVER_NODE*/ LPVOID lpSelectedDriver
;
513 HINSTANCE16 hinstClassInstaller
;
514 HINSTANCE16 hinstClassPropProvidor
;
515 HINSTANCE16 hinstDevicePropProvidor
;
516 HINSTANCE16 hinstBasicPropProvidor
;
517 FARPROC16 fpClassInstaller
;
518 FARPROC16 fpClassEnumPropPages
;
519 FARPROC16 fpDeviceEnumPropPages
;
520 FARPROC16 fpEnumBasicProperties
;
521 DWORD dwSetupReserved
;
522 DWORD dwClassInstallReserved
;
523 /*GENCALLBACKPROC*/ LPVOID gicpGenInstallCallBack
;
528 HINSTANCE16 hinstPrivateProblemHandler
;
529 FARPROC16 fpPrivateProblemHandler
;
530 LPARAM lpClassInstallParams
;
531 struct _DEVICE_INFO
*lpdiChildList
;
533 /*LPDRIVER_INFO*/ LPVOID lpCompatDrvInfoList
;
534 /*LPDRIVER_INFO*/ LPVOID lpClassDrvInfoList
;
535 char szClassGUID
[MAX_GUID_STR
];
536 } DEVICE_INFO16
, *LPDEVICE_INFO16
, **LPLPDEVICE_INFO16
;
539 extern void WINAPI
GenFormStrWithoutPlaceHolders16(LPSTR
,LPCSTR
,HINF16
);
540 extern RETERR16 WINAPI
IpOpen16(LPCSTR
,HINF16
*);
541 extern RETERR16 WINAPI
IpClose16(HINF16
);
542 extern RETERR16 WINAPI
CtlSetLdd16(LPLOGDISKDESC
);
543 extern RETERR16 WINAPI
CtlGetLdd16(LPLOGDISKDESC
);
544 extern RETERR16 WINAPI
CtlFindLdd16(LPLOGDISKDESC
);
545 extern RETERR16 WINAPI
CtlAddLdd16(LPLOGDISKDESC
);
546 extern RETERR16 WINAPI
CtlDelLdd16(LOGDISKID16
);
547 extern RETERR16 WINAPI
CtlGetLddPath16(LOGDISKID16 ldid
, LPSTR szPath
);
548 extern RETERR16 WINAPI
GenInstall16(HINF16
,LPCSTR
,WORD
);
550 #endif /* __SETUPX16_H */