xref: /reactos/base/setup/lib/spapisup/fileqsup.h (revision d7c1d220)
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 // #define SetupCloseFileQueue
82 typedef BOOL
83 (WINAPI* pSpFileQueueClose)(
84     IN HSPFILEQ QueueHandle);
85 
86 // #define SetupQueueCopyW
87 typedef BOOL
88 (WINAPI* pSpFileQueueCopy)(
89     IN HSPFILEQ QueueHandle,
90     IN PCWSTR SourceRootPath,
91     IN PCWSTR SourcePath OPTIONAL,
92     IN PCWSTR SourceFileName,
93     IN PCWSTR SourceDescription OPTIONAL,
94     IN PCWSTR SourceCabinet OPTIONAL,
95     IN PCWSTR SourceTagFile OPTIONAL,
96     IN PCWSTR TargetDirectory,
97     IN PCWSTR TargetFileName OPTIONAL,
98     IN ULONG CopyStyle);
99 
100 // #define SetupQueueDeleteW
101 typedef BOOL
102 (WINAPI* pSpFileQueueDelete)(
103     IN HSPFILEQ QueueHandle,
104     IN PCWSTR PathPart1,
105     IN PCWSTR PathPart2 OPTIONAL);
106 
107 // #define SetupQueueRenameW
108 typedef BOOL
109 (WINAPI* pSpFileQueueRename)(
110     IN HSPFILEQ QueueHandle,
111     IN PCWSTR SourcePath,
112     IN PCWSTR SourceFileName OPTIONAL,
113     IN PCWSTR TargetPath OPTIONAL,
114     IN PCWSTR TargetFileName);
115 
116 // #define SetupCommitFileQueueW
117 typedef BOOL
118 (WINAPI* pSpFileQueueCommit)(
119     IN HWND Owner,
120     IN HSPFILEQ QueueHandle,
121     IN PSP_FILE_CALLBACK_W MsgHandler,
122     IN PVOID Context OPTIONAL);
123 
124 typedef struct _SPFILE_EXPORTS
125 {
126     pSpFileQueueOpen   SpFileQueueOpen;
127     pSpFileQueueClose  SpFileQueueClose;
128     pSpFileQueueCopy   SpFileQueueCopy;
129     pSpFileQueueDelete SpFileQueueDelete;
130     pSpFileQueueRename SpFileQueueRename;
131     pSpFileQueueCommit SpFileQueueCommit;
132 } SPFILE_EXPORTS, *PSPFILE_EXPORTS;
133 
134 extern /*SPLIBAPI*/ SPFILE_EXPORTS SpFileExports;
135 
136 #define SpFileQueueOpen     (SpFileExports.SpFileQueueOpen)
137 #define SpFileQueueClose    (SpFileExports.SpFileQueueClose)
138 #define SpFileQueueCopy     (SpFileExports.SpFileQueueCopy)
139 #define SpFileQueueDelete   (SpFileExports.SpFileQueueDelete)
140 #define SpFileQueueRename   (SpFileExports.SpFileQueueRename)
141 #define SpFileQueueCommit   (SpFileExports.SpFileQueueCommit)
142 
143 /* EOF */
144