[PATCH 3 of 3] shell32: implement SHPathPrepareForWrite
madewokherd+d41d at gmail.com
Sun Sep 2 10:08:43 CDT 2007
On 9/2/07, Dmitry Timoshkov <dmitry at codeweavers.com> wrote:
> It's better to not use fixed buffer sizes but allocate the buffer dynamically.
OK. I avoided that because I didn't want to have to worry about
freeing the buffer later when it's only needed in some cases.
> If the job must be done only when SHPPFW_IGNOREFILENAME is specified then
> don't do it in all cases. And using strrchrW would simplify the code a bit.
> Why there is no check for SHCreateDirectoryExW return value?
The return value of SHCreateDirectoryExW doesn't matter. All that
matters is whether the directory exists when the function returns. It
may or may not have existed when the function was called
(SHCreateDirectoryExW fails when that happens, but
SHPathPrepareForWrite should not fail).
I could check the SHCreateDirectoryExW return value and probably
decide on a result based on that, but I think it's better to write the
result-deciding logic only once.
> 0x10b == 267, therefore 0x8007010b is HRESULT_FROM_WIN32(ERROR_DIRECTORY)
> Please use above and in other places symbolic error names instead of hex,
> and print expected and received codes to make life easier for those who looks
> at the (failing) test results without looking at the source.
> For some reason your mailer attaches the patch in text and html formats,
> it would save some time/traffic by avoiding html in wine-patches.
So it does. I should be able to avoid that now that I know to look for it.
More information about the wine-devel