NTSTATUS
MyfaultDeviceControl(
IN PFILE_OBJECT FileObject,
IN BOOLEAN Wait,
IN PVOID InputBuffer,
IN ULONG InputBufferLength,
OUT PVOID OutputBuffer,
IN ULONG OutputBufferLength,
IN ULONG IoControlCode,
OUT PIO_STATUS_BLOCK IoStatus,
IN PDEVICE_OBJECT DeviceObject
)
{
IoStatus->Status = STATUS_SUCCESS;
IoStatus->Information = 0;
switch ( IoControlCode ) {
case IOCTL_BUFFER_OVERFLOW:
BufferOverflow();
break;
>>>CUT<<<
case IOCTL_BUG_CHECK:
if( InputBufferLength != sizeof(ULONG)) {
IoStatus->Status = STATUS_INVALID_PARAMETER;
break;
}
!!>>>> BugCheck( *(PULONG) InputBuffer );
break;
default:
IoStatus->Status = STATUS_NOT_SUPPORTED;
break;
}
return IoStatus->Status;
}
VOID
BugCheck(
ULONG BugCheckCode
)
{
>>> KeBugCheckEx( BugCheckCode, 0, 0, 0, 0 );
}