25 __in PDEVICE_OBJECT DeviceObject,
30 PIO_STACK_LOCATION stackLocation;
34 KPROCESSOR_MODE accessMode;
35 UCHAR capturedInput[16 *
sizeof(ULONG_PTR)];
36 PVOID capturedInputPointer;
38 #define VERIFY_INPUT_LENGTH \
41 C_ASSERT(sizeof(*input) <= sizeof(capturedInput)); \
43 if (inputLength != sizeof(*input)) \
45 status = STATUS_INFO_LENGTH_MISMATCH; \
50 stackLocation = IoGetCurrentIrpStackLocation(Irp);
51 originalInput = stackLocation->Parameters.DeviceIoControl.Type3InputBuffer;
52 inputLength = stackLocation->Parameters.DeviceIoControl.InputBufferLength;
53 ioControlCode = stackLocation->Parameters.DeviceIoControl.IoControlCode;
54 accessMode = Irp->RequestorMode;
58 if (inputLength != 0 && !originalInput)
60 status = STATUS_INVALID_BUFFER_SIZE;
68 if (inputLength >
sizeof(capturedInput))
70 status = STATUS_INVALID_BUFFER_SIZE;
75 if (accessMode != KernelMode)
79 ProbeForRead(originalInput, inputLength,
sizeof(UCHAR));
80 memcpy(capturedInput, originalInput, inputLength);
82 __except (EXCEPTION_EXECUTE_HANDLER)
84 status = GetExceptionCode();
90 memcpy(capturedInput, originalInput, inputLength);
93 capturedInputPointer = capturedInput;
95 switch (ioControlCode)
102 } *input = capturedInputPointer;
116 PHANDLE ProcessHandle;
117 ACCESS_MASK DesiredAccess;
119 } *input = capturedInputPointer;
124 input->ProcessHandle,
125 input->DesiredAccess,
135 HANDLE ProcessHandle;
136 ACCESS_MASK DesiredAccess;
138 } *input = capturedInputPointer;
143 input->ProcessHandle,
144 input->DesiredAccess,
154 HANDLE ProcessHandle;
155 ACCESS_MASK DesiredAccess;
157 } *input = capturedInputPointer;
162 input->ProcessHandle,
163 input->DesiredAccess,
173 HANDLE ProcessHandle;
174 } *input = capturedInputPointer;
179 input->ProcessHandle,
188 HANDLE ProcessHandle;
189 } *input = capturedInputPointer;
194 input->ProcessHandle,
203 HANDLE ProcessHandle;
205 } *input = capturedInputPointer;
210 input->ProcessHandle,
220 HANDLE ProcessHandle;
224 PSIZE_T NumberOfBytesRead;
225 } *input = capturedInputPointer;
230 input->ProcessHandle,
234 input->NumberOfBytesRead,
243 HANDLE ProcessHandle;
247 PSIZE_T NumberOfBytesRead;
248 } *input = capturedInputPointer;
253 input->ProcessHandle,
257 input->NumberOfBytesRead,
266 HANDLE ProcessHandle;
270 PSIZE_T NumberOfBytesRead;
271 } *input = capturedInputPointer;
276 input->ProcessHandle,
280 input->NumberOfBytesRead,
289 HANDLE ProcessHandle;
291 PVOID ProcessInformation;
292 ULONG ProcessInformationLength;
294 } *input = capturedInputPointer;
299 input->ProcessHandle,
300 input->ProcessInformationClass,
301 input->ProcessInformation,
302 input->ProcessInformationLength,
312 HANDLE ProcessHandle;
314 PVOID ProcessInformation;
315 ULONG ProcessInformationLength;
316 } *input = capturedInputPointer;
321 input->ProcessHandle,
322 input->ProcessInformationClass,
323 input->ProcessInformation,
324 input->ProcessInformationLength,
333 PHANDLE ThreadHandle;
334 ACCESS_MASK DesiredAccess;
336 } *input = capturedInputPointer;
342 input->DesiredAccess,
353 ACCESS_MASK DesiredAccess;
354 PHANDLE ProcessHandle;
355 } *input = capturedInputPointer;
361 input->DesiredAccess,
362 input->ProcessHandle,
373 } *input = capturedInputPointer;
390 } *input = capturedInputPointer;
406 PCONTEXT ThreadContext;
407 } *input = capturedInputPointer;
413 input->ThreadContext,
423 PCONTEXT ThreadContext;
424 } *input = capturedInputPointer;
430 input->ThreadContext,
441 ULONG FramesToCapture;
443 PULONG CapturedFrames;
444 PULONG BackTraceHash;
445 } *input = capturedInputPointer;
452 input->FramesToCapture,
454 input->CapturedFrames,
455 input->BackTraceHash,
466 PVOID ThreadInformation;
467 ULONG ThreadInformationLength;
469 } *input = capturedInputPointer;
475 input->ThreadInformationClass,
476 input->ThreadInformation,
477 input->ThreadInformationLength,
489 PVOID ThreadInformation;
490 ULONG ThreadInformationLength;
491 } *input = capturedInputPointer;
497 input->ThreadInformationClass,
498 input->ThreadInformation,
499 input->ThreadInformationLength,
508 HANDLE ProcessHandle;
512 } *input = capturedInputPointer;
517 input->ProcessHandle,
529 HANDLE ProcessHandle;
532 PVOID ObjectInformation;
533 ULONG ObjectInformationLength;
535 } *input = capturedInputPointer;
540 input->ProcessHandle,
542 input->ObjectInformationClass,
543 input->ObjectInformation,
544 input->ObjectInformationLength,
554 HANDLE ProcessHandle;
557 PVOID ObjectInformation;
558 ULONG ObjectInformationLength;
559 } *input = capturedInputPointer;
564 input->ProcessHandle,
566 input->ObjectInformationClass,
567 input->ObjectInformation,
568 input->ObjectInformationLength,
577 HANDLE SourceProcessHandle;
579 HANDLE TargetProcessHandle;
580 PHANDLE TargetHandle;
581 ACCESS_MASK DesiredAccess;
582 ULONG HandleAttributes;
584 } *input = capturedInputPointer;
589 input->SourceProcessHandle,
591 input->TargetProcessHandle,
593 input->DesiredAccess,
594 input->HandleAttributes,
604 PHANDLE DriverHandle;
606 } *input = capturedInputPointer;
612 input->ObjectAttributes,
623 PVOID DriverInformation;
624 ULONG DriverInformationLength;
626 } *input = capturedInputPointer;
632 input->DriverInformationClass,
633 input->DriverInformation,
634 input->DriverInformationLength,
641 status = STATUS_INVALID_DEVICE_REQUEST;
646 Irp->IoStatus.Status = status;
647 Irp->IoStatus.Information = 0;
648 IoCompleteRequest(Irp, IO_NO_INCREMENT);