Search code examples
cwindows-kernel

Windows Hostname (NetBIOS) in windows 10 kernel driver?


How can I get the Windows Hostname (NetBIOS) while coding a windows 10 kernel driver?

I know GetComputerNameExA works in User mode, but how do I do the same in kernel mode?


Solution

  • You can get hostname through the following registry path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName

    Read the registry.