Updated IoIsSystemThread() prototype.
[reactos.git] / include / ddk / iofuncs.h
index 08b8797..b2cd827 100644 (file)
@@ -613,6 +613,9 @@ IoGetConfigurationInformation (
 #define IoGetCurrentIrpStackLocation(Irp) \
        ((Irp)->Tail.Overlay.CurrentStackLocation)
 
+#define IoGetPreviousIrpStackLocation(Irp) \
+       ((Irp)->Tail.Overlay.CurrentStackLocation+1)
+
 #define IoSetNextIrpStackLocation(Irp) { \
   (Irp)->CurrentLocation--; \
   (Irp)->Tail.Overlay.CurrentStackLocation--; }
@@ -630,6 +633,12 @@ IoGetConfigurationInformation (
   (Irp)->CurrentLocation++; \
   (Irp)->Tail.Overlay.CurrentStackLocation++;
 
+#define IoSetPreviousIrpStackLocation(Irp) \
+  IoSkipCurrentIrpStackLocation(Irp)
+
+#define IoRetardCurrentIrpStackLocation(Irp) \
+  IoSkipCurrentIrpStackLocation(Irp)
+
 struct _EPROCESS*
 STDCALL
 IoGetCurrentProcess (
@@ -748,10 +757,11 @@ STDCALL
 IoIsOperationSynchronous (
        IN      PIRP    Irp
        );
+typedef struct _ETHREAD *PETHREAD;
 BOOLEAN
 STDCALL
 IoIsSystemThread (
-       PVOID   Unknown0
+       IN PETHREAD Thread
        );
 PIRP
 STDCALL
@@ -927,16 +937,20 @@ IoReportResourceUsage (
        (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; \
@@ -1130,15 +1144,6 @@ IofCompleteRequest (
 
 /* --- EXPORTED BY HAL --- */
 
-VOID
-STDCALL
-IoAssignDriveLetters (
-       IN      PLOADER_PARAMETER_BLOCK LoaderBlock,
-       IN      PSTRING                 NtDeviceName,
-       OUT     PUCHAR                  NtSystemPath,
-       OUT     PSTRING                 NtSystemPathString
-       );
-
 BOOLEAN
 STDCALL
 IoFlushAdapterBuffers (