typedef struct _IO_STACK_LOCATION
{
    unsigned char MajorFunction;
    unsigned char MinorFunction;
    unsigned char Flags;
    unsigned char Control;
    union
    {
        struct
        {
            IO_SECURITY_CONTEXT *SecurityContext;
            unsigned long Options;
            unsigned short FileAttributes;
            unsigned short ShareAccess;
            unsigned long EaLength;
        } Create;
        struct
        {
            IO_SECURITY_CONTEXT *SecurityContext;
            unsigned long Options;
            unsigned short Reserved;
            unsigned short ShareAccess;
            NAMED_PIPE_CREATE_PARAMETERS *Parameters;
        } CreatePipe;
        struct
        {
            IO_SECURITY_CONTEXT *SecurityContext;
            unsigned long Options;
            unsigned short Reserved;
            unsigned short ShareAccess;
            MAILSLOT_CREATE_PARAMETERS *Parameters;
        } CreateMailslot;
        struct
        {
            unsigned long Length;
            unsigned long Key;
            LARGE_INTEGER ByteOffset;
        } Read;
        struct
        {
            unsigned long Length;
            unsigned long Key;
            LARGE_INTEGER ByteOffset;
        } Write;
        struct
        {
            unsigned long Length;
            UNICODE_STRING *FileName;
            FILE_INFORMATION_CLASS FileInformationClass;
            unsigned long FileIndex;
        } QueryDirectory;
        struct
        {
            unsigned long Length;
            unsigned long CompletionFilter;
        } NotifyDirectory;
        struct
        {
            unsigned long Length;
            FILE_INFORMATION_CLASS FileInformationClass;
        } QueryFile;
        struct
        {
            unsigned long Length;
            FILE_INFORMATION_CLASS FileInformationClass;
            FILE_OBJECT *FileObject;
            union
            {
                struct
                {
                    unsigned char ReplaceIfExists;
                    unsigned char AdvanceOnly;
                };
                unsigned long ClusterCount;
                void *DeleteHandle;
            };
        } SetFile;
        struct
        {
            unsigned long Length;
            void *EaList;
            unsigned long EaListLength;
            unsigned long EaIndex;
        } QueryEa;
        struct
        {
            unsigned long Length;
        } SetEa;
        struct
        {
            unsigned long Length;
            FSINFOCLASS FsInformationClass;
        } QueryVolume;
        struct
        {
            unsigned long Length;
            FSINFOCLASS FsInformationClass;
        } SetVolume;
        struct
        {
            unsigned long OutputBufferLength;
            unsigned long InputBufferLength;
            unsigned long FsControlCode;
            void *Type3InputBuffer;
        } FileSystemControl;
        struct
        {
            LARGE_INTEGER *Length;
            unsigned long Key;
            LARGE_INTEGER ByteOffset;
        } LockControl;
        struct
        {
            unsigned long OutputBufferLength;
            unsigned long InputBufferLength;
            unsigned long IoControlCode;
            void *Type3InputBuffer;
        } DeviceIoControl;
        struct
        {
            unsigned long SecurityInformation;
            unsigned long Length;
        } QuerySecurity;
        struct
        {
            unsigned long SecurityInformation;
            void *SecurityDescriptor;
        } SetSecurity;
        struct
        {
            VPB *Vpb;
            DEVICE_OBJECT *DeviceObject;
        } MountVolume;
        struct
        {
            VPB *Vpb;
            DEVICE_OBJECT *DeviceObject;
        } VerifyVolume;
        struct
        {
            SCSI_REQUEST_BLOCK *Srb;
        } Scsi;
        struct
        {
            unsigned long Length;
            void *StartSid;
            FILE_GET_QUOTA_INFORMATION *SidList;
            unsigned long SidListLength;
        } QueryQuota;
        struct
        {
            unsigned long Length;
        } SetQuota;
        struct
        {
            DEVICE_RELATION_TYPE Type;
        } QueryDeviceRelations;
        struct
        {
            GUID *InterfaceType;
            unsigned short Size;
            unsigned short Version;
            INTERFACE *Interface;
            void *InterfaceSpecificData;
        } QueryInterface;
        struct
        {
            DEVICE_CAPABILITIES *Capabilities;
        } DeviceCapabilities;
        struct
        {
            IO_RESOURCE_REQUIREMENTS_LIST *IoResourceRequirementList;
        } FilterResourceRequirements;
        struct
        {
            unsigned long WhichSpace;
            void *Buffer;
            unsigned long Offset;
            unsigned long Length;
        } ReadWriteConfig;
        struct
        {
            unsigned char Lock;
        } SetLock;
        struct
        {
            BUS_QUERY_ID_TYPE IdType;
        } QueryId;
        struct
        {
            DEVICE_TEXT_TYPE DeviceTextType;
            unsigned long LocaleId;
        } QueryDeviceText;
        struct
        {
            unsigned char InPath;
            unsigned char Reserved[3];
            DEVICE_USAGE_NOTIFICATION_TYPE Type;
        } UsageNotification;
        struct
        {
            SYSTEM_POWER_STATE PowerState;
        } WaitWake;
        struct
        {
            POWER_SEQUENCE *PowerSequence;
        } PowerSequence;
        struct
        {
            union
            {
                unsigned long SystemContext;
                SYSTEM_POWER_STATE_CONTEXT SystemPowerStateContext;
            };
            POWER_STATE_TYPE Type;
            POWER_STATE State;
            POWER_ACTION ShutdownType;
        } Power;
        struct
        {
            CM_RESOURCE_LIST *AllocatedResources;
            CM_RESOURCE_LIST *AllocatedResourcesTranslated;
        } StartDevice;
        struct
        {
            unsigned __int64 ProviderId;
            void *DataPath;
            unsigned long BufferSize;
            void *Buffer;
        } WMI;
        struct
        {
            void *Argument1;
            void *Argument2;
            void *Argument3;
            void *Argument4;
        } Others;
    } Parameters;
    DEVICE_OBJECT *DeviceObject;
    FILE_OBJECT *FileObject;
    long (*CompletionRoutine)(DEVICE_OBJECT *, IRP *, void *);
    void *Context;
} IO_STACK_LOCATION, *PIO_STACK_LOCATION;