© 2004 Microsoft Corporation. All rights reserved. 1 Modifying Parameters.

Slides:



Advertisements
Similar presentations
Filter Manager Overview
Advertisements

Filter Manager Rajeev Nagar Lead Program Manager Core File Services
Lectures on File Management
CS 450 Module R4. R4 Overview Due on March 11 th along with R3. R4 is a small yet critical part of the MPX system. In this module, you will add the functionality.
Performance of Cache Memory
CSCC69: Operating Systems
The Linux Kernel: Memory Management
EECS 470 Virtual Memory Lecture 15. Why Use Virtual Memory? Decouples size of physical memory from programmer visible virtual memory Provides a convenient.
A Pipeline for Lockless Processing of Sound Data David Thall Insomniac Games.
Loading and Unloading Minifilters
© 2004 Microsoft Corporation. All rights reserved. 1 Context Management.
© 2004 Microsoft Corporation. All rights reserved. 1 File Name Management.
Recovery 10/18/05. Implementing atomicity Note, when a transaction commits, the portion of the system implementing durability ensures the transaction’s.
Memory Management April 28, 2000 Instructor: Gary Kimura.
I/O Request Flaw in WDF Kernel-Mode Driver
1.1 CAS CS 460/660 Introduction to Database Systems File Organization Slides from UC Berkeley.
© 2004 Microsoft Corporation. All rights reserved. 1 Accessing User Buffers.
7/3/20151 Announcement (No deadline extension for the rest of quarter) Project 2 final deadline is Tuesday midnight May 19 Project 0 resubmission for autograding.
Chapter 15.7 Buffer Management ID: 219 Name: Qun Yu Class: CS Spring 2009 Instructor: Dr. T.Y.Lin.
1 CS 541 Database Systems Implementation of Undo- Redo.
Backup and Recovery Part 1.
Sunday Business Systems Using Access More Efficiently Tips and tricks to improve productivity.
McGraw-Hill/Irwin Introduction to QuickBooks Pro, 2004 © 2005 The McGraw-Hill Companies, Inc., All Rights Reserved. Chapter 4 Bank Reconciliation.
Layers of a DBMS Query optimization Execution engine Files and access methods Buffer management Disk space management Query Processor Query execution plan.
SQL Server memory architecture and debugging memory Issues
Driver Verifier Advancements In Windows 7 Daniel Mihai Principal Software Design Engineer Windows Engineering Tools.
INTRODUCTION TO TRANSACTION PROCESSING CHAPTER 21 (6/E) CHAPTER 17 (5/E)
File System and File System Filter Ecosystem Update Neal Christiansen Development Lead File System Filter Team.
How to Add WMI Interfaces to SCSIPort and Storport Miniports
Experience with Processes and Monitors in Mesa
1 Database Systems CS204 Lecture 21 Transaction Processing I Asma Ahmad FAST-NU April 7, 2011.
© Microsoft Corporation1 Windows Kernel Internals I/O Architecture *David B. Probert, Ph.D. Windows Kernel Development Microsoft Corporation.
UDI Tutorial & Driver Walk-Through Part 2 Kurt Gollhardt SCO Core OS Architect
CS 153 Design of Operating Systems Spring 2015 Lecture 17: Paging.
Introduction to Entity Framework Part 2 CRUD Scaffolding Tom Perkins NTPCUG.
Memory Management 3 Tanenbaum Ch. 3 Silberschatz Ch. 8,9.
© Microsoft Corporation Windows Kernel Internals II Advanced File Systems University of Tokyo – July 2004 Dave Probert, Ph.D. Advanced Operating.
Analysing Data with Excel Viewing Help To view Help 1.On the Start menu, point to Programs, and then click Microsoft Excel. 2.On the Help menu,
Implementing Subprograms What actions must take place when subprograms are called and when they terminate? –calling a subprogram has several associated.
© 2004 Microsoft Corporation. All rights reserved. 1 Minifilter Generated IO’s.
4P13 Week 12 Talking Points Device Drivers 1.Auto-configuration and initialization routines 2.Routines for servicing I/O requests (the top half)
DFS DBufferCache DBuffer VirtualDisk startRequest(dbuf, r/w) ioComplete() blockID = getBlockID() buf[] = getBuffer() read(), write() startFetch(), startPush()
© 2004 Microsoft Corporation. All rights reserved. 1 Rules for Filters (both Legacy and Mini)
Data Structures and Algorithms Searching Algorithms M. B. Fayek CUFE 2006.
Consider the Java code snippet below. Is it a legal use of Java synchronization? What happens if two threads A and B call get() on an object supporting.
Windows XP Memory Management Aaron Lanoy and Jason Farnsworth.
4P13 Week 9 Talking Points
ItsyBitsyRel: A Small Relational Database (Part II) Implementation Hints Shahin Shayandeh
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 7 – Buffer Management.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
UDP : User Datagram Protocol 백 일 우
Direct memory access. IO Command includes: buffer address buffer length read or write dada position in disk When IO complete, DMA sends an interrupt request.
© 2004 Microsoft Corporation. All rights reserved. 1 Processing IO Operations.
Daniel Mihai Software Design Engineer Microsoft Corporation.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
File I/O. I/O Flags Flags are passed to give some information about how the file is to be used. – Read only file – flag=0x0 – Write only file – flag=0x1.
Module 11: File Structure
The Buffer Cache.
Chapter 11: Storage and File Structure
Unix Process Management
CS222/CS122C: Principles of Data Management Lecture #3 Heap Files, Page Formats, Buffer Manager Instructor: Chen Li.
Performance Measures of Disks
I/O Manager, 64-bit Porting, and New Driver Models
Ch 21: Transaction Processing
Introduction to Database Systems
Transaction Log Internals and Performance David M Maxwell
CS 2606 Project 2 Clarifications
Internal Representation of Files
SPL – PS3 C++ Classes.
Presentation transcript:

© 2004 Microsoft Corporation. All rights reserved. 1 Modifying Parameters

© 2004 Microsoft Corporation. All rights reserved. 2 Changing Operation Parameters Only fields in FLT_CALLBACK_DATA.Iopb structure can be changed Includes TargetInstance, TargetFileObject, and operation specific parameters (including buffer address and MDL) TargetInstance can only be changed to an instance of your filter at the same altitude on another volume TargetFileObject must be to a file on the same volume as TargetInstance MajorFunction may not be changed – generate another IO

© 2004 Microsoft Corporation. All rights reserved. 3 Changing Operation Parameters (cont) FltSetCallbackDataDirty() Must be called to signify that parameters have been changed If FLT_CALLBACK_DATA is not marked DIRTY, changes are ignored FltClearCallbackDataDirty() FltIsCallbackDataDirty()

© 2004 Microsoft Corporation. All rights reserved. 4 Changing Operation Parameters (cont) Parameters received in postOperation callback are the parameters received in preOperation These parameters DO NOT reflect any parameter changes filter may have made If filter needs to know changes made to parameters in postOperation callback, it should record the changes in the context passed from the preOperation callback

© 2004 Microsoft Corporation. All rights reserved. 5 Changing Operation Parameters (cont) FLT_CALLBACK_DATA.IoStatus may also be changed This is an exception to the previous rule May be changed in pre operation callback if completing the operation May be changed in post operation callback if undoing operation If changing a successful operation to a failure, it is filters responsibility to undo the operation Do not need to call FLT_SET_CALLBACK_DATA_DIRTY()

© 2004 Microsoft Corporation. All rights reserved. 6 Swapping Buffers Always keep the MDL and buffer fields in sync After making a buffer or MDL change, always call FltSetCallbackDataDirty() Never change the state of the FLTFL_CALLBACK_DATA_SYSTEM_BUFFER flag Should only be set by Filter Manager

© 2004 Microsoft Corporation. All rights reserved. 7 Swapping Buffers (cont) If you swap buffers you must have a postOperation callback Do not free the Buffer or MDL you are replacing Do not free MDLs you have successfully inserted into a callback data structure FltMgr will free them for you In your postOperation callback, free the buffer you allocated Again, do not free the MDL

© 2004 Microsoft Corporation. All rights reserved. 8 Swapping Buffers (cont) IRP operation If FLTFL_CALLBACK_DATA_SYSTEM_BUFFER flag is set: New buffer must be allocated from nonPaged pool Set the MDL field to NULL Call FLT_SET_CALLBACK_DATA_DIRTY() If FLTFL_CALLBACK_DATA_SYSTEM_BUFFER flag is not set: New buffer can be from paged or nonPaged pool PagingIO operation buffers must be from nonPaged pool Always create and set a MDL See MmBuildMdlForNonPagedPool() Call FLT_SET_CALLBACK_DATA_DIRTY()

© 2004 Microsoft Corporation. All rights reserved. 9 Swapping Buffers (cont) FastIO New buffer can be from paged or nonPaged pool Set the MDL to NULL MDL should already be NULL Call FltSetCallbackDataDirty()

© 2004 Microsoft Corporation. All rights reserved. 10 Swapping Buffers (cont) WARNING: Non-Cached IO operations MM violates the rule that the length of non-cached IO operations must be rounded to a sector boundary The file systems round the length up to the next sector size below the filter When swapping buffers in this scenario, the filter must round the length up to the sector size (use SectorSize field in DeviceObject) before allocating/copying data. If you don’t the system may crash or you may corrupt the file

© 2004 Microsoft Corporation. All rights reserved. 11 Swapped Buffer Support Routines FltGetSwappedBufferMdlAddress() Only callable from postOperation callback Returns the MDL for the buffer that you set in the preOperation callback This may return NULL FltRetainSwappedBufferMdlAddress() Only callable from postOperation callback Tells FltMgr to not free the current operations MDL It is now the filters responsibility to free this MDL

© 2004 Microsoft Corporation. All rights reserved. 12 Unloading Filters with Swapped Buffers These operations are not “drainable” Instead, the operation is canceled After canceling, FltMgr waits for the operation to complete. Whether the operation has a cancel routine or not, it is assumed it will complete soon

© 2004 Microsoft Corporation. All rights reserved. 13 Sample See the SwapBuffers minifilter sample