On a few occasions I have run into problems where some Windows API was returning a 'strange' error code. Here is a technique that works with some APIs:
To set a tracepoint:
To set a conditional breakpoint: