return STATUS_SUCCESS;
}
+static
+NTSTATUS
+KsecDeviceControl(
+ ULONG IoControlCode,
+ PVOID Buffer,
+ SIZE_T InputLength,
+ PSIZE_T OutputLength)
+{
+ NTSTATUS Status;
+
+ Status = STATUS_SUCCESS;
+
+ /* Check ioctl code */
+ switch (IoControlCode)
+ {
+ case IOCTL_KSEC_GEN_RANDOM:
+
+ Status = KsecGenRandom(Buffer, *OutputLength);
+ break;
+
+ default:
+ DPRINT1("Unhandled control code 0x%lx\n", IoControlCode);
+ __debugbreak();
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ return Status;
+}
+
NTSTATUS
NTAPI
KsecDdDispatch(
ULONG_PTR Information;
NTSTATUS Status;
PVOID Buffer;
- SIZE_T OutputLength;
+ SIZE_T InputLength, OutputLength;
FILE_INFORMATION_CLASS FileInfoClass;
FS_INFORMATION_CLASS FsInfoClass;
+ ULONG IoControlCode;
IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
Information = OutputLength;
break;
+ case IRP_MJ_DEVICE_CONTROL:
+
+ /* Extract the parameters */
+ Buffer = Irp->AssociatedIrp.SystemBuffer;
+ InputLength = IoStackLocation->Parameters.DeviceIoControl.InputBufferLength;
+ OutputLength = IoStackLocation->Parameters.DeviceIoControl.OutputBufferLength;
+ IoControlCode = IoStackLocation->Parameters.DeviceIoControl.IoControlCode;
+
+ /* Call the internal function */
+ Status = KsecDeviceControl(IoControlCode,
+ Buffer,
+ InputLength,
+ &OutputLength);
+ Information = OutputLength;
+ break;
+
default:
DPRINT1("Unhandled major function %lu!\n",
IoStackLocation->MajorFunction);