The INVALID_PROCESS_DETACH_ATTEMPT bug check has a value of 0x00000006.
This bug check appears very infrequently. This bug check can be caused by calling KeStackAttachProcess routine and subsequently calling KeUnstackDetachProcess in the driver's implementation of the PLOAD_IMAGE_NOTIFY_ROUTINE callback function. The callback runs in a thread of the process in which the image loaded.
Important This topic is for programmers. If you are a customer who has received a blue screen error code while using your computer, see Troubleshoot blue screen errors.