- Fix kernel32 and ntoskrnl build issues.

- Define public version of DEVOBJ_EXTENSION in DDK.

svn path=/trunk/; revision=17650
This commit is contained in:
Alex Ionescu 2005-09-04 23:48:19 +00:00
parent a4d8aa2194
commit 118aa9fba3
8 changed files with 29 additions and 19 deletions

View file

@ -167,10 +167,12 @@ SetMailslotInfo(HANDLE hMailslot,
DWORD lReadTimeout) DWORD lReadTimeout)
{ {
FILE_MAILSLOT_SET_INFORMATION Buffer; FILE_MAILSLOT_SET_INFORMATION Buffer;
LARGE_INTEGER Timeout;
IO_STATUS_BLOCK Iosb; IO_STATUS_BLOCK Iosb;
NTSTATUS Status; NTSTATUS Status;
Buffer.ReadTimeout.QuadPart = lReadTimeout * -10000; Timeout.QuadPart = lReadTimeout * -10000;
Buffer.ReadTimeout = &Timeout;
Status = NtSetInformationFile(hMailslot, Status = NtSetInformationFile(hMailslot,
&Iosb, &Iosb,

View file

@ -336,17 +336,17 @@ IoAttachDeviceToDeviceStackSafe(IN PDEVICE_OBJECT SourceDevice,
OUT PDEVICE_OBJECT *AttachedToDeviceObject) OUT PDEVICE_OBJECT *AttachedToDeviceObject)
{ {
PDEVICE_OBJECT AttachedDevice; PDEVICE_OBJECT AttachedDevice;
PDEVOBJ_EXTENSION SourceDeviceExtension; PEXTENDED_DEVOBJ_EXTENSION SourceDeviceExtension;
DPRINT("IoAttachDeviceToDeviceStack(SourceDevice 0x%p, TargetDevice 0x%p)\n", DPRINT("IoAttachDeviceToDeviceStack(SourceDevice 0x%p, TargetDevice 0x%p)\n",
SourceDevice, TargetDevice); SourceDevice, TargetDevice);
/* Get the Attached Device and source extension */ /* Get the Attached Device and source extension */
AttachedDevice = IoGetAttachedDevice(TargetDevice); AttachedDevice = IoGetAttachedDevice(TargetDevice);
SourceDeviceExtension = SourceDevice->DeviceObjectExtension; SourceDeviceExtension = (PEXTENDED_DEVOBJ_EXTENSION)SourceDevice->DeviceObjectExtension;
/* Make sure that it's in a correct state */ /* Make sure that it's in a correct state */
if (!(AttachedDevice->DeviceObjectExtension->ExtensionFlags & if (!(((PEXTENDED_DEVOBJ_EXTENSION)AttachedDevice->DeviceObjectExtension)->ExtensionFlags &
(DOE_UNLOAD_PENDING | DOE_DELETE_PENDING | (DOE_UNLOAD_PENDING | DOE_DELETE_PENDING |
DOE_REMOVE_PENDING | DOE_REMOVE_PROCESSED))) DOE_REMOVE_PENDING | DOE_REMOVE_PROCESSED)))
{ {
@ -624,7 +624,7 @@ IoDeleteDevice(PDEVICE_OBJECT DeviceObject)
} }
/* I guess this should be removed later... but it shouldn't cause problems */ /* I guess this should be removed later... but it shouldn't cause problems */
DeviceObject->DeviceObjectExtension->ExtensionFlags |= DOE_DELETE_PENDING; ((PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension)->ExtensionFlags |= DOE_DELETE_PENDING;
/* Make the object temporary. This should automatically remove the device /* Make the object temporary. This should automatically remove the device
from the namespace */ from the namespace */
@ -650,7 +650,7 @@ IoDetachDevice(PDEVICE_OBJECT TargetDevice)
DPRINT("IoDetachDevice(TargetDevice 0x%p)\n", TargetDevice); DPRINT("IoDetachDevice(TargetDevice 0x%p)\n", TargetDevice);
/* Remove the attachment */ /* Remove the attachment */
TargetDevice->AttachedDevice->DeviceObjectExtension->AttachedTo = NULL; ((PEXTENDED_DEVOBJ_EXTENSION)TargetDevice->AttachedDevice->DeviceObjectExtension)->AttachedTo = NULL;
TargetDevice->AttachedDevice = NULL; TargetDevice->AttachedDevice = NULL;
} }
@ -758,7 +758,7 @@ STDCALL
IoGetDeviceAttachmentBaseRef(IN PDEVICE_OBJECT DeviceObject) IoGetDeviceAttachmentBaseRef(IN PDEVICE_OBJECT DeviceObject)
{ {
/* Return the attached Device */ /* Return the attached Device */
return (DeviceObject->DeviceObjectExtension->AttachedTo); return (((PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension)->AttachedTo);
} }
/* /*
@ -790,7 +790,7 @@ STDCALL
IoGetDiskDeviceObject(IN PDEVICE_OBJECT FileSystemDeviceObject, IoGetDiskDeviceObject(IN PDEVICE_OBJECT FileSystemDeviceObject,
OUT PDEVICE_OBJECT *DiskDeviceObject) OUT PDEVICE_OBJECT *DiskDeviceObject)
{ {
PDEVOBJ_EXTENSION DeviceExtension; PEXTENDED_DEVOBJ_EXTENSION DeviceExtension;
PVPB Vpb; PVPB Vpb;
KIRQL OldIrql; KIRQL OldIrql;
@ -801,7 +801,7 @@ IoGetDiskDeviceObject(IN PDEVICE_OBJECT FileSystemDeviceObject,
IoAcquireVpbSpinLock(&OldIrql); IoAcquireVpbSpinLock(&OldIrql);
/* Get the Device Extension */ /* Get the Device Extension */
DeviceExtension = FileSystemDeviceObject->DeviceObjectExtension; DeviceExtension = (PEXTENDED_DEVOBJ_EXTENSION)FileSystemDeviceObject->DeviceObjectExtension;
/* Make sure this one has a VPB too */ /* Make sure this one has a VPB too */
Vpb = DeviceExtension->Vpb; Vpb = DeviceExtension->Vpb;
@ -825,7 +825,7 @@ PDEVICE_OBJECT
STDCALL STDCALL
IoGetLowerDeviceObject(IN PDEVICE_OBJECT DeviceObject) IoGetLowerDeviceObject(IN PDEVICE_OBJECT DeviceObject)
{ {
PDEVOBJ_EXTENSION DeviceExtension = DeviceObject->DeviceObjectExtension; PEXTENDED_DEVOBJ_EXTENSION DeviceExtension = (PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension;
PDEVICE_OBJECT LowerDeviceObject = NULL; PDEVICE_OBJECT LowerDeviceObject = NULL;
/* Make sure it's not getting deleted */ /* Make sure it's not getting deleted */

View file

@ -618,8 +618,8 @@ IoRegisterDeviceInterface(
ASSERT(PdoNameInfo->Name.Length); ASSERT(PdoNameInfo->Name.Length);
/* Create base key name for this interface: HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\{GUID} */ /* Create base key name for this interface: HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\{GUID} */
ASSERT(PhysicalDeviceObject->DeviceObjectExtension->DeviceNode); ASSERT(((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode);
InstancePath = &PhysicalDeviceObject->DeviceObjectExtension->DeviceNode->InstancePath; InstancePath = &((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode->InstancePath;
BaseKeyName.Length = wcslen(BaseKeyString) * sizeof(WCHAR); BaseKeyName.Length = wcslen(BaseKeyString) * sizeof(WCHAR);
BaseKeyName.MaximumLength = BaseKeyName.Length BaseKeyName.MaximumLength = BaseKeyName.Length
+ GuidString.Length; + GuidString.Length;

View file

@ -751,7 +751,7 @@ IoCreateFile(OUT PHANDLE FileHandle,
PFILE_OBJECT FileObject = NULL; PFILE_OBJECT FileObject = NULL;
PDEVICE_OBJECT DeviceObject; PDEVICE_OBJECT DeviceObject;
PIRP Irp; PIRP Irp;
PIO_STACK_LOCATION StackLoc; PEXTENDED_IO_STACK_LOCATION StackLoc;
IO_SECURITY_CONTEXT SecurityContext; IO_SECURITY_CONTEXT SecurityContext;
KPROCESSOR_MODE AccessMode; KPROCESSOR_MODE AccessMode;
HANDLE LocalHandle; HANDLE LocalHandle;
@ -999,7 +999,7 @@ IoCreateFile(OUT PHANDLE FileHandle,
* Get the stack location for the new * Get the stack location for the new
* IRP and prepare it. * IRP and prepare it.
*/ */
StackLoc = IoGetNextIrpStackLocation(Irp); StackLoc = (PEXTENDED_IO_STACK_LOCATION)IoGetNextIrpStackLocation(Irp);
StackLoc->MinorFunction = 0; StackLoc->MinorFunction = 0;
StackLoc->Flags = (UCHAR)Options; StackLoc->Flags = (UCHAR)Options;
StackLoc->Control = 0; StackLoc->Control = 0;

View file

@ -439,7 +439,7 @@ IopGetRelatedDevice(PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA RelatedDeviceData)
if (DeviceObject == NULL) if (DeviceObject == NULL)
return STATUS_NO_SUCH_DEVICE; return STATUS_NO_SUCH_DEVICE;
DeviceNode = DeviceObject->DeviceObjectExtension->DeviceNode; DeviceNode = ((PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension)->DeviceNode;
} }
switch (RelatedDeviceData->Relation) switch (RelatedDeviceData->Relation)
@ -518,7 +518,7 @@ IopDeviceStatus(PPLUGPLAY_CONTROL_STATUS_DATA StatusData)
if (DeviceObject == NULL) if (DeviceObject == NULL)
return STATUS_NO_SUCH_DEVICE; return STATUS_NO_SUCH_DEVICE;
DeviceNode = DeviceObject->DeviceObjectExtension->DeviceNode; DeviceNode = ((PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension)->DeviceNode;
switch (StatusData->Operation) switch (StatusData->Operation)
{ {
@ -559,7 +559,7 @@ IopGetDeviceDepth(PPLUGPLAY_CONTROL_DEPTH_DATA DepthData)
if (DeviceObject == NULL) if (DeviceObject == NULL)
return STATUS_NO_SUCH_DEVICE; return STATUS_NO_SUCH_DEVICE;
DeviceNode = DeviceObject->DeviceObjectExtension->DeviceNode; DeviceNode = ((PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension)->DeviceNode;
DepthData->Depth = DeviceNode->Level; DepthData->Depth = DeviceNode->Level;

View file

@ -30,7 +30,7 @@ PDEVICE_NODE FASTCALL
IopGetDeviceNode( IopGetDeviceNode(
PDEVICE_OBJECT DeviceObject) PDEVICE_OBJECT DeviceObject)
{ {
return DeviceObject->DeviceObjectExtension->DeviceNode; return ((PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension)->DeviceNode;
} }
NTSTATUS NTSTATUS
@ -619,7 +619,7 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
Node->PhysicalDeviceObject = PhysicalDeviceObject; Node->PhysicalDeviceObject = PhysicalDeviceObject;
PhysicalDeviceObject->DeviceObjectExtension->DeviceNode = Node; ((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode = Node;
if (ParentNode) if (ParentNode)
{ {

View file

@ -2668,6 +2668,13 @@ typedef struct _ERESOURCE {
KSPIN_LOCK SpinLock; KSPIN_LOCK SpinLock;
} ERESOURCE, *PERESOURCE; } ERESOURCE, *PERESOURCE;
typedef struct _DEVOBJ_EXTENSION
{
CSHORT Type;
USHORT Size;
PDEVICE_OBJECT DeviceObject;
} DEVOBJ_EXTENSION, *PDEVOBJ_EXTENSION;
typedef struct _DRIVER_EXTENSION { typedef struct _DRIVER_EXTENSION {
struct _DRIVER_OBJECT *DriverObject; struct _DRIVER_OBJECT *DriverObject;
PDRIVER_ADD_DEVICE AddDevice; PDRIVER_ADD_DEVICE AddDevice;

View file

@ -8,6 +8,7 @@
#define RESTRICTED_POINTER #define RESTRICTED_POINTER
#define NTAPI __stdcall #define NTAPI __stdcall
#define OBJ_INHERIT 0x00000002 #define OBJ_INHERIT 0x00000002
#define OBJ_PERMANENT 0x00000010 #define OBJ_PERMANENT 0x00000010
#define OBJ_EXCLUSIVE 0x00000020 #define OBJ_EXCLUSIVE 0x00000020