return(STATUS_SUCCESS);
}
-#ifndef LIBCAPTIVE
PIRP STDCALL
IoBuildAsynchronousFsdRequest(ULONG MajorFunction,
return(Irp);
}
-#endif /* LIBCAPTIVE */
PIRP STDCALL
IoBuildDeviceIoControlRequest(ULONG IoControlCode,
case METHOD_IN_DIRECT:
DPRINT("Using METHOD_IN_DIRECT!\n");
- /* build input buffer (control buffer) */
- if (InputBuffer && InputBufferLength)
+ /* build output buffer (control buffer) */
+ if (OutputBuffer && OutputBufferLength)
{
Irp->AssociatedIrp.SystemBuffer = (PVOID)
- ExAllocatePoolWithTag(NonPagedPool,InputBufferLength,
+ ExAllocatePoolWithTag(NonPagedPool,OutputBufferLength,
TAG_SYS_BUF);
+
if (Irp->AssociatedIrp.SystemBuffer == NULL)
{
IoFreeIrp(Irp);
return(NULL);
}
-
- RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer,
- InputBuffer,
- InputBufferLength);
+ Irp->UserBuffer = OutputBuffer;
}
- /* build output buffer (data transfer buffer) */
- if (OutputBuffer && OutputBufferLength)
+ /* build input buffer (data transfer buffer) */
+ if (InputBuffer && InputBufferLength)
{
- Irp->MdlAddress = IoAllocateMdl(OutputBuffer,
- OutputBufferLength,
+ Irp->MdlAddress = IoAllocateMdl(InputBuffer,
+ InputBufferLength,
FALSE,
FALSE,
Irp);