NtLoadDriver - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTIOAPI_H

/**
 * \brief The NtLoadDriver function loads a driver specified by the DriverServiceName parameter.
 * \param DriverServiceName A pointer to a UNICODE_STRING structure that specifies the name of the driver service to load.
 * \return NTSTATUS The status code returned by the function. Possible values include, but are not limited to:
 * - STATUS_SUCCESS: The driver was successfully loaded.
 * - STATUS_INVALID_PARAMETER: The DriverServiceName parameter is invalid.
 * - STATUS_INSUFFICIENT_RESOURCES: There are insufficient resources to load the driver.
 * - STATUS_OBJECT_NAME_NOT_FOUND: The specified driver service name was not found.
 * - STATUS_OBJECT_PATH_NOT_FOUND: The path to the driver service was not found.
 * - STATUS_OBJECT_NAME_COLLISION: A driver with the same name already exists.
 */
NTSYSCALLAPI
NTSTATUS
NTAPI
NtLoadDriver(
    _In_ PUNICODE_STRING DriverServiceName
    );

#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwLoadDriver(
    _In_ PUNICODE_STRING DriverServiceName
    );

#endif

View code on GitHub

This function is documented in Windows Driver Kit.


DriverServiceName

Registry path in system format. Path must begin with "\registry\machine\SYSTEM\CurrentControlSet\Services\..." where "..." is driver symbolic name.
Key must have at least 2 values:

Requirements

Privilege: SeLoadDriverPrivilege

See also