2000-12-28 03:38:08 +00:00
|
|
|
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_IO_H
|
|
|
|
#define __NTOSKRNL_INCLUDE_INTERNAL_IO_H
|
1998-09-13 15:55:36 +00:00
|
|
|
|
2005-12-01 21:37:19 +00:00
|
|
|
#include <ntdddisk.h>
|
2005-09-14 01:44:19 +00:00
|
|
|
|
2005-11-25 14:40:28 +00:00
|
|
|
/* STRUCTURES ***************************************************************/
|
|
|
|
|
|
|
|
typedef struct _DISKENTRY
|
|
|
|
{
|
|
|
|
LIST_ENTRY ListEntry;
|
|
|
|
ULONG DiskNumber;
|
|
|
|
ULONG Signature;
|
|
|
|
ULONG Checksum;
|
|
|
|
PDEVICE_OBJECT DeviceObject;
|
|
|
|
} DISKENTRY, *PDISKENTRY;
|
|
|
|
|
|
|
|
#define PARTITION_TBL_SIZE 4
|
|
|
|
|
|
|
|
#include <pshpack1.h>
|
|
|
|
|
|
|
|
typedef struct _PARTITION
|
|
|
|
{
|
|
|
|
unsigned char BootFlags; /* bootable? 0=no, 128=yes */
|
|
|
|
unsigned char StartingHead; /* beginning head number */
|
|
|
|
unsigned char StartingSector; /* beginning sector number */
|
|
|
|
unsigned char StartingCylinder; /* 10 bit nmbr, with high 2 bits put in begsect */
|
|
|
|
unsigned char PartitionType; /* Operating System type indicator code */
|
|
|
|
unsigned char EndingHead; /* ending head number */
|
|
|
|
unsigned char EndingSector; /* ending sector number */
|
|
|
|
unsigned char EndingCylinder; /* also a 10 bit nmbr, with same high 2 bit trick */
|
|
|
|
unsigned int StartingBlock; /* first sector relative to start of disk */
|
|
|
|
unsigned int SectorCount; /* number of sectors in partition */
|
|
|
|
} PARTITION, *PPARTITION;
|
|
|
|
|
|
|
|
typedef struct _PARTITION_SECTOR
|
|
|
|
{
|
|
|
|
UCHAR BootCode[440]; /* 0x000 */
|
|
|
|
ULONG Signature; /* 0x1B8 */
|
|
|
|
UCHAR Reserved[2]; /* 0x1BC */
|
|
|
|
PARTITION Partition[PARTITION_TBL_SIZE]; /* 0x1BE */
|
|
|
|
USHORT Magic; /* 0x1FE */
|
|
|
|
} PARTITION_SECTOR, *PPARTITION_SECTOR;
|
|
|
|
|
|
|
|
#include <poppack.h>
|
|
|
|
|
2003-08-14 18:30:28 +00:00
|
|
|
#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003)
|
|
|
|
|
2005-05-15 17:59:33 +00:00
|
|
|
extern POBJECT_TYPE IoCompletionType;
|
2005-06-25 17:01:17 +00:00
|
|
|
extern PDEVICE_NODE IopRootDeviceNode;
|
2003-08-14 18:30:28 +00:00
|
|
|
|
2005-05-13 05:41:24 +00:00
|
|
|
/* This is like the IRP Overlay so we can optimize its insertion */
|
|
|
|
typedef struct _IO_COMPLETION_PACKET
|
|
|
|
{
|
2005-06-25 17:01:17 +00:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
LIST_ENTRY ListEntry;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct _IO_STACK_LOCATION *CurrentStackLocation;
|
|
|
|
ULONG PacketType;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
PVOID Key;
|
|
|
|
PVOID Context;
|
|
|
|
IO_STATUS_BLOCK IoStatus;
|
2003-08-14 18:30:28 +00:00
|
|
|
} IO_COMPLETION_PACKET, *PIO_COMPLETION_PACKET;
|
|
|
|
|
2005-08-11 00:01:17 +00:00
|
|
|
/* List of Bus Type GUIDs */
|
|
|
|
typedef struct _IO_BUS_TYPE_GUID_LIST
|
|
|
|
{
|
|
|
|
ULONG GuidCount;
|
|
|
|
FAST_MUTEX Lock;
|
|
|
|
GUID Guids[1];
|
|
|
|
} IO_BUS_TYPE_GUID_LIST, *PIO_BUS_TYPE_GUID_LIST;
|
|
|
|
extern PIO_BUS_TYPE_GUID_LIST IopBusTypeGuidList;
|
|
|
|
|
2005-05-13 05:41:24 +00:00
|
|
|
/* Packet Types */
|
|
|
|
#define IrpCompletionPacket 0x1
|
|
|
|
#define IrpMiniCompletionPacket 0x2
|
|
|
|
|
2001-09-16 13:19:32 +00:00
|
|
|
/*
|
|
|
|
* VOID
|
|
|
|
* IopDeviceNodeSetFlag(
|
|
|
|
* PDEVICE_NODE DeviceNode,
|
|
|
|
* ULONG Flag);
|
|
|
|
*/
|
2005-06-25 17:01:17 +00:00
|
|
|
#define IopDeviceNodeSetFlag(DeviceNode, Flag) \
|
|
|
|
((DeviceNode)->Flags |= (Flag))
|
2001-09-16 13:19:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* VOID
|
|
|
|
* IopDeviceNodeClearFlag(
|
|
|
|
* PDEVICE_NODE DeviceNode,
|
|
|
|
* ULONG Flag);
|
|
|
|
*/
|
2005-06-25 17:01:17 +00:00
|
|
|
#define IopDeviceNodeClearFlag(DeviceNode, Flag) \
|
|
|
|
((DeviceNode)->Flags &= ~(Flag))
|
2001-09-16 13:19:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* BOOLEAN
|
|
|
|
* IopDeviceNodeHasFlag(
|
|
|
|
* PDEVICE_NODE DeviceNode,
|
|
|
|
* ULONG Flag);
|
|
|
|
*/
|
2005-06-25 17:01:17 +00:00
|
|
|
#define IopDeviceNodeHasFlag(DeviceNode, Flag) \
|
|
|
|
(((DeviceNode)->Flags & (Flag)) > 0)
|
2001-09-16 13:19:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* VOID
|
|
|
|
* IopDeviceNodeSetUserFlag(
|
|
|
|
* PDEVICE_NODE DeviceNode,
|
|
|
|
* ULONG UserFlag);
|
|
|
|
*/
|
2005-06-25 17:01:17 +00:00
|
|
|
#define IopDeviceNodeSetUserFlag(DeviceNode, UserFlag) \
|
|
|
|
((DeviceNode)->UserFlags |= (UserFlag))
|
2001-09-16 13:19:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* VOID
|
|
|
|
* IopDeviceNodeClearUserFlag(
|
|
|
|
* PDEVICE_NODE DeviceNode,
|
|
|
|
* ULONG UserFlag);
|
|
|
|
*/
|
2005-06-25 17:01:17 +00:00
|
|
|
#define IopDeviceNodeClearUserFlag(DeviceNode, UserFlag) \
|
|
|
|
((DeviceNode)->UserFlags &= ~(UserFlag))
|
2001-09-16 13:19:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* BOOLEAN
|
|
|
|
* IopDeviceNodeHasUserFlag(
|
|
|
|
* PDEVICE_NODE DeviceNode,
|
|
|
|
* ULONG UserFlag);
|
|
|
|
*/
|
2005-06-25 17:01:17 +00:00
|
|
|
#define IopDeviceNodeHasUserFlag(DeviceNode, UserFlag) \
|
|
|
|
(((DeviceNode)->UserFlags & (UserFlag)) > 0)
|
2001-09-16 13:19:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* VOID
|
|
|
|
* IopDeviceNodeSetProblem(
|
|
|
|
* PDEVICE_NODE DeviceNode,
|
|
|
|
* ULONG Problem);
|
|
|
|
*/
|
2005-06-25 17:01:17 +00:00
|
|
|
#define IopDeviceNodeSetProblem(DeviceNode, Problem) \
|
|
|
|
((DeviceNode)->Problem |= (Problem))
|
2001-09-16 13:19:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* VOID
|
|
|
|
* IopDeviceNodeClearProblem(
|
|
|
|
* PDEVICE_NODE DeviceNode,
|
|
|
|
* ULONG Problem);
|
|
|
|
*/
|
2005-06-25 17:01:17 +00:00
|
|
|
#define IopDeviceNodeClearProblem(DeviceNode, Problem) \
|
|
|
|
((DeviceNode)->Problem &= ~(Problem))
|
2001-09-16 13:19:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* BOOLEAN
|
|
|
|
* IopDeviceNodeHasProblem(
|
|
|
|
* PDEVICE_NODE DeviceNode,
|
|
|
|
* ULONG Problem);
|
|
|
|
*/
|
2005-06-25 17:01:17 +00:00
|
|
|
#define IopDeviceNodeHasProblem(DeviceNode, Problem) \
|
|
|
|
(((DeviceNode)->Problem & (Problem)) > 0)
|
2001-09-16 13:19:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Called on every visit of a node during a preorder-traversal of the device
|
|
|
|
node tree.
|
|
|
|
If the routine returns STATUS_UNSUCCESSFUL the traversal will stop and
|
|
|
|
STATUS_SUCCESS is returned to the caller who initiated the tree traversal.
|
|
|
|
Any other returned status code will be returned to the caller. If a status
|
|
|
|
code that indicates an error (other than STATUS_UNSUCCESSFUL) is returned,
|
|
|
|
the traversal is stopped immediately and the status code is returned to
|
|
|
|
the caller.
|
|
|
|
*/
|
|
|
|
typedef NTSTATUS (*DEVICETREE_TRAVERSE_ROUTINE)(
|
2005-06-25 17:01:17 +00:00
|
|
|
PDEVICE_NODE DeviceNode,
|
|
|
|
PVOID Context
|
|
|
|
);
|
2001-09-16 13:19:32 +00:00
|
|
|
|
|
|
|
/* Context information for traversing the device tree */
|
|
|
|
typedef struct _DEVICETREE_TRAVERSE_CONTEXT
|
|
|
|
{
|
2005-06-25 17:01:17 +00:00
|
|
|
/* Current device node during a traversal */
|
|
|
|
PDEVICE_NODE DeviceNode;
|
|
|
|
/* Initial device node where we start the traversal */
|
|
|
|
PDEVICE_NODE FirstDeviceNode;
|
|
|
|
/* Action routine to be called for every device node */
|
|
|
|
DEVICETREE_TRAVERSE_ROUTINE Action;
|
|
|
|
/* Context passed to the action routine */
|
|
|
|
PVOID Context;
|
2001-09-16 13:19:32 +00:00
|
|
|
} DEVICETREE_TRAVERSE_CONTEXT, *PDEVICETREE_TRAVERSE_CONTEXT;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* VOID
|
|
|
|
* IopInitDeviceTreeTraverseContext(
|
|
|
|
* PDEVICETREE_TRAVERSE_CONTEXT DeviceTreeTraverseContext,
|
|
|
|
* PDEVICE_NODE DeviceNode,
|
|
|
|
* DEVICETREE_TRAVERSE_ROUTINE Action,
|
|
|
|
* PVOID Context);
|
|
|
|
*/
|
|
|
|
#define IopInitDeviceTreeTraverseContext( \
|
|
|
|
_DeviceTreeTraverseContext, _DeviceNode, _Action, _Context) { \
|
|
|
|
(_DeviceTreeTraverseContext)->FirstDeviceNode = (_DeviceNode); \
|
|
|
|
(_DeviceTreeTraverseContext)->Action = (_Action); \
|
|
|
|
(_DeviceTreeTraverseContext)->Context = (_Context); }
|
|
|
|
|
2001-05-01 23:08:21 +00:00
|
|
|
VOID
|
|
|
|
PnpInit(VOID);
|
|
|
|
|
2005-06-04 22:55:58 +00:00
|
|
|
VOID
|
|
|
|
PnpInit2(VOID);
|
|
|
|
|
2002-06-10 08:50:55 +00:00
|
|
|
VOID
|
|
|
|
IopInitDriverImplementation(VOID);
|
|
|
|
|
2005-04-30 09:39:09 +00:00
|
|
|
VOID
|
|
|
|
IopInitPnpNotificationImplementation(VOID);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
IopNotifyPlugPlayNotification(
|
2005-06-25 17:01:17 +00:00
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory,
|
2006-01-11 22:13:02 +00:00
|
|
|
IN LPCGUID Event,
|
2005-06-25 17:01:17 +00:00
|
|
|
IN PVOID EventCategoryData1,
|
|
|
|
IN PVOID EventCategoryData2
|
|
|
|
);
|
2005-04-30 09:39:09 +00:00
|
|
|
|
2001-05-01 23:08:21 +00:00
|
|
|
NTSTATUS
|
|
|
|
IopGetSystemPowerDeviceObject(PDEVICE_OBJECT *DeviceObject);
|
2005-06-25 17:01:17 +00:00
|
|
|
|
2001-05-01 23:08:21 +00:00
|
|
|
NTSTATUS
|
2005-06-25 17:01:17 +00:00
|
|
|
IopCreateDeviceNode(
|
|
|
|
PDEVICE_NODE ParentNode,
|
|
|
|
PDEVICE_OBJECT PhysicalDeviceObject,
|
|
|
|
PDEVICE_NODE *DeviceNode
|
|
|
|
);
|
|
|
|
|
2001-05-01 23:08:21 +00:00
|
|
|
NTSTATUS
|
|
|
|
IopFreeDeviceNode(PDEVICE_NODE DeviceNode);
|
2003-10-15 17:04:39 +00:00
|
|
|
|
2002-04-10 09:58:45 +00:00
|
|
|
VOID
|
2000-12-28 03:38:08 +00:00
|
|
|
IoInitCancelHandling(VOID);
|
2005-06-25 17:01:17 +00:00
|
|
|
|
2002-04-10 09:58:45 +00:00
|
|
|
VOID
|
2000-12-28 03:38:08 +00:00
|
|
|
IoInitFileSystemImplementation(VOID);
|
2005-06-25 17:01:17 +00:00
|
|
|
|
2002-04-10 09:58:45 +00:00
|
|
|
VOID
|
2002-10-03 19:24:24 +00:00
|
|
|
IoInitVpbImplementation(VOID);
|
1998-09-13 15:55:36 +00:00
|
|
|
|
2002-04-10 09:58:45 +00:00
|
|
|
NTSTATUS
|
2005-06-25 17:01:17 +00:00
|
|
|
IoMountVolume(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN BOOLEAN AllowRawMount
|
|
|
|
);
|
|
|
|
|
|
|
|
PVOID
|
|
|
|
IoOpenSymlink(PVOID SymbolicLink);
|
|
|
|
|
|
|
|
PVOID
|
|
|
|
IoOpenFileOnDevice(
|
|
|
|
PVOID SymbolicLink,
|
|
|
|
PWCHAR Name
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
STDCALL
|
|
|
|
IopCreateDevice(
|
|
|
|
PVOID ObjectBody,
|
|
|
|
PVOID Parent,
|
|
|
|
PWSTR RemainingPath,
|
|
|
|
POBJECT_ATTRIBUTES ObjectAttributes
|
|
|
|
);
|
2005-04-17 04:20:16 +00:00
|
|
|
|
2005-05-09 01:38:29 +00:00
|
|
|
NTSTATUS
|
2005-04-17 04:20:16 +00:00
|
|
|
STDCALL
|
|
|
|
IopAttachVpb(PDEVICE_OBJECT DeviceObject);
|
1999-02-01 20:58:37 +00:00
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
VOID
|
|
|
|
IoInitShutdownNotification(VOID);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
IoShutdownRegisteredDevices(VOID);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
IoShutdownRegisteredFileSystems(VOID);
|
1999-11-12 12:01:17 +00:00
|
|
|
|
2002-03-13 01:30:34 +00:00
|
|
|
NTSTATUS
|
|
|
|
IoCreateArcNames(VOID);
|
|
|
|
|
2002-03-16 00:00:13 +00:00
|
|
|
NTSTATUS
|
|
|
|
IoCreateSystemRootLink(PCHAR ParameterLine);
|
|
|
|
|
2001-09-01 15:36:45 +00:00
|
|
|
NTSTATUS
|
|
|
|
IopInitiatePnpIrp(
|
2005-06-25 17:01:17 +00:00
|
|
|
PDEVICE_OBJECT DeviceObject,
|
|
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
ULONG MinorFunction,
|
|
|
|
PIO_STACK_LOCATION Stack
|
|
|
|
);
|
2001-09-01 15:36:45 +00:00
|
|
|
|
2002-06-12 23:30:36 +00:00
|
|
|
NTSTATUS
|
|
|
|
IoCreateDriverList(VOID);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
IoDestroyDriverList(VOID);
|
|
|
|
|
2004-09-23 11:27:58 +00:00
|
|
|
/* bootlog.c */
|
|
|
|
|
|
|
|
VOID
|
2005-03-12 21:08:29 +00:00
|
|
|
IopInitBootLog(BOOLEAN StartBootLog);
|
2004-09-23 11:27:58 +00:00
|
|
|
|
|
|
|
VOID
|
|
|
|
IopStartBootLog(VOID);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
IopStopBootLog(VOID);
|
|
|
|
|
|
|
|
VOID
|
2005-06-25 17:01:17 +00:00
|
|
|
IopBootLog(
|
|
|
|
PUNICODE_STRING DriverName,
|
|
|
|
BOOLEAN Success
|
|
|
|
);
|
2004-09-23 11:27:58 +00:00
|
|
|
|
|
|
|
VOID
|
|
|
|
IopSaveBootLogToFile(VOID);
|
2002-06-12 23:30:36 +00:00
|
|
|
|
2005-03-05 11:27:15 +00:00
|
|
|
/* cancel.c */
|
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
VOID
|
|
|
|
STDCALL
|
2005-03-05 11:27:15 +00:00
|
|
|
IoCancelThreadIo(PETHREAD Thread);
|
|
|
|
|
2003-06-20 22:43:27 +00:00
|
|
|
/* errlog.c */
|
|
|
|
|
|
|
|
NTSTATUS
|
2004-09-23 11:27:58 +00:00
|
|
|
IopInitErrorLog(VOID);
|
2003-06-20 22:43:27 +00:00
|
|
|
|
2003-05-13 21:28:26 +00:00
|
|
|
/* rawfs.c */
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
RawFsIsRawFileSystemDeviceObject(IN PDEVICE_OBJECT DeviceObject);
|
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
NTSTATUS
|
|
|
|
STDCALL
|
2003-05-13 21:28:26 +00:00
|
|
|
RawFsDriverEntry(PDRIVER_OBJECT DriverObject,
|
2005-06-25 17:01:17 +00:00
|
|
|
PUNICODE_STRING RegistryPath);
|
2003-05-13 21:28:26 +00:00
|
|
|
|
|
|
|
|
2005-10-08 14:47:25 +00:00
|
|
|
/* pnpmgr.c */
|
|
|
|
|
|
|
|
PDEVICE_NODE
|
|
|
|
FASTCALL
|
|
|
|
IopGetDeviceNode(PDEVICE_OBJECT DeviceObject);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
IopActionConfigureChildServices(PDEVICE_NODE DeviceNode,
|
|
|
|
PVOID Context);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
IopActionInitChildServices(PDEVICE_NODE DeviceNode,
|
|
|
|
PVOID Context,
|
|
|
|
BOOLEAN BootDrivers);
|
|
|
|
|
|
|
|
|
2001-09-16 13:19:32 +00:00
|
|
|
/* pnproot.c */
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
STDCALL
|
|
|
|
PnpRootDriverEntry(
|
2005-06-25 17:01:17 +00:00
|
|
|
IN PDRIVER_OBJECT DriverObject,
|
|
|
|
IN PUNICODE_STRING RegistryPath
|
|
|
|
);
|
2001-09-16 13:19:32 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
2005-06-25 17:01:17 +00:00
|
|
|
PnpRootCreateDevice(PDEVICE_OBJECT *PhysicalDeviceObject);
|
2001-09-16 13:19:32 +00:00
|
|
|
|
2004-03-21 18:58:53 +00:00
|
|
|
/* device.c */
|
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
NTSTATUS
|
|
|
|
FASTCALL
|
2004-03-27 19:41:32 +00:00
|
|
|
IopInitializeDevice(
|
2005-06-25 17:01:17 +00:00
|
|
|
PDEVICE_NODE DeviceNode,
|
|
|
|
PDRIVER_OBJECT DriverObject
|
|
|
|
);
|
2004-03-21 18:58:53 +00:00
|
|
|
|
2005-05-16 18:08:55 +00:00
|
|
|
NTSTATUS
|
2005-06-25 17:01:17 +00:00
|
|
|
IopStartDevice(PDEVICE_NODE DeviceNode);
|
2005-05-16 18:08:55 +00:00
|
|
|
|
2003-10-15 17:04:39 +00:00
|
|
|
/* driver.c */
|
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
VOID
|
|
|
|
FASTCALL
|
2004-03-27 19:41:32 +00:00
|
|
|
IopInitializeBootDrivers(VOID);
|
2003-10-15 17:04:39 +00:00
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
VOID
|
|
|
|
FASTCALL
|
2004-03-27 19:41:32 +00:00
|
|
|
IopInitializeSystemDrivers(VOID);
|
2003-10-15 17:04:39 +00:00
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
NTSTATUS
|
|
|
|
FASTCALL
|
2004-03-27 19:41:32 +00:00
|
|
|
IopCreateDriverObject(
|
2005-06-25 17:01:17 +00:00
|
|
|
PDRIVER_OBJECT *DriverObject,
|
|
|
|
PUNICODE_STRING ServiceName,
|
|
|
|
ULONG CreateAttributes,
|
|
|
|
BOOLEAN FileSystemDriver,
|
|
|
|
PVOID DriverImageStart,
|
|
|
|
ULONG DriverImageSize
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
FASTCALL
|
2005-05-19 22:02:34 +00:00
|
|
|
IopGetDriverObject(
|
2005-06-25 17:01:17 +00:00
|
|
|
PDRIVER_OBJECT *DriverObject,
|
|
|
|
PUNICODE_STRING ServiceName,
|
|
|
|
BOOLEAN FileSystem
|
|
|
|
);
|
2005-05-19 22:02:34 +00:00
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
NTSTATUS
|
|
|
|
FASTCALL
|
2004-03-27 19:41:32 +00:00
|
|
|
IopLoadServiceModule(
|
2005-06-25 17:01:17 +00:00
|
|
|
IN PUNICODE_STRING ServiceName,
|
2005-07-30 16:25:35 +00:00
|
|
|
OUT PLDR_DATA_TABLE_ENTRY *ModuleObject
|
2005-06-25 17:01:17 +00:00
|
|
|
);
|
2004-03-27 19:41:32 +00:00
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
NTSTATUS
|
|
|
|
FASTCALL
|
2004-03-27 19:41:32 +00:00
|
|
|
IopInitializeDriverModule(
|
2005-06-25 17:01:17 +00:00
|
|
|
IN PDEVICE_NODE DeviceNode,
|
2005-07-30 16:25:35 +00:00
|
|
|
IN PLDR_DATA_TABLE_ENTRY ModuleObject,
|
2005-06-25 17:01:17 +00:00
|
|
|
IN PUNICODE_STRING ServiceName,
|
|
|
|
IN BOOLEAN FileSystemDriver,
|
|
|
|
OUT PDRIVER_OBJECT *DriverObject
|
|
|
|
);
|
2004-03-27 19:41:32 +00:00
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
NTSTATUS
|
|
|
|
FASTCALL
|
2004-03-27 19:41:32 +00:00
|
|
|
IopAttachFilterDrivers(
|
2005-06-25 17:01:17 +00:00
|
|
|
PDEVICE_NODE DeviceNode,
|
|
|
|
BOOLEAN Lower
|
|
|
|
);
|
2004-03-27 19:41:32 +00:00
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
VOID
|
|
|
|
FASTCALL
|
2003-12-15 17:50:23 +00:00
|
|
|
IopMarkLastReinitializeDriver(VOID);
|
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
VOID
|
|
|
|
FASTCALL
|
2003-12-15 17:50:23 +00:00
|
|
|
IopReinitializeDrivers(VOID);
|
|
|
|
|
IO Manager Cleanup continues:
- Removed many extra files that expanded the I/O Manager too much. We usually stick with the standard of
one object/class per file, like io/device.c or io/controller.c, so it was very confusing to have some
objects split up in 5 or 6 different files, some containing only one api. Additionally, even a third
system was used, were objects were bunched up together by class. This mess was so bad that NtCreateFile,
IopCreateFile, IoCreateFile, IopDeleteFile, NtDeleteFile and NtWriteFile were in 5 different files (as an
example).
- Cleaned up some IRP code and fixed a couple of bugs, mainly:
- Write I/O Type in IRP
- Write proper IRP Flags where they shoudl be used (Will help for completing requests when i clean up that code)
- Do *NOT* zero out buffers or data that shouldn't be zeroed. Scsiport actually dependen on this incorrect
behaviour. Code should never depend on a buffer being zeroed!
- Remove a lot of duplicated code and helper/alternate functions that weren't really useful.
- Free MDL and IRP on some failures where we didn't
- Alphabetized some of the large io files for easier lookup of functions. This and the deletions have resulted
in a completely bloated diff file. I will provide a cleaned up diff on request by manually downloading the
old revision and copy/pasting the new code directly above it. The functions which we touched are:
- IoAllocateIrp
- IoBuild[A]SyncronousFsdRequest
- IoBuildDeviceIoControlRequest
- IoInitializeIrp
- IoPageRead, IoSynchronousPageWrite
svn path=/trunk/; revision=14837
2005-04-28 00:54:59 +00:00
|
|
|
/* file.c */
|
2005-02-01 16:24:10 +00:00
|
|
|
|
2005-05-09 01:38:29 +00:00
|
|
|
NTSTATUS
|
IO Manager Cleanup continues:
- Removed many extra files that expanded the I/O Manager too much. We usually stick with the standard of
one object/class per file, like io/device.c or io/controller.c, so it was very confusing to have some
objects split up in 5 or 6 different files, some containing only one api. Additionally, even a third
system was used, were objects were bunched up together by class. This mess was so bad that NtCreateFile,
IopCreateFile, IoCreateFile, IopDeleteFile, NtDeleteFile and NtWriteFile were in 5 different files (as an
example).
- Cleaned up some IRP code and fixed a couple of bugs, mainly:
- Write I/O Type in IRP
- Write proper IRP Flags where they shoudl be used (Will help for completing requests when i clean up that code)
- Do *NOT* zero out buffers or data that shouldn't be zeroed. Scsiport actually dependen on this incorrect
behaviour. Code should never depend on a buffer being zeroed!
- Remove a lot of duplicated code and helper/alternate functions that weren't really useful.
- Free MDL and IRP on some failures where we didn't
- Alphabetized some of the large io files for easier lookup of functions. This and the deletions have resulted
in a completely bloated diff file. I will provide a cleaned up diff on request by manually downloading the
old revision and copy/pasting the new code directly above it. The functions which we touched are:
- IoAllocateIrp
- IoBuild[A]SyncronousFsdRequest
- IoBuildDeviceIoControlRequest
- IoInitializeIrp
- IoPageRead, IoSynchronousPageWrite
svn path=/trunk/; revision=14837
2005-04-28 00:54:59 +00:00
|
|
|
STDCALL
|
2005-06-25 17:01:17 +00:00
|
|
|
IopCreateFile(
|
|
|
|
PVOID ObjectBody,
|
|
|
|
PVOID Parent,
|
|
|
|
PWSTR RemainingPath,
|
|
|
|
POBJECT_CREATE_INFORMATION ObjectAttributes
|
|
|
|
);
|
2005-05-09 01:38:29 +00:00
|
|
|
|
|
|
|
VOID
|
IO Manager Cleanup continues:
- Removed many extra files that expanded the I/O Manager too much. We usually stick with the standard of
one object/class per file, like io/device.c or io/controller.c, so it was very confusing to have some
objects split up in 5 or 6 different files, some containing only one api. Additionally, even a third
system was used, were objects were bunched up together by class. This mess was so bad that NtCreateFile,
IopCreateFile, IoCreateFile, IopDeleteFile, NtDeleteFile and NtWriteFile were in 5 different files (as an
example).
- Cleaned up some IRP code and fixed a couple of bugs, mainly:
- Write I/O Type in IRP
- Write proper IRP Flags where they shoudl be used (Will help for completing requests when i clean up that code)
- Do *NOT* zero out buffers or data that shouldn't be zeroed. Scsiport actually dependen on this incorrect
behaviour. Code should never depend on a buffer being zeroed!
- Remove a lot of duplicated code and helper/alternate functions that weren't really useful.
- Free MDL and IRP on some failures where we didn't
- Alphabetized some of the large io files for easier lookup of functions. This and the deletions have resulted
in a completely bloated diff file. I will provide a cleaned up diff on request by manually downloading the
old revision and copy/pasting the new code directly above it. The functions which we touched are:
- IoAllocateIrp
- IoBuild[A]SyncronousFsdRequest
- IoBuildDeviceIoControlRequest
- IoInitializeIrp
- IoPageRead, IoSynchronousPageWrite
svn path=/trunk/; revision=14837
2005-04-28 00:54:59 +00:00
|
|
|
STDCALL
|
|
|
|
IopDeleteFile(PVOID ObjectBody);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
STDCALL
|
2005-06-25 17:01:17 +00:00
|
|
|
IopSecurityFile(
|
|
|
|
PVOID ObjectBody,
|
|
|
|
SECURITY_OPERATION_CODE OperationCode,
|
|
|
|
SECURITY_INFORMATION SecurityInformation,
|
|
|
|
PSECURITY_DESCRIPTOR SecurityDescriptor,
|
2005-08-07 18:38:37 +00:00
|
|
|
PULONG BufferLength,
|
|
|
|
PSECURITY_DESCRIPTOR *OldSecurityDescriptor,
|
|
|
|
POOL_TYPE PoolType,
|
|
|
|
PGENERIC_MAPPING GenericMapping
|
2005-06-25 17:01:17 +00:00
|
|
|
);
|
2005-05-09 01:38:29 +00:00
|
|
|
|
IO Manager Cleanup continues:
- Removed many extra files that expanded the I/O Manager too much. We usually stick with the standard of
one object/class per file, like io/device.c or io/controller.c, so it was very confusing to have some
objects split up in 5 or 6 different files, some containing only one api. Additionally, even a third
system was used, were objects were bunched up together by class. This mess was so bad that NtCreateFile,
IopCreateFile, IoCreateFile, IopDeleteFile, NtDeleteFile and NtWriteFile were in 5 different files (as an
example).
- Cleaned up some IRP code and fixed a couple of bugs, mainly:
- Write I/O Type in IRP
- Write proper IRP Flags where they shoudl be used (Will help for completing requests when i clean up that code)
- Do *NOT* zero out buffers or data that shouldn't be zeroed. Scsiport actually dependen on this incorrect
behaviour. Code should never depend on a buffer being zeroed!
- Remove a lot of duplicated code and helper/alternate functions that weren't really useful.
- Free MDL and IRP on some failures where we didn't
- Alphabetized some of the large io files for easier lookup of functions. This and the deletions have resulted
in a completely bloated diff file. I will provide a cleaned up diff on request by manually downloading the
old revision and copy/pasting the new code directly above it. The functions which we touched are:
- IoAllocateIrp
- IoBuild[A]SyncronousFsdRequest
- IoBuildDeviceIoControlRequest
- IoInitializeIrp
- IoPageRead, IoSynchronousPageWrite
svn path=/trunk/; revision=14837
2005-04-28 00:54:59 +00:00
|
|
|
NTSTATUS
|
|
|
|
STDCALL
|
2005-06-25 17:01:17 +00:00
|
|
|
IopQueryNameFile(
|
|
|
|
PVOID ObjectBody,
|
|
|
|
POBJECT_NAME_INFORMATION ObjectNameInfo,
|
|
|
|
ULONG Length,
|
|
|
|
PULONG ReturnLength
|
|
|
|
);
|
2005-05-09 01:38:29 +00:00
|
|
|
|
|
|
|
VOID
|
IO Manager Cleanup continues:
- Removed many extra files that expanded the I/O Manager too much. We usually stick with the standard of
one object/class per file, like io/device.c or io/controller.c, so it was very confusing to have some
objects split up in 5 or 6 different files, some containing only one api. Additionally, even a third
system was used, were objects were bunched up together by class. This mess was so bad that NtCreateFile,
IopCreateFile, IoCreateFile, IopDeleteFile, NtDeleteFile and NtWriteFile were in 5 different files (as an
example).
- Cleaned up some IRP code and fixed a couple of bugs, mainly:
- Write I/O Type in IRP
- Write proper IRP Flags where they shoudl be used (Will help for completing requests when i clean up that code)
- Do *NOT* zero out buffers or data that shouldn't be zeroed. Scsiport actually dependen on this incorrect
behaviour. Code should never depend on a buffer being zeroed!
- Remove a lot of duplicated code and helper/alternate functions that weren't really useful.
- Free MDL and IRP on some failures where we didn't
- Alphabetized some of the large io files for easier lookup of functions. This and the deletions have resulted
in a completely bloated diff file. I will provide a cleaned up diff on request by manually downloading the
old revision and copy/pasting the new code directly above it. The functions which we touched are:
- IoAllocateIrp
- IoBuild[A]SyncronousFsdRequest
- IoBuildDeviceIoControlRequest
- IoInitializeIrp
- IoPageRead, IoSynchronousPageWrite
svn path=/trunk/; revision=14837
2005-04-28 00:54:59 +00:00
|
|
|
STDCALL
|
2005-06-25 17:01:17 +00:00
|
|
|
IopCloseFile(
|
|
|
|
PVOID ObjectBody,
|
|
|
|
ULONG HandleCount
|
|
|
|
);
|
2005-05-09 01:38:29 +00:00
|
|
|
|
2005-02-05 00:04:52 +00:00
|
|
|
/* plugplay.c */
|
2005-02-01 16:24:10 +00:00
|
|
|
|
2005-06-25 17:01:17 +00:00
|
|
|
NTSTATUS
|
|
|
|
INIT_FUNCTION
|
2005-02-01 16:24:10 +00:00
|
|
|
IopInitPlugPlayEvents(VOID);
|
|
|
|
|
2005-02-05 00:04:52 +00:00
|
|
|
NTSTATUS
|
2005-06-25 17:01:17 +00:00
|
|
|
IopQueueTargetDeviceEvent(
|
|
|
|
const GUID *Guid,
|
|
|
|
PUNICODE_STRING DeviceIds
|
|
|
|
);
|
2005-02-01 16:24:10 +00:00
|
|
|
|
2003-10-15 17:04:39 +00:00
|
|
|
/* pnpmgr.c */
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
IopInitializePnpServices(
|
2005-06-25 17:01:17 +00:00
|
|
|
IN PDEVICE_NODE DeviceNode,
|
|
|
|
IN BOOLEAN BootDrivers)
|
|
|
|
;
|
2003-10-15 17:04:39 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
IopInvalidateDeviceRelations(
|
2005-06-25 17:01:17 +00:00
|
|
|
IN PDEVICE_NODE DeviceNode,
|
|
|
|
IN DEVICE_RELATION_TYPE Type
|
|
|
|
);
|
2003-10-15 17:04:39 +00:00
|
|
|
|
2004-11-06 04:12:59 +00:00
|
|
|
/* timer.c */
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
IopInitTimerImplementation(VOID);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
STDCALL
|
2005-06-25 17:01:17 +00:00
|
|
|
IopRemoveTimerFromTimerList(IN PIO_TIMER Timer);
|
2004-11-19 21:31:02 +00:00
|
|
|
|
2004-12-21 18:37:28 +00:00
|
|
|
/* iocomp.c */
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
IopInitIoCompletionImplementation(VOID);
|
|
|
|
|
2004-11-19 21:31:02 +00:00
|
|
|
#define CM_RESOURCE_LIST_SIZE(ResList) \
|
|
|
|
(ResList->Count == 1) ? \
|
|
|
|
FIELD_OFFSET(CM_RESOURCE_LIST, List[0].PartialResourceList. \
|
|
|
|
PartialDescriptors[(ResList)->List[0].PartialResourceList.Count]) \
|
|
|
|
: \
|
|
|
|
FIELD_OFFSET(CM_RESOURCE_LIST, List)
|
|
|
|
|
2005-09-14 01:44:19 +00:00
|
|
|
/* xhal.c */
|
|
|
|
NTSTATUS
|
|
|
|
FASTCALL
|
|
|
|
xHalQueryDriveLayout(
|
|
|
|
IN PUNICODE_STRING DeviceName,
|
|
|
|
OUT PDRIVE_LAYOUT_INFORMATION *LayoutInfo
|
|
|
|
);
|
|
|
|
|
|
|
|
#undef HalExamineMBR
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
HalExamineMBR(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN ULONG SectorSize,
|
|
|
|
IN ULONG MBRTypeIdentifier,
|
|
|
|
OUT PVOID *Buffer
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
xHalIoAssignDriveLetters(
|
|
|
|
IN PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|
|
|
IN PSTRING NtDeviceName,
|
|
|
|
OUT PUCHAR NtSystemPath,
|
|
|
|
OUT PSTRING NtSystemPathString
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
FASTCALL
|
|
|
|
xHalIoReadPartitionTable(
|
|
|
|
PDEVICE_OBJECT DeviceObject,
|
|
|
|
ULONG SectorSize,
|
|
|
|
BOOLEAN ReturnRecognizedPartitions,
|
|
|
|
PDRIVE_LAYOUT_INFORMATION *PartitionBuffer
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
FASTCALL
|
|
|
|
xHalIoSetPartitionInformation(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN ULONG SectorSize,
|
|
|
|
IN ULONG PartitionNumber,
|
|
|
|
IN ULONG PartitionType
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
FASTCALL
|
|
|
|
xHalIoWritePartitionTable(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN ULONG SectorSize,
|
|
|
|
IN ULONG SectorsPerTrack,
|
|
|
|
IN ULONG NumberOfHeads,
|
|
|
|
IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer
|
|
|
|
);
|
|
|
|
|
1998-09-13 15:55:36 +00:00
|
|
|
#endif
|