ReactOS 0.4.16-dev-197-g92996da
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 = HeapAlloc(GetProcessHeap(), 0, 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, %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}
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 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}
165
166/* FIXME: this is only for the local case, X:\ */
167#define ROOT_LENGTH 3
168
170 UINT_PTR Param1, UINT_PTR Param2)
171{
172 return 1;
173}
174
176 UINT_PTR Param1, UINT_PTR Param2)
177{
178 /* only be verbose for error notifications */
179 if (!Notification ||
183 {
185 Param1, Param2);
186 }
187
188 return 1;
189}
190
191/***********************************************************************
192 * AdvInstallFileA (ADVPACK.@)
193 *
194 * See AdvInstallFileW.
195 */
196HRESULT WINAPI AdvInstallFileA(HWND hwnd, LPCSTR lpszSourceDir, LPCSTR lpszSourceFile,
197 LPCSTR lpszDestDir, LPCSTR lpszDestFile,
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}
226
227/***********************************************************************
228 * AdvInstallFileW (ADVPACK.@)
229 *
230 * Copies a file from the source to a destination.
231 *
232 * PARAMS
233 * hwnd [I] Handle to the window used for messages.
234 * lpszSourceDir [I] Source directory.
235 * lpszSourceFile [I] Source filename.
236 * lpszDestDir [I] Destination directory.
237 * lpszDestFile [I] Optional destination filename.
238 * dwFlags [I] See advpub.h.
239 * dwReserved [I] Reserved. Must be 0.
240 *
241 * RETURNS
242 * Success: S_OK.
243 * Failure: E_FAIL.
244 *
245 * NOTES
246 * If lpszDestFile is NULL, the destination filename is the same as
247 * lpszSourceFIle.
248 */
249HRESULT WINAPI AdvInstallFileW(HWND hwnd, LPCWSTR lpszSourceDir, LPCWSTR lpszSourceFile,
250 LPCWSTR lpszDestDir, LPCWSTR lpszDestFile,
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}
329
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}
409
410/***********************************************************************
411 * DelNodeA (ADVPACK.@)
412 *
413 * See DelNodeW.
414 */
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}
430
431/***********************************************************************
432 * DelNodeW (ADVPACK.@)
433 *
434 * Deletes a file or directory
435 *
436 * PARAMS
437 * pszFileOrDirName [I] Name of file or directory to delete
438 * dwFlags [I] Flags; see include/advpub.h
439 *
440 * RETURNS
441 * Success: S_OK
442 * Failure: E_FAIL
443 *
444 * BUGS
445 * - Ignores flags
446 * - Native version apparently does a lot of checking to make sure
447 * we're not trying to delete a system directory etc.
448 */
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}
475
476/***********************************************************************
477 * DelNodeRunDLL32A (ADVPACK.@)
478 *
479 * See DelNodeRunDLL32W.
480 */
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}
496
497/***********************************************************************
498 * DelNodeRunDLL32W (ADVPACK.@)
499 *
500 * Deletes a file or directory, WinMain style.
501 *
502 * PARAMS
503 * hWnd [I] Handle to the window used for the display.
504 * hInst [I] Instance of the process.
505 * cmdline [I] Contains parameters in the order FileOrDirName,Flags.
506 * show [I] How the window should be shown.
507 *
508 * RETURNS
509 * Success: S_OK.
510 * Failure: E_FAIL.
511 */
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}
538
539/* The following definitions were copied from dlls/cabinet/cabinet.h */
540
541/* SESSION Operation */
542#define EXTRACT_FILLFILELIST 0x00000001
543#define EXTRACT_EXTRACTFILES 0x00000002
544
545struct FILELIST{
547 struct FILELIST *next;
549};
550
551typedef struct {
558 CHAR CurrentFile[MAX_PATH];
561} SESSION;
562
563static HRESULT (WINAPI *pExtract)(SESSION*, LPCSTR);
564
565/* removes legal characters before and after file list, and
566 * converts the file list to a NULL-separated list
567 */
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}
615
616static void free_file_node(struct FILELIST *pNode)
617{
618 HeapFree(GetProcessHeap(), 0, pNode->FileName);
619 HeapFree(GetProcessHeap(), 0, pNode);
620}
621
622/* determines whether szFile is in the NULL-separated szFileList */
623static BOOL file_in_list(LPCSTR szFile, LPCSTR szFileList)
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}
643
644
645/* returns the number of files that are in both the linked list and szFileList */
646static DWORD fill_file_list(SESSION *session, LPCSTR szCabName, LPCSTR szFileList)
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}
672
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}
684
685/***********************************************************************
686 * ExtractFilesA (ADVPACK.@)
687 *
688 * Extracts the specified files from a cab archive into
689 * a destination directory.
690 *
691 * PARAMS
692 * CabName [I] Filename of the cab archive.
693 * ExpandDir [I] Destination directory for the extracted files.
694 * Flags [I] Reserved.
695 * FileList [I] Optional list of files to extract. See NOTES.
696 * LReserved [I] Reserved. Must be NULL.
697 * Reserved [I] Reserved. Must be 0.
698 *
699 * RETURNS
700 * Success: S_OK.
701 * Failure: E_FAIL.
702 *
703 * NOTES
704 * FileList is a colon-separated list of filenames. If FileList is
705 * non-NULL, only the files in the list will be extracted from the
706 * cab file, otherwise all files will be extracted. Any number of
707 * spaces, tabs, or colons can be before or after the list, but
708 * the list itself must only be separated by colons.
709 */
711 LPCSTR FileList, LPVOID LReserved, DWORD Reserved)
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}
773
774/***********************************************************************
775 * ExtractFilesW (ADVPACK.@)
776 *
777 * Extracts the specified files from a cab archive into
778 * a destination directory.
779 *
780 * PARAMS
781 * CabName [I] Filename of the cab archive.
782 * ExpandDir [I] Destination directory for the extracted files.
783 * Flags [I] Reserved.
784 * FileList [I] Optional list of files to extract. See NOTES.
785 * LReserved [I] Reserved. Must be NULL.
786 * Reserved [I] Reserved. Must be 0.
787 *
788 * RETURNS
789 * Success: S_OK.
790 * Failure: E_FAIL.
791 *
792 * NOTES
793 * FileList is a colon-separated list of filenames. If FileList is
794 * non-NULL, only the files in the list will be extracted from the
795 * cab file, otherwise all files will be extracted. Any number of
796 * spaces, tabs, or colons can be before or after the list, but
797 * the list itself must only be separated by colons.
798 *
799 * BUGS
800 * Unimplemented.
801 */
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}
839
840/***********************************************************************
841 * FileSaveMarkNotExistA (ADVPACK.@)
842 *
843 * See FileSaveMarkNotExistW.
844 */
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}
852
853/***********************************************************************
854 * FileSaveMarkNotExistW (ADVPACK.@)
855 *
856 * Marks the files in the file list as not existing so they won't be
857 * backed up during a save.
858 *
859 * PARAMS
860 * pszFileList [I] NULL-separated list of filenames.
861 * pszDir [I] Path of the backup directory.
862 * pszBaseName [I] Basename of the INI file.
863 *
864 * RETURNS
865 * Success: S_OK.
866 * Failure: E_FAIL.
867 */
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}
875
876/***********************************************************************
877 * FileSaveRestoreA (ADVPACK.@)
878 *
879 * See FileSaveRestoreW.
880 */
882 LPSTR pszBaseName, DWORD dwFlags)
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}
903
904/***********************************************************************
905 * FileSaveRestoreW (ADVPACK.@)
906 *
907 * Saves or restores the files in the specified file list.
908 *
909 * PARAMS
910 * hDlg [I] Handle to the dialog used for the display.
911 * pszFileList [I] NULL-separated list of filenames.
912 * pszDir [I] Path of the backup directory.
913 * pszBaseName [I] Basename of the backup files.
914 * dwFlags [I] See advpub.h.
915 *
916 * RETURNS
917 * Success: S_OK.
918 * Failure: E_FAIL.
919 *
920 * NOTES
921 * If pszFileList is NULL on restore, all files will be restored.
922 *
923 * BUGS
924 * Unimplemented.
925 */
927 LPWSTR pszBaseName, DWORD dwFlags)
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}
934
935/***********************************************************************
936 * FileSaveRestoreOnINFA (ADVPACK.@)
937 *
938 * See FileSaveRestoreOnINFW.
939 */
941 LPCSTR pszSection, LPCSTR pszBackupDir,
942 LPCSTR pszBaseBackupFile, DWORD dwFlags)
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}
969
970/***********************************************************************
971 * FileSaveRestoreOnINFW (ADVPACK.@)
972 *
973 *
974 * PARAMS
975 * hWnd [I] Handle to the window used for the display.
976 * pszTitle [I] Title of the window.
977 * pszINF [I] Fully-qualified INF filename.
978 * pszSection [I] GenInstall INF section name.
979 * pszBackupDir [I] Directory to store the backup file.
980 * pszBaseBackupFile [I] Basename of the backup files.
981 * dwFlags [I] See advpub.h
982 *
983 * RETURNS
984 * Success: S_OK.
985 * Failure: E_FAIL.
986 *
987 * NOTES
988 * If pszSection is NULL, the default section will be used.
989 *
990 * BUGS
991 * Unimplemented.
992 */
994 LPCWSTR pszSection, LPCWSTR pszBackupDir,
995 LPCWSTR pszBaseBackupFile, DWORD dwFlags)
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}
1003
1004/***********************************************************************
1005 * GetVersionFromFileA (ADVPACK.@)
1006 *
1007 * See GetVersionFromFileExW.
1008 */
1010 LPDWORD MinorVer, BOOL Version )
1011{
1012 TRACE("(%s, %p, %p, %d)\n", debugstr_a(Filename), MajorVer, MinorVer, Version);
1013 return GetVersionFromFileExA(Filename, MajorVer, MinorVer, Version);
1014}
1015
1016/***********************************************************************
1017 * GetVersionFromFileW (ADVPACK.@)
1018 *
1019 * See GetVersionFromFileExW.
1020 */
1022 LPDWORD MinorVer, BOOL Version )
1023{
1024 TRACE("(%s, %p, %p, %d)\n", debugstr_w(Filename), MajorVer, MinorVer, Version);
1025 return GetVersionFromFileExW(Filename, MajorVer, MinorVer, Version);
1026}
1027
1028/* data for GetVersionFromFileEx */
1030{
1034
1035/***********************************************************************
1036 * GetVersionFromFileExA (ADVPACK.@)
1037 *
1038 * See GetVersionFromFileExW.
1039 */
1041 LPDWORD pdwLSVer, BOOL bVersion )
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}
1057
1058/***********************************************************************
1059 * GetVersionFromFileExW (ADVPACK.@)
1060 *
1061 * Gets the files version or language information.
1062 *
1063 * PARAMS
1064 * lpszFilename [I] The file to get the info from.
1065 * pdwMSVer [O] Major version.
1066 * pdwLSVer [O] Minor version.
1067 * bVersion [I] Whether to retrieve version or language info.
1068 *
1069 * RETURNS
1070 * Always returns S_OK.
1071 *
1072 * NOTES
1073 * If bVersion is TRUE, version information is retrieved, else
1074 * pdwMSVer gets the language ID and pdwLSVer gets the codepage ID.
1075 */
1077 LPDWORD pdwLSVer, BOOL bVersion )
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}
#define ADN_DEL_IF_EMPTY
Definition: DelNode.c:13
vector< FileInfo > FileList
Definition: DriveVolume.h:63
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
LPWSTR get_parameter(LPWSTR *params, WCHAR separator, BOOL quoted) DECLSPEC_HIDDEN
Definition: install.c:200
static char * heap_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
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
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 ERROR_SUCCESS
Definition: deptool.c:10
#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:1040
HRESULT WINAPI FileSaveRestoreA(HWND hDlg, LPSTR pszFileList, LPSTR pszDir, LPSTR pszBaseName, DWORD dwFlags)
Definition: files.c:881
static UINT CALLBACK pQuietQueueCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: files.c:169
HRESULT WINAPI FileSaveMarkNotExistA(LPSTR pszFileList, LPSTR pszDir, LPSTR pszBaseName)
Definition: files.c:845
HRESULT WINAPI GetVersionFromFileExW(LPCWSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion)
Definition: files.c:1076
HRESULT WINAPI GetVersionFromFileA(LPCSTR Filename, LPDWORD MajorVer, LPDWORD MinorVer, BOOL Version)
Definition: files.c:1009
HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags, LPCSTR FileList, LPVOID LReserved, DWORD Reserved)
Definition: files.c:710
static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles)
Definition: files.c:568
HRESULT WINAPI DelNodeA(LPCSTR pszFileOrDirName, DWORD dwFlags)
Definition: files.c:415
struct tagLANGANDCODEPAGE LANGANDCODEPAGE
HRESULT WINAPI AddDelBackupEntryA(LPCSTR lpcszFileList, LPCSTR lpcszBackupDir, LPCSTR lpcszBaseName, DWORD dwFlags)
Definition: files.c:59
#define EXTRACT_EXTRACTFILES
Definition: files.c:543
HRESULT WINAPI FileSaveRestoreOnINFA(HWND hWnd, LPCSTR pszTitle, LPCSTR pszINF, LPCSTR pszSection, LPCSTR pszBackupDir, LPCSTR pszBaseBackupFile, DWORD dwFlags)
Definition: files.c:940
static UINT CALLBACK pQueueCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: files.c:175
static HRESULT DELNODE_recurse_dirtree(LPWSTR fname, DWORD flags)
Definition: files.c:330
HRESULT WINAPI AdvInstallFileW(HWND hwnd, LPCWSTR lpszSourceDir, LPCWSTR lpszSourceFile, LPCWSTR lpszDestDir, LPCWSTR lpszDestFile, DWORD dwFlags, DWORD dwReserved)
Definition: files.c:249
static void free_file_list(SESSION *session)
Definition: files.c:673
#define ROOT_LENGTH
Definition: files.c:167
HRESULT WINAPI FileSaveRestoreW(HWND hDlg, LPWSTR pszFileList, LPWSTR pszDir, LPWSTR pszBaseName, DWORD dwFlags)
Definition: files.c:926
HRESULT WINAPI FileSaveRestoreOnINFW(HWND hWnd, LPCWSTR pszTitle, LPCWSTR pszINF, LPCWSTR pszSection, LPCWSTR pszBackupDir, LPCWSTR pszBaseBackupFile, DWORD dwFlags)
Definition: files.c:993
static DWORD fill_file_list(SESSION *session, LPCSTR szCabName, LPCSTR szFileList)
Definition: files.c:646
HRESULT WINAPI DelNodeW(LPCWSTR pszFileOrDirName, DWORD dwFlags)
Definition: files.c:449
static void free_file_node(struct FILELIST *pNode)
Definition: files.c:616
HRESULT WINAPI AdvInstallFileA(HWND hwnd, LPCSTR lpszSourceDir, LPCSTR lpszSourceFile, LPCSTR lpszDestDir, LPCSTR lpszDestFile, DWORD dwFlags, DWORD dwReserved)
Definition: files.c:196
static BOOL file_in_list(LPCSTR szFile, LPCSTR szFileList)
Definition: files.c:623
HRESULT WINAPI DelNodeRunDLL32A(HWND hWnd, HINSTANCE hInst, LPSTR cmdline, INT show)
Definition: files.c:481
HRESULT WINAPI FileSaveMarkNotExistW(LPWSTR pszFileList, LPWSTR pszDir, LPWSTR pszBaseName)
Definition: files.c:868
static LPWSTR ansi_to_unicode_list(LPCSTR ansi_list)
Definition: files.c:40
#define EXTRACT_FILLFILELIST
Definition: files.c:542
HRESULT WINAPI DelNodeRunDLL32W(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT show)
Definition: files.c:512
static LPCSTR
Definition: files.c:563
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:802
HRESULT WINAPI GetVersionFromFileW(LPCWSTR Filename, LPDWORD MajorVer, LPDWORD MinorVer, BOOL Version)
Definition: files.c:1021
#define GetProcessHeap()
Definition: compat.h:736
#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 HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#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:439
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
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
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:2352
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:4243
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4224
static void basename(LPCWSTR path, LPWSTR name)
Definition: profile.c:38
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
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
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 int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
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
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#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
LPCWSTR szPath
Definition: env.c:37
static PVOID ptr
Definition: dispmode.c:27
static UINT UINT last
Definition: font.c:45
HRESULT hres
Definition: protocol.c:465
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
unsigned int UINT
Definition: ndis.h:50
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:3016
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
#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)
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:584
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
TCHAR * cmdline
Definition: stretchblt.cpp:32
Definition: fci.h:44
struct FILELIST * next
Definition: files.c:547
LPSTR FileName
Definition: files.c:546
BOOL DoExtract
Definition: files.c:548
Definition: files.c:551
struct FILELIST * FilterList
Definition: files.c:560
INT Operation
Definition: files.c:556
ERF Error
Definition: files.c:553
INT FileSize
Definition: files.c:552
struct FILELIST * FileList
Definition: files.c:554
INT FileCount
Definition: files.c:555
Definition: parser.c:56
TConfig ini
Definition: tnconfig.cpp:45
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
static HMODULE hCabinet
Definition: urlmon_main.c:45
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int ret
_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
#define ZeroMemory
Definition: winbase.h:1736
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_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
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175