NtUnloadDriver - NtDoc

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

/**
 * \brief The NtUnloadDriver function unloads 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 unload.
 * \return NTSTATUS The status code returned by the function. Possible values include, but are not limited to:
 * - STATUS_SUCCESS: The driver was successfully unloaded.
 * - STATUS_INVALID_PARAMETER: The DriverServiceName parameter is invalid.
 * - 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
NtUnloadDriver(
    _In_ PUNICODE_STRING DriverServiceName
    );

#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwUnloadDriver(
    _In_ PUNICODE_STRING DriverServiceName
    );

#endif

View code on GitHub

This function is documented in Windows Driver Kit.


DriverServiceName

Registry path in system format.

Requirements

Privilege: SeLoadDriverPrivilege

See also