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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/windef16.h"
24 typedef UINT16 DI_FUNCTION16
;
25 typedef UINT16 HINF16
;
26 typedef UINT16 LOGDISKID16
;
31 /* error codes stuff */
33 typedef UINT16 RETERR16
;
35 #define IP_ERROR (UINT16)100
36 #define TP_ERROR (UINT16)200
37 #define VCP_ERROR (UINT16)300
38 #define GEN_ERROR (UINT16)400
39 #define DI_ERROR (UINT16)500
42 ERR_IP_INVALID_FILENAME
= IP_ERROR
+1,
44 ERR_IP_INVALID_SECT_NAME
,
45 ERR_IP_OUT_OF_HANDLES
,
47 ERR_IP_INVALID_INFFILE
,
50 ERR_IP_SECT_NOT_FOUND
,
51 ERR_IP_END_OF_SECTION
,
52 ERR_IP_PROFILE_NOT_FOUND
,
53 ERR_IP_LINE_NOT_FOUND
,
55 ERR_IP_TOOMANYINFFILES
,
56 ERR_IP_INVALID_SAVERESTORE
,
57 ERR_IP_INVALID_INFTYPE
60 /****** virtual copy operations ******/
62 typedef DWORD LPEXPANDVTBL
;
67 } VCPPROGRESS
, *LPVCPPROGRESS
;
73 VHSTR vhstrVolumeLabel
;
81 VCPPROGRESS prgFileRead
;
82 VCPPROGRESS prgByteRead
;
84 VCPPROGRESS prgFileWrite
;
85 VCPPROGRESS prgByteWrite
;
86 } VCPDISKINFO
, *LPVCPDISKINFO
;
92 } VCPFILESPEC
, *LPVCPFILESPEC
;
102 } VCPFATTR
, *LPVCPFATTR
;
108 } VCPFILESTAT
, *LPVCPFILESTAT
;
118 } VIRTNODEEX
, *LPVIRTNODEEX
;
126 LPEXPANDVTBL lpExpandVtbl
;
128 VHSTR vhstrDstFinalName
;
129 VCPFILESTAT vFileStat
;
130 } VIRTNODE
, *LPVIRTNODE
;
134 VCPPROGRESS prgDiskRead
;
135 VCPPROGRESS prgFileRead
;
136 VCPPROGRESS prgByteRead
;
138 VCPPROGRESS prgDiskWrite
;
139 VCPPROGRESS prgFileWrite
;
140 VCPPROGRESS prgByteWrite
;
142 LPVCPDISKINFO lpvdiIn
;
143 LPVCPDISKINFO lpvdiOut
;
145 } VCPSTATUS
, *LPVCPSTATUS
;
147 #define CNFL_BACKUP 0x0001
148 #define CNFL_DELETEONFAILURE 0x0002
149 #define CNFL_RENAMEONSUCCESS 0x0004
150 #define CNFL_CONTINUATION 0x0008
151 #define CNFL_SKIPPED 0x0010
152 #define CNFL_IGNOREERRORS 0x0020
153 #define CNFL_RETRYFILE 0x0040
154 #define CNFL_COPIED 0x0080
155 #define VNFL_UNIQUE 0x0000
156 #define VNFL_MULTIPLEOK 0x0100
157 #define VNFL_DESTROYOLD 0x0200
158 #define VNFL_COPY 0x0000
159 #define VNFL_DELETE 0x0800
160 #define VNFL_RENAME 0x1000
161 #define VNFL_NODE_TYPE (VNFL_RENAME|VNFL_DELETE|VNFL_COPY)
162 #define VNFL_CREATED 0x2000
163 #define VNFL_REJECTED 0x4000
164 #define VNFL_DEVICEINSTALLER 0x8000
167 ERR_VCP_IOFAIL
= VCP_ERROR
+1,
168 ERR_VCP_STRINGTOOLONG
,
187 ERR_VCP_LDDPATH_INVALID
,
190 ERR_VCP_NO_DIGITAL_SIGNATURE_CATALOG
,
191 ERR_VCP_NO_DIGITAL_SIGNATURE_FILE
195 #define VCPN_PROCEED 0
196 #define VCPN_ABORT -1
197 #define VCPN_RETRY -2
198 #define VCPN_IGNORE -3
200 #define VCPN_FORCE -5
201 #define VCPN_DEFER -6
203 #define VCPN_RETRYFILE -8
205 #define VCPFL_ABANDON 0x00
206 #define VCPFL_BACKUP 0x01
207 #define VCPFL_COPY 0x02
208 #define VCPFL_BACKUPANDCOPY (VCPFL_BACKUP|VCPFL_COPY)
209 #define VCPFL_INSPECIFIEDORDER 0x04
210 #define VCPFL_DELETE 0x08
211 #define VCPFL_RENAME 0x10
212 #define VCPFL_ALL (VCPFL_COPY|VCPFL_DELETE|VCPFL_RENAME)
214 #define CFNL_BACKUP 0x0001
215 #define CFNL_DELETEONFAILURE 0x0002
216 #define CFNL_RENAMEONSUCCESS 0x0004
217 #define CFNL_CONTINUATION 0x0008
218 #define CFNL_SKIPPED 0x0010
219 #define CFNL_IGNOREERRORS 0x0020
220 #define CFNL_RETRYFILE 0x0040
221 #define CFNL_COPIED 0x0080
222 #define VFNL_MULTIPLEOK 0x0100
223 #define VFNL_DESTROYOLD 0x0200
224 #define VFNL_NOW 0x0400
225 #define VFNL_COPY 0x0000
226 #define VFNL_DELETE 0x0800
227 #define VFNL_RENAME 0x1000
228 #define VFNL_CREATED 0x2000
229 #define VFNL_REJECTED 0x4000
230 #define VCPM_DISKCLASS 0x01
231 #define VCPM_DISKFIRST 0x0100
232 #define VCPM_DISKLAST 0x01ff
235 VCPM_DISKCREATEINFO
= VCPM_DISKFIRST
,
237 VCPM_DISKDESTROYINFO
,
241 VCPM_DISKFORMATBEGIN
,
246 #define VCPM_FILEINCLASS 0x02
247 #define VCPM_FILEOUTCLASS 0x03
248 #define VCPM_FILEFIRSTIN 0x0200
249 #define VCPM_FILEFIRSTOUT 0x0300
250 #define VCPM_FILELAST 0x03ff
253 VCPM_FILEOPENIN
= VCPM_FILEFIRSTIN
,
259 VCPM_FILEOPENOUT
= VCPM_FILEFIRSTOUT
,
267 #define VCPM_NODECLASS 0x04
268 #define VCPM_NODEFIRST 0x0400
269 #define VCPM_NODELAST 0x04ff
272 VCPM_NODECREATE
= VCPM_NODEFIRST
,
276 VCPM_NODECHANGEDESTDIR
,
280 #define VCPM_TALLYCLASS 0x05
281 #define VCPM_TALLYFIRST 0x0500
282 #define VCPM_TALLYLAST 0x05ff
285 VCPM_TALLYSTART
= VCPM_TALLYFIRST
,
291 #define VCPM_VERCLASS 0x06
292 #define VCPM_VERFIRST 0x0600
293 #define VCPM_VERLAST 0x06ff
296 VCPM_VERCHECK
= VCPM_VERFIRST
,
298 VCPM_VERRESOLVECONFLICT
301 #define VCPM_VSTATCLASS 0x07
302 #define VCPM_VSTATFIRST 0x0700
303 #define VCPM_VSTATLAST 0x07ff
306 VCPM_VSTATSTART
= VCPM_VSTATFIRST
,
311 VCPM_VSTATCLOSESTART
,
313 VCPM_VSTATBACKUPSTART
,
315 VCPM_VSTATRENAMESTART
,
319 VCPM_VSTATDELETESTART
,
321 VCPM_VSTATPATHCHECKSTART
,
322 VCPM_VSTATPATHCHECKEND
,
323 VCPM_VSTATCERTIFYSTART
,
324 VCPM_VSTATCERTIFYEND
,
329 #define VCPM_PATHCLASS 0x08
330 #define VCPM_PATHFIRST 0x0800
331 #define VCPM_PATHLAST 0x08ff
334 VCPM_BUILDPATH
= VCPM_PATHFIRST
,
339 #define VCPM_PATCHCLASS 0x09
340 #define VCPM_PATCHFIRST 0x0900
341 #define VCPM_PATCHLAST 0x09ff
344 VCPM_FILEPATCHBEFORECPY
= VCPM_PATCHFIRST
,
345 VCPM_FILEPATCHAFTERCPY
,
346 VCPM_FILEPATCHINFOPEN
,
347 VCPM_FILEPATCHINFCLOSE
350 #define VCPM_CERTCLASS 0x0a
351 #define VCPM_CERTFIRST 0x0a00
352 #define VCPM_CERTLAST 0x0aff
355 VCPM_FILECERTIFY
= VCPM_CERTFIRST
,
359 typedef LRESULT (CALLBACK
*VIFPROC
)(LPVOID lpvObj
, UINT16 uMsg
, WPARAM wParam
, LPARAM lParam
, LPARAM lparamRef
);
361 typedef int (CALLBACK
*VCPENUMPROC
)(LPVIRTNODE lpvn
, LPARAM lparamRef
);
363 RETERR16 WINAPI
VcpOpen16(VIFPROC vifproc
, LPARAM lparamMsgRef
);
365 /* VcpQueueCopy flags */
366 #define VNLP_SYSCRITICAL 0x0001
367 #define VNLP_SETUPCRITICAL 0x0002
368 #define VNLP_NOVERCHECK 0x0004
369 #define VNLP_FORCETEMP 0x0008
370 #define VNLP_IFEXISTS 0x0010
371 #define VNLP_KEEPNEWER 0x0020
372 #define VNLP_PATCHIFEXIST 0x0040
373 #define VNLP_NOPATCH 0x0080
374 #define VNLP_CATALOGCERT 0x0100
375 #define VNLP_NEEDCERTIFY 0x0200
376 #define VNLP_COPYIFEXISTS 0x0400
378 RETERR16 WINAPI
VcpQueueCopy16(
379 LPCSTR lpszSrcFileName
, LPCSTR lpszDstFileName
,
380 LPCSTR lpszSrcDir
, LPCSTR lpszDstDir
,
381 LOGDISKID16 ldidSrc
, LOGDISKID16 ldidDst
,
382 LPEXPANDVTBL lpExpandVtbl
,
383 WORD fl
, LPARAM lParam
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 typedef struct tagLDD_LIST
{
552 struct tagLDD_LIST
*next
;
555 #define INIT_LDD(ldd, LDID) \
557 memset(&(ldd), 0, sizeof(LOGDISKDESC_S)); \
558 (ldd).cbSize = sizeof(LOGDISKDESC_S); \
562 #endif /* __SETUPX16_H */