ReactOS 0.4.16-dev-306-g647d351
files.c File Reference
#include <stdarg.h>
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "winnls.h"
#include "winver.h"
#include "winternl.h"
#include "setupapi.h"
#include "advpub.h"
#include "fdi.h"
#include "wine/debug.h"
#include "advpack_private.h"
Include dependency graph for files.c:

Go to the source code of this file.

Classes

struct  FILELIST
 
struct  SESSION
 
struct  tagLANGANDCODEPAGE
 

Macros

#define ROOT_LENGTH   3
 
#define EXTRACT_FILLFILELIST   0x00000001
 
#define EXTRACT_EXTRACTFILES   0x00000002
 

Typedefs

typedef struct tagLANGANDCODEPAGE LANGANDCODEPAGE
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (advpack)
 
static LPWSTR ansi_to_unicode_list (LPCSTR ansi_list)
 
HRESULT WINAPI AddDelBackupEntryA (LPCSTR lpcszFileList, LPCSTR lpcszBackupDir, LPCSTR lpcszBaseName, DWORD dwFlags)
 
HRESULT WINAPI AddDelBackupEntryW (LPCWSTR lpcszFileList, LPCWSTR lpcszBackupDir, LPCWSTR lpcszBaseName, DWORD dwFlags)
 
static UINT CALLBACK pQuietQueueCallback (PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
 
static UINT CALLBACK pQueueCallback (PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
 
HRESULT WINAPI AdvInstallFileA (HWND hwnd, LPCSTR lpszSourceDir, LPCSTR lpszSourceFile, LPCSTR lpszDestDir, LPCSTR lpszDestFile, DWORD dwFlags, DWORD dwReserved)
 
HRESULT WINAPI AdvInstallFileW (HWND hwnd, LPCWSTR lpszSourceDir, LPCWSTR lpszSourceFile, LPCWSTR lpszDestDir, LPCWSTR lpszDestFile, DWORD dwFlags, DWORD dwReserved)
 
static HRESULT DELNODE_recurse_dirtree (LPWSTR fname, DWORD flags)
 
HRESULT WINAPI DelNodeA (LPCSTR pszFileOrDirName, DWORD dwFlags)
 
HRESULT WINAPI DelNodeW (LPCWSTR pszFileOrDirName, DWORD dwFlags)
 
HRESULT WINAPI DelNodeRunDLL32A (HWND hWnd, HINSTANCE hInst, LPSTR cmdline, INT show)
 
HRESULT WINAPI DelNodeRunDLL32W (HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT show)
 
static HRESULT (WINAPI *pExtract)(SESSION *
 
static LPSTR convert_file_list (LPCSTR FileList, DWORD *dwNumFiles)
 
static void free_file_node (struct FILELIST *pNode)
 
static BOOL file_in_list (LPCSTR szFile, LPCSTR szFileList)
 
static DWORD fill_file_list (SESSION *session, LPCSTR szCabName, LPCSTR szFileList)
 
static void free_file_list (SESSION *session)
 
HRESULT WINAPI ExtractFilesA (LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags, LPCSTR FileList, LPVOID LReserved, DWORD Reserved)
 
HRESULT WINAPI ExtractFilesW (LPCWSTR CabName, LPCWSTR ExpandDir, DWORD Flags, LPCWSTR FileList, LPVOID LReserved, DWORD Reserved)
 
HRESULT WINAPI FileSaveMarkNotExistA (LPSTR pszFileList, LPSTR pszDir, LPSTR pszBaseName)
 
HRESULT WINAPI FileSaveMarkNotExistW (LPWSTR pszFileList, LPWSTR pszDir, LPWSTR pszBaseName)
 
HRESULT WINAPI FileSaveRestoreA (HWND hDlg, LPSTR pszFileList, LPSTR pszDir, LPSTR pszBaseName, DWORD dwFlags)
 
HRESULT WINAPI FileSaveRestoreW (HWND hDlg, LPWSTR pszFileList, LPWSTR pszDir, LPWSTR pszBaseName, DWORD dwFlags)
 
HRESULT WINAPI FileSaveRestoreOnINFA (HWND hWnd, LPCSTR pszTitle, LPCSTR pszINF, LPCSTR pszSection, LPCSTR pszBackupDir, LPCSTR pszBaseBackupFile, DWORD dwFlags)
 
HRESULT WINAPI FileSaveRestoreOnINFW (HWND hWnd, LPCWSTR pszTitle, LPCWSTR pszINF, LPCWSTR pszSection, LPCWSTR pszBackupDir, LPCWSTR pszBaseBackupFile, DWORD dwFlags)
 
HRESULT WINAPI GetVersionFromFileA (LPCSTR Filename, LPDWORD MajorVer, LPDWORD MinorVer, BOOL Version)
 
HRESULT WINAPI GetVersionFromFileW (LPCWSTR Filename, LPDWORD MajorVer, LPDWORD MinorVer, BOOL Version)
 
HRESULT WINAPI GetVersionFromFileExA (LPCSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion)
 
HRESULT WINAPI GetVersionFromFileExW (LPCWSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion)
 

Variables

static LPCSTR
 

Macro Definition Documentation

◆ EXTRACT_EXTRACTFILES

#define EXTRACT_EXTRACTFILES   0x00000002

Definition at line 543 of file files.c.

◆ EXTRACT_FILLFILELIST

#define EXTRACT_FILLFILELIST   0x00000001

Definition at line 542 of file files.c.

◆ ROOT_LENGTH

#define ROOT_LENGTH   3

Definition at line 167 of file files.c.

Typedef Documentation

◆ LANGANDCODEPAGE

Function Documentation

◆ AddDelBackupEntryA()

HRESULT WINAPI AddDelBackupEntryA ( LPCSTR  lpcszFileList,
LPCSTR  lpcszBackupDir,
LPCSTR  lpcszBaseName,
DWORD  dwFlags 
)

Definition at line 59 of file files.c.

61{
62 UNICODE_STRING backupdir, basename;
63 LPWSTR filelist;
66
67 TRACE("(%s, %s, %s, %d)\n", debugstr_a(lpcszFileList),
68 debugstr_a(lpcszBackupDir), debugstr_a(lpcszBaseName), dwFlags);
69
70 if (lpcszFileList)
71 filelist = ansi_to_unicode_list(lpcszFileList);
72 else
73 filelist = NULL;
74
75 RtlCreateUnicodeStringFromAsciiz(&backupdir, lpcszBackupDir);
77
78 if (lpcszBackupDir)
79 backup = backupdir.Buffer;
80 else
81 backup = NULL;
82
83 res = AddDelBackupEntryW(filelist, backup, basename.Buffer, dwFlags);
84
85 HeapFree(GetProcessHeap(), 0, filelist);
86
87 RtlFreeUnicodeString(&backupdir);
89
90 return res;
91}
static long backup()
Definition: maze.c:403
#define NULL
Definition: types.h:112
static LPWSTR ansi_to_unicode_list(LPCSTR ansi_list)
Definition: files.c:40
HRESULT WINAPI AddDelBackupEntryW(LPCWSTR lpcszFileList, LPCWSTR lpcszBackupDir, LPCWSTR lpcszBaseName, DWORD dwFlags)
Definition: files.c:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
static void basename(LPCWSTR path, LPWSTR name)
Definition: profile.c:38
GLuint res
Definition: glext.h:9613
#define debugstr_a
Definition: kernel32.h:31
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by FileSaveMarkNotExistA().

◆ AddDelBackupEntryW()

HRESULT WINAPI AddDelBackupEntryW ( LPCWSTR  lpcszFileList,
LPCWSTR  lpcszBackupDir,
LPCWSTR  lpcszBaseName,
DWORD  dwFlags 
)

Definition at line 117 of file files.c.

119{
120 WCHAR szIniPath[MAX_PATH];
121 LPCWSTR szString = NULL;
122
123 static const WCHAR szBackupEntry[] = {
124 '-','1',',','0',',','0',',','0',',','0',',','0',',','-','1',0
125 };
126
127 static const WCHAR backslash[] = {'\\',0};
128 static const WCHAR ini[] = {'.','i','n','i',0};
129 static const WCHAR backup[] = {'b','a','c','k','u','p',0};
130
131 TRACE("(%s, %s, %s, %d)\n", debugstr_w(lpcszFileList),
132 debugstr_w(lpcszBackupDir), debugstr_w(lpcszBaseName), dwFlags);
133
134 if (!lpcszFileList || !*lpcszFileList)
135 return S_OK;
136
137 if (lpcszBackupDir)
138 lstrcpyW(szIniPath, lpcszBackupDir);
139 else
140 GetWindowsDirectoryW(szIniPath, MAX_PATH);
141
142 lstrcatW(szIniPath, backslash);
143 lstrcatW(szIniPath, lpcszBaseName);
144 lstrcatW(szIniPath, ini);
145
147
149 szString = szBackupEntry;
150 else if (dwFlags & AADBE_DEL_ENTRY)
151 szString = NULL;
152
153 /* add or delete the INI entries */
154 while (*lpcszFileList)
155 {
156 WritePrivateProfileStringW(backup, lpcszFileList, szString, szIniPath);
157 lpcszFileList += lstrlenW(lpcszFileList) + 1;
158 }
159
160 /* hide the INI file */
162
163 return S_OK;
164}
#define AADBE_DEL_ENTRY
Definition: advpub.h:116
#define AADBE_ADD_ENTRY
Definition: advpub.h:115
#define MAX_PATH
Definition: compat.h:34
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
Definition: profile.c:1453
#define S_OK
Definition: intsafe.h:52
#define debugstr_w
Definition: kernel32.h:32
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
TConfig ini
Definition: tnconfig.cpp:45
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by AddDelBackupEntryA(), and FileSaveMarkNotExistW().

◆ AdvInstallFileA()

HRESULT WINAPI AdvInstallFileA ( HWND  hwnd,
LPCSTR  lpszSourceDir,
LPCSTR  lpszSourceFile,
LPCSTR  lpszDestDir,
LPCSTR  lpszDestFile,
DWORD  dwFlags,
DWORD  dwReserved 
)

Definition at line 196 of file files.c.

199{
200 UNICODE_STRING sourcedir, sourcefile;
201 UNICODE_STRING destdir, destfile;
202 HRESULT res;
203
204 TRACE("(%p, %s, %s, %s, %s, %d, %d)\n", hwnd, debugstr_a(lpszSourceDir),
205 debugstr_a(lpszSourceFile), debugstr_a(lpszDestDir),
206 debugstr_a(lpszDestFile), dwFlags, dwReserved);
207
208 if (!lpszSourceDir || !lpszSourceFile || !lpszDestDir)
209 return E_INVALIDARG;
210
211 RtlCreateUnicodeStringFromAsciiz(&sourcedir, lpszSourceDir);
212 RtlCreateUnicodeStringFromAsciiz(&sourcefile, lpszSourceFile);
213 RtlCreateUnicodeStringFromAsciiz(&destdir, lpszDestDir);
214 RtlCreateUnicodeStringFromAsciiz(&destfile, lpszDestFile);
215
216 res = AdvInstallFileW(hwnd, sourcedir.Buffer, sourcefile.Buffer,
217 destdir.Buffer, destfile.Buffer, dwFlags, dwReserved);
218
219 RtlFreeUnicodeString(&sourcedir);
220 RtlFreeUnicodeString(&sourcefile);
221 RtlFreeUnicodeString(&destdir);
222 RtlFreeUnicodeString(&destfile);
223
224 return res;
225}
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT WINAPI AdvInstallFileW(HWND hwnd, LPCWSTR lpszSourceDir, LPCWSTR lpszSourceFile, LPCWSTR lpszDestDir, LPCWSTR lpszDestFile, DWORD dwFlags, DWORD dwReserved)
Definition: files.c:249
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ AdvInstallFileW()

HRESULT WINAPI AdvInstallFileW ( HWND  hwnd,
LPCWSTR  lpszSourceDir,
LPCWSTR  lpszSourceFile,
LPCWSTR  lpszDestDir,
LPCWSTR  lpszDestFile,
DWORD  dwFlags,
DWORD  dwReserved 
)

Definition at line 249 of file files.c.

252{
253 PSP_FILE_CALLBACK_W pFileCallback;
254 LPWSTR szDestFilename;
256 WCHAR szRootPath[ROOT_LENGTH];
257 DWORD dwLen, dwLastError;
258 HSPFILEQ fileQueue;
259 PVOID pContext;
260
261 TRACE("(%p, %s, %s, %s, %s, %d, %d)\n", hwnd, debugstr_w(lpszSourceDir),
262 debugstr_w(lpszSourceFile), debugstr_w(lpszDestDir),
263 debugstr_w(lpszDestFile), dwFlags, dwReserved);
264
265 if (!lpszSourceDir || !lpszSourceFile || !lpszDestDir)
266 return E_INVALIDARG;
267
268 fileQueue = SetupOpenFileQueue();
269 if (fileQueue == INVALID_HANDLE_VALUE)
271
272 pContext = NULL;
273 dwLastError = ERROR_SUCCESS;
274
275 lstrcpynW(szRootPath, lpszSourceDir, ROOT_LENGTH);
276 szPath = lpszSourceDir + ROOT_LENGTH;
277
278 /* use lpszSourceFile as destination filename if lpszDestFile is NULL */
279 if (lpszDestFile)
280 {
281 dwLen = lstrlenW(lpszDestFile);
282 szDestFilename = HeapAlloc(GetProcessHeap(), 0, (dwLen+1) * sizeof(WCHAR));
283 lstrcpyW(szDestFilename, lpszDestFile);
284 }
285 else
286 {
287 dwLen = lstrlenW(lpszSourceFile);
288 szDestFilename = HeapAlloc(GetProcessHeap(), 0, (dwLen+1) * sizeof(WCHAR));
289 lstrcpyW(szDestFilename, lpszSourceFile);
290 }
291
292 /* add the file copy operation to the setup queue */
293 if (!SetupQueueCopyW(fileQueue, szRootPath, szPath, lpszSourceFile, NULL,
294 NULL, lpszDestDir, szDestFilename, dwFlags))
295 {
296 dwLastError = GetLastError();
297 goto done;
298 }
299
301 0, 0, NULL);
302 if (!pContext)
303 {
304 dwLastError = GetLastError();
305 goto done;
306 }
307
308 /* don't output anything for AIF_QUIET */
309 if (dwFlags & AIF_QUIET)
310 pFileCallback = pQuietQueueCallback;
311 else
312 pFileCallback = pQueueCallback;
313
314 /* perform the file copy */
315 if (!SetupCommitFileQueueW(hwnd, fileQueue, pFileCallback, pContext))
316 {
317 dwLastError = GetLastError();
318 goto done;
319 }
320
321done:
323 SetupCloseFileQueue(fileQueue);
324
325 HeapFree(GetProcessHeap(), 0, szDestFilename);
326
327 return HRESULT_FROM_WIN32(dwLastError);
328}
#define AIF_QUIET
Definition: advpub.h:127
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT CALLBACK pQuietQueueCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: files.c:169
static UINT CALLBACK pQueueCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: files.c:175
#define ROOT_LENGTH
Definition: files.c:167
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define lstrcpynW
Definition: compat.h:738
PVOID WINAPI SetupInitDefaultQueueCallbackEx(HWND owner, HWND progress, UINT msg, DWORD reserved1, PVOID reserved2)
Definition: queue.c:1638
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1656
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:574
UINT(CALLBACK * PSP_FILE_CALLBACK_W)(IN PVOID Context, IN UINT Notification, IN UINT_PTR Param1, IN UINT_PTR Param2)
Definition: fileqsup.h:66
unsigned long DWORD
Definition: ntddk_ex.h:95
LPCWSTR szPath
Definition: env.c:37
#define SetupOpenFileQueue
Definition: fileqsup.c:29
#define SetupCommitFileQueueW
Definition: fileqsup.c:33
#define SetupCloseFileQueue
Definition: fileqsup.c:30
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

Referenced by AdvInstallFileA().

◆ ansi_to_unicode_list()

static LPWSTR ansi_to_unicode_list ( LPCSTR  ansi_list)
static

Definition at line 40 of file files.c.

41{
42 DWORD len, wlen = 0;
44 LPCSTR ptr = ansi_list;
45
46 while (*ptr) ptr += lstrlenA(ptr) + 1;
47 len = ptr + 1 - ansi_list;
48 wlen = MultiByteToWideChar(CP_ACP, 0, ansi_list, len, NULL, 0);
49 list = HeapAlloc(GetProcessHeap(), 0, wlen * sizeof(WCHAR));
50 MultiByteToWideChar(CP_ACP, 0, ansi_list, len, list, wlen);
51 return list;
52}
Definition: list.h:37
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
static PVOID ptr
Definition: dispmode.c:27
#define list
Definition: rosglue.h:35
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by AddDelBackupEntryA().

◆ convert_file_list()

static LPSTR convert_file_list ( LPCSTR  FileList,
DWORD dwNumFiles 
)
static

Definition at line 568 of file files.c.

569{
570 DWORD dwLen;
571 const char *first = FileList;
572 const char *last = FileList + strlen(FileList) - 1;
573 LPSTR szConvertedList, temp;
574
575 /* any number of these chars before the list is OK */
576 while (first < last && (*first == ' ' || *first == '\t' || *first == ':'))
577 first++;
578
579 /* any number of these chars after the list is OK */
580 while (last > first && (*last == ' ' || *last == '\t' || *last == ':'))
581 last--;
582
583 if (first == last)
584 return NULL;
585
586 dwLen = last - first + 3; /* room for double-null termination */
587 szConvertedList = HeapAlloc(GetProcessHeap(), 0, dwLen);
588 lstrcpynA(szConvertedList, first, dwLen - 1);
589 szConvertedList[dwLen - 1] = '\0';
590
591 /* empty list */
592 if (!szConvertedList[0])
593 {
594 HeapFree(GetProcessHeap(), 0, szConvertedList);
595 return NULL;
596 }
597
598 *dwNumFiles = 1;
599
600 /* convert the colons to double-null termination */
601 temp = szConvertedList;
602 while (*temp)
603 {
604 if (*temp == ':')
605 {
606 *temp = '\0';
607 (*dwNumFiles)++;
608 }
609
610 temp++;
611 }
612
613 return szConvertedList;
614}
vector< FileInfo > FileList
Definition: DriveVolume.h:63
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define lstrcpynA
Definition: compat.h:751
const GLint * first
Definition: glext.h:5794
static UINT UINT last
Definition: font.c:45
static calc_node_t temp
Definition: rpn_ieee.c:38
char * LPSTR
Definition: xmlstorage.h:182

Referenced by ExtractFilesA().

◆ DELNODE_recurse_dirtree()

static HRESULT DELNODE_recurse_dirtree ( LPWSTR  fname,
DWORD  flags 
)
static

Definition at line 330 of file files.c.

331{
332 DWORD fattrs = GetFileAttributesW(fname);
334
335 static const WCHAR asterisk[] = {'*',0};
336 static const WCHAR dot[] = {'.',0};
337 static const WCHAR dotdot[] = {'.','.',0};
338
339 if (fattrs & FILE_ATTRIBUTE_DIRECTORY)
340 {
341 HANDLE hFindFile;
342 WIN32_FIND_DATAW w32fd;
343 BOOL done = TRUE;
344 int fname_len = lstrlenW(fname);
345#ifdef __REACTOS__
347 goto deleteinitialdirectory;
348#endif
349
350 /* Generate a path with wildcard suitable for iterating */
351 if (fname_len && fname[fname_len-1] != '\\') fname[fname_len++] = '\\';
352 lstrcpyW(fname + fname_len, asterisk);
353
354 if ((hFindFile = FindFirstFileW(fname, &w32fd)) != INVALID_HANDLE_VALUE)
355 {
356 /* Iterate through the files in the directory */
357 for (done = FALSE; !done; done = !FindNextFileW(hFindFile, &w32fd))
358 {
359 TRACE("%s\n", debugstr_w(w32fd.cFileName));
360 if (lstrcmpW(dot, w32fd.cFileName) != 0 &&
361 lstrcmpW(dotdot, w32fd.cFileName) != 0)
362 {
363 lstrcpyW(fname + fname_len, w32fd.cFileName);
364 if (DELNODE_recurse_dirtree(fname, flags) != S_OK)
365 {
366 break; /* Failure */
367 }
368 }
369 }
370 FindClose(hFindFile);
371 }
372
373 /* We're done with this directory, so restore the old path without wildcard */
374 *(fname + fname_len) = '\0';
375
376 if (done)
377 {
378#ifdef __REACTOS__
379deleteinitialdirectory:
380#endif
381 TRACE("%s: directory\n", debugstr_w(fname));
382#ifdef __REACTOS__
384 if (RemoveDirectoryW(fname))
385#else
387#endif
388 {
389 ret = S_OK;
390 }
391 }
392 }
393 else
394 {
395 TRACE("%s: file\n", debugstr_w(fname));
396#ifdef __REACTOS__
398 if (DeleteFileW(fname))
399#else
401#endif
402 {
403 ret = S_OK;
404 }
405 }
406
407 return ret;
408}
#define ADN_DEL_IF_EMPTY
Definition: DelNode.c:13
#define E_FAIL
Definition: ddrawi.h:102
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static HRESULT DELNODE_recurse_dirtree(LPWSTR fname, DWORD flags)
Definition: files.c:330
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
unsigned int BOOL
Definition: ntddk_ex.h:94
GLbitfield flags
Definition: glext.h:7161
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
int ret

Referenced by DELNODE_recurse_dirtree(), and DelNodeW().

◆ DelNodeA()

HRESULT WINAPI DelNodeA ( LPCSTR  pszFileOrDirName,
DWORD  dwFlags 
)

Definition at line 415 of file files.c.

416{
417 UNICODE_STRING fileordirname;
418 HRESULT res;
419
420 TRACE("(%s, %d)\n", debugstr_a(pszFileOrDirName), dwFlags);
421
422 RtlCreateUnicodeStringFromAsciiz(&fileordirname, pszFileOrDirName);
423
424 res = DelNodeW(fileordirname.Buffer, dwFlags);
425
426 RtlFreeUnicodeString(&fileordirname);
427
428 return res;
429}
HRESULT WINAPI DelNodeW(LPCWSTR pszFileOrDirName, DWORD dwFlags)
Definition: files.c:449

◆ DelNodeRunDLL32A()

HRESULT WINAPI DelNodeRunDLL32A ( HWND  hWnd,
HINSTANCE  hInst,
LPSTR  cmdline,
INT  show 
)

Definition at line 481 of file files.c.

482{
484 HRESULT hr;
485
486 TRACE("(%p, %p, %s, %i)\n", hWnd, hInst, debugstr_a(cmdline), show);
487
489
490 hr = DelNodeRunDLL32W(hWnd, hInst, params.Buffer, show);
491
493
494 return hr;
495}
HWND hWnd
Definition: settings.c:17
HRESULT WINAPI DelNodeRunDLL32W(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT show)
Definition: files.c:512
HINSTANCE hInst
Definition: dxdiag.c:13
GLenum const GLfloat * params
Definition: glext.h:5645
HRESULT hr
Definition: shlfolder.c:183
TCHAR * cmdline
Definition: stretchblt.cpp:32

◆ DelNodeRunDLL32W()

HRESULT WINAPI DelNodeRunDLL32W ( HWND  hWnd,
HINSTANCE  hInst,
LPWSTR  cmdline,
INT  show 
)

Definition at line 512 of file files.c.

513{
514 LPWSTR szFilename, szFlags;
515 LPWSTR cmdline_copy, cmdline_ptr;
516 DWORD dwFlags = 0;
517 HRESULT res;
518
519 TRACE("(%p, %p, %s, %i)\n", hWnd, hInst, debugstr_w(cmdline), show);
520
521 cmdline_copy = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(cmdline) + 1) * sizeof(WCHAR));
522 cmdline_ptr = cmdline_copy;
523 lstrcpyW(cmdline_copy, cmdline);
524
525 /* get the parameters at indexes 0 and 1 respectively */
526 szFilename = get_parameter(&cmdline_ptr, ',', TRUE);
527 szFlags = get_parameter(&cmdline_ptr, ',', TRUE);
528
529 if (szFlags)
530 dwFlags = wcstol(szFlags, NULL, 10);
531
532 res = DelNodeW(szFilename, dwFlags);
533
534 HeapFree(GetProcessHeap(), 0, cmdline_copy);
535
536 return res;
537}
LPWSTR get_parameter(LPWSTR *params, WCHAR separator, BOOL quoted) DECLSPEC_HIDDEN
Definition: install.c:200
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)

Referenced by DelNodeRunDLL32A().

◆ DelNodeW()

HRESULT WINAPI DelNodeW ( LPCWSTR  pszFileOrDirName,
DWORD  dwFlags 
)

Definition at line 449 of file files.c.

450{
451 WCHAR fname[MAX_PATH];
453
454 TRACE("(%s, %d)\n", debugstr_w(pszFileOrDirName), dwFlags);
455
456#ifdef __REACTOS__
458 FIXME("Flags %#x ignored!\n", dwFlags & ~ADN_DEL_IF_EMPTY);
459#else
460 if (dwFlags)
461 FIXME("Flags ignored!\n");
462#endif
463
464 if (pszFileOrDirName && *pszFileOrDirName)
465 {
466 lstrcpyW(fname, pszFileOrDirName);
467
468 /* TODO: Should check for system directory deletion etc. here */
469
471 }
472
473 return ret;
474}
#define FIXME(fmt,...)
Definition: precomp.h:53

Referenced by del_dirs_callback(), DelNodeA(), and DelNodeRunDLL32W().

◆ ExtractFilesA()

HRESULT WINAPI ExtractFilesA ( LPCSTR  CabName,
LPCSTR  ExpandDir,
DWORD  Flags,
LPCSTR  FileList,
LPVOID  LReserved,
DWORD  Reserved 
)

Definition at line 710 of file files.c.

712{
715 HRESULT res = S_OK;
716 DWORD dwFileCount = 0;
717 DWORD dwFilesFound = 0;
718 LPSTR szConvertedList = NULL;
719
720 TRACE("(%s, %s, %d, %s, %p, %d)\n", debugstr_a(CabName), debugstr_a(ExpandDir),
721 Flags, debugstr_a(FileList), LReserved, Reserved);
722
723 if (!CabName || !ExpandDir)
724 return E_INVALIDARG;
725
728
729 hCabinet = LoadLibraryA("cabinet.dll");
730 if (!hCabinet)
731 return E_FAIL;
732
733 ZeroMemory(&session, sizeof(SESSION));
734
735 pExtract = (void *)GetProcAddress(hCabinet, "Extract");
736 if (!pExtract)
737 {
738 res = E_FAIL;
739 goto done;
740 }
741
742 lstrcpyA(session.Destination, ExpandDir);
743
744 if (FileList)
745 {
746 szConvertedList = convert_file_list(FileList, &dwFileCount);
747 if (!szConvertedList)
748 {
749 res = E_FAIL;
750 goto done;
751 }
752
753 dwFilesFound = fill_file_list(&session, CabName, szConvertedList);
754 if (dwFilesFound != dwFileCount)
755 {
756 res = E_FAIL;
757 goto done;
758 }
759 }
760 else
761 session.Operation |= EXTRACT_FILLFILELIST;
762
763 session.Operation |= EXTRACT_EXTRACTFILES;
764 res = pExtract(&session, CabName);
765
766done:
769 HeapFree(GetProcessHeap(), 0, szConvertedList);
770
771 return res;
772}
static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles)
Definition: files.c:568
#define EXTRACT_EXTRACTFILES
Definition: files.c:543
static void free_file_list(SESSION *session)
Definition: files.c:673
static DWORD fill_file_list(SESSION *session, LPCSTR szCabName, LPCSTR szFileList)
Definition: files.c:646
#define EXTRACT_FILLFILELIST
Definition: files.c:542
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
Definition: files.c:551
static HMODULE hCabinet
Definition: urlmon_main.c:45
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define ZeroMemory
Definition: winbase.h:1737
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by ExtractFilesW().

◆ ExtractFilesW()

HRESULT WINAPI ExtractFilesW ( LPCWSTR  CabName,
LPCWSTR  ExpandDir,
DWORD  Flags,
LPCWSTR  FileList,
LPVOID  LReserved,
DWORD  Reserved 
)

Definition at line 802 of file files.c.

804{
805 char *cab_name = NULL, *expand_dir = NULL, *file_list = NULL;
806 HRESULT hres = S_OK;
807
808 TRACE("(%s, %s, %d, %s, %p, %d)\n", debugstr_w(CabName), debugstr_w(ExpandDir),
809 Flags, debugstr_w(FileList), LReserved, Reserved);
810
811 if(CabName) {
812 cab_name = heap_strdupWtoA(CabName);
813 if(!cab_name)
814 return E_OUTOFMEMORY;
815 }
816
817 if(ExpandDir) {
818 expand_dir = heap_strdupWtoA(ExpandDir);
819 if(!expand_dir)
821 }
822
823 if(SUCCEEDED(hres) && FileList) {
825 if(!file_list)
827 }
828
829 /* cabinet.dll, which does the real job of extracting files, doesn't have UNICODE API,
830 so we need W->A conversion at some point anyway. */
831 if(SUCCEEDED(hres))
832 hres = ExtractFilesA(cab_name, expand_dir, Flags, file_list, LReserved, Reserved);
833
834 heap_free(cab_name);
835 heap_free(expand_dir);
837 return hres;
838}
static char * heap_strdupWtoA(const WCHAR *str)
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags, LPCSTR FileList, LPVOID LReserved, DWORD Reserved)
Definition: files.c:710
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hres
Definition: protocol.c:465

Referenced by extract_cab_file().

◆ file_in_list()

static BOOL file_in_list ( LPCSTR  szFile,
LPCSTR  szFileList 
)
static

Definition at line 623 of file files.c.

624{
625 DWORD dwLen = lstrlenA(szFile);
626 DWORD dwTestLen;
627
628 while (*szFileList)
629 {
630 dwTestLen = lstrlenA(szFileList);
631
632 if (dwTestLen == dwLen)
633 {
634 if (!lstrcmpiA(szFile, szFileList))
635 return TRUE;
636 }
637
638 szFileList += dwTestLen + 1;
639 }
640
641 return FALSE;
642}
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4224

Referenced by fill_file_list().

◆ FileSaveMarkNotExistA()

HRESULT WINAPI FileSaveMarkNotExistA ( LPSTR  pszFileList,
LPSTR  pszDir,
LPSTR  pszBaseName 
)

Definition at line 845 of file files.c.

846{
847 TRACE("(%s, %s, %s)\n", debugstr_a(pszFileList),
848 debugstr_a(pszDir), debugstr_a(pszBaseName));
849
850 return AddDelBackupEntryA(pszFileList, pszDir, pszBaseName, AADBE_DEL_ENTRY);
851}
HRESULT WINAPI AddDelBackupEntryA(LPCSTR lpcszFileList, LPCSTR lpcszBackupDir, LPCSTR lpcszBaseName, DWORD dwFlags)
Definition: files.c:59
_In_ LPCSTR pszDir
Definition: shellapi.h:585

◆ FileSaveMarkNotExistW()

HRESULT WINAPI FileSaveMarkNotExistW ( LPWSTR  pszFileList,
LPWSTR  pszDir,
LPWSTR  pszBaseName 
)

Definition at line 868 of file files.c.

869{
870 TRACE("(%s, %s, %s)\n", debugstr_w(pszFileList),
871 debugstr_w(pszDir), debugstr_w(pszBaseName));
872
873 return AddDelBackupEntryW(pszFileList, pszDir, pszBaseName, AADBE_DEL_ENTRY);
874}

◆ FileSaveRestoreA()

HRESULT WINAPI FileSaveRestoreA ( HWND  hDlg,
LPSTR  pszFileList,
LPSTR  pszDir,
LPSTR  pszBaseName,
DWORD  dwFlags 
)

Definition at line 881 of file files.c.

883{
884 UNICODE_STRING filelist, dir, basename;
885 HRESULT hr;
886
887 TRACE("(%p, %s, %s, %s, %d)\n", hDlg, debugstr_a(pszFileList),
888 debugstr_a(pszDir), debugstr_a(pszBaseName), dwFlags);
889
890 RtlCreateUnicodeStringFromAsciiz(&filelist, pszFileList);
893
894 hr = FileSaveRestoreW(hDlg, filelist.Buffer, dir.Buffer,
895 basename.Buffer, dwFlags);
896
897 RtlFreeUnicodeString(&filelist);
900
901 return hr;
902}
unsigned int dir
Definition: maze.c:112
HRESULT WINAPI FileSaveRestoreW(HWND hDlg, LPWSTR pszFileList, LPWSTR pszDir, LPWSTR pszBaseName, DWORD dwFlags)
Definition: files.c:926

◆ FileSaveRestoreOnINFA()

HRESULT WINAPI FileSaveRestoreOnINFA ( HWND  hWnd,
LPCSTR  pszTitle,
LPCSTR  pszINF,
LPCSTR  pszSection,
LPCSTR  pszBackupDir,
LPCSTR  pszBaseBackupFile,
DWORD  dwFlags 
)

Definition at line 940 of file files.c.

943{
945 UNICODE_STRING backupdir, backupfile;
946 HRESULT hr;
947
948 TRACE("(%p, %s, %s, %s, %s, %s, %d)\n", hWnd, debugstr_a(pszTitle),
949 debugstr_a(pszINF), debugstr_a(pszSection), debugstr_a(pszBackupDir),
950 debugstr_a(pszBaseBackupFile), dwFlags);
951
955 RtlCreateUnicodeStringFromAsciiz(&backupdir, pszBackupDir);
956 RtlCreateUnicodeStringFromAsciiz(&backupfile, pszBaseBackupFile);
957
958 hr = FileSaveRestoreOnINFW(hWnd, title.Buffer, inf.Buffer, section.Buffer,
959 backupdir.Buffer, backupfile.Buffer, dwFlags);
960
964 RtlFreeUnicodeString(&backupdir);
965 RtlFreeUnicodeString(&backupfile);
966
967 return hr;
968}
HRESULT WINAPI FileSaveRestoreOnINFW(HWND hWnd, LPCWSTR pszTitle, LPCWSTR pszINF, LPCWSTR pszSection, LPCWSTR pszBackupDir, LPCWSTR pszBaseBackupFile, DWORD dwFlags)
Definition: files.c:993
static char title[]
Definition: ps.c:92
Definition: parser.c:56

◆ FileSaveRestoreOnINFW()

HRESULT WINAPI FileSaveRestoreOnINFW ( HWND  hWnd,
LPCWSTR  pszTitle,
LPCWSTR  pszINF,
LPCWSTR  pszSection,
LPCWSTR  pszBackupDir,
LPCWSTR  pszBaseBackupFile,
DWORD  dwFlags 
)

Definition at line 993 of file files.c.

996{
997 FIXME("(%p, %s, %s, %s, %s, %s, %d): stub\n", hWnd, debugstr_w(pszTitle),
998 debugstr_w(pszINF), debugstr_w(pszSection), debugstr_w(pszBackupDir),
999 debugstr_w(pszBaseBackupFile), dwFlags);
1000
1001 return E_FAIL;
1002}

Referenced by FileSaveRestoreOnINFA().

◆ FileSaveRestoreW()

HRESULT WINAPI FileSaveRestoreW ( HWND  hDlg,
LPWSTR  pszFileList,
LPWSTR  pszDir,
LPWSTR  pszBaseName,
DWORD  dwFlags 
)

Definition at line 926 of file files.c.

928{
929 FIXME("(%p, %s, %s, %s, %d) stub\n", hDlg, debugstr_w(pszFileList),
930 debugstr_w(pszDir), debugstr_w(pszBaseName), dwFlags);
931
932 return E_FAIL;
933}

Referenced by FileSaveRestoreA().

◆ fill_file_list()

static DWORD fill_file_list ( SESSION session,
LPCSTR  szCabName,
LPCSTR  szFileList 
)
static

Definition at line 646 of file files.c.

647{
648 DWORD dwNumFound = 0;
649 struct FILELIST *pNode;
650
651 session->Operation |= EXTRACT_FILLFILELIST;
652 if (pExtract(session, szCabName) != S_OK)
653 {
654 session->Operation &= ~EXTRACT_FILLFILELIST;
655 return -1;
656 }
657
658 pNode = session->FileList;
659 while (pNode)
660 {
661 if (!file_in_list(pNode->FileName, szFileList))
662 pNode->DoExtract = FALSE;
663 else
664 dwNumFound++;
665
666 pNode = pNode->next;
667 }
668
669 session->Operation &= ~EXTRACT_FILLFILELIST;
670 return dwNumFound;
671}
static BOOL file_in_list(LPCSTR szFile, LPCSTR szFileList)
Definition: files.c:623
struct FILELIST * next
Definition: files.c:547
LPSTR FileName
Definition: files.c:546
BOOL DoExtract
Definition: files.c:548

Referenced by ExtractFilesA().

◆ free_file_list()

static void free_file_list ( SESSION session)
static

Definition at line 673 of file files.c.

674{
675 struct FILELIST *next, *curr = session->FileList;
676
677 while (curr)
678 {
679 next = curr->next;
680 free_file_node(curr);
681 curr = next;
682 }
683}
static void free_file_node(struct FILELIST *pNode)
Definition: files.c:616
static unsigned __int64 next
Definition: rand_nt.c:6

Referenced by ExtractFilesA().

◆ free_file_node()

static void free_file_node ( struct FILELIST pNode)
static

Definition at line 616 of file files.c.

617{
618 HeapFree(GetProcessHeap(), 0, pNode->FileName);
619 HeapFree(GetProcessHeap(), 0, pNode);
620}

Referenced by free_file_list().

◆ GetVersionFromFileA()

HRESULT WINAPI GetVersionFromFileA ( LPCSTR  Filename,
LPDWORD  MajorVer,
LPDWORD  MinorVer,
BOOL  Version 
)

Definition at line 1009 of file files.c.

1011{
1012 TRACE("(%s, %p, %p, %d)\n", debugstr_a(Filename), MajorVer, MinorVer, Version);
1013 return GetVersionFromFileExA(Filename, MajorVer, MinorVer, Version);
1014}
HRESULT WINAPI GetVersionFromFileExA(LPCSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion)
Definition: files.c:1040
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:940
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469

◆ GetVersionFromFileExA()

HRESULT WINAPI GetVersionFromFileExA ( LPCSTR  lpszFilename,
LPDWORD  pdwMSVer,
LPDWORD  pdwLSVer,
BOOL  bVersion 
)

Definition at line 1040 of file files.c.

1042{
1044 HRESULT res;
1045
1046 TRACE("(%s, %p, %p, %d)\n", debugstr_a(lpszFilename),
1047 pdwMSVer, pdwLSVer, bVersion);
1048
1050
1051 res = GetVersionFromFileExW(filename.Buffer, pdwMSVer, pdwLSVer, bVersion);
1052
1054
1055 return res;
1056}
HRESULT WINAPI GetVersionFromFileExW(LPCWSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion)
Definition: files.c:1076
const char * filename
Definition: ioapi.h:137

Referenced by GetVersionFromFileA().

◆ GetVersionFromFileExW()

HRESULT WINAPI GetVersionFromFileExW ( LPCWSTR  lpszFilename,
LPDWORD  pdwMSVer,
LPDWORD  pdwLSVer,
BOOL  bVersion 
)

Definition at line 1076 of file files.c.

1078{
1079 VS_FIXEDFILEINFO *pFixedVersionInfo;
1080 LANGANDCODEPAGE *pLangAndCodePage;
1081 DWORD dwHandle, dwInfoSize;
1082 WCHAR szWinDir[MAX_PATH];
1083 WCHAR szFile[MAX_PATH];
1084 LPVOID pVersionInfo = NULL;
1085 BOOL bFileCopied = FALSE;
1086 UINT uValueLen;
1087
1088 static const WCHAR backslash[] = {'\\',0};
1089 static const WCHAR translation[] = {
1090 '\\','V','a','r','F','i','l','e','I','n','f','o',
1091 '\\','T','r','a','n','s','l','a','t','i','o','n',0
1092 };
1093
1094 TRACE("(%s, %p, %p, %d)\n", debugstr_w(lpszFilename),
1095 pdwMSVer, pdwLSVer, bVersion);
1096
1097 *pdwLSVer = 0;
1098 *pdwMSVer = 0;
1099
1100 lstrcpynW(szFile, lpszFilename, MAX_PATH);
1101
1102 dwInfoSize = GetFileVersionInfoSizeW(szFile, &dwHandle);
1103 if (!dwInfoSize)
1104 {
1105 /* check that the file exists */
1107 return S_OK;
1108
1109 /* file exists, but won't be found by GetFileVersionInfoSize,
1110 * so copy it to the temp dir where it will be found.
1111 */
1112 GetWindowsDirectoryW(szWinDir, MAX_PATH);
1113 GetTempFileNameW(szWinDir, NULL, 0, szFile);
1114 CopyFileW(lpszFilename, szFile, FALSE);
1115 bFileCopied = TRUE;
1116
1117 dwInfoSize = GetFileVersionInfoSizeW(szFile, &dwHandle);
1118 if (!dwInfoSize)
1119 goto done;
1120 }
1121
1122 pVersionInfo = HeapAlloc(GetProcessHeap(), 0, dwInfoSize);
1123 if (!pVersionInfo)
1124 goto done;
1125
1126 if (!GetFileVersionInfoW(szFile, dwHandle, dwInfoSize, pVersionInfo))
1127 goto done;
1128
1129 if (bVersion)
1130 {
1131 if (!VerQueryValueW(pVersionInfo, backslash,
1132 (LPVOID *)&pFixedVersionInfo, &uValueLen))
1133 goto done;
1134
1135 if (!uValueLen)
1136 goto done;
1137
1138 *pdwMSVer = pFixedVersionInfo->dwFileVersionMS;
1139 *pdwLSVer = pFixedVersionInfo->dwFileVersionLS;
1140 }
1141 else
1142 {
1143 if (!VerQueryValueW(pVersionInfo, translation,
1144 (LPVOID *)&pLangAndCodePage, &uValueLen))
1145 goto done;
1146
1147 if (!uValueLen)
1148 goto done;
1149
1150 *pdwMSVer = pLangAndCodePage->wLanguage;
1151 *pdwLSVer = pLangAndCodePage->wCodePage;
1152 }
1153
1154done:
1155 HeapFree(GetProcessHeap(), 0, pVersionInfo);
1156
1157 if (bFileCopied)
1158 DeleteFileW(szFile);
1159
1160 return S_OK;
1161}
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:845
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1057
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:611
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
unsigned int UINT
Definition: ndis.h:50

Referenced by GetVersionFromFileExA(), and GetVersionFromFileW().

◆ GetVersionFromFileW()

HRESULT WINAPI GetVersionFromFileW ( LPCWSTR  Filename,
LPDWORD  MajorVer,
LPDWORD  MinorVer,
BOOL  Version 
)

Definition at line 1021 of file files.c.

1023{
1024 TRACE("(%s, %p, %p, %d)\n", debugstr_w(Filename), MajorVer, MinorVer, Version);
1025 return GetVersionFromFileExW(Filename, MajorVer, MinorVer, Version);
1026}

◆ HRESULT()

static HRESULT ( WINAPI pExtract)
static

◆ pQueueCallback()

static UINT CALLBACK pQueueCallback ( PVOID  Context,
UINT  Notification,
UINT_PTR  Param1,
UINT_PTR  Param2 
)
static

Definition at line 175 of file files.c.

177{
178 /* only be verbose for error notifications */
179 if (!Notification ||
183 {
185 Param1, Param2);
186 }
187
188 return 1;
189}
UINT WINAPI SetupDefaultQueueCallbackW(PVOID context, UINT notification, UINT_PTR param1, UINT_PTR param2)
Definition: queue.c:1729
#define SPFILENOTIFY_RENAMEERROR
Definition: fileqsup.h:33
#define SPFILENOTIFY_DELETEERROR
Definition: fileqsup.h:29
#define SPFILENOTIFY_COPYERROR
Definition: fileqsup.h:37
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:115

Referenced by AdvInstallFileW().

◆ pQuietQueueCallback()

static UINT CALLBACK pQuietQueueCallback ( PVOID  Context,
UINT  Notification,
UINT_PTR  Param1,
UINT_PTR  Param2 
)
static

Definition at line 169 of file files.c.

171{
172 return 1;
173}

Referenced by AdvInstallFileW().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( advpack  )

Variable Documentation

◆ LPCSTR

Definition at line 563 of file files.c.