ntoskrnl.exe: Implement IoReuseIrp() function.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9effc3f963
commit
eb7f784761
|
@ -975,6 +975,17 @@ void WINAPI IoInitializeIrp( IRP *irp, USHORT size, CCHAR stack_size )
|
|||
(PIO_STACK_LOCATION)(irp + 1) + stack_size;
|
||||
}
|
||||
|
||||
void WINAPI IoReuseIrp(IRP *irp, NTSTATUS iostatus)
|
||||
{
|
||||
UCHAR AllocationFlags;
|
||||
|
||||
TRACE("irp %p, iostatus %#x.\n", irp, iostatus);
|
||||
|
||||
AllocationFlags = irp->AllocationFlags;
|
||||
IoInitializeIrp(irp, irp->Size, irp->StackCount);
|
||||
irp->AllocationFlags = AllocationFlags;
|
||||
irp->IoStatus.u.Status = iostatus;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* IoInitializeTimer (NTOSKRNL.EXE.@)
|
||||
|
|
|
@ -462,7 +462,7 @@
|
|||
@ stub IoReportTargetDeviceChange
|
||||
@ stub IoReportTargetDeviceChangeAsynchronous
|
||||
@ stub IoRequestDeviceEject
|
||||
@ stub IoReuseIrp
|
||||
@ stdcall IoReuseIrp(ptr long)
|
||||
@ stub IoSetCompletionRoutineEx
|
||||
@ stdcall IoSetDeviceInterfaceState(ptr long)
|
||||
@ stub IoSetDeviceToVerify
|
||||
|
|
|
@ -211,9 +211,18 @@ static void *get_proc_address(const char *name)
|
|||
static FILE_OBJECT *last_created_file;
|
||||
static unsigned int create_count, close_count;
|
||||
|
||||
static NTSTATUS WINAPI test_irp_struct_completion_routine(DEVICE_OBJECT *reserved, IRP *irp, void *context)
|
||||
{
|
||||
unsigned int *result = context;
|
||||
|
||||
*result = 1;
|
||||
return STATUS_MORE_PROCESSING_REQUIRED;
|
||||
}
|
||||
|
||||
static void test_irp_struct(IRP *irp, DEVICE_OBJECT *device)
|
||||
{
|
||||
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp );
|
||||
unsigned int irp_completion_result;
|
||||
|
||||
ok(device == upper_device, "Expected device %p, got %p.\n", upper_device, device);
|
||||
ok(last_created_file != NULL, "last_created_file = NULL\n");
|
||||
|
@ -225,6 +234,34 @@ static void test_irp_struct(IRP *irp, DEVICE_OBJECT *device)
|
|||
"IRP thread is not the current thread\n");
|
||||
|
||||
ok(IoGetRequestorProcess(irp) == IoGetCurrentProcess(), "processes didn't match\n");
|
||||
|
||||
irp = IoAllocateIrp(1, FALSE);
|
||||
ok(irp->AllocationFlags == IRP_ALLOCATED_FIXED_SIZE, "Got unexpected irp->AllocationFlags %#x.\n",
|
||||
irp->AllocationFlags);
|
||||
ok(irp->CurrentLocation == 2,
|
||||
"Got unexpected irp->CurrentLocation %u.\n", irp->CurrentLocation);
|
||||
IoSetCompletionRoutine(irp, test_irp_struct_completion_routine, &irp_completion_result,
|
||||
TRUE, TRUE, TRUE);
|
||||
|
||||
irp_completion_result = 0;
|
||||
|
||||
irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
--irp->CurrentLocation;
|
||||
--irp->Tail.Overlay.CurrentStackLocation;
|
||||
IoCompleteRequest(irp, IO_NO_INCREMENT);
|
||||
ok(irp->CurrentLocation == 2,
|
||||
"Got unexpected irp->CurrentLocation %u.\n", irp->CurrentLocation);
|
||||
ok(irp_completion_result, "IRP completion was not called.\n");
|
||||
|
||||
--irp->CurrentLocation;
|
||||
--irp->Tail.Overlay.CurrentStackLocation;
|
||||
IoReuseIrp(irp, STATUS_UNSUCCESSFUL);
|
||||
ok(irp->CurrentLocation == 2,
|
||||
"Got unexpected irp->CurrentLocation %u.\n", irp->CurrentLocation);
|
||||
ok(irp->AllocationFlags == IRP_ALLOCATED_FIXED_SIZE, "Got unexpected irp->AllocationFlags %#x.\n",
|
||||
irp->AllocationFlags);
|
||||
|
||||
IoFreeIrp(irp);
|
||||
}
|
||||
|
||||
static void test_mdl_map(void)
|
||||
|
|
|
@ -1679,6 +1679,7 @@ NTSTATUS WINAPI IoRegisterDeviceInterface(PDEVICE_OBJECT,const GUID*,PUNICODE_S
|
|||
void WINAPI IoReleaseCancelSpinLock(KIRQL);
|
||||
void WINAPI IoReleaseRemoveLockAndWaitEx(IO_REMOVE_LOCK*,void*,ULONG);
|
||||
void WINAPI IoReleaseRemoveLockEx(IO_REMOVE_LOCK*,void*,ULONG);
|
||||
void WINAPI IoReuseIrp(IRP*,NTSTATUS);
|
||||
NTSTATUS WINAPI IoSetDeviceInterfaceState(UNICODE_STRING*,BOOLEAN);
|
||||
NTSTATUS WINAPI IoWMIRegistrationControl(PDEVICE_OBJECT,ULONG);
|
||||
|
||||
|
|
Loading…
Reference in New Issue