[USETUP] Improvements for the File-queues code.
[reactos.git] / base / setup / usetup / filequeue.h
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2002 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 /*
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS text-mode setup
22 * FILE: base/setup/usetup/filequeue.h
23 * PURPOSE: File queue functions
24 * PROGRAMMER:
25 */
26
27 #pragma once
28
29 #define SPFILENOTIFY_STARTQUEUE 0x00000001
30 #define SPFILENOTIFY_ENDQUEUE 0x00000002
31 #define SPFILENOTIFY_STARTSUBQUEUE 0x00000003
32 #define SPFILENOTIFY_ENDSUBQUEUE 0x00000004
33
34 #define SPFILENOTIFY_STARTDELETE 0x00000005
35 #define SPFILENOTIFY_ENDDELETE 0x00000006
36 #define SPFILENOTIFY_DELETEERROR 0x00000007
37
38 #define SPFILENOTIFY_STARTRENAME 0x00000008
39 #define SPFILENOTIFY_ENDRENAME 0x00000009
40 #define SPFILENOTIFY_RENAMEERROR 0x0000000a
41
42 #define SPFILENOTIFY_STARTCOPY 0x0000000b
43 #define SPFILENOTIFY_ENDCOPY 0x0000000c
44 #define SPFILENOTIFY_COPYERROR 0x0000000d
45
46 #define SPFILENOTIFY_NEEDMEDIA 0x0000000e
47 #define SPFILENOTIFY_QUEUESCAN 0x0000000f
48
49 #define FILEOP_COPY 0
50 #define FILEOP_RENAME 1
51 #define FILEOP_DELETE 2
52 #define FILEOP_BACKUP 3
53
54 #define FILEOP_ABORT 0
55 #define FILEOP_DOIT 1
56 #define FILEOP_SKIP 2
57 #define FILEOP_RETRY FILEOP_DOIT
58 #define FILEOP_NEWPATH 4
59
60
61 /* TYPES ********************************************************************/
62
63 typedef PVOID HSPFILEQ;
64
65 typedef struct _FILEPATHS_W
66 {
67 PCWSTR Target;
68 PCWSTR Source;
69 UINT Win32Error;
70 ULONG Flags;
71 } FILEPATHS_W, *PFILEPATHS_W;
72
73 typedef UINT (CALLBACK* PSP_FILE_CALLBACK_W)(
74 IN PVOID Context,
75 IN UINT Notification,
76 IN UINT_PTR Param1,
77 IN UINT_PTR Param2);
78
79
80 /* FUNCTIONS ****************************************************************/
81
82 HSPFILEQ
83 WINAPI
84 SetupOpenFileQueue(VOID);
85
86 VOID
87 WINAPI
88 SetupCloseFileQueue(
89 IN HSPFILEQ QueueHandle);
90
91 #if 0 // This is the API that is declared in setupapi.h and exported by setupapi.dll
92 BOOL
93 WINAPI
94 SetupQueueCopyWNew(
95 IN HSPFILEQ QueueHandle,
96 IN PCWSTR SourceRootPath,
97 IN PCWSTR SourcePath,
98 IN PCWSTR SourceFileName,
99 IN PCWSTR SourceDescription,
100 IN PCWSTR SourceTagFile,
101 IN PCWSTR TargetDirectory,
102 IN PCWSTR TargetFileName,
103 IN DWORD CopyStyle);
104 #endif
105
106 /* A simplified version of SetupQueueCopyW that wraps Cabinet support around */
107 BOOL
108 WINAPI
109 SetupQueueCopyWithCab( // SetupQueueCopyW
110 IN HSPFILEQ QueueHandle,
111 IN PCWSTR SourceCabinet OPTIONAL,
112 IN PCWSTR SourceRootPath,
113 IN PCWSTR SourcePath OPTIONAL,
114 IN PCWSTR SourceFileName,
115 IN PCWSTR TargetDirectory,
116 IN PCWSTR TargetFileName OPTIONAL);
117
118 BOOL
119 WINAPI
120 SetupQueueDeleteW(
121 IN HSPFILEQ QueueHandle,
122 IN PCWSTR PathPart1,
123 IN PCWSTR PathPart2 OPTIONAL);
124
125 BOOL
126 WINAPI
127 SetupQueueRenameW(
128 IN HSPFILEQ QueueHandle,
129 IN PCWSTR SourcePath,
130 IN PCWSTR SourceFileName OPTIONAL,
131 IN PCWSTR TargetPath OPTIONAL,
132 IN PCWSTR TargetFileName);
133
134 BOOL
135 WINAPI
136 SetupCommitFileQueueW(
137 IN HWND Owner,
138 IN HSPFILEQ QueueHandle,
139 IN PSP_FILE_CALLBACK_W MsgHandler,
140 IN PVOID Context OPTIONAL);
141
142 /* EOF */