ReactOS 0.4.15-dev-7842-g558ab78
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 545 of file files.c.

◆ EXTRACT_FILLFILELIST

#define EXTRACT_FILLFILELIST   0x00000001

Definition at line 544 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 570 of file files.c.

571{
572 DWORD dwLen;
573 const char *first = FileList;
574 const char *last = FileList + strlen(FileList) - 1;
575 LPSTR szConvertedList, temp;
576
577 /* any number of these chars before the list is OK */
578 while (first < last && (*first == ' ' || *first == '\t' || *first == ':'))
579 first++;
580
581 /* any number of these chars after the list is OK */
582 while (last > first && (*last == ' ' || *last == '\t' || *last == ':'))
583 last--;
584
585 if (first == last)
586 return NULL;
587
588 dwLen = last - first + 3; /* room for double-null termination */
589 szConvertedList = HeapAlloc(GetProcessHeap(), 0, dwLen);
590 lstrcpynA(szConvertedList, first, dwLen - 1);
591 szConvertedList[dwLen - 1] = '\0';
592
593 /* empty list */
594 if (!szConvertedList[0])
595 {
596 HeapFree(GetProcessHeap(), 0, szConvertedList);
597 return NULL;
598 }
599
600 *dwNumFiles = 1;
601
602 /* convert the colons to double-null termination */
603 temp = szConvertedList;
604 while (*temp)
605 {
606 if (*temp == ':')
607 {
608 *temp = '\0';
609 (*dwNumFiles)++;
610 }
611
612 temp++;
613 }
614
615 return szConvertedList;
616}
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;
345
346#ifdef __REACTOS__
348 {
349 goto deleteinitialdirectory;
350 }
351#endif
352
353 /* Generate a path with wildcard suitable for iterating */
354 fname_len = lstrlenW(fname);
355 if (fname_len && fname[fname_len-1] != '\\') fname[fname_len++] = '\\';
356 lstrcpyW(fname + fname_len, asterisk);
357
358 if ((hFindFile = FindFirstFileW(fname, &w32fd)) != INVALID_HANDLE_VALUE)
359 {
360 /* Iterate through the files in the directory */
361 for (done = FALSE; !done; done = !FindNextFileW(hFindFile, &w32fd))
362 {
363 TRACE("%s\n", debugstr_w(w32fd.cFileName));
364 if (lstrcmpW(dot, w32fd.cFileName) != 0 &&
365 lstrcmpW(dotdot, w32fd.cFileName) != 0)
366 {
367 lstrcpyW(fname + fname_len, w32fd.cFileName);
368 if (DELNODE_recurse_dirtree(fname, flags) != S_OK)
369 {
370 break; /* Failure */
371 }
372 }
373 }
374 FindClose(hFindFile);
375 }
376
377 /* We're done with this directory, so restore the old path without wildcard */
378 *(fname + fname_len) = '\0';
379
380 if (done)
381 {
382#ifdef __REACTOS__
383deleteinitialdirectory:
384 TRACE("%s: directory\n", debugstr_w(fname));
386 if (RemoveDirectoryW(fname))
387#else
389#endif
390 {
391 ret = S_OK;
392 }
393 }
394 }
395 else
396 {
397 TRACE("%s: file\n", debugstr_w(fname));
398#ifdef __REACTOS__
400 if (DeleteFileW(fname))
401#else
403#endif
404 {
405 ret = S_OK;
406 }
407 }
408
409 return ret;
410}
#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
unsigned int BOOL
Definition: ntddk_ex.h:94
GLbitfield flags
Definition: glext.h:7161
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#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 417 of file files.c.

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

◆ DelNodeRunDLL32A()

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

Definition at line 483 of file files.c.

484{
486 HRESULT hr;
487
488 TRACE("(%p, %p, %s, %i)\n", hWnd, hInst, debugstr_a(cmdline), show);
489
491
492 hr = DelNodeRunDLL32W(hWnd, hInst, params.Buffer, show);
493
495
496 return hr;
497}
HWND hWnd
Definition: settings.c:17
HRESULT WINAPI DelNodeRunDLL32W(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT show)
Definition: files.c:514
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 514 of file files.c.

515{
516 LPWSTR szFilename, szFlags;
517 LPWSTR cmdline_copy, cmdline_ptr;
518 DWORD dwFlags = 0;
519 HRESULT res;
520
521 TRACE("(%p, %p, %s, %i)\n", hWnd, hInst, debugstr_w(cmdline), show);
522
523 cmdline_copy = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(cmdline) + 1) * sizeof(WCHAR));
524 cmdline_ptr = cmdline_copy;
525 lstrcpyW(cmdline_copy, cmdline);
526
527 /* get the parameters at indexes 0 and 1 respectively */
528 szFilename = get_parameter(&cmdline_ptr, ',', TRUE);
529 szFlags = get_parameter(&cmdline_ptr, ',', TRUE);
530
531 if (szFlags)
532 dwFlags = wcstol(szFlags, NULL, 10);
533
534 res = DelNodeW(szFilename, dwFlags);
535
536 HeapFree(GetProcessHeap(), 0, cmdline_copy);
537
538 return res;
539}
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 451 of file files.c.

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

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 712 of file files.c.

714{
717 HRESULT res = S_OK;
718 DWORD dwFileCount = 0;
719 DWORD dwFilesFound = 0;
720 LPSTR szConvertedList = NULL;
721
722 TRACE("(%s, %s, %d, %s, %p, %d)\n", debugstr_a(CabName), debugstr_a(ExpandDir),
723 Flags, debugstr_a(FileList), LReserved, Reserved);
724
725 if (!CabName || !ExpandDir)
726 return E_INVALIDARG;
727
730
731 hCabinet = LoadLibraryA("cabinet.dll");
732 if (!hCabinet)
733 return E_FAIL;
734
735 ZeroMemory(&session, sizeof(SESSION));
736
737 pExtract = (void *)GetProcAddress(hCabinet, "Extract");
738 if (!pExtract)
739 {
740 res = E_FAIL;
741 goto done;
742 }
743
744 lstrcpyA(session.Destination, ExpandDir);
745
746 if (FileList)
747 {
748 szConvertedList = convert_file_list(FileList, &dwFileCount);
749 if (!szConvertedList)
750 {
751 res = E_FAIL;
752 goto done;
753 }
754
755 dwFilesFound = fill_file_list(&session, CabName, szConvertedList);
756 if (dwFilesFound != dwFileCount)
757 {
758 res = E_FAIL;
759 goto done;
760 }
761 }
762 else
763 session.Operation |= EXTRACT_FILLFILELIST;
764
765 session.Operation |= EXTRACT_EXTRACTFILES;
766 res = pExtract(&session, CabName);
767
768done:
771 HeapFree(GetProcessHeap(), 0, szConvertedList);
772
773 return res;
774}
static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles)
Definition: files.c:570
#define EXTRACT_EXTRACTFILES
Definition: files.c:545
static void free_file_list(SESSION *session)
Definition: files.c:675
static DWORD fill_file_list(SESSION *session, LPCSTR szCabName, LPCSTR szFileList)
Definition: files.c:648
#define EXTRACT_FILLFILELIST
Definition: files.c:544
#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:553
static HMODULE hCabinet
Definition: urlmon_main.c:45
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define ZeroMemory
Definition: winbase.h:1712
_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 804 of file files.c.

806{
807 char *cab_name = NULL, *expand_dir = NULL, *file_list = NULL;
808 HRESULT hres = S_OK;
809
810 TRACE("(%s, %s, %d, %s, %p, %d)\n", debugstr_w(CabName), debugstr_w(ExpandDir),
811 Flags, debugstr_w(FileList), LReserved, Reserved);
812
813 if(CabName) {
814 cab_name = heap_strdupWtoA(CabName);
815 if(!cab_name)
816 return E_OUTOFMEMORY;
817 }
818
819 if(ExpandDir) {
820 expand_dir = heap_strdupWtoA(ExpandDir);
821 if(!expand_dir)
823 }
824
825 if(SUCCEEDED(hres) && FileList) {
826 file_list = heap_strdupWtoA(FileList);
827 if(!file_list)
829 }
830
831 /* cabinet.dll, which does the real job of extracting files, doesn't have UNICODE API,
832 so we need W->A conversion at some point anyway. */
833 if(SUCCEEDED(hres))
834 hres = ExtractFilesA(cab_name, expand_dir, Flags, file_list, LReserved, Reserved);
835
836 heap_free(cab_name);
837 heap_free(expand_dir);
838 heap_free(file_list);
839 return hres;
840}
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:712
#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 625 of file files.c.

626{
627 DWORD dwLen = lstrlenA(szFile);
628 DWORD dwTestLen;
629
630 while (*szFileList)
631 {
632 dwTestLen = lstrlenA(szFileList);
633
634 if (dwTestLen == dwLen)
635 {
636 if (!lstrcmpiA(szFile, szFileList))
637 return TRUE;
638 }
639
640 szFileList += dwTestLen + 1;
641 }
642
643 return FALSE;
644}
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42

Referenced by fill_file_list().

◆ FileSaveMarkNotExistA()

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

Definition at line 847 of file files.c.

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

◆ FileSaveMarkNotExistW()

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

Definition at line 870 of file files.c.

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

◆ FileSaveRestoreA()

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

Definition at line 883 of file files.c.

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

◆ FileSaveRestoreOnINFA()

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

Definition at line 942 of file files.c.

945{
947 UNICODE_STRING backupdir, backupfile;
948 HRESULT hr;
949
950 TRACE("(%p, %s, %s, %s, %s, %s, %d)\n", hWnd, debugstr_a(pszTitle),
951 debugstr_a(pszINF), debugstr_a(pszSection), debugstr_a(pszBackupDir),
952 debugstr_a(pszBaseBackupFile), dwFlags);
953
957 RtlCreateUnicodeStringFromAsciiz(&backupdir, pszBackupDir);
958 RtlCreateUnicodeStringFromAsciiz(&backupfile, pszBaseBackupFile);
959
960 hr = FileSaveRestoreOnINFW(hWnd, title.Buffer, inf.Buffer, section.Buffer,
961 backupdir.Buffer, backupfile.Buffer, dwFlags);
962
966 RtlFreeUnicodeString(&backupdir);
967 RtlFreeUnicodeString(&backupfile);
968
969 return hr;
970}
HRESULT WINAPI FileSaveRestoreOnINFW(HWND hWnd, LPCWSTR pszTitle, LPCWSTR pszINF, LPCWSTR pszSection, LPCWSTR pszBackupDir, LPCWSTR pszBaseBackupFile, DWORD dwFlags)
Definition: files.c:995
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 995 of file files.c.

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

Referenced by FileSaveRestoreOnINFA().

◆ FileSaveRestoreW()

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

Definition at line 928 of file files.c.

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

Referenced by FileSaveRestoreA().

◆ fill_file_list()

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

Definition at line 648 of file files.c.

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

Referenced by ExtractFilesA().

◆ free_file_list()

static void free_file_list ( SESSION session)
static

Definition at line 675 of file files.c.

676{
677 struct FILELIST *next, *curr = session->FileList;
678
679 while (curr)
680 {
681 next = curr->next;
682 free_file_node(curr);
683 curr = next;
684 }
685}
static void free_file_node(struct FILELIST *pNode)
Definition: files.c:618
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 618 of file files.c.

619{
620 HeapFree(GetProcessHeap(), 0, pNode->FileName);
621 HeapFree(GetProcessHeap(), 0, pNode);
622}

Referenced by free_file_list().

◆ GetVersionFromFileA()

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

Definition at line 1011 of file files.c.

1013{
1014 TRACE("(%s, %p, %p, %d)\n", debugstr_a(Filename), MajorVer, MinorVer, Version);
1015 return GetVersionFromFileExA(Filename, MajorVer, MinorVer, Version);
1016}
HRESULT WINAPI GetVersionFromFileExA(LPCSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion)
Definition: files.c:1042
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:939
_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 1042 of file files.c.

1044{
1046 HRESULT res;
1047
1048 TRACE("(%s, %p, %p, %d)\n", debugstr_a(lpszFilename),
1049 pdwMSVer, pdwLSVer, bVersion);
1050
1052
1053 res = GetVersionFromFileExW(filename.Buffer, pdwMSVer, pdwLSVer, bVersion);
1054
1056
1057 return res;
1058}
HRESULT WINAPI GetVersionFromFileExW(LPCWSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion)
Definition: files.c:1078
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 1078 of file files.c.

1080{
1081 VS_FIXEDFILEINFO *pFixedVersionInfo;
1082 LANGANDCODEPAGE *pLangAndCodePage;
1083 DWORD dwHandle, dwInfoSize;
1084 WCHAR szWinDir[MAX_PATH];
1085 WCHAR szFile[MAX_PATH];
1086 LPVOID pVersionInfo = NULL;
1087 BOOL bFileCopied = FALSE;
1088 UINT uValueLen;
1089
1090 static const WCHAR backslash[] = {'\\',0};
1091 static const WCHAR translation[] = {
1092 '\\','V','a','r','F','i','l','e','I','n','f','o',
1093 '\\','T','r','a','n','s','l','a','t','i','o','n',0
1094 };
1095
1096 TRACE("(%s, %p, %p, %d)\n", debugstr_w(lpszFilename),
1097 pdwMSVer, pdwLSVer, bVersion);
1098
1099 *pdwLSVer = 0;
1100 *pdwMSVer = 0;
1101
1102 lstrcpynW(szFile, lpszFilename, MAX_PATH);
1103
1104 dwInfoSize = GetFileVersionInfoSizeW(szFile, &dwHandle);
1105 if (!dwInfoSize)
1106 {
1107 /* check that the file exists */
1109 return S_OK;
1110
1111 /* file exists, but won't be found by GetFileVersionInfoSize,
1112 * so copy it to the temp dir where it will be found.
1113 */
1114 GetWindowsDirectoryW(szWinDir, MAX_PATH);
1115 GetTempFileNameW(szWinDir, NULL, 0, szFile);
1116 CopyFileW(lpszFilename, szFile, FALSE);
1117 bFileCopied = TRUE;
1118
1119 dwInfoSize = GetFileVersionInfoSizeW(szFile, &dwHandle);
1120 if (!dwInfoSize)
1121 goto done;
1122 }
1123
1124 pVersionInfo = HeapAlloc(GetProcessHeap(), 0, dwInfoSize);
1125 if (!pVersionInfo)
1126 goto done;
1127
1128 if (!GetFileVersionInfoW(szFile, dwHandle, dwInfoSize, pVersionInfo))
1129 goto done;
1130
1131 if (bVersion)
1132 {
1133 if (!VerQueryValueW(pVersionInfo, backslash,
1134 (LPVOID *)&pFixedVersionInfo, &uValueLen))
1135 goto done;
1136
1137 if (!uValueLen)
1138 goto done;
1139
1140 *pdwMSVer = pFixedVersionInfo->dwFileVersionMS;
1141 *pdwLSVer = pFixedVersionInfo->dwFileVersionLS;
1142 }
1143 else
1144 {
1145 if (!VerQueryValueW(pVersionInfo, translation,
1146 (LPVOID *)&pLangAndCodePage, &uValueLen))
1147 goto done;
1148
1149 if (!uValueLen)
1150 goto done;
1151
1152 *pdwMSVer = pLangAndCodePage->wLanguage;
1153 *pdwLSVer = pLangAndCodePage->wCodePage;
1154 }
1155
1156done:
1157 HeapFree(GetProcessHeap(), 0, pVersionInfo);
1158
1159 if (bFileCopied)
1160 DeleteFileW(szFile);
1161
1162 return S_OK;
1163}
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:1049
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 1023 of file files.c.

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

◆ 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 565 of file files.c.