[wix-devs] Debugging WIX4/Burn Unit tests

Sean Hall r.sean.hall at gmail.com
Tue Nov 1 13:23:58 PDT 2022


No, the function is trying to determine if a file is inside a directory. If
the given path is equal  to the given directory then it is the directory
itself. I don't consider a directory to contain itself.

On Tue, Nov 1, 2022 at 3:16 PM Hoover, Jacob <Jacob.Hoover at greenheck.com>
wrote:

> Wouldn’t it only be  less than?
>
>
>
> *From:* wix-devs <wix-devs-bounces at lists.wixtoolset.org> *On Behalf Of *Sean
> Hall via wix-devs
> *Sent:* Tuesday, November 1, 2022 3:13 PM
> *To:* WiX Toolset Developer Mailing List <wix-devs at lists.wixtoolset.org>
> *Cc:* Sean Hall <r.sean.hall at gmail.com>
> *Subject:* Re: [wix-devs] Debugging WIX4/Burn Unit tests
>
>
>
> > however I am unsure on the next line..
>
> It's part of the optimization of not calculating the length of the second
> string. If we have to calculate the length, then remove that line and
> return S_FALSE if cchPath <= cchDirectory before comparing the string.
>
> On Tue, Nov 1, 2022 at 3:08 PM Hoover, Jacob <Jacob.Hoover at greenheck.com>
> wrote:
>
> > size_t cchPath = 0;
> >
> > …
> >
> > hr = ::StringCchLengthW(sczCanonicalizedPath, STRSAFE_MAX_CCH,
> > &cchPath);
> >
> > PathExitOnFailure(hr, "Failed to get length of canonicalized path.");
> >
> >
> >
> >
> >
> > if (CSTR_EQUAL != ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE,
> > sczCanonicalizedDirectory, (DWORD)cchDirectory, sczCanonicalizedPath,
> > cchDirectory < cchPath ? (DWORD)cchDirectory: (DWORD)cchPath))
> >
> > {
> >
> > ExitFunction1(hr = S_FALSE);
> >
> > }
> >
> >
> >
> > Avoids the AV, however I am unsure on the next line..
> >
> >
> >
> > hr = sczCanonicalizedPath[cchDirectory] ? S_OK : S_FALSE;
>


More information about the wix-devs mailing list