[SETUPLIB][REACTOS][USETUP] Further improve the interfacing with INF and File-Queue...
[reactos.git] / base / setup / lib / spapisup / fileqsup.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Setup Library
4 * FILE: base/setup/lib/fileqsup.h
5 * PURPOSE: Interfacing with Setup* API File Queue support functions
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10 #pragma once
11
12 #include "spapisup.h"
13
14 // FIXME: Temporary measure until all the users of this header
15 // (usetup...) use or define SetupAPI-conforming APIs.
16 #if defined(_SETUPAPI_H_) || defined(_INC_SETUPAPI)
17
18 #include <setupapi.h>
19
20 #else
21
22 #define SPFILENOTIFY_STARTQUEUE 0x00000001
23 #define SPFILENOTIFY_ENDQUEUE 0x00000002
24 #define SPFILENOTIFY_STARTSUBQUEUE 0x00000003
25 #define SPFILENOTIFY_ENDSUBQUEUE 0x00000004
26
27 #define SPFILENOTIFY_STARTDELETE 0x00000005
28 #define SPFILENOTIFY_ENDDELETE 0x00000006
29 #define SPFILENOTIFY_DELETEERROR 0x00000007
30
31 #define SPFILENOTIFY_STARTRENAME 0x00000008
32 #define SPFILENOTIFY_ENDRENAME 0x00000009
33 #define SPFILENOTIFY_RENAMEERROR 0x0000000a
34
35 #define SPFILENOTIFY_STARTCOPY 0x0000000b
36 #define SPFILENOTIFY_ENDCOPY 0x0000000c
37 #define SPFILENOTIFY_COPYERROR 0x0000000d
38
39 #define SPFILENOTIFY_NEEDMEDIA 0x0000000e
40 #define SPFILENOTIFY_QUEUESCAN 0x0000000f
41
42 #define FILEOP_COPY 0
43 #define FILEOP_RENAME 1
44 #define FILEOP_DELETE 2
45 #define FILEOP_BACKUP 3
46
47 #define FILEOP_ABORT 0
48 #define FILEOP_DOIT 1
49 #define FILEOP_SKIP 2
50 #define FILEOP_RETRY FILEOP_DOIT
51 #define FILEOP_NEWPATH 4
52
53
54 /* TYPES ********************************************************************/
55
56 typedef PVOID HSPFILEQ;
57
58 typedef struct _FILEPATHS_W
59 {
60 PCWSTR Target;
61 PCWSTR Source;
62 UINT Win32Error;
63 ULONG Flags;
64 } FILEPATHS_W, *PFILEPATHS_W;
65
66 typedef UINT (CALLBACK* PSP_FILE_CALLBACK_W)(
67 IN PVOID Context,
68 IN UINT Notification,
69 IN UINT_PTR Param1,
70 IN UINT_PTR Param2);
71
72 #endif
73
74
75 /* FUNCTIONS ****************************************************************/
76
77 // #define SetupOpenFileQueue
78 typedef HSPFILEQ
79 (WINAPI* pSpFileQueueOpen)(VOID);
80
81 extern pSpFileQueueOpen SpFileQueueOpen;
82
83 // #define SetupCloseFileQueue
84 typedef BOOL
85 (WINAPI* pSpFileQueueClose)(
86 IN HSPFILEQ QueueHandle);
87
88 extern pSpFileQueueClose SpFileQueueClose;
89
90 // #define SetupQueueCopyW
91 typedef BOOL
92 (WINAPI* pSpFileQueueCopy)(
93 IN HSPFILEQ QueueHandle,
94 IN PCWSTR SourceRootPath,
95 IN PCWSTR SourcePath OPTIONAL,
96 IN PCWSTR SourceFileName,
97 IN PCWSTR SourceDescription OPTIONAL,
98 IN PCWSTR SourceCabinet OPTIONAL,
99 IN PCWSTR SourceTagFile OPTIONAL,
100 IN PCWSTR TargetDirectory,
101 IN PCWSTR TargetFileName OPTIONAL,
102 IN ULONG CopyStyle);
103
104 extern pSpFileQueueCopy SpFileQueueCopy;
105
106 // #define SetupQueueDeleteW
107 typedef BOOL
108 (WINAPI* pSpFileQueueDelete)(
109 IN HSPFILEQ QueueHandle,
110 IN PCWSTR PathPart1,
111 IN PCWSTR PathPart2 OPTIONAL);
112
113 extern pSpFileQueueDelete SpFileQueueDelete;
114
115 // #define SetupQueueRenameW
116 typedef BOOL
117 (WINAPI* pSpFileQueueRename)(
118 IN HSPFILEQ QueueHandle,
119 IN PCWSTR SourcePath,
120 IN PCWSTR SourceFileName OPTIONAL,
121 IN PCWSTR TargetPath OPTIONAL,
122 IN PCWSTR TargetFileName);
123
124 extern pSpFileQueueRename SpFileQueueRename;
125
126 // #define SetupCommitFileQueueW
127 typedef BOOL
128 (WINAPI* pSpFileQueueCommit)(
129 IN HWND Owner,
130 IN HSPFILEQ QueueHandle,
131 IN PSP_FILE_CALLBACK_W MsgHandler,
132 IN PVOID Context OPTIONAL);
133
134 extern pSpFileQueueCommit SpFileQueueCommit;
135
136 /* EOF */