VistaVerifier.docx
《VistaVerifier.docx》由会员分享,可在线阅读,更多相关《VistaVerifier.docx(50页珍藏版)》请在冰豆网上搜索。
VistaVerifier
DriverVerifierinWindowsVista
October26,2006
Abstract
DriverVerifiermonitorskernel-modedriverstodetectillegalfunctioncallsoractionsthatmightcorruptthesystem.ItwasfirstincludedinMicrosoft®Windows® 2000andisavailableinalllaterversionsofWindows.DriverVerifierworksonboththefreeandcheckedbuildsofWindowsoperatingsystems.
ForWindowsVista™,DriverVerifierhasbeenenhancedwithnewtestsandfeaturesthatallowDriverVerifiertoexposemoreclassesoftypicaldriverbugs.Also,DriverVerifieriseasiertouse,beginningwithWindowsVista.ThispaperprovidesapreviewofWindowsDriverKit(WDK)documentationfortheDriverVerifierenhancementsinWindowsVista.
Thispaperappliesfortheseoperatingsystems:
MicrosoftWindowsServer®CodeName"Longhorn"
WindowsVista
ThecurrentversionofthispaperismaintainedontheWebat:
Referencesandresourcesdiscussedherearelistedattheendofthispaper.
Contents
Introduction3
EnablingDriverVerifierandChangingSettingswithoutRebooting3
EnhancedLowResourcesSimulation4
SimulatingSTATUS_ALERTEDReturnValuefromAlertableWaits6
DebuggingDriverCrashes6
ForcePendingI/ORequests8
UsingForcePendingI/ORequests9
ActivatingtheForcePendingI/ORequestsOption10
ViewingtheResultsoftheForcePendingI/ORequestsOption10
SecurityChecks11
MoreThoroughI/OVerification13
ViewingtheIoAllocateIrp,IoCompleteRequest,andIoCancelIrpCallsLog13
ActivatingtheI/OVerificationOption15
EnhancedIRQLChecking16
MiscellaneousChecks17
EnablingKernelHandleTracingfortheSystemProcess17
ViewingtheKernelHandleTracingLogfortheSystemProcess18
ActivatingtheMiscellaneousChecksOption22
ViewingtheResultsoftheMiscellaneousChecksOption23
LockedMemoryPageTracking25
AdditionalAutomaticChecks25
LoggingPoolMemoryAllocateandFreeCalls26
ViewingtheLogofPoolMemoryAllocateandFreeCalls26
Resources29
Disclaimer
Thisisapreliminarydocumentandmaybechangedsubstantiallypriortofinalcommercialreleaseofthesoftwaredescribedherein.
TheinformationcontainedinthisdocumentrepresentsthecurrentviewofMicrosoftCorporationontheissuesdiscussedasofthedateofpublication.BecauseMicrosoftmustrespondtochangingmarketconditions,itshouldnotbeinterpretedtobeacommitmentonthepartofMicrosoft,andMicrosoftcannotguaranteetheaccuracyofanyinformationpresentedafterthedateofpublication.
ThisWhitePaperisforinformationalpurposesonly.MICROSOFTMAKESNOWARRANTIES,EXPRESS,IMPLIEDORSTATUTORY,ASTOTHEINFORMATIONINTHISDOCUMENT.
Complyingwithallapplicablecopyrightlawsistheresponsibilityoftheuser.Withoutlimitingtherightsundercopyright,nopartofthisdocumentmaybereproduced,storedinorintroducedintoaretrievalsystem,ortransmittedinanyformorbyanymeans(electronic,mechanical,photocopying,recording,orotherwise),orforanypurpose,withouttheexpresswrittenpermissionofMicrosoftCorporation.
Microsoftmayhavepatents,patentapplications,trademarks,copyrights,orotherintellectualpropertyrightscoveringsubjectmatterinthisdocument.ExceptasexpresslyprovidedinanywrittenlicenseagreementfromMicrosoft,thefurnishingofthisdocumentdoesnotgiveyouanylicensetothesepatents,trademarks,copyrights,orotherintellectualproperty.
Unlessotherwisenoted,theexamplecompanies,organizations,products,domainnames,e-mailaddresses,logos,people,placesandeventsdepictedhereinarefictitious,andnoassociationwithanyrealcompany,organization,product,domainname,emailaddress,logo,person,placeoreventisintendedorshouldbeinferred.
©2005–2006MicrosoftCorporation.Allrightsreserved.
Microsoft,Windows,WindowsServer,andWindowsVistaareeitherregisteredtrademarksortrademarksofMicrosoftCorporationintheUnitedStatesand/orothercountries.
Thenamesofactualcompaniesandproductsmentionedhereinmaybethetrademarksoftheirrespectiveowners.
Introduction
DriverVerifiermonitorskernel-modedriverstodetectillegalfunctioncallsoractionsthatmightcorruptthesystem.Itcansubjectthedriverstoavarietyofstressesandteststofindimproperbehavior.
MicrosoftstronglyencourageshardwaremanufacturerstotesttheirdriverswithDriverVerifiertoensurethatdriversarenotmakingillegalfunctioncallsorcausingsystemcorruption.DriverVerifierisincludedinMicrosoft®Windows® 2000andalllaterversionsofMicrosoftWindows.DriverVerifierworksonboththefreeandcheckedbuildsofWindowsoperatingsystems.
ForWindowsVista™,DriverVerifierhasbeenenhancedwithnewtestsandfeaturesthatallowDriverVerifiertoexposemoreclassesoftypicaldriverbugs.Also,DriverVerifieriseasiertouse,beginningwithWindowsVista.ThispaperprovidesapreviewofWindowsDriverKit(WDK)documentationfortheDriverVerifierenhancementsinWindowsVista.
TheDebuggingToolsforWindowsaretypicallyusedtoinvestigateissuesthatDriverVerifierexposes,asexemplifiedinthispreview.ForavailabilityofWindowsVistaandDebuggingToolsforWindows,see“Resources”attheendofthispaper.
Note DriverVerifierrunsonlywithelevatedprivilegeinWindows VistaandlaterversionsofWindows.
EnablingDriverVerifierandChangingSettingswithoutRebooting
InWindowsVista,DriverVerifierprovidestheabilitytoactivatemostoptionsandtoaddandremovedriversforverificationwithoutrebootingthecomputer.
Specifically,intheversionofDriverVerifierincludedinWindowsVista:
∙Youcanstartverificationofanydriverwithoutrebooting,evenifDriverVerifierisnotalreadyrunning.
ThiseliminatestherequirementinearlieroperatingsystemsthatDriverVerifierbeverifyinganotherdriverbeforerebootingWindows.
∙Youcanstarttheverificationofadriverthatisalreadyloaded.
ThiseliminatestheearlierrequirementthatdriversloadafterstartingDriverVerifier.
∙YoucanactivateordeactivatemostDriverVerifieroptionswithoutrebooting.
Again,DriverVerifierneednotberunningtochangeoptions.
Thisnewfunctionalityisdesignedtoeliminatethetimespentondisruptivereboots,allowingyoutouseDriverVerifieronproductionserversthatcannotaffordtorebootandtomonitoryourdriverwhileyouattachandremovedevices.
Qualifications.Thereareafewqualifications,however:
∙YoucannotactivateordeactivatetheSCSIVerificationorDiskIntegrityCheckingoptionswithoutrebooting.
∙Youcannotstoptheverificationofadriverwithoutrebootingifthedriveriscurrentlyloaded.However,youcandeactivatealloftheDriverVerifieroptionswithoutrebooting,therebyminimizingtheoverheaduntilthenextreboot.
∙Driversthatareverifiedaftertheyareloadedandwithoutrebootingarenotmonitoredasthoroughlyasdriversthatareloadedafterareboot.Approximately90percentofthetypicalDriverVerifiertestsareactivewhenverificationhasstartedafterloadingthedriver.TogetthefullDriverVerifierpower,wheneverpossible,enablethedriverforverificationandthenrebootthecomputer.
∙Theoptionsanddriversthatyouselectwithoutrebootingareeffectiveimmediately,buttheyarelostwhenyoushutdownorrestartthesystem.
UsingtheNo-RebootFeature.Youcanusetheno-rebootfeatureinDriverVerifierManageroratthecommandline.Tostartorstopverification,ortochangeoptionswithoutrebooting,usetheproceduresthatwereestablishedforvolatilesettings.
Thefollowingexamplesshowhowtousetheno-rebootfeatureatthecommandlinebyaddingthe/volatileparameter.
Tostartorstoptheverificationofadriverwithoutrebooting
verifier/volatile/adddriverDriverName.sys
verifier/volatile/removedriverDriverName.sys
Youcanusethiscommandsyntaxtoaddanydriver(starttheverification),evenadriverthatiscurrentlyloaded.Commandstoremoveacurrentlyloadeddriver(stoptheverification)willfail.Asalways,theverificationofadriverthatisnotloadedwillbeginassoonasthedriverisloaded.
Toactivateordeactivateoptionswithoutrebooting
verifier/volatile/flags[Options]
YoucanusethiscommandsyntaxwithanyDriverVerifieroption,exceptforSCSIVerificationandDiskIntegrityChecking.Forexample:
verifier/volatile/flags0x20
Thiscommandactivatesthedeadlockdetectionoptionwithoutrebooting.
Youcannotstoptheverificationofadriverthatiscurrentlyloadedwithoutrebooting.However,youcanusethefollowingcommandsyntaxtodeactivatealloftheDriverVerifieroptionswithoutrebooting,therebyminimizingtheoverheaduntilthenextreboot.
ToturnoffallDriverVerifieroptions
∙UsethiscommandtodeactivateallDriverVerifieroptionswithoutrebooting:
verifier/volatile/flags0
DriverVerifiercontinuestomonitorthedriverbyusingtheoptionsintheAutomaticChecksfeature,whichcannotbeturnedoff,buttheoverheadisreducedtoapproximately10percentoftheoverheadofatypicalverification.
EnhancedLowResourcesSimulation
WhentheLowResourcesSimulationoptionisactive,DriverVerifierfailsrandominstancesofthedriver’smemoryallocations,asmightoccurifthedriverisrunningonacomputerwithinsufficientmemory.Thisteststhedriver’sabilitytorespondproperlytolow-memoryandotherlow-resourceconditions.
TheLowResourcesSimulationtestfailsallocationsrequestedbycallstoseveraldifferentfunctions,includingExAllocatePoolXXX,MmProbeAndLockPages,MmMapLockedPagesSpecifyCache,andMmMapIoSpace.StartingwithWindowsVista,callstoMmAlloca