Arrays in the kernel?

I have a problem where I need to keep track of a variable number of items (UNICODE_STRINGS) in my driver. I don’t know how to initialize such a list. I’ve seen articles on singly and doubly linked lists. Maybe that’s the only safe way to do this?

Yep, that’s the case. There is a dearth of container support in the kernel. Someday, we’ll have a kernel-safe version of STL, but not today.

UNICODE_STRINGS are particularly obnoxious, because you have to remember to free the string buffer as well as the structure.