SlideShare a Scribd company logo
WINDOWS NT INTERNALS – 04
Computer Call
September 22, 1997
WINDOWS NT AND
OBJECTIVES
• Design of NT object-based
• Kernel and Execute modules define
• Driver is allowed to access some object
fields and access functions
• I/O Manager objects are partially opaque
to a driver
NT Objects Win 32 Objects
• No external visible names
• Not managed by Object
Manager
• Use pointer to the
Object body
• Visible names
• Managed by
Object Manager
• Use Handles to the
Object body
I/O REQUEST PACKETS
• I/O packet driver in NT
• IRPs are data structures which contains
work order
OPERATIONS OF IRPS
• User specifies some function
• I/O Manager allocates IRP from non
paged system memory
• IRP is passed to driver dispatch routine
• Dispatch routine passes IRP to driver’s start
I/O routine
• Start I/O routine uses contents of the IRP
and sets up device operation
• On operation completion, Dpc For lsr
routine stores final status code in IRP and
sends it back to I/O Manager
• I/O Manager sends the user final status
LAYOUT OF IRP
IO Status
Major Function;
Minor function;
Union { Struct{} Read;
Struct{}Write;
Struct{}Device located;
}parameters
IRP
IO-STATUS-BLOCK
Status;
Information;
IO-STACK-LOCATION
Two sections in IRP
•Header area containing book keeping information
•One or more parameter blocks called I/O stack
locations
IRP HEADER
• IO status- holds final status of the I/O
operation
 Status field-STATUS XXX value
 Information fiels- 0(error)
value(no.of bites
transferred)
I/O STACK LOCATIONS
• Major functions- hold function code(IRP-MJ-XXX
function)
• Minor function- used by file system and SCSI
drivers
• Parameters- Operation to perform
 Struct Read-parameters for IRP-MJ-READ
 Struct Write- parameters for IRP-MJ-WRITE
 Struct Device IO control- parameters for IRP-MJ-
DEVICE-CONTROL and IRP-MJ-INTERNAL-DEVICE-
CONTROL
DRIVER OBJECT
• A catalog that contains pointers to various
driver functions
OPERATION OF DRIVER
OBJECT
• I/O Manager creates Driver Object
• Driver Entry routine loads pointer to other
driver functions
• I/O Manager uses associated dispatch
routine of Driver Object
• I/O Manager uses Driver Object to locate
the driver’s start I/O routine
• I/O Manager deletes the Driver Objects
• I/O Manager uses Driver Object to find
unload routine
LAYOUT OF DRIVER OBJECT
Device
Object
Device
Object
Device Object
Driver Object
Driver Start IO
Driver Unload
Major Function
.
.
Start I/O routine`
Unload Routine
Dispatch Routine
Dispatch Routine
DEVICE OBJECTS AND
DEVICE EXTENSIONS
• Keep information about a device’s
characteristics and state
• One device object for each virtual, logical,
and physical device on the system
OPERATION OF DEVICE
OBJECTS
• Driver Entry routine creates a Device Object
• I/O Manager uses a pointer in the Device
Object to locate corresponding Driver Object
•Driver routines use the Device Object to
locate corresponding Device Extension
•Driver’s Unload routine deletes the Device
Object
LAYOUT OF DEVICE OBJECT
Driver Object
Pending
IRP
Pending
IRP
Device Object
Next Device
Flags
Driver Object
Current lrp
Device
Extension
Device Queue
Object
Current
IRP
Device
Extension
DEVICE EXTENSION
• Used to hold any information associated with
a particular device
• Block of non=paged pool that the I/O Manager
attaches to Device object
LAYOUT DEVICE EXTENSION
Controller
Object
Device
Extension
Information
Device Object
Device State
Interrupt Object
Controller Object
Adapter Object
Device Object
Interrupt
Object
Adapter Object
CONTROLLER AND CONTROLLER
EXTENSIONS
• A token that can be owned by only one
device at a time
Operation of Controller Objects
• Driver Entry routine creates controller object and stores its
address in Device Extension
• Start I/O asks for exclusive ownership of controller object
• I/O Manager grants ownerships and calls controller control routine
which starts I/O operation
• After completion of device operation, driver’s Dpc For lsr routine
releases the controller object
• Unload routine deletes the controller object
Device Object
Device
Extension
Device Object
Device
Extension
Controller
Object
Controller
Extension
Controller
Extension
ADAPTER OBJECTS
• Used to prevent arguments over DMA hardware
• One Adapter Object for each DMA data transfer channel
• Manage mapping registers used to map scattered physical pages
of a user’s buffer onto contiguous range of address
Operations on Adapter Objects
• HAL creates Adapter Objects for all DMA channels detected
at bootsteap time
• Driver Entry routine locates the Adapter Object and stores
pointers in the Device or Controller Extension
• Start I/O routine requests owner ship of Adapter Object
• I/O Manager calls the drivers Adapter Control routine
• Dpc For lsr routine releases the Adapter Object
LAYOUT OF ADAPTER OBJECT
Device Controller
Extension
Adapter Ptr
Map RegCount
Adapter Object
INTERRUPT OBJECTS
• Give the Kernel’s interrupt dispatcher a
way to find right ISR
Operation of Interrupt Object
 Driver Entry routine creates Interrupt
Object
 Kernel’s interrupt dispatcher locates
the ISR
 Unload routine deletes the Interrupt
Object
LAYOUT OF AN INTERRUPT
OBJECT
Device or
Controller
Extension
Interrupt Ptr
Interrupt
Object
Interrupt
Service
Routine

More Related Content

PDF
Understanding Windows NT Internals - Part 3
PDF
2 programming.the.microsoft.windows.driver.model.2nd.edition
PDF
AnyDesk Pro 3.7.0 Crack License Key Free Download
PDF
Understanding Windows NT Internals - Part 5
PDF
PDF Replacer Pro Crack 1.8.9 Free Download
PDF
Revo Uninstaller Pro 5.2.6 Crack + License Key 2025 [Full Latest]
PDF
windowsntinterevo uninstaller pro crack rnals-chapter5-250311141151-a0411...
PDF
PDF Replacer Pro 1.8.9 Crack Free Download
Understanding Windows NT Internals - Part 3
2 programming.the.microsoft.windows.driver.model.2nd.edition
AnyDesk Pro 3.7.0 Crack License Key Free Download
Understanding Windows NT Internals - Part 5
PDF Replacer Pro Crack 1.8.9 Free Download
Revo Uninstaller Pro 5.2.6 Crack + License Key 2025 [Full Latest]
windowsntinterevo uninstaller pro crack rnals-chapter5-250311141151-a0411...
PDF Replacer Pro 1.8.9 Crack Free Download

Similar to Understanding Windows NT Internals - Part 4 (20)

PDF
Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...
PDF
Programming The Microsoft Windows Driver Model 2nd Edition Walter Oney
PPT
Windows io manager
PPT
WinCE
PDF
Manjjsjsjsjs3826101-IO-Software-Layers.pdf
PPTX
Window IO
PPTX
Introduction to windows kernel
PPTX
Introduction to windows kernel
PDF
ITFT_Device management in Operating System
PDF
Organisasi dan Arsitektur Komputer MO-06
PDF
wp-understanding-the-aix-object-data-manager.pdf
PDF
Windows Internals Part 2_6th Edition.pdf
PPT
PPTX
unit 5.pptx
PPT
PPT
Presentation
PPT
Input / Output organization of computer architecture
PPT
Windows kernel and memory io subsystem
PPT
07_Input Output_Computer Architecture.ppt
PPT
07 input output
Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...
Programming The Microsoft Windows Driver Model 2nd Edition Walter Oney
Windows io manager
WinCE
Manjjsjsjsjs3826101-IO-Software-Layers.pdf
Window IO
Introduction to windows kernel
Introduction to windows kernel
ITFT_Device management in Operating System
Organisasi dan Arsitektur Komputer MO-06
wp-understanding-the-aix-object-data-manager.pdf
Windows Internals Part 2_6th Edition.pdf
unit 5.pptx
Presentation
Input / Output organization of computer architecture
Windows kernel and memory io subsystem
07_Input Output_Computer Architecture.ppt
07 input output
Ad

More from Arun Seetharaman (12)

PDF
Implementing Load Balancing in COM+ Applications
PDF
Advanced Windows DNA Scripting with Visual InterDev
PDF
Implementing DHTML Behavior Script Components
PDF
Creating Data-based Applications Using DHTML
PDF
COM Events for Late-bound Delivery of Information
PDF
Understanding Windows NT Internals - Part 1
PDF
Understanding Windows NT Internals - Part 2
PDF
OLE DB Provider Development - Encapsulating a Service Provider
PDF
OLE DB 2.0 Architecture - Supporting Remote Data Exchange
PDF
Data Structures in Java and Introduction to Collection Framework
PDF
AWT Enhancements in V1.1 - Supporting Richer GUI Development
PDF
Java Foundation Classes - Building Portable GUIs
Implementing Load Balancing in COM+ Applications
Advanced Windows DNA Scripting with Visual InterDev
Implementing DHTML Behavior Script Components
Creating Data-based Applications Using DHTML
COM Events for Late-bound Delivery of Information
Understanding Windows NT Internals - Part 1
Understanding Windows NT Internals - Part 2
OLE DB Provider Development - Encapsulating a Service Provider
OLE DB 2.0 Architecture - Supporting Remote Data Exchange
Data Structures in Java and Introduction to Collection Framework
AWT Enhancements in V1.1 - Supporting Richer GUI Development
Java Foundation Classes - Building Portable GUIs
Ad

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Cloud computing and distributed systems.
PPT
Teaching material agriculture food technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Machine Learning_overview_presentation.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Empathic Computing: Creating Shared Understanding
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MIND Revenue Release Quarter 2 2025 Press Release
20250228 LYD VKU AI Blended-Learning.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Cloud computing and distributed systems.
Teaching material agriculture food technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine Learning_overview_presentation.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Big Data Technologies - Introduction.pptx
Unlocking AI with Model Context Protocol (MCP)
Empathic Computing: Creating Shared Understanding
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Assigned Numbers - 2025 - Bluetooth® Document
Reach Out and Touch Someone: Haptics and Empathic Computing
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation theory and applications.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Understanding Windows NT Internals - Part 4

  • 1. WINDOWS NT INTERNALS – 04 Computer Call September 22, 1997
  • 2. WINDOWS NT AND OBJECTIVES • Design of NT object-based • Kernel and Execute modules define • Driver is allowed to access some object fields and access functions • I/O Manager objects are partially opaque to a driver
  • 3. NT Objects Win 32 Objects • No external visible names • Not managed by Object Manager • Use pointer to the Object body • Visible names • Managed by Object Manager • Use Handles to the Object body
  • 4. I/O REQUEST PACKETS • I/O packet driver in NT • IRPs are data structures which contains work order
  • 5. OPERATIONS OF IRPS • User specifies some function • I/O Manager allocates IRP from non paged system memory • IRP is passed to driver dispatch routine • Dispatch routine passes IRP to driver’s start I/O routine • Start I/O routine uses contents of the IRP and sets up device operation • On operation completion, Dpc For lsr routine stores final status code in IRP and sends it back to I/O Manager • I/O Manager sends the user final status
  • 6. LAYOUT OF IRP IO Status Major Function; Minor function; Union { Struct{} Read; Struct{}Write; Struct{}Device located; }parameters IRP IO-STATUS-BLOCK Status; Information; IO-STACK-LOCATION Two sections in IRP •Header area containing book keeping information •One or more parameter blocks called I/O stack locations
  • 7. IRP HEADER • IO status- holds final status of the I/O operation  Status field-STATUS XXX value  Information fiels- 0(error) value(no.of bites transferred)
  • 8. I/O STACK LOCATIONS • Major functions- hold function code(IRP-MJ-XXX function) • Minor function- used by file system and SCSI drivers • Parameters- Operation to perform  Struct Read-parameters for IRP-MJ-READ  Struct Write- parameters for IRP-MJ-WRITE  Struct Device IO control- parameters for IRP-MJ- DEVICE-CONTROL and IRP-MJ-INTERNAL-DEVICE- CONTROL
  • 9. DRIVER OBJECT • A catalog that contains pointers to various driver functions
  • 10. OPERATION OF DRIVER OBJECT • I/O Manager creates Driver Object • Driver Entry routine loads pointer to other driver functions • I/O Manager uses associated dispatch routine of Driver Object • I/O Manager uses Driver Object to locate the driver’s start I/O routine • I/O Manager deletes the Driver Objects • I/O Manager uses Driver Object to find unload routine
  • 11. LAYOUT OF DRIVER OBJECT Device Object Device Object Device Object Driver Object Driver Start IO Driver Unload Major Function . . Start I/O routine` Unload Routine Dispatch Routine Dispatch Routine
  • 12. DEVICE OBJECTS AND DEVICE EXTENSIONS • Keep information about a device’s characteristics and state • One device object for each virtual, logical, and physical device on the system
  • 13. OPERATION OF DEVICE OBJECTS • Driver Entry routine creates a Device Object • I/O Manager uses a pointer in the Device Object to locate corresponding Driver Object •Driver routines use the Device Object to locate corresponding Device Extension •Driver’s Unload routine deletes the Device Object
  • 14. LAYOUT OF DEVICE OBJECT Driver Object Pending IRP Pending IRP Device Object Next Device Flags Driver Object Current lrp Device Extension Device Queue Object Current IRP Device Extension
  • 15. DEVICE EXTENSION • Used to hold any information associated with a particular device • Block of non=paged pool that the I/O Manager attaches to Device object
  • 16. LAYOUT DEVICE EXTENSION Controller Object Device Extension Information Device Object Device State Interrupt Object Controller Object Adapter Object Device Object Interrupt Object Adapter Object
  • 17. CONTROLLER AND CONTROLLER EXTENSIONS • A token that can be owned by only one device at a time Operation of Controller Objects • Driver Entry routine creates controller object and stores its address in Device Extension • Start I/O asks for exclusive ownership of controller object • I/O Manager grants ownerships and calls controller control routine which starts I/O operation • After completion of device operation, driver’s Dpc For lsr routine releases the controller object • Unload routine deletes the controller object
  • 19. ADAPTER OBJECTS • Used to prevent arguments over DMA hardware • One Adapter Object for each DMA data transfer channel • Manage mapping registers used to map scattered physical pages of a user’s buffer onto contiguous range of address Operations on Adapter Objects • HAL creates Adapter Objects for all DMA channels detected at bootsteap time • Driver Entry routine locates the Adapter Object and stores pointers in the Device or Controller Extension • Start I/O routine requests owner ship of Adapter Object • I/O Manager calls the drivers Adapter Control routine • Dpc For lsr routine releases the Adapter Object
  • 20. LAYOUT OF ADAPTER OBJECT Device Controller Extension Adapter Ptr Map RegCount Adapter Object
  • 21. INTERRUPT OBJECTS • Give the Kernel’s interrupt dispatcher a way to find right ISR Operation of Interrupt Object  Driver Entry routine creates Interrupt Object  Kernel’s interrupt dispatcher locates the ISR  Unload routine deletes the Interrupt Object
  • 22. LAYOUT OF AN INTERRUPT OBJECT Device or Controller Extension Interrupt Ptr Interrupt Object Interrupt Service Routine