2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory
4 * PURPOSE: Kernel-Mode Test Suite Io Regressions KM-Test (Irp)
5 * PROGRAMMER: Aleksey Bragin <aleksey@reactos.org>
7 /* Based on code Copyright 2008 Etersoft (Alexander Morozov) */
20 size
= sizeof(IRP
) + 5 * sizeof(IO_STACK_LOCATION
);
21 iorp
= ExAllocatePool(NonPagedPool
, size
);
25 IoInitializeIrp(iorp
, size
, 5);
27 ok(6 == iorp
->Type
, "Irp type should be 6, but got %d\n", iorp
->Type
);
28 ok(iorp
->Size
== size
, "Irp size should be %d, but got %d\n",
30 ok(5 == iorp
->StackCount
, "Irp StackCount should be 5, but got %d\n",
32 ok(6 == iorp
->CurrentLocation
, "Irp CurrentLocation should be 6, but got %d\n",
33 iorp
->CurrentLocation
);
34 ok(IsListEmpty(&iorp
->ThreadListEntry
), "IRP thread list is not empty\n");
35 ok ((PIO_STACK_LOCATION
)(iorp
+ 1) + 5 ==
36 iorp
->Tail
.Overlay
.CurrentStackLocation
,
37 "CurrentStackLocation mismatch\n");
43 size
= sizeof(IRP
) + 2 * sizeof(IO_STACK_LOCATION
);
44 iorp
= IoAllocateIrp(2, FALSE
);
48 ok(6 == iorp
->Type
, "Irp type should be 6, but got %d\n", iorp
->Type
);
49 ok(iorp
->Size
>= size
,
50 "Irp size should be more or equal to %d, but got %d\n",
52 ok(2 == iorp
->StackCount
, "Irp StackCount should be 2, but got %d\n",
54 ok(3 == iorp
->CurrentLocation
, "Irp CurrentLocation should be 3, but got %d\n",
55 iorp
->CurrentLocation
);
56 ok(IsListEmpty(&iorp
->ThreadListEntry
), "IRP thread list is not empty\n");
57 ok ((PIO_STACK_LOCATION
)(iorp
+ 1) + 2 ==
58 iorp
->Tail
.Overlay
.CurrentStackLocation
,
59 "CurrentStackLocation mismatch\n");
60 ok((IRP_ALLOCATED_FIXED_SIZE
& iorp
->AllocationFlags
),
61 "IRP Allocation flags lack fixed size attribute\n");
62 ok(!(IRP_LOOKASIDE_ALLOCATION
& iorp
->AllocationFlags
),
63 "IRP Allocation flags should not have lookaside allocation\n");
69 size
= sizeof(IRP
) + 2 * sizeof(IO_STACK_LOCATION
);
70 iorp
= IoAllocateIrp(2, TRUE
);
74 ok(6 == iorp
->Type
, "Irp type should be 6, but got %d\n", iorp
->Type
);
75 ok(iorp
->Size
>= size
,
76 "Irp size should be more or equal to %d, but got %d\n",
78 ok(2 == iorp
->StackCount
, "Irp StackCount should be 2, but got %d\n",
80 ok(3 == iorp
->CurrentLocation
, "Irp CurrentLocation should be 3, but got %d\n",
81 iorp
->CurrentLocation
);
82 ok(IsListEmpty(&iorp
->ThreadListEntry
), "IRP thread list is not empty\n");
83 ok ((PIO_STACK_LOCATION
)(iorp
+ 1) + 2 ==
84 iorp
->Tail
.Overlay
.CurrentStackLocation
,
85 "CurrentStackLocation mismatch\n");
86 ok((IRP_ALLOCATED_FIXED_SIZE
& iorp
->AllocationFlags
),
87 "IRP Allocation flags lack fixed size attribute\n");
88 ok((IRP_LOOKASIDE_ALLOCATION
& iorp
->AllocationFlags
),
89 "IRP Allocation flags lack lookaside allocation\n");