Tag
Explains that FILE_FLAG_DELETE_ON_CLOSE is irreversible, but you can achieve conditional deletion by using SetFileInformationByHandle to toggle the delete disposition.
Raymond Chen describes a technique using a helper process to precisely control which handles are inherited by a new process, avoiding accidental inheritance from other components in the same process.