直接写IO端口0x64完成计算机重启操作

#include

VOID DriverUnload(IN PDRIVER_OBJECT DriverObject)
{
 KdPrint(("Driver Unload is Run!\n"));
}

NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject,IN PUNICODE_STRING RegistryPath)
{
 KdPrint(("Driver Entry is Run!\n"));
    DriverObject -> DriverUnload = DriverUnload;
 
 //汇编中直接写端口0x64完成计算机直接重启操作
 __asm {
  mov al,0xfe
  out 0x64,al
 }
    return STATUS_SUCCESS;
}

 

你可能感兴趣的:(驱动开发学习)