Just a small note, Microsoft says ILFree shouldn't be used, use CoTaskMemFree instead.

Note When using Windows 2000 or later, use CoTaskMemFree rather than ILFree. ITEMIDLIST structures are always allocated with the Component Object Model (COM) task allocator on those platforms.