weird return values like 0xd0000510 (NTSTATUS, but nonexistent facility)
That corresponds to `STATUS_ALREADY_INITIALIZED`. I'm not sure, but I remember reading somewhere that in `NTSTATUS` values, bit 28 (the low bit of the high nibble) is set to turn it into an `HRESULT`... (/me checks) It's documented in MS's `<ntstatus.h>` to be reserved, but it's definitely not part of the facility code.
or 0x88760868 (non-existent HRESULT facility)
That's `D3DERR_DEVICELOST`. Facility 0x876 is the old DirectDraw/Direct3D facility code (`_FACDD`/`_FACD3D`); 0x868 is 2152 in decimal. You won't find these in `<winerror.h>`.