microsoft / wil

Windows Implementation Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WIL diagnostic level 2 not working

JeffMill opened this issue · comments

            if (failure.pszFile != nullptr)
            {
                dest = details::LogStringPrintf(dest, destEnd, L"%hs(%u)[\\%hs!%p](file://%25hs!%25p): ", failure.pszFile, failure.uLineNumber, failure.pszModule, failure.returnAddress);
            }
            else
            {
                dest = details::LogStringPrintf(dest, destEnd, L"%hs!%p: ", failure.pszModule, failure.returnAddress);
            }

The code says “Well, if you don’t provide a file name, then I’m just going to log the module named and return address and not bother with a line number.”

Having said that, level 2 is pretty worthless, so maybe it should be removed with a #pragma error if that level is chosen.

Level 2 is supposed to be:

// 2   - Line number
//        ConsoleApplication1.exe!0026E622: ReturnHr(1) tid(5d60) 80004005 Unspecified error
//        Msg:[Optional text sent to _MSG]