ReactOS  0.4.15-dev-1647-g91fceab
fileqsup.c File Reference
#include "reactos.h"
#include <debug.h>
Include dependency graph for fileqsup.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

BOOL WINAPI SpFileQueueCopy_NtToWin32 (IN HSPFILEQ QueueHandle, IN PCWSTR SourceRootPath, IN PCWSTR SourcePath OPTIONAL, IN PCWSTR SourceFileName, IN PCWSTR SourceDescription OPTIONAL, IN PCWSTR SourceCabinet OPTIONAL, IN PCWSTR SourceTagFile OPTIONAL, IN PCWSTR TargetDirectory, IN PCWSTR TargetFileName OPTIONAL, IN ULONG CopyStyle)
 
BOOL WINAPI SpFileQueueDelete_NtToWin32 (IN HSPFILEQ QueueHandle, IN PCWSTR PathPart1, IN PCWSTR PathPart2 OPTIONAL)
 
BOOL WINAPI SpFileQueueRename_NtToWin32 (IN HSPFILEQ QueueHandle, IN PCWSTR SourcePath, IN PCWSTR SourceFileName OPTIONAL, IN PCWSTR TargetPath OPTIONAL, IN PCWSTR TargetFileName)
 

Variables

pSpFileQueueOpen SpFileQueueOpen = SetupOpenFileQueue
 
pSpFileQueueClose SpFileQueueClose = SetupCloseFileQueue
 
pSpFileQueueCopy SpFileQueueCopy = SpFileQueueCopy_NtToWin32
 
pSpFileQueueDelete SpFileQueueDelete = SpFileQueueDelete_NtToWin32
 
pSpFileQueueRename SpFileQueueRename = SpFileQueueRename_NtToWin32
 
pSpFileQueueCommit SpFileQueueCommit = SetupCommitFileQueueW
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file fileqsup.c.

Function Documentation

◆ SpFileQueueCopy_NtToWin32()

BOOL WINAPI SpFileQueueCopy_NtToWin32 ( IN HSPFILEQ  QueueHandle,
IN PCWSTR  SourceRootPath,
IN PCWSTR SourcePath  OPTIONAL,
IN PCWSTR  SourceFileName,
IN PCWSTR SourceDescription  OPTIONAL,
IN PCWSTR SourceCabinet  OPTIONAL,
IN PCWSTR SourceTagFile  OPTIONAL,
IN PCWSTR  TargetDirectory,
IN PCWSTR TargetFileName  OPTIONAL,
IN ULONG  CopyStyle 
)

Definition at line 21 of file fileqsup.c.

32 {
33  WCHAR Win32SourceRootPath[MAX_PATH];
34  WCHAR Win32TargetDirectory[MAX_PATH];
35 
36  /*
37  * SpFileQueueCopy is called within setuplib with NT paths, however
38  * the Win32 SetupQueueCopyW API only takes Win32 paths. We therefore
39  * map the NT path to Win32 path and then call the Win32 API.
40  */
42  Win32SourceRootPath,
43  _countof(Win32SourceRootPath),
44  SourceRootPath))
45  {
46  return FALSE;
47  }
48  /* SourcePath, SourceFileName and SourceCabinet are appended to SourceRootPath by the SetupApi function */
49 
51  Win32TargetDirectory,
52  _countof(Win32TargetDirectory),
53  TargetDirectory))
54  {
55  return FALSE;
56  }
57  /* TargetFileName is appended to TargetDirectory by the SetupApi function */
58 
59  /*
60  * Use the undocumented way of copying files from within a given cabinet file
61  * *ONLY IF* the files do not already exist in the same directory where
62  * the cabinet file resides!!
63  */
64  return SetupQueueCopyW(QueueHandle,
65  Win32SourceRootPath,
66  SourcePath,
67  SourceFileName,
68  // Undocumented on MSDN is the fact that this parameter is mandatory *IF* one wants to take the TagFile into account!
69  L"ReactOS",
70  // SourceTagFile -- Special behaviour: use cabinet file present in ArchiveDir path! The API does not check for a ".cab" extension.
71  SourceCabinet,
72  Win32TargetDirectory,
73  TargetFileName,
74  // We choose to decompress the archive, so do NOT specify SP_COPY_NODECOMP !
75  SP_COPY_NOOVERWRITE /* | SP_COPY_SOURCE_ABSOLUTE | SP_COPY_SOURCEPATH_ABSOLUTE */
76  );
77 }
BOOL WINAPI SetupQueueCopyW(HSPFILEQ queue, PCWSTR src_root, PCWSTR src_path, PCWSTR src_file, PCWSTR src_descr, PCWSTR src_tag, PCWSTR dst_dir, PCWSTR dst_file, DWORD style)
Definition: queue.c:622
#define FALSE
Definition: types.h:117
BOOL ConvertNtPathToWin32Path(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: reactos.c:1498
#define SP_COPY_NOOVERWRITE
Definition: setupapi.h:475
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:126
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
SETUPDATA SetupData
Definition: reactos.c:41
static const WCHAR L[]
Definition: oid.c:1250

◆ SpFileQueueDelete_NtToWin32()

BOOL WINAPI SpFileQueueDelete_NtToWin32 ( IN HSPFILEQ  QueueHandle,
IN PCWSTR  PathPart1,
IN PCWSTR PathPart2  OPTIONAL 
)

Definition at line 81 of file fileqsup.c.

85 {
86  WCHAR Win32PathPart1[MAX_PATH];
87 
88  /*
89  * SpFileQueueDelete is called within setuplib with NT paths, however
90  * the Win32 SetupQueueDeleteW API only takes Win32 paths. We therefore
91  * map the NT path to Win32 path and then call the Win32 API.
92  */
94  Win32PathPart1,
95  _countof(Win32PathPart1),
96  PathPart1))
97  {
98  return FALSE;
99  }
100  /* PathPart2 is appended to PathPart1 by the SetupApi function */
101 
102  return SetupQueueDeleteW(QueueHandle, Win32PathPart1, PathPart2);
103 }
#define FALSE
Definition: types.h:117
BOOL ConvertNtPathToWin32Path(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: reactos.c:1498
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:126
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI SetupQueueDeleteW(IN HSPFILEQ QueueHandle, IN PCWSTR PathPart1, IN PCWSTR PathPart2 OPTIONAL)
Definition: fileqsup.c:433
SETUPDATA SetupData
Definition: reactos.c:41

◆ SpFileQueueRename_NtToWin32()

BOOL WINAPI SpFileQueueRename_NtToWin32 ( IN HSPFILEQ  QueueHandle,
IN PCWSTR  SourcePath,
IN PCWSTR SourceFileName  OPTIONAL,
IN PCWSTR TargetPath  OPTIONAL,
IN PCWSTR  TargetFileName 
)

Definition at line 107 of file fileqsup.c.

113 {
114  WCHAR Win32SourcePath[MAX_PATH];
115  WCHAR Win32TargetPath[MAX_PATH];
116 
117  /*
118  * SpFileQueueRename is called within setuplib with NT paths, however
119  * the Win32 SetupQueueRenameW API only takes Win32 paths. We therefore
120  * map the NT path to Win32 path and then call the Win32 API.
121  */
123  Win32SourcePath,
124  _countof(Win32SourcePath),
125  SourcePath))
126  {
127  return FALSE;
128  }
129  /* SourceFileName is appended to SourcePath by the SetupApi function */
130 
131  if (TargetPath)
132  {
134  Win32TargetPath,
135  _countof(Win32TargetPath),
136  TargetPath))
137  {
138  return FALSE;
139  }
140  }
141  /* TargetFileName is appended to TargetPath by the SetupApi function */
142 
143  return SetupQueueRenameW(QueueHandle,
144  Win32SourcePath,
145  SourceFileName,
146  TargetPath ? Win32TargetPath : NULL,
147  TargetFileName);
148 }
BOOL WINAPI SetupQueueRenameW(IN HSPFILEQ QueueHandle, IN PCWSTR SourcePath, IN PCWSTR SourceFileName OPTIONAL, IN PCWSTR TargetPath OPTIONAL, IN PCWSTR TargetFileName)
Definition: fileqsup.c:503
#define FALSE
Definition: types.h:117
BOOL ConvertNtPathToWin32Path(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: reactos.c:1498
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:126
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
SETUPDATA SetupData
Definition: reactos.c:41
#define NULL
Definition: types.h:112

Variable Documentation

◆ SpFileQueueClose

Definition at line 154 of file fileqsup.c.

◆ SpFileQueueCommit

Definition at line 158 of file fileqsup.c.

◆ SpFileQueueCopy

Definition at line 155 of file fileqsup.c.

◆ SpFileQueueDelete

Definition at line 156 of file fileqsup.c.

◆ SpFileQueueOpen

Definition at line 153 of file fileqsup.c.

◆ SpFileQueueRename

Definition at line 157 of file fileqsup.c.