Getting the Windows Driver Catalog

Is there an official / correct way to get the windows driver directory or just concatenate "\\Drivers"to GetSystemDirectory()?

To be clear, I mean the directory Driversthat is in the system directory (for example, System32). Yes, drivers can technically be anywhere, but is there an official way (like a function) to get this specific directory?

+3
source share
2 answers

It is hard-coded to the kernel, although drivers do not need to be loaded from there. Here are some bits taken from various parts of the I / O subsystem that load drivers:

#define SYSTEM32_DRIVERS_DIR        (L"\\System32\\drivers\\")

...

        pathLength = sizeof(L"\\SystemRoot\\System32\\Drivers\\") - sizeof(UNICODE_NULL);
        path = L"\\SystemRoot\\System32\\Drivers\\";
...
0
source

All Articles