Hi there.
For a legacy application that expects all its customization (.dlls,
mostly) in its working directory and because I need to constantly
switch projects (which involves "copy the working directory, replace
it with another one and restart") I searched for a kind of unionfs[1]
for windows, which would allow me to create a logical view on the
application directory which includes external directories as
neccessary.
Sample:
C:\MyApp\Bin\
C:\MyApp\Projects\Foo\
I'd like to map all file requests that would fail for the Bin to check
another directory again.
Being new to this stuff (and doing it out of lazyness, since the
process described above sucks) I'd love to hear that this barely
involves dispatching IRP_MJ_CREATE?
My current idea would be to deploy a minifilter which does the
following steps in the PreCreate event:
- Check if this request wants a file inside of my Bin directory., else
ignore the request
- Check if the request is readonly (no create file, no append), else
ignore the request
- Check if the requested file exists (ZwFileOpen?) and
- ignore the request if the file exists
- redirect the request to the overlay directory otherwise (setting
the filenameinfo and marking the request as dirty)
Since I'm bloody new here: Can anyone comment on obvious mistakes? Is
this too hard for a beginner's (talking about drivers here) task?
Thanks in advance,
Ben