The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
I am trying to read a config.txt file that contains a list of paths separated by ";" from a minifilter.
config.txt file looks like:
instance_setup() method I do:
HANDLE fileHandle = NULL; OBJECT_ATTRIBUTES objectAttributes; PVOID result; result = ExAllocatePool(NonPagedPool, 65536); PFILE_OBJECT fileObject = NULL; UNICODE_STRING myUnicodeStr; RtlInitUnicodeString(&myUnicodeStr, config_file_path); InitializeObjectAttributes(&objectAttributes, &myUnicodeStr, OBJ_CASE_INSENSITIVE | OBJ_OPENIF, NULL,NULL); IO_STATUS_BLOCK ioStatus; FltCreateFile(flt_objects->Filter, flt_objects->Instance, &fileHandle, GENERIC_READ, &objectAttributes, &ioStatus, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ, FILE_OPEN, FILE_SEQUENTIAL_ONLY, NULL, 0, 0); ObReferenceObjectByHandle(fileHandle, GENERIC_READ, NULL, KernelMode, &fileObject, NULL); ULONG bytes_read; FltReadFile(flt_objects->Instance, fileObject, NULL, 65536, result, FLTFL_IO_OPERATION_DO_NOT_UPDATE_BYTE_OFFSET, &bytes_read, NULL, NULL); FltClose(fileHandle); //result should have the content of file
I am getting a blue screen when starting the minifilter. I´ve tested that the code works properly until
FltCreateFile (I am able to get a proper fileHandler). I do not see what I am doing wrong after this.
|Upcoming OSR Seminars|
|OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!|
|Kernel Debugging||30 January 2023||Live, Online|
|Developing Minifilters||20 March 2023||Live, Online|
|Writing WDF Drivers||TBD 2023||Live, Online|
|Internals & Software Drivers||17 April 2023||Live, Online|