In my minifilter driver I would like to read data from an ADS of a file on pre-read.
I understand I have 2 options to open ADS:
1. Get the file name, allocate a string and create the ADS full name (file name + ADS name), and open the ADS using FltCreateFile.
2. Open the ADS from a file handle: I need to open the file first (using FltCreateFile) to get a file handle, and then open the ADS using this handle & ADS name.
I don't want to get the name every time, or maintain it because it may change.
I also don't like the overhead of 2 calls to FltCreateFile in the second option.
Is there a way to open ADS using file id and ADS name? Or maybe in the second option, get a handle to the file (from file object?) without the overhead of opening it?