EnumDeviceDrivers

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
);
 

Parameters

lpImageBase
Pointer to an array that receives the list of load addresses for the device drivers.
cb
Specifies the size, in bytes, of the lpImageBase array. If the value is zero, lpcbNeeded receives the size, in bytes, of the array needed to store the load addresses.
lpcbNeeded
Receives the number of bytes returned in the lpImageBase array.

Return Value

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.

Remarks

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).

See Also

Process Status Helper Overview, PSAPI Functions