RegistryFilter Error when data sent via DeviceIoControl

The user and all related content has been deleted.

UNICODE_STRING structures are not a good choice for passing data to kernel mode. The problem is that UNICODE_STRING has a pointer to a buffer. You’re not copying the string, you’re only copying the pointer. It’s a user-mode pointer, so it is only valid as long as that process is the current process. In your registry callback, it’s pointing into random space. Either pack the strings into a variable length structure, or allocate space in your ioctl handler and copy the user-mode data into a kernel-mode string buffer.