ReactOS 0.4.15-dev-7924-g5949c20
replace.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Command shell
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: base/shell/cmd/replace.c
5 * PURPOSE: Implements 'replace' cmd command
6 * PROGRAMMERS: Samuel Erdtman (samuel@erdtman.se)
7 */
8
9/* INCLUDES ******************************************************************/
10
11#include "precomp.h"
12
13#ifdef INCLUDE_CMD_REPLACE
14
15/* GLOBALS *******************************************************************/
16
17enum
18{
19 REPLACE_ADD = 0x001, /* /A */
20 REPLACE_CONFIRM = 0x002, /* /P */
21 REPLACE_READ_ONLY = 0x004, /* /R */
22 REPLACE_SUBDIR = 0x008, /* /S */
23 REPLACE_DISK = 0x010, /* /W */
24 REPLACE_UPDATE = 0x020, /* /U */
25};
26
27/* FUNCTIONS *****************************************************************/
28
29/* just makes a print out if there is a problem with the switches */
31{
34}
35
36/* retrieves the path dependent on the input file name */
38{
39 if (_tcslen(in) == 2 && in[1] == _T(':'))
41 else
43}
44
45
46/* makes the replace */
48{
51 HANDLE hFileSrc, hFileDest;
52 DWORD dwAttrib, dwRead, dwWritten;
54 BOOL bEof = FALSE;
55 FILETIME srcCreationTime, destCreationTime, srcLastAccessTime, destLastAccessTime;
56 FILETIME srcLastWriteTime, destLastWriteTime;
59 s[0] = _totupper(s[0]);
60 d[0] = _totupper(d[0]);
61 // ConOutPrintf(_T("old-src: %s\n"), s);
62 // ConOutPrintf(_T("old-dest: %s\n"), d);
63 // ConOutPrintf(_T("src: %s\n"), source);
64 // ConOutPrintf(_T("dest: %s\n"), dest);
65
66 /* Open up the sourcefile */
68 if (hFileSrc == INVALID_HANDLE_VALUE)
69 {
71 return 0;
72 }
73
74 /*
75 * Get the time from source file to be used in the comparison
76 * with dest time if update switch is set.
77 */
78 GetFileTime (hFileSrc, &srcCreationTime, &srcLastAccessTime, &srcLastWriteTime);
79
80 /*
81 * Retrieve the source attributes so that they later on
82 * can be inserted in to the destination.
83 */
84 dwAttrib = GetFileAttributes (source);
85
86 if (IsExistingFile (dest))
87 {
88 /*
89 * Resets the attributes to avoid problems with read only files,
90 * checks for read only has been made earlier.
91 */
93 /*
94 * Is the update flas set? The time has to be controled so that
95 * only older files are replaced.
96 */
98 {
99 /* Read destination time */
101 0, NULL);
102
103 if (hFileDest == INVALID_HANDLE_VALUE)
104 {
106 CloseHandle (hFileSrc);
107 return 0;
108 }
109
110 /* Compare time */
111 GetFileTime (hFileDest, &destCreationTime, &destLastAccessTime, &destLastWriteTime);
112 if (!((srcLastWriteTime.dwHighDateTime > destLastWriteTime.dwHighDateTime) ||
113 (srcLastWriteTime.dwHighDateTime == destLastWriteTime.dwHighDateTime &&
114 srcLastWriteTime.dwLowDateTime > destLastWriteTime.dwLowDateTime)))
115 {
116 CloseHandle (hFileSrc);
117 CloseHandle (hFileDest);
118 return 0;
119 }
120 CloseHandle (hFileDest);
121 }
122 /* Delete the old file */
124 }
125
126 /* Check confirm flag, and take appropriate action */
128 {
129 /* Output depending on add flag */
130 if (dwFlags & REPLACE_ADD)
132 else
134 if ( !FilePromptYNA (0))
135 {
136 CloseHandle (hFileSrc);
137 return 0;
138 }
139 }
140
141 /* Output depending on add flag */
142 if (dwFlags & REPLACE_ADD)
144 else
146
147 /* Make sure source and destination is not the same */
148 if (!_tcscmp(s, d))
149 {
151 CloseHandle (hFileSrc);
152 *doMore = FALSE;
153 return 0;
154 }
155
156 /* Open destination file to write to */
157 hFileDest = CreateFile (dest, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
158 if (hFileDest == INVALID_HANDLE_VALUE)
159 {
160 CloseHandle (hFileSrc);
162 *doMore = FALSE;
163 return 0;
164 }
165
166 /* Get buffer for the copy process */
168 if (buffer == NULL)
169 {
170 CloseHandle (hFileDest);
171 CloseHandle (hFileSrc);
173 return 0;
174 }
175
176 /* Put attribute and time to the new destination file */
177 SetFileAttributes (dest, dwAttrib);
178 SetFileTime (hFileDest, &srcCreationTime, &srcLastAccessTime, &srcLastWriteTime);
179 do
180 {
181 /* Read data from source */
182 ReadFile (hFileSrc, buffer, BUFF_SIZE, &dwRead, NULL);
183
184 /* Done? */
185 if (dwRead == 0)
186 break;
187
188 /* Write to destination file */
189 WriteFile (hFileDest, buffer, dwRead, &dwWritten, NULL);
190
191 /* Done! or ctrl break! */
192 if (dwWritten != dwRead || CheckCtrlBreak(BREAK_INPUT))
193 {
196 CloseHandle (hFileDest);
197 CloseHandle (hFileSrc);
198 nErrorLevel = 1;
199 return 0;
200 }
201 }
202 while (!bEof);
203
204 /* Return memory and close files */
206 CloseHandle (hFileDest);
207 CloseHandle (hFileSrc);
208
209 /* Return one file replaced */
210 return 1;
211}
212
213
214/* Function to iterate over source files and call replace for each of them */
216 TCHAR szSrcPath[MAX_PATH],
217 TCHAR szDestPath[MAX_PATH],
218 BOOL *doMore)
219{
220 TCHAR tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH];
221 INT filesReplaced=0;
222 INT_PTR i;
223 DWORD dwAttrib = 0;
225 WIN32_FIND_DATA findBuffer;
226
227 /* Get file handle to the sourcefile(s) */
228 hFile = FindFirstFile (szSrcPath, &findBuffer);
229
230 /*
231 * Strip the paths back to the folder they are in, so that
232 * the different filenames can be added if more than one.
233 */
234 for(i = (_tcslen(szSrcPath) - 1); i > -1; i--)
235 {
236 if (szSrcPath[i] != _T('\\'))
237 szSrcPath[i] = _T('\0');
238 else
239 break;
240 }
241
242 /* Go through all the sourcefiles and copy/replace them */
243 do
244 {
246 {
247 return filesReplaced;
248 }
249
250 /* Problem with file handler */
252 return filesReplaced;
253
254 /* We do not want to replace any .. . ocr directory */
255 if (!_tcscmp (findBuffer.cFileName, _T(".")) ||
256 !_tcscmp (findBuffer.cFileName, _T(".."))||
257 findBuffer.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
258 continue;
259
260 /* Add filename to destpath */
261 _tcscpy(tmpDestPath,szDestPath);
262 _tcscat (tmpDestPath, findBuffer.cFileName);
263
264 dwAttrib = GetFileAttributes(tmpDestPath);
265 /* Check add flag */
266 if (dwFlags & REPLACE_ADD)
267 {
268 if (IsExistingFile(tmpDestPath))
269 continue;
270 else
271 dwAttrib = 0;
272 }
273 else
274 {
275 if (!IsExistingFile(tmpDestPath))
276 continue;
277 }
278
279 /* Check if file is read only, if so check if that should be ignored */
280 if (dwAttrib & FILE_ATTRIBUTE_READONLY)
281 {
282 if (!(dwFlags & REPLACE_READ_ONLY))
283 {
285 *doMore = FALSE;
286 break;
287 }
288 }
289
290 /* Add filename to sourcepath, insted of wildcards */
291 _tcscpy(tmpSrcPath,szSrcPath);
292 _tcscat (tmpSrcPath, findBuffer.cFileName);
293
294 /* Make the replace */
295 if (replace(tmpSrcPath,tmpDestPath, dwFlags, doMore))
296 {
297 filesReplaced++;
298 }
299 else if (!*doMore)
300 {
301 /* The file to be replaced was the same as the source */
302 filesReplaced = -1;
303 break;
304 }
305
306 /* Take next sourcefile if any */
307 } while(FindNextFile (hFile, &findBuffer));
308
310
311 return filesReplaced;
312}
313
314/* If /s switch is specifyed all subdirs has to be considered */
316 TCHAR szSrcPath[MAX_PATH],
317 TCHAR szDestPath[MAX_PATH],
318 BOOL *doMore)
319{
321 WIN32_FIND_DATA findBuffer;
322 TCHAR tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH];
323 INT filesReplaced = 0;
324 INT_PTR i;
325
326 /*
327 * Add a wildcard to dest end so the it will be easy to iterate
328 * over all the files and directorys in the dest directory.
329 */
330 _tcscat(szDestPath, _T("*"));
331
332 /* Get the first file in the directory */
333 hFile = FindFirstFile (szDestPath, &findBuffer);
334
335 /* Remove the star added earlier to dest path */
336 for(i = (_tcslen(szDestPath) - 1); i > -1; i--)
337 {
338 if (szDestPath[i] != _T('\\'))
339 szDestPath[i] = _T('\0');
340 else
341 break;
342 }
343
344 /* Iterate over all filed directories in the dest dir */
345 do
346 {
347 /* Save the source path so that it will not be wrecked */
348 _tcscpy(tmpSrcPath,szSrcPath);
349 /* Check for reading problems */
351 {
352 ConOutFormatMessage (GetLastError(), tmpSrcPath);
353 return filesReplaced;
354 }
355
356 /*
357 * Check if the we should enter the dir or if it is a file
358 * or . or .. if so thake the next object to process.
359 */
360 if (!_tcscmp (findBuffer.cFileName, _T(".")) ||
361 !_tcscmp (findBuffer.cFileName, _T(".."))||
362 IsExistingFile(findBuffer.cFileName))
363 continue;
364 /* Add the destpath and the new dir path to tempDestPath */
365 _tcscpy(tmpDestPath,szDestPath);
366 _tcscat (tmpDestPath, findBuffer.cFileName);
367 /* Make sure that we have a directory */
368 if (IsExistingDirectory(tmpDestPath))
369 {
370 /* Add a \ to the end or the path */
371 if (szDestPath[_tcslen(tmpDestPath) - 1] != _T('\\'))
372 _tcscat(tmpDestPath, _T("\\"));
373 /* Call the function to replace files in the new directory */
374 filesReplaced += recReplace(dwFlags, tmpSrcPath, tmpDestPath, doMore);
375 /* If there were problems break e.g. read-only file */
376 if (!*doMore)
377 break;
378 _tcscpy(tmpSrcPath,szSrcPath);
379 /* Control the next level of subdirs */
380 filesReplaced += recFindSubDirs(dwFlags,tmpSrcPath,tmpDestPath, doMore);
381 if (!*doMore)
382 break;
383 }
384 /* Get the next handle */
385 } while(FindNextFile (hFile, &findBuffer));
386
388
389 return filesReplaced;
390}
391
393{
394 LPTSTR *arg;
395 INT argc, i,filesReplaced = 0, nFiles, srcIndex = -1, destIndex = -1;
396 DWORD dwFlags = 0;
397 TCHAR szDestPath[MAX_PATH], szSrcPath[MAX_PATH], tmpSrcPath[MAX_PATH];
398 BOOL doMore = TRUE;
399
400 /* Help wanted? */
401 if (!_tcsncmp (param, _T("/?"), 2))
402 {
404 return 0;
405 }
406
407 /* Divide the argument in to an array of c-strings */
408 arg = split (param, &argc, FALSE, FALSE);
409 nFiles = argc;
410
411 /* Read options */
412 for (i = 0; i < argc; i++)
413 {
414 if (arg[i][0] == _T('/'))
415 {
416 if (_tcslen(arg[i]) == 2)
417 {
418 switch (_totupper(arg[i][1]))
419 {
420 case _T('A'):
422 break;
423 case _T('P'):
425 break;
426 case _T('R'):
428 break;
429 case _T('S'):
431 break;
432 case _T('W'):
434 break;
435 case _T('U'):
437 break;
438 default:
440 freep(arg);
441 return 0;
442 }
443 }
444 else
445 {
447 freep(arg);
448 return 0;
449 }
450 nFiles--;
451 }
452 else
453 {
454 if (srcIndex == -1)
455 {
456 srcIndex = i;
457 }
458 else if (destIndex == -1)
459 {
460 destIndex = i;
461 }
462 else
463 {
465 freep(arg);
466 return 0;
467 }
468 }
469 }
470
471 /* See so that at least source is there */
472 if (nFiles < 1)
473 {
476 freep(arg);
477 return 1;
478 }
479 /* Check so that not both update and add switch is added and subdir */
481 {
484 freep(arg);
485 return 1;
486 }
487
488 /* If we have a destination get the full path */
489 if (destIndex != -1)
490 {
491 if (_tcslen(arg[destIndex]) == 2 && arg[destIndex][1] == ':')
492 GetRootPath(arg[destIndex],szDestPath,MAX_PATH);
493 else
494 {
495 /* Check for wildcards in destination directory */
496 if (_tcschr (arg[destIndex], _T('*')) != NULL ||
497 _tcschr (arg[destIndex], _T('?')) != NULL)
498 {
501 freep(arg);
502 return 1;
503 }
504 getPath(szDestPath, arg[destIndex]);
505 /* Make sure that destination exists */
506 if (!IsExistingDirectory(szDestPath))
507 {
510 freep(arg);
511 return 1;
512 }
513 }
514 }
515 else
516 {
517 /* Dest is current dir */
518 GetCurrentDirectory(MAX_PATH,szDestPath);
519 }
520
521 /* Get the full source path */
522 if (!(_tcslen(arg[srcIndex]) == 2 && arg[srcIndex][1] == ':'))
523 getPath(szSrcPath, arg[srcIndex]);
524 else
525 _tcscpy(szSrcPath,arg[srcIndex]);
526
527 /* Source does not have wildcards */
528 if (_tcschr (arg[srcIndex], _T('*')) == NULL &&
529 _tcschr (arg[srcIndex], _T('?')) == NULL)
530 {
531 /* Check so that source is not a directory, because that is not allowed */
532 if (IsExistingDirectory(szSrcPath))
533 {
536 freep(arg);
537 return 1;
538 }
539 /* Check if the file exists */
540 if (!IsExistingFile(szSrcPath))
541 {
543 freep(arg);
544 return 1;
545 }
546 }
547 /* /w switch is set so wait for any key to be pressed */
548 if (dwFlags & REPLACE_DISK)
549 {
550 msg_pause();
551 cgetchar();
552 }
553
554 /* Add an extra \ to the destination path if needed */
555 if (szDestPath[_tcslen(szDestPath) - 1] != _T('\\'))
556 _tcscat(szDestPath, _T("\\"));
557
558 /* Save source path */
559 _tcscpy(tmpSrcPath,szSrcPath);
560 /* Replace in dest dir */
561 filesReplaced += recReplace(dwFlags, tmpSrcPath, szDestPath, &doMore);
562 /* If subdir switch is set replace in the subdirs to */
563 if (dwFlags & REPLACE_SUBDIR && doMore)
564 {
565 filesReplaced += recFindSubDirs(dwFlags, szSrcPath, szDestPath, &doMore);
566 }
567
568 /* If source == dest write no more */
569 if (filesReplaced != -1)
570 {
571 /* No files replaced */
572 if (filesReplaced==0)
573 {
574 /* Add switch dependent output */
575 if (dwFlags & REPLACE_ADD)
577 else
579 }
580 /* Some files replaced */
581 else
582 {
583 /* Add switch dependent output */
584 if (dwFlags & REPLACE_ADD)
586 else
588 }
589 }
590 /* Return memory */
591 freep(arg);
592 return 1;
593}
594#endif /* INCLUDE_CMD_REPLACE */
static int argc
Definition: ServiceArgs.c:12
INT nErrorLevel
Definition: cmd.c:158
BOOL IsExistingDirectory(IN LPCTSTR pszPath)
Definition: misc.c:504
BOOL IsExistingFile(IN LPCTSTR pszPath)
Definition: misc.c:498
INT GetRootPath(IN LPCTSTR InPath, OUT LPTSTR OutPath, IN INT size)
Definition: internal.c:152
TCHAR cgetchar(VOID)
Definition: misc.c:41
VOID msg_pause(VOID)
Definition: error.c:167
INT FilePromptYNA(UINT)
Definition: misc.c:622
BOOL CheckCtrlBreak(INT)
Definition: misc.c:132
#define BUFF_SIZE
Definition: cmd.h:47
VOID GetPathCase(TCHAR *, TCHAR *)
Definition: misc.c:86
#define BREAK_INPUT
Definition: cmd.h:36
VOID ConOutResPaging(BOOL StartPaging, UINT resID)
Definition: console.c:182
#define ConOutResPrintf(uID,...)
Definition: console.h:47
#define ConOutFormatMessage(MessageId,...)
Definition: console.h:53
#define ConOutResPuts(uID)
Definition: console.h:35
#define STRING_ERROR_OUT_OF_MEMORY
Definition: resource.h:14
#define STRING_REPLACE_HELP1
Definition: resource.h:223
#define STRING_REPLACE_HELP7
Definition: resource.h:229
#define STRING_REPLACE_HELP11
Definition: resource.h:233
#define STRING_REPLACE_HELP3
Definition: resource.h:225
#define STRING_REPLACE_HELP4
Definition: resource.h:226
#define STRING_REPLACE_ERROR7
Definition: resource.h:66
#define STRING_COPY_ERROR1
Definition: resource.h:35
#define STRING_REPLACE_HELP5
Definition: resource.h:227
#define STRING_REPLACE_HELP9
Definition: resource.h:231
#define STRING_REPLACE_HELP2
Definition: resource.h:224
#define STRING_REPLACE_ERROR4
Definition: resource.h:63
#define STRING_REPLACE_HELP10
Definition: resource.h:232
#define STRING_REPLACE_ERROR5
Definition: resource.h:64
#define STRING_COPY_ERROR3
Definition: resource.h:37
#define STRING_REPLACE_ERROR6
Definition: resource.h:65
#define STRING_REPLACE_ERROR1
Definition: resource.h:60
#define STRING_REPLACE_ERROR2
Definition: resource.h:61
#define STRING_REPLACE_HELP8
Definition: resource.h:230
static VOID freep(LPSTR *p)
Definition: cmdcons.c:98
static LPSTR * split(LPSTR s, LPINT args)
Definition: cmdcons.c:163
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
BOOL WINAPI SetFileTime(IN HANDLE hFile, CONST FILETIME *lpCreationTime OPTIONAL, CONST FILETIME *lpLastAccessTime OPTIONAL, CONST FILETIME *lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:948
BOOL WINAPI GetFileTime(IN HANDLE hFile, OUT LPFILETIME lpCreationTime OPTIONAL, OUT LPFILETIME lpLastAccessTime OPTIONAL, OUT LPFILETIME lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:896
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble s
Definition: gl.h:2039
GLuint buffer
Definition: glext.h:5915
GLuint in
Definition: glext.h:9616
GLfloat param
Definition: glext.h:5796
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define _tcscmp
Definition: tchar.h:1424
#define _tcscat
Definition: tchar.h:622
#define _tcscpy
Definition: tchar.h:623
#define _tcsncmp
Definition: tchar.h:1428
#define _totupper
Definition: tchar.h:1509
#define _tcschr
Definition: tchar.h:1406
#define d
Definition: ke_i.h:81
#define CREATE_ALWAYS
Definition: disk.h:72
static char * dest
Definition: rtl.c:135
_In_ HANDLE hFile
Definition: mswsock.h:90
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define PAGE_READWRITE
Definition: nt_native.h:1304
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define MEM_RELEASE
Definition: nt_native.h:1316
#define GENERIC_WRITE
Definition: nt_native.h:90
#define MEM_COMMIT
Definition: nt_native.h:1313
static FILE * out
Definition: regtests2xml.c:44
void invalid_switch(LPTSTR is)
Definition: replace.c:30
INT recReplace(DWORD dwFlags, TCHAR szSrcPath[MAX_PATH], TCHAR szDestPath[MAX_PATH], BOOL *doMore)
Definition: replace.c:215
INT cmd_replace(LPTSTR param)
Definition: replace.c:392
void getPath(TCHAR *out, LPTSTR in)
Definition: replace.c:37
INT recFindSubDirs(DWORD dwFlags, TCHAR szSrcPath[MAX_PATH], TCHAR szDestPath[MAX_PATH], BOOL *doMore)
Definition: replace.c:315
@ REPLACE_UPDATE
Definition: replace.c:24
@ REPLACE_READ_ONLY
Definition: replace.c:21
@ REPLACE_SUBDIR
Definition: replace.c:22
@ REPLACE_DISK
Definition: replace.c:23
@ REPLACE_ADD
Definition: replace.c:19
@ REPLACE_CONFIRM
Definition: replace.c:20
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:47
DWORD dwHighDateTime
Definition: mapidefs.h:66
DWORD dwLowDateTime
Definition: mapidefs.h:65
int32_t INT_PTR
Definition: typedefs.h:64
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
#define _T(x)
Definition: vfdio.h:22
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
Definition: virtmem.c:65
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
Definition: virtmem.c:119
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define GetFileAttributes
Definition: winbase.h:3815
#define SetFileAttributes
Definition: winbase.h:3909
#define DeleteFile
Definition: winbase.h:3764
#define FindNextFile
Definition: winbase.h:3788
#define FindFirstFile
Definition: winbase.h:3782
#define CreateFile
Definition: winbase.h:3749
#define GetCurrentDirectory
Definition: winbase.h:3805
#define GetFullPathName
Definition: winbase.h:3821
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
void * arg
Definition: msvc.h:10
char TCHAR
Definition: xmlstorage.h:189
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define _tcslen
Definition: xmlstorage.h:198