Re; cleanup shlfileop.c: why does this fail?
Joris Huizer
jorishuizer at planet.nl
Tue Jan 18 12:17:01 CST 2005
Juan Lang wrote:
> Hi Joris,
>
> pFromFile and pToFile are treated oddly. Pass them as WCHAR pointers to
> file_operation_on_data, not as pointers to WCHAR pointers. The
> implementation of file_operation_on_data does not behave the same way as
> the code it replaced.
>
> You want something like:
> +static int file_operation_on_data(WIN32_FIND_DATAW *wfd,SHFILEOPSTRUCTW
> *nFileOp, LPWSTR pFromFile,LPWSTR pToFile)
> +{
> + LPWSTR lpFileName = wfd->cAlternateFileName;
> + if (!lpFileName[0])
> + lpFileName = wfd->cFileName;
> + if (IsDotDir(lpFileName) ||
> + (IsAttribDir(wfd->dwFileAttributes) && (nFileOp->fFlags &
> FOF_FILESONLY)))
> + {
> + return 0; /* next name in pTempFrom(dir) */
> + }
> + SHFileStrCpyCatW(&pToFile[1], lpFileName, NULL);
> + SHFileStrCpyCatW(&pFromFile[1], lpFileName, NULL);
> + return SHFileOperationW (nFileOp);
> +}
Thanks, this works
>
> One other difference that jumps out at me:
>
> - lpFileOp->fAnyOperationsAborted = nFileOp.fAnyOperationsAborted;
> + /*lpFileOp->fAnyOperationsAborted = nFileOp.fAnyOperationsAborted;*/
>
> Why this change?
>
> --Juan
>
That line can be removed as
nFileOp = *(lpFileOp)
on the first line - the variable is never changed after that (yeah, if
we really like, we could get rid of it)
I hadn't removed it just like that, yet - but as it is useless, it can
be removed.
Thanks again
regards,
Joris
More information about the wine-devel
mailing list