#define IoGetCurrentIrpStackLocation(Irp) \
((Irp)->Tail.Overlay.CurrentStackLocation)
+#define IoGetPreviousIrpStackLocation(Irp) \
+ ((Irp)->Tail.Overlay.CurrentStackLocation+1)
+
#define IoSetNextIrpStackLocation(Irp) { \
(Irp)->CurrentLocation--; \
(Irp)->Tail.Overlay.CurrentStackLocation--; }
(Irp)->CurrentLocation++; \
(Irp)->Tail.Overlay.CurrentStackLocation++;
+#define IoSetPreviousIrpStackLocation(Irp) \
+ IoSkipCurrentIrpStackLocation(Irp)
+
+#define IoRetardCurrentIrpStackLocation(Irp) \
+ IoSkipCurrentIrpStackLocation(Irp)
+
struct _EPROCESS*
STDCALL
IoGetCurrentProcess (
IoIsOperationSynchronous (
IN PIRP Irp
);
+typedef struct _ETHREAD *PETHREAD;
BOOLEAN
STDCALL
IoIsSystemThread (
- PVOID Unknown0
+ IN PETHREAD Thread
);
PIRP
STDCALL
(KeInsertQueueDpc(&(DeviceObject)->Dpc,(Irp),(Context)))
#define IoSetCancelRoutine(Irp,NewCancelRoutine) \
- ((PDRIVER_CANCEL)InterlockedExchange((PULONG)&(Irp)->CancelRoutine, \
- (ULONG)(NewCancelRoutine)));
+ ((PDRIVER_CANCEL)InterlockedExchangePointer(&(Irp)->CancelRoutine, \
+ NewCancelRoutine))
+
+// AG: Context is now NewContext, otherwise we end up with this:
+// param->LocalLength=(LocalLength)
+// ...which isn't possible.
-#define IoSetCompletionRoutine(Irp,Routine,Context,Success,Error,Cancel) \
+#define IoSetCompletionRoutine(Irp,Routine,NewContext,Success,Error,Cancel) \
{ \
PIO_STACK_LOCATION param; \
assert((Success)||(Error)||(Cancel)?(Routine)!=NULL:TRUE); \
param = IoGetNextIrpStackLocation((Irp)); \
param->CompletionRoutine=(Routine); \
- param->CompletionContext=(Context); \
+ param->Context=(NewContext); \
param->Control = 0; \
if ((Success)) \
param->Control = SL_INVOKE_ON_SUCCESS; \
/* --- EXPORTED BY HAL --- */
-VOID
-STDCALL
-IoAssignDriveLetters (
- IN PLOADER_PARAMETER_BLOCK LoaderBlock,
- IN PSTRING NtDeviceName,
- OUT PUCHAR NtSystemPath,
- OUT PSTRING NtSystemPathString
- );
-
BOOLEAN
STDCALL
IoFlushAdapterBuffers (