Error Reporting and Handling
The CBFS Vault component APIs communicate errors using the Win32 error codes defined in WinError.h, which is part of the Windows Platform SDK. The CBFS Vault system drivers, however, use NT native error codes, which don't have one-to-one mappings with Win32 error codes. The component includes logic for converting between the two as necessary, and that logic can be updated if there are any codes that are not covered.
Additionally, there are certain error codes which CBFS Vault uses in a special manner. For more information about such error codes, please refer to the Error Codes page.
Reporting Errors to the Component from Event Handlers
If the event has a ResultCode parameter, the event handler can use it to return the result code of the operation to the component. The ResultCode parameter is set to 0 by default, which indicates the operation was successful.
If an unhandled exception occurs in the event handler, it will be caught by the component, which will fire the OnError event.
In some events, the OS doesn't expect the error code to be returned and either the component or the OS ignores the returned error code. Please, refer to the description of a particular event for more information.
How to Handle Errors Reported by the Component
If an error occurs, the component will throw an exception. The Code property of the exception object will contain an error code, and the Message property will contain an error message (if available).