Site icon EfmSoft

What does HRESULT 0x801F0002 (ERROR_FLT_CONTEXT_ALREADY_DEFINED) mean?

 
Previous Next
ERROR_FLT_NO_HANDLER_DEFINED ERROR_FLT_INVALID_ASYNCHRONOUS_REQUEST

ERROR_FLT_CONTEXT_ALREADY_DEFINED

The object already owns a context of this type

ERROR_FLT_CONTEXT_ALREADY_DEFINED is normally returned by a FltSetXxxContext routine when FLT_SET_CONTEXT_KEEP_IF_EXISTS was requested and another context is already attached to the same object for this minifilter instance. It is a race-aware result: two threads can both allocate and initialize candidates, but only one becomes the installed context.

The losing thread should use the existing context returned through OldContext when the specific API supports it, then release every reference it owns. Replacing the context without a deliberate lifetime design can lose state observed by concurrent I/O and can invoke cleanup callbacks while other code still assumes the old object is authoritative.

Safe handling of the set race

References


Looking for a different code? Search another status or error code.

Exit mobile version