The EnumDeviceDrivers function retrieves the load address for each device driver in the system.
BOOL EnumDeviceDrivers(
LPVOID *lpImageBase, // array to receive the load addresses
DWORD cb, // size of the array
LPDWORD lpcbNeeded // receives the number of bytes returned
);
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
It is a good idea to give EnumDeviceDrivers a large array of LPVOID values, because it is hard to predict how many device drivers there will be at the time you call EnumDeviceDrivers. To determine how many device drivers were enumerated by the call to EnumDeviceDrivers, divide the resulting value in the lpcbNeeded parameter by sizeof(LPVOID).
Process Status Helper Overview, PSAPI Functions