RT3823: Improve the robustness of event logging
authorGunnar Kudrjavets <gunnarku@microsoft.com>
Mon, 27 Apr 2015 18:14:45 +0000 (11:14 -0700)
committerRich Salz <rsalz@openssl.org>
Mon, 21 Sep 2015 18:29:41 +0000 (14:29 -0400)
commit4cd94416a452c3a3e0df24c297f7d2f0e6d5bb5f
tree3bfdc48cb721692354bc27e00046fb258f3fa0f7
parent7788638777934141e235d0add9341e852ac4e80b
RT3823: Improve the robustness of event logging

There are a couple of minor fixes here:

1) Handle the case when RegisterEventSource() fails (which it may for
various reasons) and do the work of logging the event only if it succeeds.

2) Handle the case when ReportEvent() fails and do our best in debug builds
to at least attempt somehow indicate that something has gone wrong. The
typical situation would be someone running tools like DbMon, DBWin32,
DebugView or just having the debugger attached. The intent is to make sure
that at least some data will be captured so that we can save hours and days
of debugging time.

3) Minor fix to change the MessageBox() flag to MB_ICONERROR. Though the
value of MB_ICONERROR is the same value as MB_ICONSTOP, the intent is
better conveyed by using MB_ICONERROR.

Testing performed:

1) Clean compilation for debug-VC-WIN32 and VC-WIN32.

2) Good test results (nmake -f ms\ntdll.mak test) for debug-VC-WIN32 and
VC-WIN32.

3) Stepped through relevant changes using WinDBG and exercised the impacted
code paths.

Signed-off-by: Rich Salz <rsalz@akamai.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/cryptlib.c