ReactOS 0.4.17-dev-804-g023d8af
files.c
Go to the documentation of this file.
1/*
2 * Advpack file functions
3 *
4 * Copyright 2006 James Hawkins
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include <stdarg.h>
22#include <stdlib.h>
23
24#include "windef.h"
25#include "winbase.h"
26#include "winuser.h"
27#include "winreg.h"
28#include "winnls.h"
29#include "winver.h"
30#include "winternl.h"
31#include "setupapi.h"
32#include "advpub.h"
33#include "fdi.h"
34#include "wine/debug.h"
35#include "advpack_private.h"
36
38
39/* converts an ansi double null-terminated list to a unicode list */
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 = malloc(wlen * sizeof(WCHAR));
50 MultiByteToWideChar(CP_ACP, 0, ansi_list, len, list, wlen);
51 return list;
52}
53
54/***********************************************************************
55 * AddDelBackupEntryA (ADVPACK.@)
56 *
57 * See AddDelBackupEntryW.
58 */
59HRESULT WINAPI AddDelBackupEntryA(LPCSTR lpcszFileList, LPCSTR lpcszBackupDir,
60 LPCSTR lpcszBaseName, DWORD dwFlags)
61{
62 UNICODE_STRING backupdir, basename;
63 LPWSTR filelist;
66
67 TRACE("(%s, %s, %s, %ld)\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 free(filelist);
86
87 RtlFreeUnicodeString(&backupdir);
89
90 return res;
91}
92
93/***********************************************************************
94 * AddDelBackupEntryW (ADVPACK.@)
95 *
96 * Either appends the files in the file list to the backup section of
97 * the specified INI, or deletes the entries from the INI file.
98 *
99 * PARAMS
100 * lpcszFileList [I] NULL-separated list of filenames.
101 * lpcszBackupDir [I] Path of the backup directory.
102 * lpcszBaseName [I] Basename of the INI file.
103 * dwFlags [I] AADBE_ADD_ENTRY adds the entries in the file list
104 * to the INI file, while AADBE_DEL_ENTRY removes
105 * the entries from the INI file.
106 *
107 * RETURNS
108 * S_OK in all cases.
109 *
110 * NOTES
111 * If the INI file does not exist before adding entries to it, the file
112 * will be created.
113 *
114 * If lpcszBackupDir is NULL, the INI file is assumed to exist in
115 * c:\windows or created there if it does not exist.
116 */
117HRESULT WINAPI AddDelBackupEntryW(LPCWSTR lpcszFileList, LPCWSTR lpcszBackupDir,
118 LPCWSTR lpcszBaseName, DWORD dwFlags)
119{
120 WCHAR szIniPath[MAX_PATH];
121 LPCWSTR szString = NULL;
122
123 TRACE("(%s, %s, %s, %ld)\n", debugstr_w(lpcszFileList),
124 debugstr_w(lpcszBackupDir), debugstr_w(lpcszBaseName), dwFlags);
125
126 if (!lpcszFileList || !*lpcszFileList)
127 return S_OK;
128
129 if (lpcszBackupDir)
130 lstrcpyW(szIniPath, lpcszBackupDir);
131 else
132 GetWindowsDirectoryW(szIniPath, MAX_PATH);
133
134 lstrcatW(szIniPath, L"\\");
135 lstrcatW(szIniPath, lpcszBaseName);
136 lstrcatW(szIniPath, L".ini");
137
139
141 szString = L"-1,0,0,0,0,0,-1";
142 else if (dwFlags & AADBE_DEL_ENTRY)
143 szString = NULL;
144
145 /* add or delete the INI entries */
146 while (*lpcszFileList)
147 {
148 WritePrivateProfileStringW(L"backup", lpcszFileList, szString, szIniPath);
149 lpcszFileList += lstrlenW(lpcszFileList) + 1;
150 }
151
152 /* hide the INI file */
154
155 return S_OK;
156}
157
158/* FIXME: this is only for the local case, X:\ */
159#define ROOT_LENGTH 3
160
162 UINT_PTR Param1, UINT_PTR Param2)
163{
164 return 1;
165}
166
168 UINT_PTR Param1, UINT_PTR Param2)
169{
170 /* only be verbose for error notifications */
171 if (!Notification ||
175 {
177 Param1, Param2);
178 }
179
180 return 1;
181}
182
183/***********************************************************************
184 * AdvInstallFileA (ADVPACK.@)
185 *
186 * See AdvInstallFileW.
187 */
188HRESULT WINAPI AdvInstallFileA(HWND hwnd, LPCSTR lpszSourceDir, LPCSTR lpszSourceFile,
189 LPCSTR lpszDestDir, LPCSTR lpszDestFile,
191{
192 UNICODE_STRING sourcedir, sourcefile;
193 UNICODE_STRING destdir, destfile;
194 HRESULT res;
195
196 TRACE("(%p, %s, %s, %s, %s, %ld, %ld)\n", hwnd, debugstr_a(lpszSourceDir),
197 debugstr_a(lpszSourceFile), debugstr_a(lpszDestDir),
198 debugstr_a(lpszDestFile), dwFlags, dwReserved);
199
200 if (!lpszSourceDir || !lpszSourceFile || !lpszDestDir)
201 return E_INVALIDARG;
202
203 RtlCreateUnicodeStringFromAsciiz(&sourcedir, lpszSourceDir);
204 RtlCreateUnicodeStringFromAsciiz(&sourcefile, lpszSourceFile);
205 RtlCreateUnicodeStringFromAsciiz(&destdir, lpszDestDir);
206 RtlCreateUnicodeStringFromAsciiz(&destfile, lpszDestFile);
207
208 res = AdvInstallFileW(hwnd, sourcedir.Buffer, sourcefile.Buffer,
209 destdir.Buffer, destfile.Buffer, dwFlags, dwReserved);
210
211 RtlFreeUnicodeString(&sourcedir);
212 RtlFreeUnicodeString(&sourcefile);
213 RtlFreeUnicodeString(&destdir);
214 RtlFreeUnicodeString(&destfile);
215
216 return res;
217}
218
219/***********************************************************************
220 * AdvInstallFileW (ADVPACK.@)
221 *
222 * Copies a file from the source to a destination.
223 *
224 * PARAMS
225 * hwnd [I] Handle to the window used for messages.
226 * lpszSourceDir [I] Source directory.
227 * lpszSourceFile [I] Source filename.
228 * lpszDestDir [I] Destination directory.
229 * lpszDestFile [I] Optional destination filename.
230 * dwFlags [I] See advpub.h.
231 * dwReserved [I] Reserved. Must be 0.
232 *
233 * RETURNS
234 * Success: S_OK.
235 * Failure: E_FAIL.
236 *
237 * NOTES
238 * If lpszDestFile is NULL, the destination filename is the same as
239 * lpszSourceFIle.
240 */
241HRESULT WINAPI AdvInstallFileW(HWND hwnd, LPCWSTR lpszSourceDir, LPCWSTR lpszSourceFile,
242 LPCWSTR lpszDestDir, LPCWSTR lpszDestFile,
244{
245 PSP_FILE_CALLBACK_W pFileCallback;
246 LPWSTR szDestFilename;
248 WCHAR szRootPath[ROOT_LENGTH];
249 DWORD dwLastError;
250 HSPFILEQ fileQueue;
251 PVOID pContext;
252
253 TRACE("(%p, %s, %s, %s, %s, %ld, %ld)\n", hwnd, debugstr_w(lpszSourceDir),
254 debugstr_w(lpszSourceFile), debugstr_w(lpszDestDir),
255 debugstr_w(lpszDestFile), dwFlags, dwReserved);
256
257 if (!lpszSourceDir || !lpszSourceFile || !lpszDestDir)
258 return E_INVALIDARG;
259
260 fileQueue = SetupOpenFileQueue();
261 if (fileQueue == INVALID_HANDLE_VALUE)
263
264 pContext = NULL;
265 dwLastError = ERROR_SUCCESS;
266
267 lstrcpynW(szRootPath, lpszSourceDir, ROOT_LENGTH);
268 szPath = lpszSourceDir + ROOT_LENGTH;
269
270 /* use lpszSourceFile as destination filename if lpszDestFile is NULL */
271 szDestFilename = wcsdup(lpszDestFile ? lpszDestFile : lpszSourceFile);
272
273 /* add the file copy operation to the setup queue */
274 if (!SetupQueueCopyW(fileQueue, szRootPath, szPath, lpszSourceFile, NULL,
275 NULL, lpszDestDir, szDestFilename, dwFlags))
276 {
277 dwLastError = GetLastError();
278 goto done;
279 }
280
282 0, 0, NULL);
283 if (!pContext)
284 {
285 dwLastError = GetLastError();
286 goto done;
287 }
288
289 /* don't output anything for AIF_QUIET */
290 if (dwFlags & AIF_QUIET)
291 pFileCallback = pQuietQueueCallback;
292 else
293 pFileCallback = pQueueCallback;
294
295 /* perform the file copy */
296 if (!SetupCommitFileQueueW(hwnd, fileQueue, pFileCallback, pContext))
297 {
298 dwLastError = GetLastError();
299 goto done;
300 }
301
302done:
304 SetupCloseFileQueue(fileQueue);
305
306 free(szDestFilename);
307
308 return HRESULT_FROM_WIN32(dwLastError);
309}
310
312{
313 DWORD fattrs = GetFileAttributesW(fname);
315
316 if (fattrs & FILE_ATTRIBUTE_DIRECTORY)
317 {
318 HANDLE hFindFile;
319 WIN32_FIND_DATAW w32fd;
320 BOOL done = TRUE;
321 int fname_len = lstrlenW(fname);
322#ifdef __REACTOS__
324 goto deleteinitialdirectory;
325#endif
326
327 /* Generate a path with wildcard suitable for iterating */
328 if (fname_len && fname[fname_len-1] != '\\') fname[fname_len++] = '\\';
329 lstrcpyW(fname + fname_len, L"*");
330
331 if ((hFindFile = FindFirstFileW(fname, &w32fd)) != INVALID_HANDLE_VALUE)
332 {
333 /* Iterate through the files in the directory */
334 for (done = FALSE; !done; done = !FindNextFileW(hFindFile, &w32fd))
335 {
336 TRACE("%s\n", debugstr_w(w32fd.cFileName));
337 if (lstrcmpW(L".", w32fd.cFileName) != 0 && lstrcmpW(L"..", w32fd.cFileName) != 0)
338 {
339 lstrcpyW(fname + fname_len, w32fd.cFileName);
340 if (DELNODE_recurse_dirtree(fname, flags) != S_OK)
341 {
342 break; /* Failure */
343 }
344 }
345 }
346 FindClose(hFindFile);
347 }
348
349 /* We're done with this directory, so restore the old path without wildcard */
350 *(fname + fname_len) = '\0';
351
352 if (done)
353 {
354#ifdef __REACTOS__
355deleteinitialdirectory:
356#endif
357 TRACE("%s: directory\n", debugstr_w(fname));
358#ifdef __REACTOS__
360 if (RemoveDirectoryW(fname))
361#else
363#endif
364 {
365 ret = S_OK;
366 }
367 }
368 }
369 else
370 {
371 TRACE("%s: file\n", debugstr_w(fname));
372#ifdef __REACTOS__
374 if (DeleteFileW(fname))
375#else
377#endif
378 {
379 ret = S_OK;
380 }
381 }
382
383 return ret;
384}
385
386/***********************************************************************
387 * DelNodeA (ADVPACK.@)
388 *
389 * See DelNodeW.
390 */
392{
393 UNICODE_STRING fileordirname;
394 HRESULT res;
395
396 TRACE("(%s, %ld)\n", debugstr_a(pszFileOrDirName), dwFlags);
397
398 RtlCreateUnicodeStringFromAsciiz(&fileordirname, pszFileOrDirName);
399
400 res = DelNodeW(fileordirname.Buffer, dwFlags);
401
402 RtlFreeUnicodeString(&fileordirname);
403
404 return res;
405}
406
407/***********************************************************************
408 * DelNodeW (ADVPACK.@)
409 *
410 * Deletes a file or directory
411 *
412 * PARAMS
413 * pszFileOrDirName [I] Name of file or directory to delete
414 * dwFlags [I] Flags; see include/advpub.h
415 *
416 * RETURNS
417 * Success: S_OK
418 * Failure: E_FAIL
419 *
420 * BUGS
421 * - Ignores flags
422 * - Native version apparently does a lot of checking to make sure
423 * we're not trying to delete a system directory etc.
424 */
426{
427 WCHAR fname[MAX_PATH];
429
430 TRACE("(%s, %ld)\n", debugstr_w(pszFileOrDirName), dwFlags);
431
432#ifdef __REACTOS__
434 FIXME("Flags %#x ignored!\n", dwFlags & ~ADN_DEL_IF_EMPTY);
435#else
436 if (dwFlags)
437 FIXME("Flags ignored!\n");
438#endif
439
440 if (pszFileOrDirName && *pszFileOrDirName)
441 {
442 lstrcpyW(fname, pszFileOrDirName);
443
444 /* TODO: Should check for system directory deletion etc. here */
445
447 }
448
449 return ret;
450}
451
452/***********************************************************************
453 * DelNodeRunDLL32A (ADVPACK.@)
454 *
455 * See DelNodeRunDLL32W.
456 */
458{
460 HRESULT hr;
461
462 TRACE("(%p, %p, %s, %i)\n", hWnd, hInst, debugstr_a(cmdline), show);
463
465
466 hr = DelNodeRunDLL32W(hWnd, hInst, params.Buffer, show);
467
469
470 return hr;
471}
472
473/***********************************************************************
474 * DelNodeRunDLL32W (ADVPACK.@)
475 *
476 * Deletes a file or directory, WinMain style.
477 *
478 * PARAMS
479 * hWnd [I] Handle to the window used for the display.
480 * hInst [I] Instance of the process.
481 * cmdline [I] Contains parameters in the order FileOrDirName,Flags.
482 * show [I] How the window should be shown.
483 *
484 * RETURNS
485 * Success: S_OK.
486 * Failure: E_FAIL.
487 */
489{
490 LPWSTR szFilename, szFlags;
491 LPWSTR cmdline_copy, cmdline_ptr;
492 DWORD dwFlags = 0;
493 HRESULT res;
494
495 TRACE("(%p, %p, %s, %i)\n", hWnd, hInst, debugstr_w(cmdline), show);
496
497 cmdline_copy = wcsdup(cmdline);
498 cmdline_ptr = cmdline_copy;
499
500 /* get the parameters at indexes 0 and 1 respectively */
501 szFilename = get_parameter(&cmdline_ptr, ',', TRUE);
502 szFlags = get_parameter(&cmdline_ptr, ',', TRUE);
503
504 if (szFlags)
505 dwFlags = wcstol(szFlags, NULL, 10);
506
507 res = DelNodeW(szFilename, dwFlags);
508
509 free(cmdline_copy);
510
511 return res;
512}
513
514/* The following definitions were copied from dlls/cabinet/cabinet.h */
515
516/* SESSION Operation */
517#define EXTRACT_FILLFILELIST 0x00000001
518#define EXTRACT_EXTRACTFILES 0x00000002
519
520struct FILELIST{
522 struct FILELIST *next;
524};
525
526typedef struct {
533 CHAR CurrentFile[MAX_PATH];
536} SESSION;
537
538static HRESULT (WINAPI *pExtract)(SESSION*, LPCSTR);
539
540/* removes legal characters before and after file list, and
541 * converts the file list to a NULL-separated list
542 */
544{
545 DWORD dwLen;
546 const char *first = FileList;
547 const char *last = FileList + strlen(FileList) - 1;
548 LPSTR szConvertedList, temp;
549
550 /* any number of these chars before the list is OK */
551 while (first < last && (*first == ' ' || *first == '\t' || *first == ':'))
552 first++;
553
554 /* any number of these chars after the list is OK */
555 while (last > first && (*last == ' ' || *last == '\t' || *last == ':'))
556 last--;
557
558 if (first == last)
559 return NULL;
560
561 dwLen = last - first + 3; /* room for double-null termination */
562 szConvertedList = malloc(dwLen);
563 lstrcpynA(szConvertedList, first, dwLen - 1);
564 szConvertedList[dwLen - 1] = '\0';
565
566 /* empty list */
567 if (!szConvertedList[0])
568 {
569 free(szConvertedList);
570 return NULL;
571 }
572
573 *dwNumFiles = 1;
574
575 /* convert the colons to double-null termination */
576 temp = szConvertedList;
577 while (*temp)
578 {
579 if (*temp == ':')
580 {
581 *temp = '\0';
582 (*dwNumFiles)++;
583 }
584
585 temp++;
586 }
587
588 return szConvertedList;
589}
590
591static void free_file_node(struct FILELIST *pNode)
592{
593 free(pNode->FileName);
594 free(pNode);
595}
596
597/* determines whether szFile is in the NULL-separated szFileList */
598static BOOL file_in_list(LPCSTR szFile, LPCSTR szFileList)
599{
600 DWORD dwLen = lstrlenA(szFile);
601 DWORD dwTestLen;
602
603 while (*szFileList)
604 {
605 dwTestLen = lstrlenA(szFileList);
606
607 if (dwTestLen == dwLen)
608 {
609 if (!lstrcmpiA(szFile, szFileList))
610 return TRUE;
611 }
612
613 szFileList += dwTestLen + 1;
614 }
615
616 return FALSE;
617}
618
619
620/* returns the number of files that are in both the linked list and szFileList */
621static DWORD fill_file_list(SESSION *session, LPCSTR szCabName, LPCSTR szFileList)
622{
623 DWORD dwNumFound = 0;
624 struct FILELIST *pNode;
625
626 session->Operation |= EXTRACT_FILLFILELIST;
627 if (pExtract(session, szCabName) != S_OK)
628 {
629 session->Operation &= ~EXTRACT_FILLFILELIST;
630 return -1;
631 }
632
633 pNode = session->FileList;
634 while (pNode)
635 {
636 if (!file_in_list(pNode->FileName, szFileList))
637 pNode->DoExtract = FALSE;
638 else
639 dwNumFound++;
640
641 pNode = pNode->next;
642 }
643
644 session->Operation &= ~EXTRACT_FILLFILELIST;
645 return dwNumFound;
646}
647
649{
650 struct FILELIST *next, *curr = session->FileList;
651
652 while (curr)
653 {
654 next = curr->next;
655 free_file_node(curr);
656 curr = next;
657 }
658}
659
660/***********************************************************************
661 * ExtractFilesA (ADVPACK.@)
662 *
663 * Extracts the specified files from a cab archive into
664 * a destination directory.
665 *
666 * PARAMS
667 * CabName [I] Filename of the cab archive.
668 * ExpandDir [I] Destination directory for the extracted files.
669 * Flags [I] Reserved.
670 * FileList [I] Optional list of files to extract. See NOTES.
671 * LReserved [I] Reserved. Must be NULL.
672 * Reserved [I] Reserved. Must be 0.
673 *
674 * RETURNS
675 * Success: S_OK.
676 * Failure: E_FAIL.
677 *
678 * NOTES
679 * FileList is a colon-separated list of filenames. If FileList is
680 * non-NULL, only the files in the list will be extracted from the
681 * cab file, otherwise all files will be extracted. Any number of
682 * spaces, tabs, or colons can be before or after the list, but
683 * the list itself must only be separated by colons.
684 */
686 LPCSTR FileList, LPVOID LReserved, DWORD Reserved)
687{
690 HRESULT res = S_OK;
691 DWORD dwFileCount = 0;
692 DWORD dwFilesFound = 0;
693 LPSTR szConvertedList = NULL;
694
695 TRACE("(%s, %s, %ld, %s, %p, %ld)\n", debugstr_a(CabName), debugstr_a(ExpandDir),
696 Flags, debugstr_a(FileList), LReserved, Reserved);
697
698 if (!CabName || !ExpandDir)
699 return E_INVALIDARG;
700
703
704 hCabinet = LoadLibraryA("cabinet.dll");
705 if (!hCabinet)
706 return E_FAIL;
707
708 ZeroMemory(&session, sizeof(SESSION));
709
710 pExtract = (void *)GetProcAddress(hCabinet, "Extract");
711 if (!pExtract)
712 {
713 res = E_FAIL;
714 goto done;
715 }
716
717 lstrcpyA(session.Destination, ExpandDir);
718
719 if (FileList)
720 {
721 szConvertedList = convert_file_list(FileList, &dwFileCount);
722 if (!szConvertedList)
723 {
724 res = E_FAIL;
725 goto done;
726 }
727
728 dwFilesFound = fill_file_list(&session, CabName, szConvertedList);
729 if (dwFilesFound != dwFileCount)
730 {
731 res = E_FAIL;
732 goto done;
733 }
734 }
735 else
736 session.Operation |= EXTRACT_FILLFILELIST;
737
738 session.Operation |= EXTRACT_EXTRACTFILES;
739 res = pExtract(&session, CabName);
740
741done:
744 free(szConvertedList);
745
746 return res;
747}
748
749/***********************************************************************
750 * ExtractFilesW (ADVPACK.@)
751 *
752 * Extracts the specified files from a cab archive into
753 * a destination directory.
754 *
755 * PARAMS
756 * CabName [I] Filename of the cab archive.
757 * ExpandDir [I] Destination directory for the extracted files.
758 * Flags [I] Reserved.
759 * FileList [I] Optional list of files to extract. See NOTES.
760 * LReserved [I] Reserved. Must be NULL.
761 * Reserved [I] Reserved. Must be 0.
762 *
763 * RETURNS
764 * Success: S_OK.
765 * Failure: E_FAIL.
766 *
767 * NOTES
768 * FileList is a colon-separated list of filenames. If FileList is
769 * non-NULL, only the files in the list will be extracted from the
770 * cab file, otherwise all files will be extracted. Any number of
771 * spaces, tabs, or colons can be before or after the list, but
772 * the list itself must only be separated by colons.
773 *
774 * BUGS
775 * Unimplemented.
776 */
779{
780 char *cab_name = NULL, *expand_dir = NULL, *file_list = NULL;
781 HRESULT hres = S_OK;
782
783 TRACE("(%s, %s, %ld, %s, %p, %ld)\n", debugstr_w(CabName), debugstr_w(ExpandDir),
784 Flags, debugstr_w(FileList), LReserved, Reserved);
785
786 if(CabName) {
787 cab_name = strdupWtoA(CabName);
788 if(!cab_name)
789 return E_OUTOFMEMORY;
790 }
791
792 if(ExpandDir) {
793 expand_dir = strdupWtoA(ExpandDir);
794 if(!expand_dir)
796 }
797
798 if(SUCCEEDED(hres) && FileList) {
800 if(!file_list)
802 }
803
804 /* cabinet.dll, which does the real job of extracting files, doesn't have UNICODE API,
805 so we need W->A conversion at some point anyway. */
806 if(SUCCEEDED(hres))
807 hres = ExtractFilesA(cab_name, expand_dir, Flags, file_list, LReserved, Reserved);
808
809 free(cab_name);
810 free(expand_dir);
812 return hres;
813}
814
815/***********************************************************************
816 * FileSaveMarkNotExistA (ADVPACK.@)
817 *
818 * See FileSaveMarkNotExistW.
819 */
821{
822 TRACE("(%s, %s, %s)\n", debugstr_a(pszFileList),
823 debugstr_a(pszDir), debugstr_a(pszBaseName));
824
825 return AddDelBackupEntryA(pszFileList, pszDir, pszBaseName, AADBE_DEL_ENTRY);
826}
827
828/***********************************************************************
829 * FileSaveMarkNotExistW (ADVPACK.@)
830 *
831 * Marks the files in the file list as not existing so they won't be
832 * backed up during a save.
833 *
834 * PARAMS
835 * pszFileList [I] NULL-separated list of filenames.
836 * pszDir [I] Path of the backup directory.
837 * pszBaseName [I] Basename of the INI file.
838 *
839 * RETURNS
840 * Success: S_OK.
841 * Failure: E_FAIL.
842 */
844{
845 TRACE("(%s, %s, %s)\n", debugstr_w(pszFileList),
846 debugstr_w(pszDir), debugstr_w(pszBaseName));
847
848 return AddDelBackupEntryW(pszFileList, pszDir, pszBaseName, AADBE_DEL_ENTRY);
849}
850
851/***********************************************************************
852 * FileSaveRestoreA (ADVPACK.@)
853 *
854 * See FileSaveRestoreW.
855 */
857 LPSTR pszBaseName, DWORD dwFlags)
858{
859 UNICODE_STRING filelist, dir, basename;
860 HRESULT hr;
861
862 TRACE("(%p, %s, %s, %s, %ld)\n", hDlg, debugstr_a(pszFileList),
863 debugstr_a(pszDir), debugstr_a(pszBaseName), dwFlags);
864
865 RtlCreateUnicodeStringFromAsciiz(&filelist, pszFileList);
868
869 hr = FileSaveRestoreW(hDlg, filelist.Buffer, dir.Buffer,
870 basename.Buffer, dwFlags);
871
872 RtlFreeUnicodeString(&filelist);
875
876 return hr;
877}
878
879/***********************************************************************
880 * FileSaveRestoreW (ADVPACK.@)
881 *
882 * Saves or restores the files in the specified file list.
883 *
884 * PARAMS
885 * hDlg [I] Handle to the dialog used for the display.
886 * pszFileList [I] NULL-separated list of filenames.
887 * pszDir [I] Path of the backup directory.
888 * pszBaseName [I] Basename of the backup files.
889 * dwFlags [I] See advpub.h.
890 *
891 * RETURNS
892 * Success: S_OK.
893 * Failure: E_FAIL.
894 *
895 * NOTES
896 * If pszFileList is NULL on restore, all files will be restored.
897 *
898 * BUGS
899 * Unimplemented.
900 */
902 LPWSTR pszBaseName, DWORD dwFlags)
903{
904 FIXME("(%p, %s, %s, %s, %ld) stub\n", hDlg, debugstr_w(pszFileList),
905 debugstr_w(pszDir), debugstr_w(pszBaseName), dwFlags);
906
907 return E_FAIL;
908}
909
910/***********************************************************************
911 * FileSaveRestoreOnINFA (ADVPACK.@)
912 *
913 * See FileSaveRestoreOnINFW.
914 */
916 LPCSTR pszSection, LPCSTR pszBackupDir,
917 LPCSTR pszBaseBackupFile, DWORD dwFlags)
918{
920 UNICODE_STRING backupdir, backupfile;
921 HRESULT hr;
922
923 TRACE("(%p, %s, %s, %s, %s, %s, %ld)\n", hWnd, debugstr_a(pszTitle),
924 debugstr_a(pszINF), debugstr_a(pszSection), debugstr_a(pszBackupDir),
925 debugstr_a(pszBaseBackupFile), dwFlags);
926
930 RtlCreateUnicodeStringFromAsciiz(&backupdir, pszBackupDir);
931 RtlCreateUnicodeStringFromAsciiz(&backupfile, pszBaseBackupFile);
932
933 hr = FileSaveRestoreOnINFW(hWnd, title.Buffer, inf.Buffer, section.Buffer,
934 backupdir.Buffer, backupfile.Buffer, dwFlags);
935
939 RtlFreeUnicodeString(&backupdir);
940 RtlFreeUnicodeString(&backupfile);
941
942 return hr;
943}
944
945/***********************************************************************
946 * FileSaveRestoreOnINFW (ADVPACK.@)
947 *
948 *
949 * PARAMS
950 * hWnd [I] Handle to the window used for the display.
951 * pszTitle [I] Title of the window.
952 * pszINF [I] Fully-qualified INF filename.
953 * pszSection [I] GenInstall INF section name.
954 * pszBackupDir [I] Directory to store the backup file.
955 * pszBaseBackupFile [I] Basename of the backup files.
956 * dwFlags [I] See advpub.h
957 *
958 * RETURNS
959 * Success: S_OK.
960 * Failure: E_FAIL.
961 *
962 * NOTES
963 * If pszSection is NULL, the default section will be used.
964 *
965 * BUGS
966 * Unimplemented.
967 */
969 LPCWSTR pszSection, LPCWSTR pszBackupDir,
970 LPCWSTR pszBaseBackupFile, DWORD dwFlags)
971{
972 FIXME("(%p, %s, %s, %s, %s, %s, %ld): stub\n", hWnd, debugstr_w(pszTitle),
973 debugstr_w(pszINF), debugstr_w(pszSection), debugstr_w(pszBackupDir),
974 debugstr_w(pszBaseBackupFile), dwFlags);
975
976 return E_FAIL;
977}
978
979/***********************************************************************
980 * GetVersionFromFileA (ADVPACK.@)
981 *
982 * See GetVersionFromFileExW.
983 */
985 LPDWORD MinorVer, BOOL Version )
986{
987 TRACE("(%s, %p, %p, %d)\n", debugstr_a(Filename), MajorVer, MinorVer, Version);
988 return GetVersionFromFileExA(Filename, MajorVer, MinorVer, Version);
989}
990
991/***********************************************************************
992 * GetVersionFromFileW (ADVPACK.@)
993 *
994 * See GetVersionFromFileExW.
995 */
997 LPDWORD MinorVer, BOOL Version )
998{
999 TRACE("(%s, %p, %p, %d)\n", debugstr_w(Filename), MajorVer, MinorVer, Version);
1000 return GetVersionFromFileExW(Filename, MajorVer, MinorVer, Version);
1001}
1002
1003/* data for GetVersionFromFileEx */
1005{
1009
1010/***********************************************************************
1011 * GetVersionFromFileExA (ADVPACK.@)
1012 *
1013 * See GetVersionFromFileExW.
1014 */
1016 LPDWORD pdwLSVer, BOOL bVersion )
1017{
1019 HRESULT res;
1020
1021 TRACE("(%s, %p, %p, %d)\n", debugstr_a(lpszFilename),
1022 pdwMSVer, pdwLSVer, bVersion);
1023
1025
1026 res = GetVersionFromFileExW(filename.Buffer, pdwMSVer, pdwLSVer, bVersion);
1027
1029
1030 return res;
1031}
1032
1033/***********************************************************************
1034 * GetVersionFromFileExW (ADVPACK.@)
1035 *
1036 * Gets the files version or language information.
1037 *
1038 * PARAMS
1039 * lpszFilename [I] The file to get the info from.
1040 * pdwMSVer [O] Major version.
1041 * pdwLSVer [O] Minor version.
1042 * bVersion [I] Whether to retrieve version or language info.
1043 *
1044 * RETURNS
1045 * Always returns S_OK.
1046 *
1047 * NOTES
1048 * If bVersion is TRUE, version information is retrieved, else
1049 * pdwMSVer gets the language ID and pdwLSVer gets the codepage ID.
1050 */
1052 LPDWORD pdwLSVer, BOOL bVersion )
1053{
1054 VS_FIXEDFILEINFO *pFixedVersionInfo;
1055 LANGANDCODEPAGE *pLangAndCodePage;
1056 DWORD dwHandle, dwInfoSize;
1057 WCHAR szWinDir[MAX_PATH];
1058 WCHAR szFile[MAX_PATH];
1059 LPVOID pVersionInfo = NULL;
1060 BOOL bFileCopied = FALSE;
1061 UINT uValueLen;
1062
1063 TRACE("(%s, %p, %p, %d)\n", debugstr_w(lpszFilename),
1064 pdwMSVer, pdwLSVer, bVersion);
1065
1066 *pdwLSVer = 0;
1067 *pdwMSVer = 0;
1068
1069 lstrcpynW(szFile, lpszFilename, MAX_PATH);
1070
1071 dwInfoSize = GetFileVersionInfoSizeW(szFile, &dwHandle);
1072 if (!dwInfoSize)
1073 {
1074 /* check that the file exists */
1076 return S_OK;
1077
1078 /* file exists, but won't be found by GetFileVersionInfoSize,
1079 * so copy it to the temp dir where it will be found.
1080 */
1081 GetWindowsDirectoryW(szWinDir, MAX_PATH);
1082 GetTempFileNameW(szWinDir, NULL, 0, szFile);
1083 CopyFileW(lpszFilename, szFile, FALSE);
1084 bFileCopied = TRUE;
1085
1086 dwInfoSize = GetFileVersionInfoSizeW(szFile, &dwHandle);
1087 if (!dwInfoSize)
1088 goto done;
1089 }
1090
1091 pVersionInfo = malloc(dwInfoSize);
1092 if (!pVersionInfo)
1093 goto done;
1094
1095 if (!GetFileVersionInfoW(szFile, dwHandle, dwInfoSize, pVersionInfo))
1096 goto done;
1097
1098 if (bVersion)
1099 {
1100 if (!VerQueryValueW(pVersionInfo, L"\\", (void **)&pFixedVersionInfo, &uValueLen))
1101 goto done;
1102
1103 if (!uValueLen)
1104 goto done;
1105
1106 *pdwMSVer = pFixedVersionInfo->dwFileVersionMS;
1107 *pdwLSVer = pFixedVersionInfo->dwFileVersionLS;
1108 }
1109 else
1110 {
1111 if (!VerQueryValueW(pVersionInfo, L"\\VarFileInfo\\Translation",
1112 (LPVOID *)&pLangAndCodePage, &uValueLen))
1113 goto done;
1114
1115 if (!uValueLen)
1116 goto done;
1117
1118 *pdwMSVer = pLangAndCodePage->wLanguage;
1119 *pdwLSVer = pLangAndCodePage->wCodePage;
1120 }
1121
1122done:
1123 free(pVersionInfo);
1124
1125 if (bFileCopied)
1126 DeleteFileW(szFile);
1127
1128 return S_OK;
1129}
#define ADN_DEL_IF_EMPTY
Definition: DelNode.c:13
vector< FileInfo > FileList
Definition: DriveVolume.h:63
LPWSTR get_parameter(LPWSTR *params, WCHAR separator, BOOL quoted)
Definition: install.c:178
static char * strdupWtoA(const WCHAR *str)
#define AADBE_DEL_ENTRY
Definition: advpub.h:116
#define AIF_QUIET
Definition: advpub.h:127
#define AADBE_ADD_ENTRY
Definition: advpub.h:115
unsigned int dir
Definition: maze.c:112
static long backup()
Definition: maze.c:403
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
Definition: list.h:37
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
#define ERROR_SUCCESS
Definition: deptool.c:10
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG Flags
Definition: dispmprt.h:245
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI GetVersionFromFileExA(LPCSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion)
Definition: files.c:1015
HRESULT WINAPI FileSaveRestoreA(HWND hDlg, LPSTR pszFileList, LPSTR pszDir, LPSTR pszBaseName, DWORD dwFlags)
Definition: files.c:856
static UINT CALLBACK pQuietQueueCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: files.c:161
HRESULT WINAPI FileSaveMarkNotExistA(LPSTR pszFileList, LPSTR pszDir, LPSTR pszBaseName)
Definition: files.c:820
HRESULT WINAPI GetVersionFromFileExW(LPCWSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion)
Definition: files.c:1051
HRESULT WINAPI GetVersionFromFileA(LPCSTR Filename, LPDWORD MajorVer, LPDWORD MinorVer, BOOL Version)
Definition: files.c:984
HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags, LPCSTR FileList, LPVOID LReserved, DWORD Reserved)
Definition: files.c:685
static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles)
Definition: files.c:543
HRESULT WINAPI DelNodeA(LPCSTR pszFileOrDirName, DWORD dwFlags)
Definition: files.c:391
struct tagLANGANDCODEPAGE LANGANDCODEPAGE
HRESULT WINAPI AddDelBackupEntryA(LPCSTR lpcszFileList, LPCSTR lpcszBackupDir, LPCSTR lpcszBaseName, DWORD dwFlags)
Definition: files.c:59
#define EXTRACT_EXTRACTFILES
Definition: files.c:518
HRESULT WINAPI FileSaveRestoreOnINFA(HWND hWnd, LPCSTR pszTitle, LPCSTR pszINF, LPCSTR pszSection, LPCSTR pszBackupDir, LPCSTR pszBaseBackupFile, DWORD dwFlags)
Definition: files.c:915
static UINT CALLBACK pQueueCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: files.c:167
static HRESULT DELNODE_recurse_dirtree(LPWSTR fname, DWORD flags)
Definition: files.c:311
HRESULT WINAPI AdvInstallFileW(HWND hwnd, LPCWSTR lpszSourceDir, LPCWSTR lpszSourceFile, LPCWSTR lpszDestDir, LPCWSTR lpszDestFile, DWORD dwFlags, DWORD dwReserved)
Definition: files.c:241
static void free_file_list(SESSION *session)
Definition: files.c:648
#define ROOT_LENGTH
Definition: files.c:159
HRESULT WINAPI FileSaveRestoreW(HWND hDlg, LPWSTR pszFileList, LPWSTR pszDir, LPWSTR pszBaseName, DWORD dwFlags)
Definition: files.c:901
HRESULT WINAPI FileSaveRestoreOnINFW(HWND hWnd, LPCWSTR pszTitle, LPCWSTR pszINF, LPCWSTR pszSection, LPCWSTR pszBackupDir, LPCWSTR pszBaseBackupFile, DWORD dwFlags)
Definition: files.c:968
static DWORD fill_file_list(SESSION *session, LPCSTR szCabName, LPCSTR szFileList)
Definition: files.c:621
HRESULT WINAPI DelNodeW(LPCWSTR pszFileOrDirName, DWORD dwFlags)
Definition: files.c:425
static void free_file_node(struct FILELIST *pNode)
Definition: files.c:591
HRESULT WINAPI AdvInstallFileA(HWND hwnd, LPCSTR lpszSourceDir, LPCSTR lpszSourceFile, LPCSTR lpszDestDir, LPCSTR lpszDestFile, DWORD dwFlags, DWORD dwReserved)
Definition: files.c:188
static BOOL file_in_list(LPCSTR szFile, LPCSTR szFileList)
Definition: files.c:598
HRESULT WINAPI DelNodeRunDLL32A(HWND hWnd, HINSTANCE hInst, LPSTR cmdline, INT show)
Definition: files.c:457
HRESULT WINAPI FileSaveMarkNotExistW(LPWSTR pszFileList, LPWSTR pszDir, LPWSTR pszBaseName)
Definition: files.c:843
static LPWSTR ansi_to_unicode_list(LPCSTR ansi_list)
Definition: files.c:40
#define EXTRACT_FILLFILELIST
Definition: files.c:517
HRESULT WINAPI DelNodeRunDLL32W(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT show)
Definition: files.c:488
static LPCSTR
Definition: files.c:538
HRESULT WINAPI AddDelBackupEntryW(LPCWSTR lpcszFileList, LPCWSTR lpcszBackupDir, LPCWSTR lpcszBaseName, DWORD dwFlags)
Definition: files.c:117
HRESULT WINAPI ExtractFilesW(LPCWSTR CabName, LPCWSTR ExpandDir, DWORD Flags, LPCWSTR FileList, LPVOID LReserved, DWORD Reserved)
Definition: files.c:777
HRESULT WINAPI GetVersionFromFileW(LPCWSTR Filename, LPDWORD MajorVer, LPDWORD MinorVer, BOOL Version)
Definition: files.c:996
#define CP_ACP
Definition: compat.h:109
#define lstrcpynA
Definition: compat.h:751
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:367
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:700
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:779
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:620
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
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2271
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
Definition: profile.c:1453
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4133
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:967
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1171
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:738
static void basename(LPCWSTR path, LPWSTR name)
Definition: profile.c:38
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2752
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
PVOID WINAPI SetupInitDefaultQueueCallbackEx(HWND owner, HWND progress, UINT msg, DWORD reserved1, PVOID reserved2)
Definition: queue.c:1638
UINT WINAPI SetupDefaultQueueCallbackW(PVOID context, UINT notification, UINT_PTR param1, UINT_PTR param2)
Definition: queue.c:1729
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
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
HINSTANCE hInst
Definition: dxdiag.c:13
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:940
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
#define SPFILENOTIFY_RENAMEERROR
Definition: fileqsup.h:33
UINT(CALLBACK * PSP_FILE_CALLBACK_W)(IN PVOID Context, IN UINT Notification, IN UINT_PTR Param1, IN UINT_PTR Param2)
Definition: fileqsup.h:66
#define SPFILENOTIFY_DELETEERROR
Definition: fileqsup.h:29
#define SPFILENOTIFY_COPYERROR
Definition: fileqsup.h:37
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
GLenum const GLfloat * params
Definition: glext.h:5645
GLbitfield flags
Definition: glext.h:7161
const GLint * first
Definition: glext.h:5794
GLenum GLsizei len
Definition: glext.h:6722
unsigned int UINT
Definition: sysinfo.c:13
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
const char * filename
Definition: ioapi.h:137
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define ZeroMemory
Definition: minwinbase.h:31
LPCWSTR szPath
Definition: env.c:37
static PVOID ptr
Definition: dispmode.c:27
HRESULT hres
Definition: protocol.c:465
static const LARGE_INTEGER *static const HANDLE const LARGE_INTEGER *static PSLIST_ENTRY PSLIST_ENTRY last
Definition: sync.c:64
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:3051
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
short WCHAR
Definition: pedump.c:58
char CHAR
Definition: pedump.c:57
static char title[]
Definition: ps.c:92
static unsigned __int64 next
Definition: rand_nt.c:6
#define SetupOpenFileQueue
Definition: fileqsup.c:29
#define SetupCommitFileQueueW
Definition: fileqsup.c:33
#define SetupCloseFileQueue
Definition: fileqsup.c:30
#define list
Definition: rosglue.h:35
static calc_node_t temp
Definition: rpn_ieee.c:38
_In_ LPCSTR pszDir
Definition: shellapi.h:609
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PVOID Context
Definition: storport.h:2269
TCHAR * cmdline
Definition: stretchblt.cpp:32
Definition: fci.h:44
struct FILELIST * next
Definition: files.c:522
LPSTR FileName
Definition: files.c:521
BOOL DoExtract
Definition: files.c:523
Definition: files.c:526
struct FILELIST * FilterList
Definition: files.c:535
INT Operation
Definition: files.c:531
ERF Error
Definition: files.c:528
INT FileSize
Definition: files.c:527
struct FILELIST * FileList
Definition: files.c:529
INT FileCount
Definition: files.c:530
_Field_z_ WCHAR cFileName[MAX_PATH]
Definition: minwinbase.h:291
Definition: parser.c:56
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint16_t * LPWSTR
Definition: typedefs.h:56
uint32_t * LPDWORD
Definition: typedefs.h:59
char * LPSTR
Definition: typedefs.h:51
int32_t INT
Definition: typedefs.h:58
static HMODULE hCabinet
Definition: urlmon_main.c:43
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:115
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:228