Windows Kernel Development Articles (2016-03-30).html 1.2 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997
  1. <!DOCTYPE html>
  2. <!-- saved from url=(0084)http://pabprod.blob.core.windows.net/books/d385673a-8a13-495b-b4fc-e946b683e6c9.html -->
  3. <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>My Collection</title><!--<base href="http://msdn.microsoft.com/">--><base href="."><style type="text/css"></style><script class="mtps-injected">try {
  4. /**/
  5. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  6. "image": "https://i-msdn.sec.s-msft.com",
  7. "js": "https://i2-msdn.sec.s-msft.com",
  8. "css": "https://i-msdn.sec.s-msft.com",
  9. "ttf": "https://i-msdn.sec.s-msft.com"
  10. });
  11. /**/
  12. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  13. //
  14. var literalNormalizedUrl = '/en-us/library/ms809754(d=printer,l=en-us,v=msdn.10).aspx';
  15. var wt_nvr_ru = 'WT_NVR_RU';
  16. var wt_fpcdom = '.microsoft.com';
  17. var wt_domlist = 'msdn.microsoft.com';
  18. var wt_pathlist = '';
  19. var wt_paramlist = 'DCSext.mtps_devcenter';
  20. var wt_siteid = 'MSDN';
  21. var gDomain = 'm.webtrends.com';
  22. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  23. var gFpc = 'WT_FPC';
  24. if (document.cookie.indexOf(gFpc + "=") == -1) {
  25. var wtidJs = document.createElement("script");
  26. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  27. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  28. }
  29. var detectedLocale = 'en-us';
  30. var wtsp = 'msdnlib_w32_com';
  31. var gTrackEvents = '0';
  32. /**/
  33. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  34. //
  35. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  36. //
  37. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  38. /**/
  39. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  40. "image": "https://i-msdn.sec.s-msft.com",
  41. "js": "https://i2-msdn.sec.s-msft.com",
  42. "css": "https://i-msdn.sec.s-msft.com",
  43. "ttf": "https://i-msdn.sec.s-msft.com"
  44. });
  45. /**/
  46. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  47. //
  48. var literalNormalizedUrl = '/en-us/library/dn655038(d=printer,l=en-us,v=vs.140).aspx';
  49. var wt_nvr_ru = 'WT_NVR_RU';
  50. var wt_fpcdom = '.microsoft.com';
  51. var wt_domlist = 'msdn.microsoft.com';
  52. var wt_pathlist = '';
  53. var wt_paramlist = 'DCSext.mtps_devcenter';
  54. var wt_siteid = 'MSDN';
  55. var gDomain = 'm.webtrends.com';
  56. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  57. var gFpc = 'WT_FPC';
  58. if (document.cookie.indexOf(gFpc + "=") == -1) {
  59. var wtidJs = document.createElement("script");
  60. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  61. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  62. }
  63. var detectedLocale = 'en-us';
  64. var wtsp = 'msdnlib_devtools_lang';
  65. var gTrackEvents = '0';
  66. /**/
  67. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  68. //
  69. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  70. //
  71. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(1).js"></script><script class="mtps-injected">try {
  72. /**/
  73. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  74. "image": "https://i-msdn.sec.s-msft.com",
  75. "js": "https://i2-msdn.sec.s-msft.com",
  76. "css": "https://i-msdn.sec.s-msft.com",
  77. "ttf": "https://i-msdn.sec.s-msft.com"
  78. });
  79. /**/
  80. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  81. //
  82. var literalNormalizedUrl = '/en-us/library/t6tay6cz(d=printer,l=en-us,v=vs.140).aspx';
  83. var wt_nvr_ru = 'WT_NVR_RU';
  84. var wt_fpcdom = '.microsoft.com';
  85. var wt_domlist = 'msdn.microsoft.com';
  86. var wt_pathlist = '';
  87. var wt_paramlist = 'DCSext.mtps_devcenter';
  88. var wt_siteid = 'MSDN';
  89. var gDomain = 'm.webtrends.com';
  90. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  91. var gFpc = 'WT_FPC';
  92. if (document.cookie.indexOf(gFpc + "=") == -1) {
  93. var wtidJs = document.createElement("script");
  94. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  95. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  96. }
  97. var detectedLocale = 'en-us';
  98. var wtsp = 'msdnlib_devtools_lang';
  99. var gTrackEvents = '0';
  100. /**/
  101. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  102. //
  103. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  104. //
  105. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(1).js"></script><script class="mtps-injected">try {
  106. /**/
  107. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  108. "image": "https://i-msdn.sec.s-msft.com",
  109. "js": "https://i2-msdn.sec.s-msft.com",
  110. "css": "https://i-msdn.sec.s-msft.com",
  111. "ttf": "https://i-msdn.sec.s-msft.com"
  112. });
  113. /**/
  114. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  115. //
  116. var literalNormalizedUrl = '/en-us/library/ff554731(d=printer,l=en-us,v=vs.85).aspx';
  117. var wt_nvr_ru = 'WT_NVR_RU';
  118. var wt_fpcdom = '.microsoft.com';
  119. var wt_domlist = 'msdn.microsoft.com';
  120. var wt_pathlist = '';
  121. var wt_paramlist = 'DCSext.mtps_devcenter';
  122. var wt_siteid = 'MSDN';
  123. var gDomain = 'm.webtrends.com';
  124. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  125. var gFpc = 'WT_FPC';
  126. if (document.cookie.indexOf(gFpc + "=") == -1) {
  127. var wtidJs = document.createElement("script");
  128. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  129. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  130. }
  131. var detectedLocale = 'en-us';
  132. var wtsp = 'msdnlib_w32_com';
  133. var gTrackEvents = '0';
  134. /**/
  135. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  136. //
  137. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  138. //
  139. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected">try {
  140. /**/
  141. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  142. "image": "https://i-msdn.sec.s-msft.com",
  143. "js": "https://i2-msdn.sec.s-msft.com",
  144. "css": "https://i-msdn.sec.s-msft.com",
  145. "ttf": "https://i-msdn.sec.s-msft.com"
  146. });
  147. /**/
  148. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  149. //
  150. var literalNormalizedUrl = '/en-us/library/ff554836(d=printer,l=en-us,v=vs.85).aspx';
  151. var wt_nvr_ru = 'WT_NVR_RU';
  152. var wt_fpcdom = '.microsoft.com';
  153. var wt_domlist = 'msdn.microsoft.com';
  154. var wt_pathlist = '';
  155. var wt_paramlist = 'DCSext.mtps_devcenter';
  156. var wt_siteid = 'MSDN';
  157. var gDomain = 'm.webtrends.com';
  158. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  159. var gFpc = 'WT_FPC';
  160. if (document.cookie.indexOf(gFpc + "=") == -1) {
  161. var wtidJs = document.createElement("script");
  162. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  163. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  164. }
  165. var detectedLocale = 'en-us';
  166. var wtsp = 'msdnlib_w32_com';
  167. var gTrackEvents = '0';
  168. /**/
  169. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  170. //
  171. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  172. //
  173. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  174. /**/
  175. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  176. "image": "https://i-msdn.sec.s-msft.com",
  177. "js": "https://i2-msdn.sec.s-msft.com",
  178. "css": "https://i-msdn.sec.s-msft.com",
  179. "ttf": "https://i-msdn.sec.s-msft.com"
  180. });
  181. /**/
  182. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  183. //
  184. var literalNormalizedUrl = '/en-us/library/hh439648(d=printer,l=en-us,v=vs.85).aspx';
  185. var wt_nvr_ru = 'WT_NVR_RU';
  186. var wt_fpcdom = '.microsoft.com';
  187. var wt_domlist = 'msdn.microsoft.com';
  188. var wt_pathlist = '';
  189. var wt_paramlist = 'DCSext.mtps_devcenter';
  190. var wt_siteid = 'MSDN';
  191. var gDomain = 'm.webtrends.com';
  192. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  193. var gFpc = 'WT_FPC';
  194. if (document.cookie.indexOf(gFpc + "=") == -1) {
  195. var wtidJs = document.createElement("script");
  196. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  197. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  198. }
  199. var detectedLocale = 'en-us';
  200. var wtsp = 'msdnlib_w32_com';
  201. var gTrackEvents = '0';
  202. /**/
  203. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  204. //
  205. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  206. //
  207. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  208. /**/
  209. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  210. "image": "https://i-msdn.sec.s-msft.com",
  211. "js": "https://i2-msdn.sec.s-msft.com",
  212. "css": "https://i-msdn.sec.s-msft.com",
  213. "ttf": "https://i-msdn.sec.s-msft.com"
  214. });
  215. /**/
  216. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  217. //
  218. var literalNormalizedUrl = '/en-us/library/ff554721(d=printer,l=en-us,v=vs.85).aspx';
  219. var wt_nvr_ru = 'WT_NVR_RU';
  220. var wt_fpcdom = '.microsoft.com';
  221. var wt_domlist = 'msdn.microsoft.com';
  222. var wt_pathlist = '';
  223. var wt_paramlist = 'DCSext.mtps_devcenter';
  224. var wt_siteid = 'MSDN';
  225. var gDomain = 'm.webtrends.com';
  226. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  227. var gFpc = 'WT_FPC';
  228. if (document.cookie.indexOf(gFpc + "=") == -1) {
  229. var wtidJs = document.createElement("script");
  230. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  231. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  232. }
  233. var detectedLocale = 'en-us';
  234. var wtsp = 'msdnlib_w32_com';
  235. var gTrackEvents = '0';
  236. /**/
  237. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  238. //
  239. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  240. //
  241. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  242. /**/
  243. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  244. "image": "https://i-msdn.sec.s-msft.com",
  245. "js": "https://i2-msdn.sec.s-msft.com",
  246. "css": "https://i-msdn.sec.s-msft.com",
  247. "ttf": "https://i-msdn.sec.s-msft.com"
  248. });
  249. /**/
  250. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  251. //
  252. var literalNormalizedUrl = '/en-us/library/hh439638(d=printer,l=en-us,v=vs.85).aspx';
  253. var wt_nvr_ru = 'WT_NVR_RU';
  254. var wt_fpcdom = '.microsoft.com';
  255. var wt_domlist = 'msdn.microsoft.com';
  256. var wt_pathlist = '';
  257. var wt_paramlist = 'DCSext.mtps_devcenter';
  258. var wt_siteid = 'MSDN';
  259. var gDomain = 'm.webtrends.com';
  260. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  261. var gFpc = 'WT_FPC';
  262. if (document.cookie.indexOf(gFpc + "=") == -1) {
  263. var wtidJs = document.createElement("script");
  264. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  265. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  266. }
  267. var detectedLocale = 'en-us';
  268. var wtsp = 'msdnlib_w32_com';
  269. var gTrackEvents = '0';
  270. /**/
  271. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  272. //
  273. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  274. //
  275. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  276. /**/
  277. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  278. "image": "https://i-msdn.sec.s-msft.com",
  279. "js": "https://i2-msdn.sec.s-msft.com",
  280. "css": "https://i-msdn.sec.s-msft.com",
  281. "ttf": "https://i-msdn.sec.s-msft.com"
  282. });
  283. /**/
  284. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  285. //
  286. var literalNormalizedUrl = '/en-us/library/hh439632(d=printer,l=en-us,v=vs.85).aspx';
  287. var wt_nvr_ru = 'WT_NVR_RU';
  288. var wt_fpcdom = '.microsoft.com';
  289. var wt_domlist = 'msdn.microsoft.com';
  290. var wt_pathlist = '';
  291. var wt_paramlist = 'DCSext.mtps_devcenter';
  292. var wt_siteid = 'MSDN';
  293. var gDomain = 'm.webtrends.com';
  294. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  295. var gFpc = 'WT_FPC';
  296. if (document.cookie.indexOf(gFpc + "=") == -1) {
  297. var wtidJs = document.createElement("script");
  298. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  299. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  300. }
  301. var detectedLocale = 'en-us';
  302. var wtsp = 'msdnlib_w32_com';
  303. var gTrackEvents = '0';
  304. /**/
  305. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  306. //
  307. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  308. //
  309. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  310. /**/
  311. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  312. "image": "https://i-msdn.sec.s-msft.com",
  313. "js": "https://i2-msdn.sec.s-msft.com",
  314. "css": "https://i-msdn.sec.s-msft.com",
  315. "ttf": "https://i-msdn.sec.s-msft.com"
  316. });
  317. /**/
  318. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  319. //
  320. var literalNormalizedUrl = '/en-us/library/hh439643(d=printer,l=en-us,v=vs.85).aspx';
  321. var wt_nvr_ru = 'WT_NVR_RU';
  322. var wt_fpcdom = '.microsoft.com';
  323. var wt_domlist = 'msdn.microsoft.com';
  324. var wt_pathlist = '';
  325. var wt_paramlist = 'DCSext.mtps_devcenter';
  326. var wt_siteid = 'MSDN';
  327. var gDomain = 'm.webtrends.com';
  328. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  329. var gFpc = 'WT_FPC';
  330. if (document.cookie.indexOf(gFpc + "=") == -1) {
  331. var wtidJs = document.createElement("script");
  332. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  333. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  334. }
  335. var detectedLocale = 'en-us';
  336. var wtsp = 'msdnlib_w32_com';
  337. var gTrackEvents = '0';
  338. /**/
  339. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  340. //
  341. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  342. //
  343. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  344. /**/
  345. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  346. "image": "https://i-msdn.sec.s-msft.com",
  347. "js": "https://i2-msdn.sec.s-msft.com",
  348. "css": "https://i-msdn.sec.s-msft.com",
  349. "ttf": "https://i-msdn.sec.s-msft.com"
  350. });
  351. /**/
  352. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  353. //
  354. var literalNormalizedUrl = '/en-us/library/hh706279(d=printer,l=en-us,v=vs.85).aspx';
  355. var wt_nvr_ru = 'WT_NVR_RU';
  356. var wt_fpcdom = '.microsoft.com';
  357. var wt_domlist = 'msdn.microsoft.com';
  358. var wt_pathlist = '';
  359. var wt_paramlist = 'DCSext.mtps_devcenter';
  360. var wt_siteid = 'MSDN';
  361. var gDomain = 'm.webtrends.com';
  362. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  363. var gFpc = 'WT_FPC';
  364. if (document.cookie.indexOf(gFpc + "=") == -1) {
  365. var wtidJs = document.createElement("script");
  366. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  367. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  368. }
  369. var detectedLocale = 'en-us';
  370. var wtsp = 'msdnlib_w32_com';
  371. var gTrackEvents = '0';
  372. /**/
  373. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  374. //
  375. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  376. //
  377. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  378. /**/
  379. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  380. "image": "https://i-msdn.sec.s-msft.com",
  381. "js": "https://i2-msdn.sec.s-msft.com",
  382. "css": "https://i-msdn.sec.s-msft.com",
  383. "ttf": "https://i-msdn.sec.s-msft.com"
  384. });
  385. /**/
  386. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  387. //
  388. var literalNormalizedUrl = '/en-us/library/hh706278(d=printer,l=en-us,v=vs.85).aspx';
  389. var wt_nvr_ru = 'WT_NVR_RU';
  390. var wt_fpcdom = '.microsoft.com';
  391. var wt_domlist = 'msdn.microsoft.com';
  392. var wt_pathlist = '';
  393. var wt_paramlist = 'DCSext.mtps_devcenter';
  394. var wt_siteid = 'MSDN';
  395. var gDomain = 'm.webtrends.com';
  396. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  397. var gFpc = 'WT_FPC';
  398. if (document.cookie.indexOf(gFpc + "=") == -1) {
  399. var wtidJs = document.createElement("script");
  400. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  401. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  402. }
  403. var detectedLocale = 'en-us';
  404. var wtsp = 'msdnlib_w32_com';
  405. var gTrackEvents = '0';
  406. /**/
  407. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  408. //
  409. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  410. //
  411. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  412. /**/
  413. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  414. "image": "https://i-msdn.sec.s-msft.com",
  415. "js": "https://i2-msdn.sec.s-msft.com",
  416. "css": "https://i-msdn.sec.s-msft.com",
  417. "ttf": "https://i-msdn.sec.s-msft.com"
  418. });
  419. /**/
  420. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  421. //
  422. var literalNormalizedUrl = '/en-us/library/hh706280(d=printer,l=en-us,v=vs.85).aspx';
  423. var wt_nvr_ru = 'WT_NVR_RU';
  424. var wt_fpcdom = '.microsoft.com';
  425. var wt_domlist = 'msdn.microsoft.com';
  426. var wt_pathlist = '';
  427. var wt_paramlist = 'DCSext.mtps_devcenter';
  428. var wt_siteid = 'MSDN';
  429. var gDomain = 'm.webtrends.com';
  430. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  431. var gFpc = 'WT_FPC';
  432. if (document.cookie.indexOf(gFpc + "=") == -1) {
  433. var wtidJs = document.createElement("script");
  434. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  435. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  436. }
  437. var detectedLocale = 'en-us';
  438. var wtsp = 'msdnlib_w32_com';
  439. var gTrackEvents = '0';
  440. /**/
  441. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  442. //
  443. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  444. //
  445. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  446. /**/
  447. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  448. "image": "https://i-msdn.sec.s-msft.com",
  449. "js": "https://i2-msdn.sec.s-msft.com",
  450. "css": "https://i-msdn.sec.s-msft.com",
  451. "ttf": "https://i-msdn.sec.s-msft.com"
  452. });
  453. /**/
  454. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  455. //
  456. var literalNormalizedUrl = '/en-us/library/ff554695(d=printer,l=en-us,v=vs.85).aspx';
  457. var wt_nvr_ru = 'WT_NVR_RU';
  458. var wt_fpcdom = '.microsoft.com';
  459. var wt_domlist = 'msdn.microsoft.com';
  460. var wt_pathlist = '';
  461. var wt_paramlist = 'DCSext.mtps_devcenter';
  462. var wt_siteid = 'MSDN';
  463. var gDomain = 'm.webtrends.com';
  464. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  465. var gFpc = 'WT_FPC';
  466. if (document.cookie.indexOf(gFpc + "=") == -1) {
  467. var wtidJs = document.createElement("script");
  468. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  469. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  470. }
  471. var detectedLocale = 'en-us';
  472. var wtsp = 'msdnlib_w32_com';
  473. var gTrackEvents = '0';
  474. /**/
  475. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  476. //
  477. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  478. //
  479. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  480. /**/
  481. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  482. "image": "https://i-msdn.sec.s-msft.com",
  483. "js": "https://i2-msdn.sec.s-msft.com",
  484. "css": "https://i-msdn.sec.s-msft.com",
  485. "ttf": "https://i-msdn.sec.s-msft.com"
  486. });
  487. /**/
  488. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  489. //
  490. var literalNormalizedUrl = '/en-us/library/ff554887(d=printer,l=en-us,v=vs.85).aspx';
  491. var wt_nvr_ru = 'WT_NVR_RU';
  492. var wt_fpcdom = '.microsoft.com';
  493. var wt_domlist = 'msdn.microsoft.com';
  494. var wt_pathlist = '';
  495. var wt_paramlist = 'DCSext.mtps_devcenter';
  496. var wt_siteid = 'MSDN';
  497. var gDomain = 'm.webtrends.com';
  498. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  499. var gFpc = 'WT_FPC';
  500. if (document.cookie.indexOf(gFpc + "=") == -1) {
  501. var wtidJs = document.createElement("script");
  502. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  503. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  504. }
  505. var detectedLocale = 'en-us';
  506. var wtsp = 'msdnlib_w32_com';
  507. var gTrackEvents = '0';
  508. /**/
  509. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  510. //
  511. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  512. //
  513. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  514. /**/
  515. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  516. "image": "https://i-msdn.sec.s-msft.com",
  517. "js": "https://i2-msdn.sec.s-msft.com",
  518. "css": "https://i-msdn.sec.s-msft.com",
  519. "ttf": "https://i-msdn.sec.s-msft.com"
  520. });
  521. /**/
  522. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  523. //
  524. var literalNormalizedUrl = '/en-us/library/ff554836(d=printer,l=en-us,v=vs.85).aspx';
  525. var wt_nvr_ru = 'WT_NVR_RU';
  526. var wt_fpcdom = '.microsoft.com';
  527. var wt_domlist = 'msdn.microsoft.com';
  528. var wt_pathlist = '';
  529. var wt_paramlist = 'DCSext.mtps_devcenter';
  530. var wt_siteid = 'MSDN';
  531. var gDomain = 'm.webtrends.com';
  532. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  533. var gFpc = 'WT_FPC';
  534. if (document.cookie.indexOf(gFpc + "=") == -1) {
  535. var wtidJs = document.createElement("script");
  536. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  537. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  538. }
  539. var detectedLocale = 'en-us';
  540. var wtsp = 'msdnlib_w32_com';
  541. var gTrackEvents = '0';
  542. /**/
  543. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  544. //
  545. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  546. //
  547. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/PrintExportButton.js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/PrintExportButton.js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected">try {
  548. /**/
  549. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  550. "image": "https://i-msdn.sec.s-msft.com",
  551. "js": "https://i2-msdn.sec.s-msft.com",
  552. "css": "https://i-msdn.sec.s-msft.com",
  553. "ttf": "https://i-msdn.sec.s-msft.com"
  554. });
  555. /**/
  556. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  557. //
  558. var literalNormalizedUrl = '/en-us/library/hh439648(d=printer,l=en-us,v=vs.85).aspx';
  559. var wt_nvr_ru = 'WT_NVR_RU';
  560. var wt_fpcdom = '.microsoft.com';
  561. var wt_domlist = 'msdn.microsoft.com';
  562. var wt_pathlist = '';
  563. var wt_paramlist = 'DCSext.mtps_devcenter';
  564. var wt_siteid = 'MSDN';
  565. var gDomain = 'm.webtrends.com';
  566. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  567. var gFpc = 'WT_FPC';
  568. if (document.cookie.indexOf(gFpc + "=") == -1) {
  569. var wtidJs = document.createElement("script");
  570. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  571. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  572. }
  573. var detectedLocale = 'en-us';
  574. var wtsp = 'msdnlib_w32_com';
  575. var gTrackEvents = '0';
  576. /**/
  577. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  578. //
  579. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  580. //
  581. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected">try {
  582. /**/
  583. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  584. "image": "https://i-msdn.sec.s-msft.com",
  585. "js": "https://i2-msdn.sec.s-msft.com",
  586. "css": "https://i-msdn.sec.s-msft.com",
  587. "ttf": "https://i-msdn.sec.s-msft.com"
  588. });
  589. /**/
  590. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  591. //
  592. var literalNormalizedUrl = '/en-us/library/ff554721(d=printer,l=en-us,v=vs.85).aspx';
  593. var wt_nvr_ru = 'WT_NVR_RU';
  594. var wt_fpcdom = '.microsoft.com';
  595. var wt_domlist = 'msdn.microsoft.com';
  596. var wt_pathlist = '';
  597. var wt_paramlist = 'DCSext.mtps_devcenter';
  598. var wt_siteid = 'MSDN';
  599. var gDomain = 'm.webtrends.com';
  600. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  601. var gFpc = 'WT_FPC';
  602. if (document.cookie.indexOf(gFpc + "=") == -1) {
  603. var wtidJs = document.createElement("script");
  604. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  605. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  606. }
  607. var detectedLocale = 'en-us';
  608. var wtsp = 'msdnlib_w32_com';
  609. var gTrackEvents = '0';
  610. /**/
  611. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  612. //
  613. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  614. //
  615. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  616. /**/
  617. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  618. "image": "https://i-msdn.sec.s-msft.com",
  619. "js": "https://i2-msdn.sec.s-msft.com",
  620. "css": "https://i-msdn.sec.s-msft.com",
  621. "ttf": "https://i-msdn.sec.s-msft.com"
  622. });
  623. /**/
  624. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  625. //
  626. var literalNormalizedUrl = '/en-us/library/hh439638(d=printer,l=en-us,v=vs.85).aspx';
  627. var wt_nvr_ru = 'WT_NVR_RU';
  628. var wt_fpcdom = '.microsoft.com';
  629. var wt_domlist = 'msdn.microsoft.com';
  630. var wt_pathlist = '';
  631. var wt_paramlist = 'DCSext.mtps_devcenter';
  632. var wt_siteid = 'MSDN';
  633. var gDomain = 'm.webtrends.com';
  634. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  635. var gFpc = 'WT_FPC';
  636. if (document.cookie.indexOf(gFpc + "=") == -1) {
  637. var wtidJs = document.createElement("script");
  638. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  639. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  640. }
  641. var detectedLocale = 'en-us';
  642. var wtsp = 'msdnlib_w32_com';
  643. var gTrackEvents = '0';
  644. /**/
  645. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  646. //
  647. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  648. //
  649. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  650. $(document).ready(function() {
  651. try {
  652. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  653. $("#siteFeedbackForm").append(token);
  654. } catch(err) {
  655. }
  656. });
  657. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  658. MTPS = window.MTPS || {}; MTPS.LocalizedStrings = window.MTPS.LocalizedStrings || {}; MTPS.LocalizedStrings.ExpandButtonTooltip = 'Expand'; MTPS.LocalizedStrings.CollapseButtonTooltip = 'Collapse'; MTPS.LocalizedStrings.EnhancedExpandTooltip = 'Click to expand. Double-click to expand all.'; MTPS.LocalizedStrings.EnhancedCollapseTooltip = 'Click to collapse. Double-click to collapse all.'; MTPS.LocalizedStrings.ExpandAllButtonTooltip = 'Expand All'; MTPS.LocalizedStrings.CollapseAllButtonTooltip = 'Collapse All';
  659. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(3).js"></script><script class="mtps-injected">try {
  660. MTPS = window.MTPS || {}; MTPS.LocalizedStrings = window.MTPS.LocalizedStrings || {}; MTPS.LocalizedStrings.ExpandButtonTooltip = 'Expand'; MTPS.LocalizedStrings.CollapseButtonTooltip = 'Collapse'; MTPS.LocalizedStrings.EnhancedExpandTooltip = 'Click to expand. Double-click to expand all.'; MTPS.LocalizedStrings.EnhancedCollapseTooltip = 'Click to collapse. Double-click to collapse all.'; MTPS.LocalizedStrings.ExpandAllButtonTooltip = 'Expand All'; MTPS.LocalizedStrings.CollapseAllButtonTooltip = 'Collapse All';
  661. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(3).js"></script><script class="mtps-injected">try {
  662. $(document).ready(function() {
  663. try {
  664. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  665. $("#siteFeedbackForm").append(token);
  666. } catch(err) {
  667. }
  668. });
  669. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  670. /**/
  671. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  672. "image": "https://i-msdn.sec.s-msft.com",
  673. "js": "https://i2-msdn.sec.s-msft.com",
  674. "css": "https://i-msdn.sec.s-msft.com",
  675. "ttf": "https://i-msdn.sec.s-msft.com"
  676. });
  677. /**/
  678. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  679. //
  680. var literalNormalizedUrl = '/en-us/library/hh439632(d=printer,l=en-us,v=vs.85).aspx';
  681. var wt_nvr_ru = 'WT_NVR_RU';
  682. var wt_fpcdom = '.microsoft.com';
  683. var wt_domlist = 'msdn.microsoft.com';
  684. var wt_pathlist = '';
  685. var wt_paramlist = 'DCSext.mtps_devcenter';
  686. var wt_siteid = 'MSDN';
  687. var gDomain = 'm.webtrends.com';
  688. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  689. var gFpc = 'WT_FPC';
  690. if (document.cookie.indexOf(gFpc + "=") == -1) {
  691. var wtidJs = document.createElement("script");
  692. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  693. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  694. }
  695. var detectedLocale = 'en-us';
  696. var wtsp = 'msdnlib_w32_com';
  697. var gTrackEvents = '0';
  698. /**/
  699. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  700. //
  701. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  702. //
  703. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  704. /**/
  705. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  706. "image": "https://i-msdn.sec.s-msft.com",
  707. "js": "https://i2-msdn.sec.s-msft.com",
  708. "css": "https://i-msdn.sec.s-msft.com",
  709. "ttf": "https://i-msdn.sec.s-msft.com"
  710. });
  711. /**/
  712. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  713. //
  714. var literalNormalizedUrl = '/en-us/library/hh439643(d=printer,l=en-us,v=vs.85).aspx';
  715. var wt_nvr_ru = 'WT_NVR_RU';
  716. var wt_fpcdom = '.microsoft.com';
  717. var wt_domlist = 'msdn.microsoft.com';
  718. var wt_pathlist = '';
  719. var wt_paramlist = 'DCSext.mtps_devcenter';
  720. var wt_siteid = 'MSDN';
  721. var gDomain = 'm.webtrends.com';
  722. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  723. var gFpc = 'WT_FPC';
  724. if (document.cookie.indexOf(gFpc + "=") == -1) {
  725. var wtidJs = document.createElement("script");
  726. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  727. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  728. }
  729. var detectedLocale = 'en-us';
  730. var wtsp = 'msdnlib_w32_com';
  731. var gTrackEvents = '0';
  732. /**/
  733. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  734. //
  735. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  736. //
  737. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  738. /**/
  739. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  740. "image": "https://i-msdn.sec.s-msft.com",
  741. "js": "https://i2-msdn.sec.s-msft.com",
  742. "css": "https://i-msdn.sec.s-msft.com",
  743. "ttf": "https://i-msdn.sec.s-msft.com"
  744. });
  745. /**/
  746. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  747. //
  748. var literalNormalizedUrl = '/en-us/library/hh706279(d=printer,l=en-us,v=vs.85).aspx';
  749. var wt_nvr_ru = 'WT_NVR_RU';
  750. var wt_fpcdom = '.microsoft.com';
  751. var wt_domlist = 'msdn.microsoft.com';
  752. var wt_pathlist = '';
  753. var wt_paramlist = 'DCSext.mtps_devcenter';
  754. var wt_siteid = 'MSDN';
  755. var gDomain = 'm.webtrends.com';
  756. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  757. var gFpc = 'WT_FPC';
  758. if (document.cookie.indexOf(gFpc + "=") == -1) {
  759. var wtidJs = document.createElement("script");
  760. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  761. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  762. }
  763. var detectedLocale = 'en-us';
  764. var wtsp = 'msdnlib_w32_com';
  765. var gTrackEvents = '0';
  766. /**/
  767. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  768. //
  769. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  770. //
  771. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected">try {
  772. /**/
  773. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  774. "image": "https://i-msdn.sec.s-msft.com",
  775. "js": "https://i2-msdn.sec.s-msft.com",
  776. "css": "https://i-msdn.sec.s-msft.com",
  777. "ttf": "https://i-msdn.sec.s-msft.com"
  778. });
  779. /**/
  780. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  781. //
  782. var literalNormalizedUrl = '/en-us/library/hh706278(d=printer,l=en-us,v=vs.85).aspx';
  783. var wt_nvr_ru = 'WT_NVR_RU';
  784. var wt_fpcdom = '.microsoft.com';
  785. var wt_domlist = 'msdn.microsoft.com';
  786. var wt_pathlist = '';
  787. var wt_paramlist = 'DCSext.mtps_devcenter';
  788. var wt_siteid = 'MSDN';
  789. var gDomain = 'm.webtrends.com';
  790. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  791. var gFpc = 'WT_FPC';
  792. if (document.cookie.indexOf(gFpc + "=") == -1) {
  793. var wtidJs = document.createElement("script");
  794. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  795. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  796. }
  797. var detectedLocale = 'en-us';
  798. var wtsp = 'msdnlib_w32_com';
  799. var gTrackEvents = '0';
  800. /**/
  801. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  802. //
  803. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  804. //
  805. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  806. $(document).ready(function() {
  807. try {
  808. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  809. $("#siteFeedbackForm").append(token);
  810. } catch(err) {
  811. }
  812. });
  813. } finally { MTPS._injectNextScript_8 && MTPS._injectNextScript_8(); }</script><script class="mtps-injected">try {
  814. $(document).ready(function() {
  815. try {
  816. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  817. $("#siteFeedbackForm").append(token);
  818. } catch(err) {
  819. }
  820. });
  821. } finally { MTPS._injectNextScript_8 && MTPS._injectNextScript_8(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected">try {
  822. /**/
  823. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  824. "image": "https://i-msdn.sec.s-msft.com",
  825. "js": "https://i2-msdn.sec.s-msft.com",
  826. "css": "https://i-msdn.sec.s-msft.com",
  827. "ttf": "https://i-msdn.sec.s-msft.com"
  828. });
  829. /**/
  830. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  831. //
  832. var literalNormalizedUrl = '/en-us/library/hh706280(d=printer,l=en-us,v=vs.85).aspx';
  833. var wt_nvr_ru = 'WT_NVR_RU';
  834. var wt_fpcdom = '.microsoft.com';
  835. var wt_domlist = 'msdn.microsoft.com';
  836. var wt_pathlist = '';
  837. var wt_paramlist = 'DCSext.mtps_devcenter';
  838. var wt_siteid = 'MSDN';
  839. var gDomain = 'm.webtrends.com';
  840. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  841. var gFpc = 'WT_FPC';
  842. if (document.cookie.indexOf(gFpc + "=") == -1) {
  843. var wtidJs = document.createElement("script");
  844. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  845. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  846. }
  847. var detectedLocale = 'en-us';
  848. var wtsp = 'msdnlib_w32_com';
  849. var gTrackEvents = '0';
  850. /**/
  851. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  852. //
  853. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  854. //
  855. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  856. $(document).ready(function() {
  857. try {
  858. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  859. $("#siteFeedbackForm").append(token);
  860. } catch(err) {
  861. }
  862. });
  863. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  864. $(document).ready(function() {
  865. try {
  866. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  867. $("#siteFeedbackForm").append(token);
  868. } catch(err) {
  869. }
  870. });
  871. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  872. $(document).ready(function() {
  873. try {
  874. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  875. $("#siteFeedbackForm").append(token);
  876. } catch(err) {
  877. }
  878. });
  879. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  880. $(document).ready(function() {
  881. try {
  882. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  883. $("#siteFeedbackForm").append(token);
  884. } catch(err) {
  885. }
  886. });
  887. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  888. $(document).ready(function() {
  889. try {
  890. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  891. $("#siteFeedbackForm").append(token);
  892. } catch(err) {
  893. }
  894. });
  895. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  896. $(document).ready(function() {
  897. try {
  898. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  899. $("#siteFeedbackForm").append(token);
  900. } catch(err) {
  901. }
  902. });
  903. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  904. $(document).ready(function() {
  905. try {
  906. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  907. $("#siteFeedbackForm").append(token);
  908. } catch(err) {
  909. }
  910. });
  911. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  912. $(document).ready(function() {
  913. try {
  914. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  915. $("#siteFeedbackForm").append(token);
  916. } catch(err) {
  917. }
  918. });
  919. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  920. $(document).ready(function() {
  921. try {
  922. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  923. $("#siteFeedbackForm").append(token);
  924. } catch(err) {
  925. }
  926. });
  927. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  928. $(document).ready(function() {
  929. try {
  930. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  931. $("#siteFeedbackForm").append(token);
  932. } catch(err) {
  933. }
  934. });
  935. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  936. /**/
  937. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  938. "image": "https://i-msdn.sec.s-msft.com",
  939. "js": "https://i2-msdn.sec.s-msft.com",
  940. "css": "https://i-msdn.sec.s-msft.com",
  941. "ttf": "https://i-msdn.sec.s-msft.com"
  942. });
  943. /**/
  944. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  945. //
  946. var literalNormalizedUrl = '/en-us/library/ff554695(d=printer,l=en-us,v=vs.85).aspx';
  947. var wt_nvr_ru = 'WT_NVR_RU';
  948. var wt_fpcdom = '.microsoft.com';
  949. var wt_domlist = 'msdn.microsoft.com';
  950. var wt_pathlist = '';
  951. var wt_paramlist = 'DCSext.mtps_devcenter';
  952. var wt_siteid = 'MSDN';
  953. var gDomain = 'm.webtrends.com';
  954. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  955. var gFpc = 'WT_FPC';
  956. if (document.cookie.indexOf(gFpc + "=") == -1) {
  957. var wtidJs = document.createElement("script");
  958. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  959. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  960. }
  961. var detectedLocale = 'en-us';
  962. var wtsp = 'msdnlib_w32_com';
  963. var gTrackEvents = '0';
  964. /**/
  965. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  966. //
  967. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  968. //
  969. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected">try {
  970. /**/
  971. (window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = {
  972. "image": "https://i-msdn.sec.s-msft.com",
  973. "js": "https://i2-msdn.sec.s-msft.com",
  974. "css": "https://i-msdn.sec.s-msft.com",
  975. "ttf": "https://i-msdn.sec.s-msft.com"
  976. });
  977. /**/
  978. } finally { MTPS._injectNextScript_0 && MTPS._injectNextScript_0(); }</script><script class="mtps-injected">try {
  979. //
  980. var literalNormalizedUrl = '/en-us/library/ff554887(d=printer,l=en-us,v=vs.85).aspx';
  981. var wt_nvr_ru = 'WT_NVR_RU';
  982. var wt_fpcdom = '.microsoft.com';
  983. var wt_domlist = 'msdn.microsoft.com';
  984. var wt_pathlist = '';
  985. var wt_paramlist = 'DCSext.mtps_devcenter';
  986. var wt_siteid = 'MSDN';
  987. var gDomain = 'm.webtrends.com';
  988. var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  989. var gFpc = 'WT_FPC';
  990. if (document.cookie.indexOf(gFpc + "=") == -1) {
  991. var wtidJs = document.createElement("script");
  992. wtidJs.src = "//" + gDomain + "/" + gDcsId + "/wtid.js";
  993. document.getElementsByTagName("head")[0].appendChild(wtidJs);
  994. }
  995. var detectedLocale = 'en-us';
  996. var wtsp = 'msdnlib_w32_com';
  997. var gTrackEvents = '0';
  998. /**/
  999. } finally { MTPS._injectNextScript_1 && MTPS._injectNextScript_1(); }</script><script src="./Windows Kernel Development Articles (2016-03-30)_files/wtid.js"></script><script class="mtps-injected">try {
  1000. //
  1001. window.appInsightsId = '5eb1b2eb-c47a-497a-a7ac-a1c230b2882f';
  1002. //
  1003. } finally { MTPS._injectNextScript_2 && MTPS._injectNextScript_2(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined.js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected">try {
  1004. $(document).ready(function() {
  1005. try {
  1006. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1007. $("#siteFeedbackForm").append(token);
  1008. } catch(err) {
  1009. }
  1010. });
  1011. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  1012. $(document).ready(function() {
  1013. try {
  1014. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1015. $("#siteFeedbackForm").append(token);
  1016. } catch(err) {
  1017. }
  1018. });
  1019. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/SearchBox.jss"></script><script class="mtps-injected">try {
  1020. $(document).ready(function() {
  1021. try {
  1022. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1023. $("#siteFeedbackForm").append(token);
  1024. } catch(err) {
  1025. }
  1026. });
  1027. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  1028. $(document).ready(function() {
  1029. try {
  1030. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1031. $("#siteFeedbackForm").append(token);
  1032. } catch(err) {
  1033. }
  1034. });
  1035. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  1036. $(document).ready(function() {
  1037. try {
  1038. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1039. $("#siteFeedbackForm").append(token);
  1040. } catch(err) {
  1041. }
  1042. });
  1043. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected">try {
  1044. $(document).ready(function() {
  1045. try {
  1046. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1047. $("#siteFeedbackForm").append(token);
  1048. } catch(err) {
  1049. }
  1050. });
  1051. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  1052. $(document).ready(function() {
  1053. try {
  1054. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1055. $("#siteFeedbackForm").append(token);
  1056. } catch(err) {
  1057. }
  1058. });
  1059. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  1060. $(document).ready(function() {
  1061. try {
  1062. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1063. $("#siteFeedbackForm").append(token);
  1064. } catch(err) {
  1065. }
  1066. });
  1067. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected" src="./Windows Kernel Development Articles (2016-03-30)_files/Combined(2).js"></script><script class="mtps-injected">try {
  1068. $(document).ready(function() {
  1069. try {
  1070. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1071. $("#siteFeedbackForm").append(token);
  1072. } catch(err) {
  1073. }
  1074. });
  1075. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  1076. $(document).ready(function() {
  1077. try {
  1078. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1079. $("#siteFeedbackForm").append(token);
  1080. } catch(err) {
  1081. }
  1082. });
  1083. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  1084. $(document).ready(function() {
  1085. try {
  1086. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1087. $("#siteFeedbackForm").append(token);
  1088. } catch(err) {
  1089. }
  1090. });
  1091. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script><script class="mtps-injected">try {
  1092. $(document).ready(function() {
  1093. try {
  1094. var token = $("#globalRequestVerification input[name='__RequestVerificationToken']").clone();
  1095. $("#siteFeedbackForm").append(token);
  1096. } catch(err) {
  1097. }
  1098. });
  1099. } finally { MTPS._injectNextScript_6 && MTPS._injectNextScript_6(); }</script></head><body>
  1100. <link href="./Windows Kernel Development Articles (2016-03-30)_files/PrintBook.css" rel="stylesheet" type="text/css"> <div class="BookHeader"><div class="BookTitleHeading">My Collection</div><div class="PabLogo"><a href="http://msdn.microsoft.com/" title="Microsoft Developer Network"><img alt="Microsoft Developer Network" src="./Windows Kernel Development Articles (2016-03-30)_files/BrandLogoMsdn.png"></a></div><div style="clear: both"></div><div class="pageBlank"><div class="pageFooter"><hr class="pageFooterSeparater">This document is provided "as-is". Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. This document does not provide you with any legal rights to any intellectual property in any Microsoft product or product name. You may copy and use this document for your internal, reference purposes. You may modify this document for your internal, reference purposes.© 2016 Microsoft. All rights reserved. Terms of Use (https://msdn.microsoft.com/cc300389.aspx) | Trademarks (http://www.microsoft.com/library/toolbar/3.0/trademarks/en-us.mspx)</div></div></div><p style="page-break-before: always"></p><div class="TableOfContents"><hr class="pageSplitter"><div class="TableOfContentsTitle">Table Of Contents</div><div class="ChapterName">Chapter 1</div><div><a href="http://msdn.microsoft.com/en-us/library/ms809754.aspx" class="TopicLink">The Debugging Application Programming Interface</a></div><div><a href="https://msdn.microsoft.com/en-us/library/dn655038.aspx" class="TopicLink">/CGTHREADS (Compiler Threads)</a></div><div><a href="https://msdn.microsoft.com/en-us/library/t6tay6cz.aspx" class="TopicLink">Getting Started (Debug Interface Access SDK)</a></div><div><a href="https://msdn.microsoft.com/en-us/library/ff554731(v=vs.85).aspx" class="TopicLink">Concepts for all driver developers</a></div><div><a href="https://msdn.microsoft.com/en-us/library/ff554836(v=vs.85).aspx" class="TopicLink">User mode and kernel mode</a></div><div><a href="https://msdn.microsoft.com/en-us/library/hh439648(v=vs.85).aspx" class="TopicLink">Virtual address spaces</a></div><div><a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx" class="TopicLink">Device nodes and device stacks</a></div><div><a href="https://msdn.microsoft.com/en-us/library/hh439638(v=vs.85).aspx" class="TopicLink">I/O request packets</a></div><div><a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx" class="TopicLink">Driver stacks</a></div><div><a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx" class="TopicLink">Minidrivers, miniport drivers, and driver pairs</a></div><div><a href="https://msdn.microsoft.com/en-us/library/hh706279(v=vs.85).aspx" class="TopicLink">KMDF as a generic driver pair model</a></div><div><a href="https://msdn.microsoft.com/en-us/library/hh706278(v=vs.85).aspx" class="TopicLink">KMDF extensions and driver triples</a></div><div><a href="https://msdn.microsoft.com/en-us/library/hh706280(v=vs.85).aspx" class="TopicLink">Upper and lower edges of drivers</a></div><div><a href="https://msdn.microsoft.com/en-us/library/ff554695(v=vs.85).aspx" class="TopicLink">Header files in the Windows Driver Kit</a></div><div><a href="https://msdn.microsoft.com/en-us/library/ff554887(v=vs.85).aspx" class="TopicLink">Writing drivers for different versions of Windows</a></div><div class="chapterSplitter"></div><div style="clear: both"></div></div><p style="page-break-before: always"></p>
  1101. <hr class="pageSplitter"><div class="ChapterTitle">Chapter 1</div>
  1102. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  1103. <div id="page">
  1104. <link type="text/css" rel="stylesheet">
  1105. <input type="hidden" id="isHeaderBleeding" value="true">
  1106. <div id="ux-header" dir="ltr" class="ltr msdn">
  1107. <header>
  1108. <span id="singleCol"></span>
  1109. <span id="doubleCol"></span>
  1110. <span id="isMobile"></span>
  1111. <div>
  1112. <div class="row topRow">
  1113. <div class="top">
  1114. <div class="left">
  1115. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  1116. <div id="msft-logo" class="msft-logo"></div>
  1117. </a>
  1118. <div class="GrayPipe"></div>
  1119. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  1120. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  1121. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  1122. </div>
  1123. <div class="right">
  1124. <div id="signIn">
  1125. <div class="profileImage"></div>
  1126. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376395&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fms809754%2528d%3dprinter%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  1127. <div class="auxNav">
  1128. <div>
  1129. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  1130. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  1131. </div>
  1132. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  1133. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  1134. </div>
  1135. </div>
  1136. <div>
  1137. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  1138. <div class="linkList">
  1139. <ul class="links horizontal">
  1140. <li>
  1141. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  1142. </li>
  1143. <li>
  1144. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  1145. </li>
  1146. <li>
  1147. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  1148. </li>
  1149. </ul>
  1150. </div>
  1151. </div>
  1152. </div>
  1153. </div>
  1154. </div>
  1155. </div>
  1156. </div>
  1157. <div class="row middleRow">
  1158. <div class="expandTop">
  1159. <div class="left"></div>
  1160. <div class="right"></div>
  1161. </div>
  1162. </div>
  1163. </div>
  1164. <div id="buttomRowWrapper" class="bg_default">
  1165. <div class="row buttomRow bg_default">
  1166. <div class="bottom">
  1167. <div class="left">
  1168. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  1169. <div id="drawer">
  1170. <div class="toc">
  1171. <nav>
  1172. <ul class="navL1">
  1173. <li class="inactive toggle">
  1174. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  1175. <ul class="navL2">
  1176. <li class="inactive">
  1177. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  1178. </li>
  1179. <li class="inactive">
  1180. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  1181. </li>
  1182. <li class="inactive">
  1183. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  1184. </li>
  1185. <li class="inactive">
  1186. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  1187. </li>
  1188. <li class="inactive">
  1189. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  1190. </li>
  1191. <li class="inactive">
  1192. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  1193. </li>
  1194. </ul>
  1195. </li>
  1196. <li class="inactive toggle">
  1197. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  1198. <ul class="navL2">
  1199. <li class="inactive">
  1200. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  1201. </li>
  1202. <li class="inactive">
  1203. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  1204. </li>
  1205. <li class="inactive">
  1206. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  1207. </li>
  1208. <li class="inactive toggle">
  1209. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  1210. <ul class="navL3">
  1211. <li class="inactive">
  1212. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  1213. </li>
  1214. <li class="inactive">
  1215. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  1216. </li>
  1217. <li class="inactive">
  1218. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  1219. </li>
  1220. <li class="inactive">
  1221. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  1222. </li>
  1223. <li class="inactive">
  1224. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  1225. </li>
  1226. </ul>
  1227. </li>
  1228. </ul>
  1229. </li>
  1230. <li class="inactive toggle">
  1231. <a href="javascript:void(0)" title="Programs">Programs</a>
  1232. <ul class="navL2">
  1233. <li class="inactive toggle">
  1234. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  1235. <ul class="navL3">
  1236. <li class="inactive">
  1237. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  1238. </li>
  1239. <li class="inactive">
  1240. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  1241. </li>
  1242. <li class="inactive">
  1243. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  1244. </li>
  1245. </ul>
  1246. </li>
  1247. <li class="inactive toggle">
  1248. <a href="javascript:void(0)" title="Students">Students</a>
  1249. <ul class="navL3">
  1250. <li class="inactive">
  1251. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  1252. </li>
  1253. <li class="inactive">
  1254. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  1255. </li>
  1256. </ul>
  1257. </li>
  1258. <li class="inactive toggle">
  1259. <a href="javascript:void(0)" title="Architects">Architects</a>
  1260. <ul class="navL3">
  1261. <li class="inactive">
  1262. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  1263. </li>
  1264. <li class="inactive">
  1265. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  1266. </li>
  1267. <li class="inactive">
  1268. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  1269. </li>
  1270. <li class="inactive">
  1271. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  1272. </li>
  1273. <li class="inactive">
  1274. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  1275. </li>
  1276. </ul>
  1277. </li>
  1278. <li class="inactive">
  1279. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  1280. </li>
  1281. <li class="inactive">
  1282. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  1283. </li>
  1284. <li class="inactive">
  1285. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  1286. </li>
  1287. <li class="inactive">
  1288. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  1289. </li>
  1290. </ul>
  1291. </li>
  1292. <li class="inactive toggle">
  1293. <a href="javascript:void(0)" title="Community">Community</a>
  1294. <ul class="navL2">
  1295. <li class="inactive">
  1296. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  1297. </li>
  1298. <li class="inactive">
  1299. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  1300. </li>
  1301. <li class="inactive">
  1302. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  1303. </li>
  1304. <li class="inactive">
  1305. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  1306. </li>
  1307. <li class="inactive">
  1308. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  1309. </li>
  1310. </ul>
  1311. </li>
  1312. <li class="inactive current toggle">
  1313. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  1314. <ul class="navL2">
  1315. <li class="inactive current">
  1316. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  1317. </li>
  1318. <li class="inactive">
  1319. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  1320. </li>
  1321. </ul>
  1322. </li>
  1323. <li class="inactive">
  1324. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  1325. </li>
  1326. </ul>
  1327. </nav>
  1328. </div>
  1329. </div>
  1330. </div>
  1331. <div class="right">
  1332. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  1333. <div class="SearchBox">
  1334. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  1335. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  1336. <div id="search-finder" class="search-finder"></div>
  1337. </button>
  1338. <button id="HeaderSearchButton" style="display:none"></button>
  1339. <div id="searchSplitter"></div>
  1340. <div id="searchCloseIcon" class="search-clear-x"></div>
  1341. <div id="searchTextContainer" style="width: 0;">
  1342. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  1343. </div>
  1344. </form>
  1345. </div>
  1346. </div>
  1347. </div>
  1348. </div>
  1349. </div>
  1350. </div>
  1351. </header>
  1352. </div>
  1353. <div class="printExportMenus ltr">
  1354. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fms809754(d%3dprinter).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  1355. Export (<span class="count">0</span>)
  1356. </a>
  1357. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/ms809754(d=printer).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  1358. Print
  1359. </a>
  1360. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  1361. </a>
  1362. </div>
  1363. <div class="printExportMenus ltr">
  1364. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  1365. </div>
  1366. <div id="body" ms.pgarea="body">
  1367. <span id="tabletView_large"></span>
  1368. <span id="tabletView_small"></span>
  1369. <span id="mobileView"></span>
  1370. <div id="content" class="content">
  1371. <input type="hidden" id="printForPab" value="true">
  1372. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  1373. <h1 class="title">The Debugging Application Programming Interface</h1>
  1374. <a id="msdn_debugeh">
  1375. </a>
  1376. <div id="nstext">&nbsp;
  1377. <p>Randy Kath<br>
  1378. Microsoft Developer Network Technology Group</p>
  1379. <p>November 5, 1992</p>
  1380. <br>
  1381. <h2 class="dtH1">Abstract</h2>
  1382. <p>This article demonstrates how the debugging support in the Microsoft Windows Application Programming Interface (API) can be used by developers to create custom debugging applications that behave exactly the way they want, including any specific features they desire. Specifically, this article discusses the following topics:
  1383. </p><ul>
  1384. <li>Exploring the built-in debugging support, including debug events and debug functions</li>
  1385. <li>Looking at the relationship between a debugger and the process being debugged</li>
  1386. <li>Representing information about a process being debugged</li>
  1387. <li>Using event objects for communicating between debugger threads</li>
  1388. <li>Managing the debugger's graphical user interface (GUI)</li>
  1389. <li>Responding to user commands in debug threads</li>
  1390. <li>Controlling the threads of a process being debugged</li>
  1391. <li>Accessing thread context information from threads of a process being debugged</li>
  1392. <li>Terminating and exiting a process being debugged</li>
  1393. <li>Calling debug functions from a process being debugged</li>
  1394. <li>Expanding on this debugger model</li>
  1395. </ul>
  1396. <p>Each of the key concepts presented is supported with code segments extracted from a sample debugging application called DEBUGAPP.EXE, whose source is included with this article. The sample application stands on its own as a multiprocess debugging application, or its source code can be used as the framework for a more elaborate custom debugger.</p>
  1397. <h2 class="dtH1">Introduction</h2>
  1398. <p>Of the time a programmer spends developing an application, a large portion is usually spent debugging that application. Consequently, developers rely on third-party debuggers almost as much as they do editors. Unlike editors, however, debuggers can rarely be customized much. If a debugger lacks an important feature or behaves in an unusual or irritating way, developers are simply forced to put up with it.</p>
  1399. <p>Windows appears ready to break this cumbersome debugging tradition with new, built-in debugging support included as part of the standard application programming interface (API). Now developers have the flexibility to create their own personal debugger that behaves exactly the way they wish. And once that is complete, having the source code to that debugger makes it all the more flexible. Developers can repeatedly add new features directly to the source code of the debugger as needed in the future.</p>
  1400. <p>The debugging architecture consists of a clean, relatively straightforward set of functions and events that make it useful to all developers, not just debugger builders. Simply being familiar with Windows and, more importantly, the Windows API is enough to build an understanding of the debugging support. The debugger sample application described in this article required only about three weeks for implementation, including the time required to make sense of the API.</p>
  1401. <h2 class="dtH1">Exploring the Built-In Debugging Support</h2>
  1402. <p>DebugApp, the sample application associated with this article, is a high-level debugger that meets a number of important requirements for a debugger. It can debug multiple applications simultaneously, controlling the execution of each process being debugged and presenting feedback about noteworthy events that occur in each of the processes. It can also be used to view the 2 gigabyte (GB) heap space of each process for learning how memory allocations are organized. These are only some of the capabilities that could be added to a debugger. To get a better feel for what capabilities can be implemented in a debugger, you will need to gain some knowledge of how the debugging API works.</p>
  1403. <h3 class="dtH1">Debug Events</h3>
  1404. <p><em>Debug events</em> are the objects of interest to a debugger—they're noteworthy incidents that occur within the process being debugged, causing the kernel to notify the debugger when they occur. As defined by Windows, debug events are one of the following:
  1405. </p><ul>
  1406. <li>CREATE_PROCESS_DEBUG_EVENT occurs before a new process being debugged initializes or at the time a debugger attaches to an active process.</li>
  1407. <li>EXIT_PROCESS_DEBUG_EVENT occurs when the process being debugged exits.</li>
  1408. <li>CREATE_THREAD_DEBUG_EVENT occurs when the process being debugged creates a new thread.</li>
  1409. <li>EXIT_THREAD_DEBUG_EVENT occurs when a thread in the process being debugged exits.</li>
  1410. <li>LOAD_DLL_DEBUG_EVENT occurs when the process being debugged loads a DLL (either explicitly or implicitly).</li>
  1411. <li>UNLOAD_DLL_DEBUG_EVENT occurs when the process being debugged frees a DLL.</li>
  1412. <li>EXCEPTION_DEBUG_EVENT occurs when an exception occurs in the process being debugged.</li>
  1413. <li>OUTPUT_DEBUG_STRING_DEBUG_EVENT occurs when the process being debugged makes a call to the <strong>OutputDebugString</strong> function.</li>
  1414. </ul>
  1415. <p>When a debug event is generated, it comes to the debugger packaged in a <strong>DEBUG_EVENT</strong> structure. The structure contains fields that represent an event code (listed above), the process ID of the process that generated the debug event, the thread ID of the thread executing when the debug event occurred, and a union of eight structures, one for each of the different events. This structure provides information necessary for the debugger to distinguish between different debug events and process them individually based on their unique requirements. The <strong>DEBUG_EVENT</strong> structure is:</p>
  1416. <div id="code-snippet-1" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  1417. <div class="codeSnippetContainerTabs">
  1418. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  1419. <a></a>
  1420. </div>
  1421. </div>
  1422. <div class="codeSnippetContainerCodeContainer">
  1423. <div class="codeSnippetToolBar"></div>
  1424. <div class="codeSnippetContainerCode" dir="ltr">
  1425. <div style="color:Black;"><pre>typedef struct _DEBUG_EVENT { /* de */
  1426. DWORD dwDebugEventCode;
  1427. DWORD dwProcessId;
  1428. DWORD dwThreadId;
  1429. union {
  1430. EXCEPTION_DEBUG_INFO Exception;
  1431. CREATE_THREAD_DEBUG_INFO CreateThread;
  1432. CREATE_PROCESS_DEBUG_INFO CreateProcess;
  1433. EXIT_THREAD_DEBUG_INFO ExitThread;
  1434. EXIT_PROCESS_DEBUG_INFO ExitProcess;
  1435. LOAD_DLL_DEBUG_INFO LoadDll;
  1436. UNLOAD_DLL_DEBUG_INFO UnloadDll;
  1437. OUTPUT_DEBUG_STRING_INFO DebugString;
  1438. } u;
  1439. } DEBUG_EVENT, *LPDEBUG_EVENT;
  1440. </pre></div>
  1441. </div>
  1442. </div>
  1443. </div>
  1444. <h3 class="dtH1">Debug Functions</h3>
  1445. <p>Two functions, <strong>WaitForDebugEvent</strong> and <strong>ContinueDebugEvent</strong>, are designed specifically for managing debug events as they occur in a process being debugged. These functions permit a debugger to wait for a debug event to occur, suspend execution of the process being debugged, process each debug event, and resume execution of the process being debugged when finished. Additionally, while the process being debugged is suspended, the debugger is able to change the thread context information of each of its threads. This ability provides a mechanism through which the debugger can alter normal execution of one or more threads in the process being debugged. It can, for example, change the instruction pointer for a thread to refer to an instruction at a new location. Then, when the thread resumes execution, it begins executing code at the new location. A discussion of this subject is presented later in the "Accessing Thread Context Information from Threads of a Process Being Debugged" section.</p>
  1446. <p>When called, the <strong>WaitForDebugEvent</strong> function does not return until a debug event occurs in the process being debugged or a time-out value is reached. The time-out value is set as one of the parameters in the function. The function returns TRUE if an event occurs, and FALSE if the function times out.</p>
  1447. <p><strong>DEBUG.C</strong></p>
  1448. <div id="code-snippet-2" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  1449. <div class="codeSnippetContainerTabs">
  1450. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  1451. <a></a>
  1452. </div>
  1453. </div>
  1454. <div class="codeSnippetContainerCodeContainer">
  1455. <div class="codeSnippetToolBar"></div>
  1456. <div class="codeSnippetContainerCode" dir="ltr">
  1457. <div style="color:Black;"><pre>while (TRUE)
  1458. {
  1459. /* Wait for 1/10 second for a debug event. */
  1460. if (WaitForDebugEvent (&amp;de, (DWORD)100))
  1461. {
  1462. switch (de.dwDebugEventCode)
  1463. {
  1464. case EXCEPTION_DEBUG_EVENT:
  1465. ProcessExceptionEvent (&amp;de);
  1466. break;
  1467. case CREATE_PROCESS_DEBUG_EVENT:
  1468. ProcessCreateProcessEvent (&amp;de);
  1469. break;
  1470. .
  1471. .
  1472. .
  1473. case default:
  1474. ProcessUnknownDebugEvent (&amp;de);
  1475. break;
  1476. }
  1477. ContinueDebugEvent (de.dwProcessId,
  1478. de.dwThreadId,
  1479. DBG_CONTINUE);
  1480. }
  1481. else
  1482. /* Perform periodic debugger responsibilities. */
  1483. }
  1484. </pre></div>
  1485. </div>
  1486. </div>
  1487. </div>
  1488. <p>In the code fragment above, notice that <strong>WaitForDebugEvent</strong> returns a Boolean value where a value of TRUE indicates that a debug event occurred and FALSE means that the function timed out. This example waits for 1/10 second for a debug event to occur, but if an event does not occur in that amount of time, it uses the time-out indicator to perform some other periodic debugger responsibilities. Since time-outs only happen when there are no debug events, this time is analogous to the idle time a CPU observes. Specifically, the DEBUGAPP.EXE sample uses this time to communicate with the main debugger thread in order to process user commands.</p>
  1489. <p>When a debug event occurs, execution of that process is suspended until the debugger calls the <strong>ContinueDebugEvent</strong> function. Consequently, all threads in the process are suspended while the debugger is processing the debug event. A debugger needs to be mindful of the performance impact this will impose on the process being debugged. A good design, in this case, is one that allows the process being debugged to continue as soon as possible after a debug event occurs. On the other hand, when the <strong>WaitForDebugEvent</strong> function times out, the process being debugged is able to run concurrently with the debugger process and no performance impact is observed. Any debug events that occur during the time-out period are queued until the debugger calls the <strong>WaitForDebugEvent</strong> function again. So, no need to worry—there is no possibility of missing a debug event because of this circumstance.</p>
  1490. <p>To call the <strong>ContinueDebugEvent</strong> function, the debugger must supply as parameters the thread ID and process ID of the process that generated the last debug event. Both the process and thread IDs are included as part of the <strong>DEBUG_EVENT</strong> structure with each debug event. They're also returned as part of the <strong>PROCESS_INFORMATION</strong> structure filled out by the <strong>CreateProcess</strong> function when starting a process for debugging. A debugger can attach to an active process for debugging, but an ID for that process is required prior to the attachment. Once the debugger has attached, the thread ID is retrieved from the <strong>DEBUG_EVENT</strong> structure.</p>
  1491. <h3 class="dtH1">The Relationship Between a Debugger and the Process Being Debugged</h3>
  1492. <p>For one application (process) to become the debugger of another, it must either create the process as a debug process or attach to an active process. In both cases, a parent/child relationship is established between the debugger and the process being debugged. If the debugger process ends without ending the process being debugged, the latter process is terminated by the system. If the process being debugged ends, the debugger process becomes a normal process, able to start or attach to another process to debug.</p>
  1493. <p>When the parent/child association is made, the debugger thread responsible for establishing this dependence—the thread that attaches or starts the process to be debugged—becomes the parent thread to the process being debugged. Only the parent thread of a process being debugged is capable of receiving debug events for that process. Consequently, the parent thread is the only thread able to call the <strong>WaitForDebugEvent</strong> and <strong>ContinueDebugEvent</strong> functions. If another thread calls these functions, they simply return FALSE. The basis for the design of the sample application, DEBUGAPP.EXE, is inherent in this requirement.</p>
  1494. <h4 class="dtH1">Creating a process to debug</h4>
  1495. <p>To create a process for debugging, the debugger calls the <strong>CreateProcess</strong> function with the <em>fdwCreate</em> parameter set to either DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS. DEBUG_PROCESS sets up the parent/child relationship so that the debugger will receive debug events from a process being debugged and any other processes created by that process. In this case, processes created by the process being debugged are automatically debugged by the same debugger. Using DEBUG_ONLY_THIS_PROCESS restricts debugging to the immediate process being debugged only. Processes created by the process being debugged are normal processes that have no debugging relationship established with any other process. </p>
  1496. <p>An abbreviated definition of <strong>CreateProcess</strong> is found below. A complete definition of the <strong>CreateProcess</strong> function is in the Platform SDK.</p>
  1497. <div id="code-snippet-3" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  1498. <div class="codeSnippetContainerTabs">
  1499. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  1500. <a></a>
  1501. </div>
  1502. </div>
  1503. <div class="codeSnippetContainerCodeContainer">
  1504. <div class="codeSnippetToolBar"></div>
  1505. <div class="codeSnippetContainerCode" dir="ltr">
  1506. <div style="color:Black;"><pre>BOOL CreateProcess(
  1507. LPCTSTR lpszImageName, /* address of image file name */
  1508. LPCTSTR lpszCommandLine, /* address of the command line */
  1509. LPSECURITY_ATTRIBUTES lpsaProcess, /* optional process attrs */
  1510. LPSECURITY_ATTRIBUTES lpsaThread, /* optional thread attrs */
  1511. BOOL fInheritHandles, /* new process inherits handles? */
  1512. DWORD fdwCreate, /* creation flags */
  1513. LPVOID lpvEnvironment, /* address of optional environment */
  1514. LPTSTR lpszCurDir, /* address of new current directory */
  1515. LPSTARTUPINFO lpsi, /* address of STARTUPINFO */
  1516. LPPROCESS_INFORMATION lppi); /* address of PROCESSINFORMATION */
  1517. </pre></div>
  1518. </div>
  1519. </div>
  1520. </div>
  1521. <p><strong>CreateProcess</strong> includes several parameters for establishing the environment of the process being debugged, passing command-line arguments to the process being debugged, specifying security attributes about the process, and indicating how to start the application. The LPPROCESS_INFORMATION parameter is used for receiving information about the process being started. Specifically, it consists of the process and thread IDs of the process being debugged that are used in <strong>ContinueDebugEvent</strong> and handles to both the process being debugged and its initial thread.</p>
  1522. <h4 class="dtH1">Attaching a debugger to an active process</h4>
  1523. <p>A debugger can attach to any existing process in the system, providing that it has the ID of that process. Through the <strong>DebugActiveProcess</strong> function, a debugger can establish the same parent/child relationship described earlier with active processes. In theory, then, the debugger should be able to present a list of active processes to the user, allowing them to select which one they would like to debug. Upon selection, the debugger could determine the ID of the selected process and begin debugging it by means of the <strong>DebugActiveProcess</strong> function. All that is needed then is a mechanism for enumerating the handles of each active process in the system. Unfortunately, Windows provides no support for determining the ID of other processes in the system. While this seems to render the function useless, it really just limits the way it can be used. On its own, a debugger process cannot determine the ID of other active processes, but with some help from the system it can get the ID of a specific process in need of debugging.</p>
  1524. <p>Built into Windows is the ability for the system to start a debugger upon the occurrence of an unhandled exception in a process. When such an exception occurs, Windows starts the default debugger and passes it the ID of the process to be debugged as a command-line parameter. Windows also passes an event handle as a second command-line parameter. The debugger then calls the <strong>DebugActiveProcess</strong> function using the process ID passed as a command-line parameter. Once the debugger has established the debugging relationship with the offending process, it signals that it is ready to begin debugging by calling the <strong>SetEvent</strong> function on the event handle. At that time the system releases control of the process to the debugger.</p>
  1525. <blockquote class="dtBlock"><div>
  1526. <strong>Note</strong><div class="tt">&nbsp;&nbsp;&nbsp;</div>The system administrator can change the default debugger in Windows to be any third-party debugger or any other debugger you choose. To do this, an entry must be added to the WIN.INI file as indicated:</div></blockquote>
  1527. <div id="code-snippet-4" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  1528. <div class="codeSnippetContainerTabs">
  1529. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  1530. <a></a>
  1531. </div>
  1532. </div>
  1533. <div class="codeSnippetContainerCodeContainer">
  1534. <div class="codeSnippetToolBar"></div>
  1535. <div class="codeSnippetContainerCode" dir="ltr">
  1536. <div style="color:Black;"><pre>[AeDebug]
  1537. Debugger = ntsd -d -p %d -e %d -g
  1538. </pre></div>
  1539. </div>
  1540. </div>
  1541. </div>
  1542. <blockquote class="dtBlock"><div>
  1543. To change from the standard default debugger, ntsd, to one of your choosing, simply replace the name ntsd with the name of the debugger you want. Also, make sure that the debugger resides in a directory in the path.</div></blockquote>
  1544. <p>An application can take advantage of this built-in behavior as a way of invoking a debugger to debug itself if, and only if, a special circumstance occurs. For example, an application could be executing normally when a condition occurs that warrants debugging. The application could then start the debugger by calling the <strong>CreateProcess</strong> function similar to the way it was described above, only not as a process to debug. Also, the process needs to pass its ID as a single command-line parameter to the debugger process. The debugger is then started and passed an ID of the process to debug. One requirement of this technique is that the debugger must differentiate between the two ways that it can be created. The difference is that, when the system starts the debugger, there is a second command-line parameter representing a valid wait event that the debugger must eventually signal. When the process wishing to be debugged creates the debugger, there is no second command-line parameter and no wait event to signal.</p>
  1545. <h2 class="dtH1">DEBUGAPP.EXE, A Sample Implementation</h2>
  1546. <p>Combining a knowledge of the debugging API and some idea of the features a custom debugger should have is important for devising the architecture of a debugger application. For example, Figure 1 portrays the architecture that was used in implementing the sample custom debugger, DebugApp.</p>
  1547. <p class="fig"><code><img id="debug_1" alt="ms809754.debug_1(en-us,MSDN.10).gif" src="./Windows Kernel Development Articles (2016-03-30)_files/IC17357.gif" title="ms809754.debug_1(en-us,MSDN.10).gif" xmlns=""></code></p>
  1548. <p class="label"><strong>Figure 1. DebugApp's architecture. A main debugger thread manages the debugger interface, while one thread exists for each process being debugged.</strong></p>
  1549. <p>DebugApp consists of one main thread and one or more debug threads. The main thread is responsible for handling the entire graphical user interface (GUI) of the debugger. Each of the other debug threads is created and destroyed as new debug sessions are started and ended. This structure serves to contain the debug-specific functionality in the debug threads and the GUI-specific functionality in the main thread. Embedded, then, is a layer of encapsulation that promotes maintenance and revision of the source code. Further, the source code for these two types of threads is located in separate source modules, DEBUG.C and MAIN.C, making it easier to go back and add functionality to one part of the system without having an adverse impact on the other.</p>
  1550. <p>Once the underlying structure for the debugger is in place, the next issue is how to represent the debugger and, more specifically, each process being debugged in a single Windows® interface. This implementation uses multiple document interface (MDI) because MDI supports multiple process debugging simultaneously and offers basic multiple window management functionality for free. It turns out MDI is also a good selection because each MDI child window can be used as a separate object capable of maintaining its own private data structures. In that case, writing the interface code to support multiple processes for debugging is no more work than writing it for one.</p>
  1551. <p>A final consideration concerns the bells and whistles that should be added to the debugger. DEBUGAPP.EXE need only meet the basic requirements stated earlier in this article, but at this point many more features and behaviors could easily be applied to the underlying debugger architecture. Specifically, DEBUGAPP.EXE implements support for controlling the execution of individual threads in each of the processes being debugged. It also records all debug events chronologically and provides a mechanism for saving this log to a file for post-mortem review. </p>
  1552. <h2 class="dtH1">Representing Information About a Process Being Debugged</h2>
  1553. <p>DEBUGAPP.EXE uses a single data structure for representing all of the information associated with a process being debugged and its threads. The structure is a simple, singly-linked list where the header (<strong>DBGPROCESS</strong> structure) represents the information of the process being debugged, and each node (<strong>DBGTHREAD</strong> structure) in the list represents information about each thread in the process. Figure 2 depicts this information and how it is organized.</p>
  1554. <p class="fig"><code><img id="debug_2" alt="ms809754.debug_2(en-us,MSDN.10).gif" src="./Windows Kernel Development Articles (2016-03-30)_files/IC33205.gif" title="ms809754.debug_2(en-us,MSDN.10).gif" xmlns=""></code></p>
  1555. <p class="label"><strong>Figure 2. A linked list stores information about the process being debugged and its threads.</strong></p>
  1556. <p>As the process being debugged creates and destroys new threads, the linked list grows and shrinks dynamically. Storage for this data structure is allocated within the debugger process in the form of a <em>serialized heap</em>. Since all threads in the debugger process have access to a shared heap, their access must be serialized to allow one thread to finish accessing the heap before another thread begins accessing it. Windows provides serialized heaps as a mechanism to prevent access contention between threads that share a heap.</p>
  1557. <p>In addition to information about the process being debugged, Windows uses the linked-list header as a place to store information that is communicated between the main thread and the debug thread. Such information includes the MDI child window handle representing a specific debug session, the module path and filename of the process being debugged, a thread number for control information, and a handle to the heap itself, which is used both for destroying the heap when the debug session ends and allocating additional linked-list nodes. Both the linked-list header and node structures are presented in the code below.</p>
  1558. <p><strong>DEBUG.H</strong></p>
  1559. <div id="code-snippet-5" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  1560. <div class="codeSnippetContainerTabs">
  1561. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  1562. <a></a>
  1563. </div>
  1564. </div>
  1565. <div class="codeSnippetContainerCodeContainer">
  1566. <div class="codeSnippetToolBar"></div>
  1567. <div class="codeSnippetContainerCode" dir="ltr">
  1568. <div style="color:Black;"><pre>// Define structures for debugging processes and threads.
  1569. typedef struct DBGTHREAD *LPDBGTHREAD;
  1570. typedef struct tagDbgThread
  1571. {
  1572. HANDLE hThread;
  1573. LPTHREAD_START_ROUTINE lpStartAddress;
  1574. BOOL bfState;
  1575. LPDBGTHREAD Next;
  1576. }DBGTHREAD;
  1577. typedef struct tagDbgProcess
  1578. {
  1579. HANDLE hDbgHeap;
  1580. DWORD dwProcessID;
  1581. DWORD dwThreadID;
  1582. HANDLE hProcess;
  1583. HANDLE hFile;
  1584. LPVOID lpImage;
  1585. DWORD dwDbgInfoOffset;
  1586. DWORD nDbgInfoSize;
  1587. DBGTHREAD *lpThreads;
  1588. HWND hWnd;
  1589. int ProcessPriority;
  1590. HANDLE hThread;
  1591. int ThreadPriority;
  1592. char szModule[MAX_PATH];
  1593. }DBGPROCESS;
  1594. </pre></div>
  1595. </div>
  1596. </div>
  1597. </div>
  1598. <p>DebugApp's main thread creates a serialized heap for each debug thread prior to creating the thread, and a pointer to the heap is passed to the debug thread at creation time. Both the debug thread and the main thread, each keeping a separate copy of the pointer to the structure, maintain the heap independently. The main thread stores its heap pointer in the window extra bytes of the MDI child window responsible for the process being debugged. This way each window can keep track of its own structures, independent of every other window. </p>
  1599. <p>Because the debug thread is implemented as a function (similar to a <strong>WinMain</strong> function) that returns only when the thread has completed, and because each thread has its own stack, each debug thread can keep the pointer to the heap as an automatic variable on its stack. In this way, each debug thread can access its pointer as a local variable because it resides permanently on the stack for that thread. When the thread exits (returns from the function), its stack is deallocated and the pointer is automatically freed. Keep in mind that the heap itself is not freed by this action; it must be explicitly freed through a call to <strong>DestroyHeap</strong>. When and where the heap gets deallocated is discussed in the "Terminating and Exiting a Process Being Debugged" section later in this article.</p>
  1600. <h2 class="dtH1">Using Event Objects for Communicating Between Debugger Threads</h2>
  1601. <p>Because, as described above, the debug thread and the main thread both share access to the same heap, some type of synchronization is necessary for at least creating and destroying that heap. Also, because both the debug thread and the main thread independently perform functions that occasionally must be coordinated, it stands to reason that a debugger needs a mechanism to communicate between threads. DEBUGAPP.EXE uses wait event objects for this purpose.</p>
  1602. <p>Windows uses wait events as a signaling mechanism much like a traffic signal, except there's no yellow light. A wait event represents either a signaled or unsignaled state. A thread can wait for one or more of these events to become signaled and then perform some related action. While waiting for an event to become signaled, a thread is idle. Consequently, events are perfect synchronization objects that allow one thread to wait for a signal from another before performing a specific task. In DEBUGAPP.EXE, the main thread opens a set of event objects, one for each debug thread, and stores the handles in a segment of global memory. The memory is treated as an array of object handles called <em>lpDbgEvents</em> and is kept in the window extra bytes of the responsible child window, along with the linked-list structure mentioned in the previous section.</p>
  1603. <p>Threads cannot share handles to event objects, so the debug thread must open its own array of handles to access the same event objects. The strategy so far is reasonable, but a potential problem lurks here. Since the debug thread must open handles to the same event objects, it has to do so by referring to these objects by name. Windows provides support for naming objects when they are created and referring to objects by name when they are opened for exactly this purpose. Consequently, the wait event objects must be named so that both the main thread and the debug thread can refer to identical objects. The problem arises when you start a second debug session. The second debug session requires a unique set of wait event objects—objects that can be referred to by both the debug thread and the main thread, but that also must be distinguishable from the first debug session's objects.</p>
  1604. <p>To solve this problem, DEBUGAPP.EXE uses the process ID of each process being debugged as part of the name used to identify each object, as in the following example.</p>
  1605. <p><strong>DEBUG.C</strong></p>
  1606. <div id="code-snippet-6" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  1607. <div class="codeSnippetContainerTabs">
  1608. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  1609. <a></a>
  1610. </div>
  1611. </div>
  1612. <div class="codeSnippetContainerCodeContainer">
  1613. <div class="codeSnippetToolBar"></div>
  1614. <div class="codeSnippetContainerCode" dir="ltr">
  1615. <div style="color:Black;"><pre>/* Local function creates debug event objects for thread */
  1616. /* synchronization. */
  1617. BOOL CreateDebugEvents (
  1618. LPHANDLE lpDbgEvents,
  1619. DWORD dwProcessID)
  1620. {
  1621. char szEvent[MAX_PATH];
  1622. char Buff[15];
  1623. LoadString (GetModuleHandle (NULL),
  1624. IDS_DBGEVNTACTIVE,
  1625. szEvent,
  1626. sizeof (szEvent));
  1627. strcat (szEvent, itoa (dwProcessID, Buff, 10));
  1628. if (!(lpDbgEvents[DEBUGACTIVE] = CreateEvent (NULL,
  1629. TRUE,
  1630. FALSE,
  1631. szEvent)))
  1632. return FALSE;
  1633. .
  1634. .
  1635. .
  1636. </pre></div>
  1637. </div>
  1638. </div>
  1639. </div>
  1640. <p>Each wait event object is given a static name that is stored in a string resource table. Then, when creating a new event or opening a new handle to an existing event, the ID of the process being debugged is appended to the end of the static string. Together the static string and the process ID uniquely identify an object belonging to a specific process.</p>
  1641. <p>Because each thread is responsible for storing its own array of wait event handles, each thread creates its own handles independently. Fortunately, Windows is robust enough that no synchronization is needed for this process. In fact, both threads can make the same call to <strong>CreateEvent</strong> using the same object name, but only the first call will actually create new objects. The second call will return a valid handle to the same object. For that reason, both threads use one function (<strong>CreateDebugEvents</strong>) to retrieve valid handles without regard to which one calls first. The debug thread stores its debug event handle array on the stack as an automatic variable.</p>
  1642. <blockquote class="dtBlock"><div>
  1643. <strong>Note</strong><div class="tt">&nbsp;&nbsp;&nbsp;</div>In an effort to make the code in DebugApp more readable, I defined constants to represent array indexes by name rather than number. Refer to DEBUG.H to find the array index value that corresponds to a specific wait event handle.</div></blockquote>
  1644. <p>In addition to the array of wait events used for communication between the two threads, DebugApp uses two other wait events, one for synchronizing startup and one for shutdown of the debug thread. These two event objects need only be created and used for a relatively short duration, so no accommodation is needed for them. Instead, they are created, freed, and released, all within the context of a single window message in the main thread. In both cases they are used as in the following example.</p>
  1645. <p><strong>DEBUG.C</strong></p>
  1646. <div id="code-snippet-7" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  1647. <div class="codeSnippetContainerTabs">
  1648. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  1649. <a></a>
  1650. </div>
  1651. </div>
  1652. <div class="codeSnippetContainerCodeContainer">
  1653. <div class="codeSnippetToolBar"></div>
  1654. <div class="codeSnippetContainerCode" dir="ltr">
  1655. <div style="color:Black;"><pre>/* Create initialize event. */
  1656. LoadString (GetModuleHandle (NULL),
  1657. IDS_DBGEVNTINITACK,
  1658. szEvent,
  1659. MAX_PATH);
  1660. hEvent = CreateEvent (NULL, TRUE, FALSE, szEvent);
  1661. /* Create debug thread. */
  1662. if (!(CreateThread ((LPSECURITY_ATTRIBUTES)NULL,
  1663. 4096,
  1664. (LPTHREAD_START_ROUTINE)DebugEventThread,
  1665. (LPVOID)lpDbgProcess,
  1666. 0,
  1667. &amp;TID)))
  1668. return NULL;
  1669. /* Wait for debugger to complete initialization before opening */
  1670. /* debug events. */
  1671. WaitForSingleObject (hEvent, INFINITE);
  1672. CloseHandle (hEvent);
  1673. </pre></div>
  1674. </div>
  1675. </div>
  1676. </div>
  1677. <p>First, the main thread creates an event by name with an initial value of FALSE. Then, it starts the debug thread and waits for the object it created. At this point, the thread stops execution until the wait event becomes TRUE, its signaled state. Meanwhile, the debug thread starts execution at the same time. The following code fragment shows how the debug thread signals the same wait event, identified by a common name, once it has completed its initialization.</p>
  1678. <p><strong>DEBUG.C</strong></p>
  1679. <div id="code-snippet-8" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  1680. <div class="codeSnippetContainerTabs">
  1681. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  1682. <a></a>
  1683. </div>
  1684. </div>
  1685. <div class="codeSnippetContainerCodeContainer">
  1686. <div class="codeSnippetToolBar"></div>
  1687. <div class="codeSnippetContainerCode" dir="ltr">
  1688. <div style="color:Black;"><pre>/* Create process to be debugged. */
  1689. .
  1690. .
  1691. .
  1692. /* Signal completion of initialization to calling thread. */
  1693. LoadString (GetModuleHandle (NULL),
  1694. IDS_DBGEVNTINITACK,
  1695. szEvent,
  1696. MAX_PATH);
  1697. hEvent = OpenEvent (EVENT_ALL_ACCESS, FALSE, szEvent);
  1698. SetEvent (hEvent);
  1699. CloseHandle (hEvent);
  1700. </pre></div>
  1701. </div>
  1702. </div>
  1703. </div>
  1704. <p>The main thread is able to continue execution after the event is signaled. Then, it is free to release the event object because the synchronization is complete. A similar wait event is used for synchronization when the debug thread shuts down.</p>
  1705. <h2 class="dtH1">Managing the Debugger's Graphical User Interface</h2>
  1706. <p>When DEBUGAPP.EXE begins, the first thread in the process gets started. This thread behaves exactly like a basic, single-threaded MDI Windows-based application. It registers window classes for the frame and debug windows, creates the frame and MDI client windows, and initializes application-specific data. When complete, the thread enters a continuous <strong>GetMessage</strong> loop, awaiting commands from the user.</p>
  1707. <p>When the command is sent to load a process for debugging, the main thread first calls the <strong>GetOpenFileName</strong> common dialog routine, validates the selected filename, and informs the MDI client to create a new child window. The MDI client then creates the new child window, allowing it to perform its own window initialization. </p>
  1708. <p>The following initialization is performed during the WM_CREATE message of the debugger window:
  1709. </p><ol>
  1710. <li>The child window creates an edit control, used for recording debug information for this debug process, that completely fills its client area. </li>
  1711. <li>The child window allocates a segment of global memory for storing the array of wait event object handles.</li>
  1712. <li>The child window calls the <strong>StartDebugger</strong> function to create the debug thread and the process for debugging.</li>
  1713. </ol>
  1714. <p>The segment of global memory is passed as a parameter and returned with the array filled with valid event handles. The <strong>StartDebugger</strong> function also returns a pointer to the serialized heap for this debugger. Both of these pointers are then placed in window extra bytes for this window. The new child window then returns—eventually back to the frame window where the command to load the process for debugging was originally sent—permitting the main thread to continue executing in support of the graphical user interface. </p>
  1715. <p>All subsequent file-loading commands work in exactly the same way, permitting the user to load simultaneously as many processes for debugging as the system can accommodate, given the amount of resources available. Other menu commands are distributed as appropriate by the frame window. Some of the commands are handled by the MDI client window, while others are processed only by the frame window. Still other commands, like <strong>View Thread</strong> and <strong>View Process</strong>, are intended for the debug window that is currently active. The frame distributes these messages directly to the active debugger window.</p>
  1716. <p>Most commands intended for a specific debugger window involve communication between that window and the corresponding debug thread. In these cases, the debugger window signals a wait event for the debug thread. The debug thread can then act upon that event the next time it waits for it. Once the event has been signaled, the main thread simply returns back to the message loop for the next user command. Since the debug thread has access to the window handle of the debug window in its <strong>DBGPROCESS</strong> data structure, it is able to submit data to the edit control directly. This permits the user free access to commands without having to wait for any prolonged processing on the part of the debug thread.</p>
  1717. <h2 class="dtH1">Responding to User Commands in Debug Threads</h2>
  1718. <p>Besides handling debug events in the process being debugged, the debug thread also handles all user commands once they have been signaled as wait events in the debug window. To accommodate user command events from the main thread and still be able to debug the process, the debug thread implements a multiple-object wait loop.</p>
  1719. <p><strong>DEBUG.C</strong></p>
  1720. <div id="code-snippet-9" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  1721. <div class="codeSnippetContainerTabs">
  1722. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  1723. <a></a>
  1724. </div>
  1725. </div>
  1726. <div class="codeSnippetContainerCodeContainer">
  1727. <div class="codeSnippetToolBar"></div>
  1728. <div class="codeSnippetContainerCode" dir="ltr">
  1729. <div style="color:Black;"><pre>while (TRUE)
  1730. {
  1731. int nIndex;
  1732. /* Wait for debugger active. */
  1733. switch (nIndex = WaitForMultipleObjects (nDEBUGEVENTS,
  1734. hDbgEvent,
  1735. FALSE,
  1736. INFINITE))
  1737. {
  1738. case CLOSEDEBUGGER:
  1739. {
  1740. int i;
  1741. /* Terminate process being debugged. */
  1742. TerminateProcess (lpDbgProcess-&gt;hProcess, 0);
  1743. /* Signal close command acknowledged event. */
  1744. LoadString (GetModuleHandle (NULL),
  1745. IDS_DBGEVNTCLOSEACK,
  1746. szEvent,
  1747. MAX_PATH);
  1748. hEvent = OpenEvent (EVENT_ALL_ACCESS,
  1749. FALSE,
  1750. szEvent);
  1751. SetEvent (hEvent);
  1752. /* Close all debug events. */
  1753. for (i=0; i&lt;nDEBUGEVENTS; i++)
  1754. CloseHandle (hDbgEvent[i]);
  1755. CloseHandle (hEvent);
  1756. /* Exit debugger now. */
  1757. return TRUE;
  1758. }
  1759. break;
  1760. case SUSPENDDEBUGGER:
  1761. SuspendDebuggeeProcess (lpDbgProcess);
  1762. ResetEvent (hDbgEvent[DEBUGACTIVE]);
  1763. ResetEvent (hDbgEvent[SUSPENDDEBUGGER]);
  1764. break;
  1765. case RESUMEDEBUGGER:
  1766. ResumeDebuggeeProcess (lpDbgProcess);
  1767. SetEvent (hDbgEvent[DEBUGACTIVE]);
  1768. ResetEvent (hDbgEvent[RESUMEDEBUGGER]);
  1769. break;
  1770. case DEBUGACTIVE:
  1771. /* If debug active */
  1772. if ((WaitForDebugEvent (&amp;de, (DWORD)100)))
  1773. {
  1774. if (de.dwProcessId == lpDbgProcess-&gt;dwProcessID)
  1775. {
  1776. switch (de.dwDebugEventCode)
  1777. {
  1778. case EXCEPTION_DEBUG_EVENT:
  1779. ProcessExceptionEvent (&amp;de);
  1780. break;
  1781. case CREATE_PROCESS_DEBUG_EVENT:
  1782. ProcessCreateProcessDebugEvent (&amp;de);
  1783. break;
  1784. .
  1785. .
  1786. .
  1787. default:
  1788. ProcessDefaultDebugEvent (&amp;de);
  1789. break;
  1790. }
  1791. }
  1792. else
  1793. /* Notify of sibling process debug event. */
  1794. AppendEditText (lpDbgProcess-&gt;hWnd,
  1795. de.dwDebugEventCode +
  1796. IDS_SIBLING,
  1797. NULL);
  1798. ContinueDebugEvent (de.dwProcessId,
  1799. de.dwThreadId,
  1800. DBG_CONTINUE);
  1801. }
  1802. break;
  1803. }
  1804. }
  1805. </pre></div>
  1806. </div>
  1807. </div>
  1808. </div>
  1809. <p>In the example above, the debug thread begins a loop and immediately calls <strong>WaitForMultipleObjects</strong> to await the signaling of any debugger event. The debugger events are described below:
  1810. </p><ul>
  1811. <li>CLOSEDEBUGGER signals the debug thread to abort debugging the current process. Highest priority event.</li>
  1812. <li>SUSPENDDEBUGGER signals the debugger to suspend debugging the current process.</li>
  1813. <li>RESUMEDEBUGGER signals the debugger to resume debugging the process.</li>
  1814. <li>DEBUGACTIVE signals the debug thread to debug the process because there is nothing else to do. Lowest priority event.</li>
  1815. </ul>
  1816. <p>The debug thread remains suspended upon this call until an event becomes signaled. Then, the <strong>WaitForMultipleObjects</strong> function returns the index of the event that was signaled. If more than one debugger event is signaled at a time, the one with the highest priority is returned. Events are assigned priorities according to how they are ordered in the array of event handles, where the lower the array position the higher the priority. The array of handles is passed as an argument to the <strong>WaitForMultipleObjects</strong> function. DEBUGAPP.EXE places the highest priority on exiting the debugger and the lowest priority on actual debugging. That means that debugging is performed only when the debug thread has nothing else to do. Really this means that the debugger is able to respond immediately to commands that do not occur frequently—such as exit.</p>
  1817. <p>Also, debug events are separate events from the events that are signaled by the main thread in a debug window. Consequently, another wait loop is embedded within the first for handling debug events alone. However, the debug thread must break from the debug event loop periodically to wait for debugger events. To facilitate this requirement, a time-out is used on the debug event loop to allow the debug thread a way of breaking out of the debug event loop when no debug events are occurring. When the debugger is no longer debugging, as it were, it is able to check for other events that may have become signaled in the interim. While doing so, the debugger does not need to suspend the process being debugged. Any debug events that occur while the debugger is not waiting for them are queued until the debugger resumes its call to <strong>WaitForDebugEvent</strong>.</p>
  1818. <p>Wait events, as used by the debugger, can be either automatic or manual reset types. DebugApp uses manual reset events for more control over when the events become acknowledged. This is necessary because, while the debugger is handling (or waiting for) debug events, more than one debugger event command might have become signaled. When the debugger returns to handle the events, it must handle them one at a time. Two automatic wait events would automatically become reset as soon as the debugger returned from the <strong>WaitForMultipleObjects</strong>. Yet the debugger prioritizes itself so that it responds only to the signaled event with lowest priority. When complete, it returns to handle any others that are still signaled. While handling each one, it resets the event manually to acknowledge the completion of the task for that event. This prevents events from slipping through the cracks while other events are being processed.</p>
  1819. <h2 class="dtH1">Controlling the Threads of a Process Being Debugged</h2>
  1820. <p>In preemptive, multithreaded operating systems, a mechanism often referred to as the <em>system scheduler</em> exists for scheduling each thread in the system. The system scheduler assigns each thread a rank or priority that it uses to determine how much processing to attribute to a thread before switching to the next thread. Specifically in Windows, each thread has a base priority in the range 1–31, where the higher the priority, the more processing time is attributed to the thread. Windows establishes the base priority by combining the specific thread priority and the priority class of its process, as shown in the diagram in Figure 3.</p>
  1821. <p class="fig"><code><img id="debug_3" alt="ms809754.debug_3(en-us,MSDN.10).gif" src="./Windows Kernel Development Articles (2016-03-30)_files/IC147612.gif" title="ms809754.debug_3(en-us,MSDN.10).gif" xmlns=""></code></p>
  1822. <p class="label"><strong>Figure 3. Base thread priorities for each of the process priority classes.</strong></p>
  1823. <p>Windows provides processes with the capability of determining and adjusting their threads' base priorities. Windows provides this feature through the <strong>SetPriorityClass</strong>, <strong>GetPriorityClass</strong>, <strong>SetThreadPriority</strong>, and <strong>GetThreadPriority</strong> functions. Using these functions, processes can adjust their threads' base priority values. To adjust the base priority of threads belonging to a process other than itself, a process needs special access rights.</p>
  1824. <p>By default, a debugger process has PROCESS_SET_INFORMATION access to the process it is debugging and THREAD_SET_INFORMATION access to all threads in that process. These accesses permit the debugger process to change both the priority class of the process being debugged and the thread priority value for each thread in the process. In addition, unlike debug events, any thread in the debugger process can adjust both the process priority class and thread priority values of the process it is debugging. This means that the main debugger thread is able to perform these functions directly without having to synchronize the procedure with the appropriate debug thread.</p>
  1825. <p>Because of this, the GUI thread of the debugger can perform execution control for all processes being debugged. In DEBUGAPP.EXE, execution control is handled by a single dialog box, Thread Execution Control. When the dialog box is invoked, the process being debugged is suspended until the dialog box is dismissed by the user. In the interim, the user is able to modify the priority value for each thread and the priority class for the process being debugged. The dialog box lists each of the threads in the process being debugged, showing their base priorities for comparison. After adjusting priorities for the threads and process, the user exits the dialog box by clicking either OK or Cancel. Clicking OK changes the priorities in the process being debugged and resumes its execution. Clicking Cancel simply causes the process being debugged to resume with the priorities left unchanged.</p>
  1826. <p>In addition to adjusting the base priority of threads, the debugger process can also suspend and terminate the threads of the process being debugged. Specifically, suspending and resuming threads is only available to processes with THREAD_SUSPEND_RESUME access and termination to processes with THREAD_TERMINATE access, but again a debugger process has these access rights by default. The aforementioned Thread Execution Control dialog box in DEBUGAPP.EXE provides support for suspending and resuming threads, but not for terminating threads. Windows provides support for controlling threads through the <strong>SuspendThread</strong>, <strong>ResumeThread</strong>, and <strong>TerminateThread</strong> functions.</p>
  1827. <h3 class="dtH1">Accessing Thread Context Information from Threads of a Process Being Debugged</h3>
  1828. <p>By default, a debugger can change the context of any thread in the process being debugged by virtue of the fact that it has access to the handle for each thread of that process. In DEBUGAPP.EXE, the thread handles of the process being debugged are saved as the thread is created in the linked-list structure described earlier in "Representing Information About a Process Being Debugged." To change the context of a thread in the process being debugged, the debugger calls the <strong>SetThreadContext</strong> function. The arguments to this function are simply a handle to the thread to be affected and a pointer to a <strong>CONTEXT</strong> structure filled with information describing how the thread context will exist after making the call. Similarly, to view the state of a thread's context, the debugger calls <strong>GetThreadContext</strong>. Any process can call <strong>Set/GetThreadContext</strong> for any other thread, providing that it has a valid handle to that thread.</p>
  1829. <blockquote class="dtBlock"><div>
  1830. <strong>Note</strong><div class="tt">&nbsp;&nbsp;&nbsp;</div>A thread context is implementation-specific, differing from one hardware architecture to another. The fields of the <strong>CONTEXT</strong> structure vary, depending on whether you're running on an Intel platform or a MIPS platform. For details on implementing the <strong>CONTEXT</strong> structure for a specific platform, refer to the specific header file where the structure is defined.</div></blockquote>
  1831. <h3 class="dtH1">Terminating and Exiting a Process Being Debugged</h3>
  1832. <p>There is more than one way to end a process. Windows provides support for terminating a process, given the handle to that process, in the <strong>TerminateProcess</strong> function. Yet, using this function prevents the process from having the opportunity to clean up volatile data. <strong>TerminateProcess</strong> ends the process immediately without calling the <strong>DllEntryPoint</strong> function of any dynamic-link libraries (DLLs) that the application may have loaded. <strong>TerminateProcess</strong> does not send any last messages to window procedures (like WM_DESTROY); it simply terminates. Windows, however, is robust enough to clean up all system resources owned by the process and associated DLLs. Unlike Windows version 3.1, a process does not leave the system in an unstable state solely by calling this function.</p>
  1833. <p>Terminating a process from the debugger may, in fact, be the appropriate way to end a process being debugged. If at any time a user of the debugger commands the process being debugged to exit from the debugger, it is understood that the process is closing abnormally. If the user wants to gracefully exit the process, the user can simply exit it normally directly from the application interface. In fact, abruptly exiting a process—but only after it's allowed to save its changes—is, in itself, a contradiction.</p>
  1834. <p>Another method of exiting a process is to have a process call <strong>ExitProcess</strong> itself. This method is considered a "graceful" exit because all associated DLLs get a chance to clean up before being detached. In this case, the <strong>DllEntryPoint</strong> function gets called for each thread as it terminates and once for when the process goes away. This function permits the process to save volatile data before exiting. Yet, since <strong>DllEntryPoint</strong> does not include a parameter for a process handle, it cannot be called by one process in the hope of exiting another process. So, the debugger cannot command the process being debugged to exit gracefully by calling this function.</p>
  1835. <p>The final technique a debugger process could employ to command the process being debugged to exit gracefully does not use a straightforward API call. Instead, it involves manipulating the context information of a thread in the process being debugged. Because <strong>ExitProcess</strong> can only be called from the process that intends to exit, the debugger can change the context information of the main thread in the process being debugged so that the next instruction it executes is a call to <strong>ExitProcess</strong>. </p>
  1836. <p>To do this, the debugger must:
  1837. </p><ol>
  1838. <li>Suspend the process being debugged.</li>
  1839. <li>Get the context information of a thread in the process being debugged. (It can be any thread in the process, as long as it is not a suspended thread.)</li>
  1840. <li>Replace the instruction-pointer contents with the address of the <strong>ExitProcess</strong> function as referenced by the process being debugged.</li>
  1841. <li>Set the altered context information structure back into the thread of the process being debugged.</li>
  1842. <li>Resume execution of the process.</li>
  1843. </ol>
  1844. <p>The process being debugged behaves as though it made a call to <strong>ExitProcess</strong> itself. (Actually that is exactly what it does.) The following function illustrates this technique.</p>
  1845. <p><strong>DEBUG.C</strong></p>
  1846. <div id="code-snippet-10" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  1847. <div class="codeSnippetContainerTabs">
  1848. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  1849. <a></a>
  1850. </div>
  1851. </div>
  1852. <div class="codeSnippetContainerCodeContainer">
  1853. <div class="codeSnippetToolBar"></div>
  1854. <div class="codeSnippetContainerCode" dir="ltr">
  1855. <div style="color:Black;"><pre>void ExitDebuggee (
  1856. DBGPROCESS *lppr)
  1857. {
  1858. CONTEXT thContext;
  1859. GetThreadContext (((DBGTHREAD *)lppr-&gt;lpThreads)-&gt;hThread,
  1860. &amp;thContext);
  1861. thContext.Eip = lppr-&gt;ExitProcess;
  1862. SetThreadContext (((DBGTHREAD *)lppr-&gt;lpThreads)-&gt;hThread,
  1863. &amp;thContext);
  1864. }
  1865. </pre></div>
  1866. </div>
  1867. </div>
  1868. </div>
  1869. <p>Obtaining the address of the <strong>ExitProcess</strong> function is problematic in the above procedure. While it is relatively easy to determine the whereabouts of the function in a process that is executing (it is a member of the system DLL, KERNEL32.DLL), finding the exact address of that function in the process being debugged is more difficult. Each application maps all of the DLLs it uses into its own address space, based mostly on the order in which the DLLs are loaded. This means that, while more than one application may use a given DLL, two processes may or may not have loaded the same system DLL into the same location in their respective address spaces. Consequently, the same function called from a common DLL might be located at different virtual addresses in the two applications. It is tempting to draw the conclusion that system DLLs are loaded into the same base address in every application, for that would make this problem simply go away. <strong>This conclusion, however, is invalid. It may work in some cases, but it cannot be considered a fail-safe assumption. Developers are wise not to draw this conclusion about the system.</strong></p>
  1870. <p>So, to make the <strong>ExitDebuggee</strong> function work properly (see code fragment above), the address of the <strong>ExitProcess</strong> function must be known in the context of the address space of the process being debugged.</p>
  1871. <h4 class="dtH1">Determining the location of ExitProcess</h4>
  1872. <p>One safe assumption to make is that the location of a function in a DLL is always at the same offset from the DLL's base address. This assumption provides the necessary information to develop a technique that is fail-safe. The debugger is already notified when the process being debugged loads each of its DLLs, and at that time the base address of the DLL is provided to the debugger. All the debugger needs to do at this point is determine which DLL being loaded contains the <strong>ExitProcess</strong> function and the offset of that function within the DLL.</p>
  1873. <p>To determine the offset of the function in the DLL, call <strong>GetProcAddress</strong> with the handle to the appropriate DLL and a string identifying the <strong>ExitProcess</strong> function. This can be done within the context of the debugger process since the offset is consistent across processes. The handle to this DLL can be obtained by making a call to <strong>LoadLibrary</strong>, specifying KERNEL32.DLL by name. Then, subtract the base address of the DLL from the address returned from <strong>GetProcAddress</strong>. The difference is the offset into the DLL. The base address of KERNEL32.DLL can be determined by calling the <strong>VirtualQuery</strong> function, supplying the address of the <strong>ExitProcess</strong> function as the base address for the region of memory. <strong>VirtualQuery</strong> returns a filled-out <strong>MEMORY_BASIC_INFORMATION</strong> structure. One field of that structure is the base address for the region of memory. In this case, that will be the base address of the DLL code region.</p>
  1874. <p>Even more difficult is the task of determining which DLL is being loaded in the process being debugged when LOAD_DLL_DEBUG_EVENT occurs. During this debug event, the debugger receives the base address for the DLL being loaded, but only a module file handle with which to identify the DLL. Fortunately, the file handle can be used to read information about the file. To identify the file as the correct DLL, the debugger must determine the name of the DLL by extracting the filename, assigned by the linker, from the executable image. The name is found after tracing through a maze of offsets and tables of data embedded within the executable file. </p>
  1875. <p>A limitation, though, exists in this technique. Since the name of the executable is embedded in the file during the link process, there is no way of knowing whether a user renamed the file after linking. Unfortunately, there is no way around this limitation. No other way exists to determine the name of the DLL that is being loaded in the debugger—yet, one can always hope that this will be a feature included in a future release of Windows.</p>
  1876. <p>Once the name is extracted, it can be compared to see if, in fact, the DLL is the KERNEL32.DLL file. If so, the debugger saves this base address in the process structure for use in the <strong>ExitDebuggee</strong> function as shown in the code fragment in the previous section.</p>
  1877. <h2 class="dtH1">Debug Functions a Process Being Debugged Can Call</h2>
  1878. <p>A few functions are provided as part of the Windows API for applications that are being debugged. Each of these functions generates a debug event in the debugger process:
  1879. </p><ul>
  1880. <li><strong>DebugBreak</strong> is provided simply to insert a break point in an application. This function generates the EXCEPTION_DEBUG_EVENT event and with it an <strong>EXCEPTION_DEBUG_INFO</strong> structure that includes an <strong>EXCEPTION_RECORD</strong> structure, which includes an EXCEPTION_BREAKPOINT exception code for this event.</li>
  1881. <li><strong>OutputDebugString</strong> provides the opportunity for the process being debugged to pass a string to the debugger application. This function can be extremely useful in a custom debugger application because it provides a mechanism for the process being debugged to pass information to the debugger. The debugger can then log these strings when they occur or respond according to their content. This function generates the OUTPUT_DEBUG_STRING_DEBUG_EVENT event and is accompanied by an <strong>OUTPUT_DEBUG_STRING_INFO</strong> structure. This structure contains the address and length of the string in the process being debugged and a Unicode® flag, indicating the type of string it is. The debugger can access the string by calling <strong>ReadProcessMemory</strong> and indicating the length and address of the string to read along with the process handle.</li>
  1882. <li><strong>FatalExit</strong> and <strong>FatalAppExit</strong> are functions provided for an application to exit immediately but pass control to the debugger before going away.</li>
  1883. </ul>
  1884. <p>The debugger handles each of the above calls as any application calling them would when encountering any other debug event. The only distinction is the type of event itself. If it is desirable to have the debugger execute special processing after one of these types of events, the debugger simply treats each of these debug events uniquely. The debug event loop is already prepared to handle this eventuality.</p>
  1885. <h2 class="dtH1">Expanding on This Debugger Model</h2>
  1886. <p>The debugger presented in this article falls short of a full-fledged, source-level debugger in several ways. It does not provide any source-level functionality, like single-step execution and break points. It also lacks any symbolic information support. Many features could easily be added to this debugger—many without too much effort and some that would require considerable effort. The purpose of DEBUGAPP.EXE is to provide a base upon which a complete debugging environment could be built while at the same time introducing the debugging API. To that extent, this debugger is a solid debugging foundation, and it demonstrates extensive use of the debugging API. Don't be surprised to see future samples and technical articles based on this debugging sample!</p>
  1887. </div>
  1888. </div>
  1889. </div>
  1890. </div>
  1891. <div class="clear"></div>
  1892. <input name="__RequestVerificationToken" type="hidden" value="fKVhUw50W0Cx1RcGSOB-78qntfCbfSRGZuY25Ly7GH3ufsIslCsWQ4GgYSPSZKo4zmIPsqfjZRz084JLaqsNnCW7xhk1">
  1893. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/ms809754(d=printer).aspx">
  1894. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/ms809754(d=printer).aspx">
  1895. <input id="isTopicRated" type="hidden" value="false">
  1896. <div id="lib-footer" ms.pgarea="body">
  1897. <link type="text/css" rel="stylesheet">
  1898. <div id="ux-footer" class="" style="" dir="ltr">
  1899. <div id="footerSock" class="librarySock both">
  1900. <div id="footerSockInner">
  1901. <a name="feedback"></a>
  1902. <div class="rating">
  1903. <div id="ratingSection1">
  1904. <div class="title">
  1905. Was this page helpful?
  1906. </div>
  1907. <div class="description">
  1908. Your feedback about this content is important.<br>Let us know what you think.
  1909. </div>
  1910. <div class="buttons">
  1911. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  1912. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  1913. </div>
  1914. <input id="ratingValue" type="hidden" value="">
  1915. </div>
  1916. <div id="ratingSection2">
  1917. <div class="title left">
  1918. Additional feedback?
  1919. </div>
  1920. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  1921. <div class="right">
  1922. <div class="counter">
  1923. <span id="feedbackTextCounter">1500</span> characters remaining
  1924. </div>
  1925. <div class="buttons">
  1926. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  1927. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  1928. </div>
  1929. </div>
  1930. </div>
  1931. <div id="ratingSection3">
  1932. <div class="title">
  1933. Thank you!
  1934. </div>
  1935. <div class="description">
  1936. We appreciate your feedback.
  1937. </div>
  1938. </div>
  1939. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  1940. </div>
  1941. <div class="userVoice">
  1942. <div class="title">
  1943. Help us improve MSDN.
  1944. </div>
  1945. <div class="description">
  1946. Visit our UserVoice Page to submit and vote on ideas!
  1947. </div>
  1948. <div class="buttons">
  1949. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  1950. </div>
  1951. </div>
  1952. <div class="clear"></div>
  1953. </div>
  1954. </div>
  1955. <footer class="top">
  1956. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  1957. <div class="linkList">
  1958. <div class="linkListTitle">Dev centers</div>
  1959. <ul class="links">
  1960. <li>
  1961. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  1962. </li>
  1963. <li>
  1964. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  1965. </li>
  1966. <li>
  1967. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  1968. </li>
  1969. <li>
  1970. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  1971. </li>
  1972. <li>
  1973. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  1974. </li>
  1975. </ul>
  1976. </div>
  1977. </div>
  1978. <div id="rightLinks">
  1979. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  1980. <div class="linkList">
  1981. <div class="linkListTitle">Learning resources</div>
  1982. <ul class="links">
  1983. <li>
  1984. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  1985. </li>
  1986. <li>
  1987. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  1988. </li>
  1989. <li>
  1990. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  1991. </li>
  1992. </ul>
  1993. </div>
  1994. </div>
  1995. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  1996. <div class="linkList">
  1997. <div class="linkListTitle">Community</div>
  1998. <ul class="links">
  1999. <li>
  2000. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  2001. </li>
  2002. <li>
  2003. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  2004. </li>
  2005. <li>
  2006. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  2007. </li>
  2008. </ul>
  2009. </div>
  2010. </div>
  2011. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  2012. <div class="linkList">
  2013. <div class="linkListTitle">Support</div>
  2014. <ul class="links">
  2015. <li>
  2016. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  2017. </li>
  2018. </ul>
  2019. </div>
  2020. </div>
  2021. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  2022. <div class="linkList">
  2023. <div class="linkListTitle">Programs</div>
  2024. <ul class="links">
  2025. <li>
  2026. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  2027. </li>
  2028. <li>
  2029. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  2030. </li>
  2031. <li>
  2032. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  2033. </li>
  2034. </ul>
  2035. </div>
  2036. </div>
  2037. </div>
  2038. </footer>
  2039. <footer class="bottom">
  2040. <span class="localeContainer">
  2041. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  2042. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fms809754(d%3dprinter).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  2043. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  2044. </form>
  2045. </span>
  2046. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  2047. <div class="linkList">
  2048. <ul class="links horizontal">
  2049. <li>
  2050. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  2051. </li>
  2052. <li>
  2053. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  2054. </li>
  2055. <li>
  2056. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  2057. </li>
  2058. <li>
  2059. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  2060. </li>
  2061. </ul>
  2062. </div>
  2063. </div>
  2064. <span class="logoLegal">
  2065. <span class="logo"></span>
  2066. <span class="copyright">© 2016 Microsoft</span>
  2067. </span>
  2068. </footer>
  2069. </div>
  2070. </div>
  2071. <div class="footerPrintView">
  2072. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  2073. </div>
  2074. <input id="tocPaddingPerLevel" type="hidden" value="17">
  2075. <input id="MtpsDevice" type="hidden" value="Printer">
  2076. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  2077. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  2078. <div id="globalRequestVerification">
  2079. <input name="__RequestVerificationToken" type="hidden" value="S3eQxysIg4Cc2ZKrGI8zjPRQw8ypyUeRW6zTqVyxkTpZXnjoyuffdFT9yIXmrTIjwCL4n-pBNpmElwobS4LZMHdD7Kw1">
  2080. </div>
  2081. </div>
  2082. <script type="text/javascript" class="mtps-injected">
  2083. /*<![CDATA[*/
  2084. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  2085. MTPS.injectScripts([
  2086. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  2087. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/ms809754(d=printer,l=en-us,v=msdn.10).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  2088. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  2089. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  2090. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  2091. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  2092. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  2093. ]);
  2094. /*]]>*/
  2095. </script>
  2096. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined(4).css">
  2097. <div id="page">
  2098. <link type="text/css" rel="stylesheet">
  2099. <input type="hidden" id="isHeaderBleeding" value="true">
  2100. <div id="ux-header" dir="ltr" class="ltr msdn">
  2101. <header>
  2102. <span id="singleCol"></span>
  2103. <span id="doubleCol"></span>
  2104. <span id="isMobile"></span>
  2105. <div>
  2106. <div class="row topRow">
  2107. <div class="top">
  2108. <div class="left">
  2109. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  2110. <div id="msft-logo" class="msft-logo"></div>
  2111. </a>
  2112. <div class="GrayPipe"></div>
  2113. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  2114. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  2115. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  2116. </div>
  2117. <div class="right">
  2118. <div id="signIn">
  2119. <div class="profileImage"></div>
  2120. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376396&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fdn655038%2528d%3dprinter%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  2121. <div class="auxNav">
  2122. <div>
  2123. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  2124. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  2125. </div>
  2126. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  2127. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  2128. </div>
  2129. </div>
  2130. <div>
  2131. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  2132. <div class="linkList">
  2133. <ul class="links horizontal">
  2134. <li>
  2135. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  2136. </li>
  2137. <li>
  2138. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  2139. </li>
  2140. <li>
  2141. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  2142. </li>
  2143. </ul>
  2144. </div>
  2145. </div>
  2146. </div>
  2147. </div>
  2148. </div>
  2149. </div>
  2150. </div>
  2151. <div class="row middleRow">
  2152. <div class="expandTop">
  2153. <div class="left"></div>
  2154. <div class="right"></div>
  2155. </div>
  2156. </div>
  2157. </div>
  2158. <div id="buttomRowWrapper" class="bg_default">
  2159. <div class="row buttomRow bg_default">
  2160. <div class="bottom">
  2161. <div class="left">
  2162. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  2163. <div id="drawer">
  2164. <div class="toc">
  2165. <nav>
  2166. <ul class="navL1">
  2167. <li class="inactive toggle">
  2168. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  2169. <ul class="navL2">
  2170. <li class="inactive">
  2171. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  2172. </li>
  2173. <li class="inactive">
  2174. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  2175. </li>
  2176. <li class="inactive">
  2177. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  2178. </li>
  2179. <li class="inactive">
  2180. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  2181. </li>
  2182. <li class="inactive">
  2183. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  2184. </li>
  2185. <li class="inactive">
  2186. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  2187. </li>
  2188. </ul>
  2189. </li>
  2190. <li class="inactive toggle">
  2191. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  2192. <ul class="navL2">
  2193. <li class="inactive">
  2194. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  2195. </li>
  2196. <li class="inactive">
  2197. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  2198. </li>
  2199. <li class="inactive">
  2200. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  2201. </li>
  2202. <li class="inactive toggle">
  2203. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  2204. <ul class="navL3">
  2205. <li class="inactive">
  2206. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  2207. </li>
  2208. <li class="inactive">
  2209. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  2210. </li>
  2211. <li class="inactive">
  2212. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  2213. </li>
  2214. <li class="inactive">
  2215. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  2216. </li>
  2217. <li class="inactive">
  2218. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  2219. </li>
  2220. </ul>
  2221. </li>
  2222. </ul>
  2223. </li>
  2224. <li class="inactive toggle">
  2225. <a href="javascript:void(0)" title="Programs">Programs</a>
  2226. <ul class="navL2">
  2227. <li class="inactive toggle">
  2228. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  2229. <ul class="navL3">
  2230. <li class="inactive">
  2231. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  2232. </li>
  2233. <li class="inactive">
  2234. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  2235. </li>
  2236. <li class="inactive">
  2237. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  2238. </li>
  2239. </ul>
  2240. </li>
  2241. <li class="inactive toggle">
  2242. <a href="javascript:void(0)" title="Students">Students</a>
  2243. <ul class="navL3">
  2244. <li class="inactive">
  2245. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  2246. </li>
  2247. <li class="inactive">
  2248. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  2249. </li>
  2250. </ul>
  2251. </li>
  2252. <li class="inactive toggle">
  2253. <a href="javascript:void(0)" title="Architects">Architects</a>
  2254. <ul class="navL3">
  2255. <li class="inactive">
  2256. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  2257. </li>
  2258. <li class="inactive">
  2259. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  2260. </li>
  2261. <li class="inactive">
  2262. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  2263. </li>
  2264. <li class="inactive">
  2265. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  2266. </li>
  2267. <li class="inactive">
  2268. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  2269. </li>
  2270. </ul>
  2271. </li>
  2272. <li class="inactive">
  2273. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  2274. </li>
  2275. <li class="inactive">
  2276. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  2277. </li>
  2278. <li class="inactive">
  2279. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  2280. </li>
  2281. <li class="inactive">
  2282. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  2283. </li>
  2284. </ul>
  2285. </li>
  2286. <li class="inactive toggle">
  2287. <a href="javascript:void(0)" title="Community">Community</a>
  2288. <ul class="navL2">
  2289. <li class="inactive">
  2290. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  2291. </li>
  2292. <li class="inactive">
  2293. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  2294. </li>
  2295. <li class="inactive">
  2296. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  2297. </li>
  2298. <li class="inactive">
  2299. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  2300. </li>
  2301. <li class="inactive">
  2302. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  2303. </li>
  2304. </ul>
  2305. </li>
  2306. <li class="inactive current toggle">
  2307. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  2308. <ul class="navL2">
  2309. <li class="inactive current">
  2310. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  2311. </li>
  2312. <li class="inactive">
  2313. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  2314. </li>
  2315. </ul>
  2316. </li>
  2317. <li class="inactive">
  2318. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  2319. </li>
  2320. </ul>
  2321. </nav>
  2322. </div>
  2323. </div>
  2324. </div>
  2325. <div class="right">
  2326. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  2327. <div class="SearchBox">
  2328. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  2329. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  2330. <div id="search-finder" class="search-finder"></div>
  2331. </button>
  2332. <button id="HeaderSearchButton" style="display:none"></button>
  2333. <div id="searchSplitter"></div>
  2334. <div id="searchCloseIcon" class="search-clear-x"></div>
  2335. <div id="searchTextContainer" style="width: 0;">
  2336. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  2337. </div>
  2338. </form>
  2339. </div>
  2340. </div>
  2341. </div>
  2342. </div>
  2343. </div>
  2344. </div>
  2345. </header>
  2346. </div>
  2347. <div class="printExportMenus ltr">
  2348. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fdn655038(d%3dprinter).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  2349. Export (<span class="count">0</span>)
  2350. </a>
  2351. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/dn655038(d=printer).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  2352. Print
  2353. </a>
  2354. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  2355. </a>
  2356. </div>
  2357. <div class="printExportMenus ltr">
  2358. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  2359. </div>
  2360. <div id="body" ms.pgarea="body">
  2361. <span id="tabletView_large"></span>
  2362. <span id="tabletView_small"></span>
  2363. <span id="mobileView"></span>
  2364. <div id="content" class="content">
  2365. <input type="hidden" id="printForPab" value="true">
  2366. <div xmlns="http://www.w3.org/1999/xhtml">
  2367. <div class="topic">
  2368. <h1 class="title">/CGTHREADS (Compiler Threads)</h1>
  2369. <div class="lw_vs">
  2370. <div id="curversion">
  2371. <strong>
  2372. Visual Studio 2015
  2373. </strong>
  2374. </div>
  2375. <div id="versionclick">
  2376. <div id="vsseperator" class="cl_lw_vs_seperator"></div>
  2377. <div>
  2378. <div>
  2379. <a id="vsLink" href="javascript:;">
  2380. Other Versions
  2381. </a>
  2382. </div>
  2383. <div class="cl_vs_arrow clip10x10">
  2384. <img class="cl_lw_vs_arrow" id="vsArrow" alt="" src="./Windows Kernel Development Articles (2016-03-30)_files/ImageSprite.png">
  2385. </div>
  2386. </div>
  2387. <ul id="vsPanel">
  2388. <li class="">
  2389. <a href="http://msdn.microsoft.com/en-us/library/dn655038(d=printer,v=vs.120).aspx">Visual Studio 2013 </a>
  2390. </li>
  2391. <li id="vsExpand">
  2392. <span class="breadcrumbEllipsis">
  2393. <a href="http://msdn.microsoft.com/#"></a>
  2394. </span>
  2395. </li>
  2396. </ul>
  2397. </div>
  2398. </div>
  2399. <div style="clear:both;"></div>
  2400. <div id="mainSection">
  2401. <div id="mainBody">&nbsp;<div class="introduction"><p>Sets the number of cl.exe threads to use for optimization and code generation when link-time code generation is specified.</p></div><div><h2 class="LW_CollapsibleArea_TitleDiv"><div><a href="javascript:void(0)" class="LW_CollapsibleArea_TitleAhref" title="Collapse" role="button"><span class="cl_CollapsibleArea_expanding LW_CollapsibleArea_Img"></span><span class="LW_CollapsibleArea_Title">Syntax</span></a><div id="Anchor_0" class="LW_CollapsibleArea_Anchor_Div"><a href="http://msdn.microsoft.com/en-us/library/dn655038(d=printer).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book#Anchor_0" class="LW_CollapsibleArea_Anchor_Img" title="Right-click to copy and share the link for this section"></a></div><div class="LW_CollapsibleArea_HrDiv"><hr class="LW_CollapsibleArea_Hr"></div></div></h2><div class="sectionblock">
  2402. <div id="code-snippet-1" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  2403. <div class="codeSnippetContainerTabs">
  2404. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  2405. <a></a>
  2406. </div>
  2407. </div>
  2408. <div class="codeSnippetContainerCodeContainer">
  2409. <div class="codeSnippetToolBar"></div>
  2410. <div class="codeSnippetContainerCode" dir="ltr">
  2411. <div style="color:Black;"><pre>/CGTHREADS:[1-8]
  2412. </pre></div>
  2413. </div>
  2414. </div>
  2415. </div>
  2416. </div></div><div><h2 class="LW_CollapsibleArea_TitleDiv"><div><a href="javascript:void(0)" class="LW_CollapsibleArea_TitleAhref" title="Collapse" role="button"><span class="cl_CollapsibleArea_expanding LW_CollapsibleArea_Img"></span><span class="LW_CollapsibleArea_Title">Arguments</span></a><div id="Anchor_1" class="LW_CollapsibleArea_Anchor_Div"><a href="http://msdn.microsoft.com/en-us/library/dn655038(d=printer).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book#Anchor_1" class="LW_CollapsibleArea_Anchor_Img" title="Right-click to copy and share the link for this section"></a></div><div class="LW_CollapsibleArea_HrDiv"><hr class="LW_CollapsibleArea_Hr"></div></div></h2><div class="sectionblock"><div class="section"><dl class="definitionTable"><dt>number</dt><dd><p>The maximum number of threads for cl.exe to use, in the range 1 to 8.</p></dd></dl></div></div></div><div><h2 class="LW_CollapsibleArea_TitleDiv"><div><a href="javascript:void(0)" class="LW_CollapsibleArea_TitleAhref" title="Collapse" role="button"><span class="cl_CollapsibleArea_expanding LW_CollapsibleArea_Img"></span><span class="LW_CollapsibleArea_Title">Remarks</span></a><div id="Anchor_2" class="LW_CollapsibleArea_Anchor_Div"><a href="http://msdn.microsoft.com/en-us/library/dn655038(d=printer).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book#Anchor_2" class="LW_CollapsibleArea_Anchor_Img" title="Right-click to copy and share the link for this section"></a></div><div class="LW_CollapsibleArea_HrDiv"><hr class="LW_CollapsibleArea_Hr"></div></div></h2><div class="sectionblock"><div class="section"><p>The <strong>/CGTHREADS</strong> option specifies the maximum number of threads cl.exe uses in parallel for the optimization and code-generation phases of compilation when link-time code generation (<a href="https://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx">/LTCG</a>) is specified. By default, cl.exe uses four threads, as if <strong>/CGTHREADS:4</strong> were specified. If more processor cores are available, a larger <em>number</em> value can improve build times. </p><p>Multiple levels of parallelism can be specified for a build. The msbuild.exe switch <strong>/maxcpucount</strong> specifies the number of MSBuild processes that can be run in parallel. The <a href="https://msdn.microsoft.com/en-us/library/bb385193.aspx">/MP (Build with Multiple Processes)</a> compiler flag specifies the number of cl.exe processes that simultaneously compile the source files. The <a href="https://msdn.microsoft.com/en-us/library/dn631956.aspx">/cgthreads</a> compiler option specifies the number of threads used by each cl.exe process. Because the processor can only run as many threads at the same time as there are processor cores, it's not useful to specify larger values for all of these options at the same time, and it can be counterproductive. For more information about how to build projects in parallel, see <a href="https://msdn.microsoft.com/en-us/library/bb651793.aspx">Building Multiple Projects in Parallel with MSBuild</a>.</p><div class="section" bookmarktitle="To set this linker option in the Visual Studio development environment"><h2 class="heading" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">To set this linker option in the Visual Studio development environment</h2><ol class="steps"><li class="step"><div class="section"><p>Open the project's <strong>Property Pages</strong> dialog box. For details, see <a href="https://msdn.microsoft.com/en-us/library/669zx6zc.aspx">Working with Project Properties</a>. </p></div></li><li class="step"><div class="section"><p>Select the <strong>Configuration Properties</strong>, <strong>Linker</strong> folder.</p></div></li><li class="step"><div class="section"><p>Select the <strong>Command Line</strong> property page.</p></div></li><li class="step"><div class="section"><p>Modify the <strong>Additional Options</strong> property to include <strong>/CGTHREADS:</strong><em>number</em>, where <em>number</em> is a value from 1 to 8, and then choose <strong>OK</strong>.</p></div></li></ol></div><div class="section" bookmarktitle="To set this linker option programmatically"><h2 class="heading" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">To set this linker option programmatically</h2><ul class="steps"><li class="step"><div class="section"><p>See <a href="https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vcprojectengine.vclinkertool.additionaloptions.aspx"><span xmlns="">AdditionalOptions</span></a>.</p></div></li></ul></div></div></div></div><div><h2 class="LW_CollapsibleArea_TitleDiv"><div><a href="javascript:void(0)" class="LW_CollapsibleArea_TitleAhref" title="Collapse" role="button"><span class="cl_CollapsibleArea_expanding LW_CollapsibleArea_Img"></span><span class="LW_CollapsibleArea_Title">See Also</span></a><div id="Anchor_3" class="LW_CollapsibleArea_Anchor_Div"><a href="http://msdn.microsoft.com/en-us/library/dn655038(d=printer).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book#Anchor_3" class="LW_CollapsibleArea_Anchor_Img" title="Right-click to copy and share the link for this section"></a></div><div class="LW_CollapsibleArea_HrDiv"><hr class="LW_CollapsibleArea_Hr"></div></div></h2><div class="sectionblock"><p><a href="https://msdn.microsoft.com/en-us/library/y0zzbyt4.aspx">Linker Options</a><br><a href="https://msdn.microsoft.com/en-us/library/wk97ab1b.aspx">Setting Linker Options</a><br></p></div></div></div>
  2417. </div>
  2418. </div>
  2419. </div>
  2420. </div>
  2421. </div>
  2422. <div class="clear"></div>
  2423. <input name="__RequestVerificationToken" type="hidden" value="DAizjTLHhhX_0EXGZkZw0UnlZOLlUsHTrS3ZIPTE5VLjjXcJlNGD7dbPEsPSckXxd3U64syDsRImRx8pCO14LDMvLr81">
  2424. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/dn655038(d=printer).aspx">
  2425. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/dn655038(d=printer).aspx">
  2426. <input id="isTopicRated" type="hidden" value="false">
  2427. <div id="lib-footer" ms.pgarea="body">
  2428. <link type="text/css" rel="stylesheet">
  2429. <div id="ux-footer" class="" style="" dir="ltr">
  2430. <div id="footerSock" class="librarySock both">
  2431. <div id="footerSockInner">
  2432. <a name="feedback"></a>
  2433. <div class="rating">
  2434. <div id="ratingSection1">
  2435. <div class="title">
  2436. Was this page helpful?
  2437. </div>
  2438. <div class="description">
  2439. Your feedback about this content is important.<br>Let us know what you think.
  2440. </div>
  2441. <div class="buttons">
  2442. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  2443. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  2444. </div>
  2445. <input id="ratingValue" type="hidden" value="">
  2446. </div>
  2447. <div id="ratingSection2">
  2448. <div class="title left">
  2449. Additional feedback?
  2450. </div>
  2451. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  2452. <div class="right">
  2453. <div class="counter">
  2454. <span id="feedbackTextCounter">1500</span> characters remaining
  2455. </div>
  2456. <div class="buttons">
  2457. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  2458. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  2459. </div>
  2460. </div>
  2461. </div>
  2462. <div id="ratingSection3">
  2463. <div class="title">
  2464. Thank you!
  2465. </div>
  2466. <div class="description">
  2467. We appreciate your feedback.
  2468. </div>
  2469. </div>
  2470. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  2471. </div>
  2472. <div class="userVoice">
  2473. <div class="title">
  2474. Help us improve MSDN.
  2475. </div>
  2476. <div class="description">
  2477. Visit our UserVoice Page to submit and vote on ideas!
  2478. </div>
  2479. <div class="buttons">
  2480. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  2481. </div>
  2482. </div>
  2483. <div class="clear"></div>
  2484. </div>
  2485. </div>
  2486. <footer class="top">
  2487. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  2488. <div class="linkList">
  2489. <div class="linkListTitle">Dev centers</div>
  2490. <ul class="links">
  2491. <li>
  2492. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  2493. </li>
  2494. <li>
  2495. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  2496. </li>
  2497. <li>
  2498. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  2499. </li>
  2500. <li>
  2501. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  2502. </li>
  2503. <li>
  2504. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  2505. </li>
  2506. </ul>
  2507. </div>
  2508. </div>
  2509. <div id="rightLinks">
  2510. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  2511. <div class="linkList">
  2512. <div class="linkListTitle">Learning resources</div>
  2513. <ul class="links">
  2514. <li>
  2515. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  2516. </li>
  2517. <li>
  2518. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  2519. </li>
  2520. <li>
  2521. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  2522. </li>
  2523. </ul>
  2524. </div>
  2525. </div>
  2526. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  2527. <div class="linkList">
  2528. <div class="linkListTitle">Community</div>
  2529. <ul class="links">
  2530. <li>
  2531. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  2532. </li>
  2533. <li>
  2534. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  2535. </li>
  2536. <li>
  2537. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  2538. </li>
  2539. </ul>
  2540. </div>
  2541. </div>
  2542. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  2543. <div class="linkList">
  2544. <div class="linkListTitle">Support</div>
  2545. <ul class="links">
  2546. <li>
  2547. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  2548. </li>
  2549. </ul>
  2550. </div>
  2551. </div>
  2552. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  2553. <div class="linkList">
  2554. <div class="linkListTitle">Programs</div>
  2555. <ul class="links">
  2556. <li>
  2557. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  2558. </li>
  2559. <li>
  2560. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  2561. </li>
  2562. <li>
  2563. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  2564. </li>
  2565. </ul>
  2566. </div>
  2567. </div>
  2568. </div>
  2569. </footer>
  2570. <footer class="bottom">
  2571. <span class="localeContainer">
  2572. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  2573. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fdn655038(d%3dprinter).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  2574. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  2575. </form>
  2576. </span>
  2577. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  2578. <div class="linkList">
  2579. <ul class="links horizontal">
  2580. <li>
  2581. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  2582. </li>
  2583. <li>
  2584. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  2585. </li>
  2586. <li>
  2587. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  2588. </li>
  2589. <li>
  2590. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  2591. </li>
  2592. </ul>
  2593. </div>
  2594. </div>
  2595. <span class="logoLegal">
  2596. <span class="logo"></span>
  2597. <span class="copyright">© 2016 Microsoft</span>
  2598. </span>
  2599. </footer>
  2600. </div>
  2601. </div>
  2602. <div class="footerPrintView">
  2603. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  2604. </div>
  2605. <input id="tocPaddingPerLevel" type="hidden" value="17">
  2606. <input id="MtpsDevice" type="hidden" value="Printer">
  2607. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  2608. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  2609. <div id="globalRequestVerification">
  2610. <input name="__RequestVerificationToken" type="hidden" value="uI0WDaf-NkEGnJveLLErvIEF5WuLpQI0UXDaMrMC_8-dFZ3tiFi_R459UGQ1Hc5rVD_VTV31rRJvSvxWYmMYSg6fXx81">
  2611. </div>
  2612. </div>
  2613. <script type="text/javascript" class="mtps-injected">
  2614. /*<![CDATA[*/
  2615. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  2616. MTPS.injectScripts([
  2617. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  2618. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/dn655038(d=printer,l=en-us,v=vs.140).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_devtools_lang\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  2619. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  2620. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=F664E7A9238E1F224D24BE082A3197DF" },
  2621. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  2622. { url: "https://i2-msdn.sec.s-msft.com/Areas/Library/Themes/Base/Content/PrintExportButton.js" },
  2623. { txt: "MTPS = window.MTPS || {}; MTPS.LocalizedStrings = window.MTPS.LocalizedStrings || {}; MTPS.LocalizedStrings.ExpandButtonTooltip = \u0027Expand\u0027; MTPS.LocalizedStrings.CollapseButtonTooltip = \u0027Collapse\u0027; MTPS.LocalizedStrings.EnhancedExpandTooltip = \u0027Click to expand. Double-click to expand all.\u0027; MTPS.LocalizedStrings.EnhancedCollapseTooltip = \u0027Click to collapse. Double-click to collapse all.\u0027; MTPS.LocalizedStrings.ExpandAllButtonTooltip = \u0027Expand All\u0027; MTPS.LocalizedStrings.CollapseAllButtonTooltip = \u0027Collapse All\u0027;" },
  2624. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Toc_Fixed,0:CodeSnippet,0:TopicNotInScope,0:CollapsibleArea,0:VersionSelector,0:SurveyBroker;/Areas/Epx/Content/Scripts:0\u0026amp;hashKey=8DC15B34541884CA29DF06F58B5CA754\u0026amp;v=F664E7A9238E1F224D24BE082A3197DF" },
  2625. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  2626. ]);
  2627. /*]]>*/
  2628. </script>
  2629. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined(4).css">
  2630. <div id="page">
  2631. <link type="text/css" rel="stylesheet">
  2632. <input type="hidden" id="isHeaderBleeding" value="true">
  2633. <div id="ux-header" dir="ltr" class="ltr msdn">
  2634. <header>
  2635. <span id="singleCol"></span>
  2636. <span id="doubleCol"></span>
  2637. <span id="isMobile"></span>
  2638. <div>
  2639. <div class="row topRow">
  2640. <div class="top">
  2641. <div class="left">
  2642. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  2643. <div id="msft-logo" class="msft-logo"></div>
  2644. </a>
  2645. <div class="GrayPipe"></div>
  2646. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  2647. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  2648. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  2649. </div>
  2650. <div class="right">
  2651. <div id="signIn">
  2652. <div class="profileImage"></div>
  2653. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376399&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2ft6tay6cz%2528d%3dprinter%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  2654. <div class="auxNav">
  2655. <div>
  2656. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  2657. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  2658. </div>
  2659. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  2660. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  2661. </div>
  2662. </div>
  2663. <div>
  2664. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  2665. <div class="linkList">
  2666. <ul class="links horizontal">
  2667. <li>
  2668. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  2669. </li>
  2670. <li>
  2671. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  2672. </li>
  2673. <li>
  2674. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  2675. </li>
  2676. </ul>
  2677. </div>
  2678. </div>
  2679. </div>
  2680. </div>
  2681. </div>
  2682. </div>
  2683. </div>
  2684. <div class="row middleRow">
  2685. <div class="expandTop">
  2686. <div class="left"></div>
  2687. <div class="right"></div>
  2688. </div>
  2689. </div>
  2690. </div>
  2691. <div id="buttomRowWrapper" class="bg_default">
  2692. <div class="row buttomRow bg_default">
  2693. <div class="bottom">
  2694. <div class="left">
  2695. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  2696. <div id="drawer">
  2697. <div class="toc">
  2698. <nav>
  2699. <ul class="navL1">
  2700. <li class="inactive toggle">
  2701. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  2702. <ul class="navL2">
  2703. <li class="inactive">
  2704. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  2705. </li>
  2706. <li class="inactive">
  2707. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  2708. </li>
  2709. <li class="inactive">
  2710. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  2711. </li>
  2712. <li class="inactive">
  2713. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  2714. </li>
  2715. <li class="inactive">
  2716. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  2717. </li>
  2718. <li class="inactive">
  2719. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  2720. </li>
  2721. </ul>
  2722. </li>
  2723. <li class="inactive toggle">
  2724. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  2725. <ul class="navL2">
  2726. <li class="inactive">
  2727. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  2728. </li>
  2729. <li class="inactive">
  2730. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  2731. </li>
  2732. <li class="inactive">
  2733. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  2734. </li>
  2735. <li class="inactive toggle">
  2736. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  2737. <ul class="navL3">
  2738. <li class="inactive">
  2739. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  2740. </li>
  2741. <li class="inactive">
  2742. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  2743. </li>
  2744. <li class="inactive">
  2745. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  2746. </li>
  2747. <li class="inactive">
  2748. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  2749. </li>
  2750. <li class="inactive">
  2751. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  2752. </li>
  2753. </ul>
  2754. </li>
  2755. </ul>
  2756. </li>
  2757. <li class="inactive toggle">
  2758. <a href="javascript:void(0)" title="Programs">Programs</a>
  2759. <ul class="navL2">
  2760. <li class="inactive toggle">
  2761. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  2762. <ul class="navL3">
  2763. <li class="inactive">
  2764. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  2765. </li>
  2766. <li class="inactive">
  2767. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  2768. </li>
  2769. <li class="inactive">
  2770. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  2771. </li>
  2772. </ul>
  2773. </li>
  2774. <li class="inactive toggle">
  2775. <a href="javascript:void(0)" title="Students">Students</a>
  2776. <ul class="navL3">
  2777. <li class="inactive">
  2778. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  2779. </li>
  2780. <li class="inactive">
  2781. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  2782. </li>
  2783. </ul>
  2784. </li>
  2785. <li class="inactive toggle">
  2786. <a href="javascript:void(0)" title="Architects">Architects</a>
  2787. <ul class="navL3">
  2788. <li class="inactive">
  2789. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  2790. </li>
  2791. <li class="inactive">
  2792. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  2793. </li>
  2794. <li class="inactive">
  2795. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  2796. </li>
  2797. <li class="inactive">
  2798. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  2799. </li>
  2800. <li class="inactive">
  2801. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  2802. </li>
  2803. </ul>
  2804. </li>
  2805. <li class="inactive">
  2806. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  2807. </li>
  2808. <li class="inactive">
  2809. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  2810. </li>
  2811. <li class="inactive">
  2812. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  2813. </li>
  2814. <li class="inactive">
  2815. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  2816. </li>
  2817. </ul>
  2818. </li>
  2819. <li class="inactive toggle">
  2820. <a href="javascript:void(0)" title="Community">Community</a>
  2821. <ul class="navL2">
  2822. <li class="inactive">
  2823. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  2824. </li>
  2825. <li class="inactive">
  2826. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  2827. </li>
  2828. <li class="inactive">
  2829. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  2830. </li>
  2831. <li class="inactive">
  2832. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  2833. </li>
  2834. <li class="inactive">
  2835. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  2836. </li>
  2837. </ul>
  2838. </li>
  2839. <li class="inactive current toggle">
  2840. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  2841. <ul class="navL2">
  2842. <li class="inactive current">
  2843. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  2844. </li>
  2845. <li class="inactive">
  2846. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  2847. </li>
  2848. </ul>
  2849. </li>
  2850. <li class="inactive">
  2851. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  2852. </li>
  2853. </ul>
  2854. </nav>
  2855. </div>
  2856. </div>
  2857. </div>
  2858. <div class="right">
  2859. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  2860. <div class="SearchBox">
  2861. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  2862. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  2863. <div id="search-finder" class="search-finder"></div>
  2864. </button>
  2865. <button id="HeaderSearchButton" style="display:none"></button>
  2866. <div id="searchSplitter"></div>
  2867. <div id="searchCloseIcon" class="search-clear-x"></div>
  2868. <div id="searchTextContainer" style="width: 0;">
  2869. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  2870. </div>
  2871. </form>
  2872. </div>
  2873. </div>
  2874. </div>
  2875. </div>
  2876. </div>
  2877. </div>
  2878. </header>
  2879. </div>
  2880. <div class="printExportMenus ltr">
  2881. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2ft6tay6cz(d%3dprinter).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  2882. Export (<span class="count">0</span>)
  2883. </a>
  2884. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/t6tay6cz(d=printer).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  2885. Print
  2886. </a>
  2887. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  2888. </a>
  2889. </div>
  2890. <div class="printExportMenus ltr">
  2891. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  2892. </div>
  2893. <div id="body" ms.pgarea="body">
  2894. <span id="tabletView_large"></span>
  2895. <span id="tabletView_small"></span>
  2896. <span id="mobileView"></span>
  2897. <div id="content" class="content">
  2898. <input type="hidden" id="printForPab" value="true">
  2899. <div xmlns="http://www.w3.org/1999/xhtml">
  2900. <div class="topic">
  2901. <h1 class="title">Getting Started (Debug Interface Access SDK)</h1>
  2902. <div class="lw_vs">
  2903. <div id="curversion">
  2904. <strong>
  2905. Visual Studio 2015
  2906. </strong>
  2907. </div>
  2908. <div id="versionclick">
  2909. <div id="vsseperator" class="cl_lw_vs_seperator"></div>
  2910. <div>
  2911. <div>
  2912. <a id="vsLink" href="javascript:;">
  2913. Other Versions
  2914. </a>
  2915. </div>
  2916. <div class="cl_vs_arrow clip10x10">
  2917. <img class="cl_lw_vs_arrow" id="vsArrow" alt="" src="./Windows Kernel Development Articles (2016-03-30)_files/ImageSprite.png">
  2918. </div>
  2919. </div>
  2920. <ul id="vsPanel">
  2921. <li class="">
  2922. <a href="http://msdn.microsoft.com/en-us/library/t6tay6cz(d=printer,v=vs.120).aspx">Visual Studio 2013 </a>
  2923. </li>
  2924. <li class="">
  2925. <a href="http://msdn.microsoft.com/en-us/library/t6tay6cz(d=printer,v=vs.110).aspx">Visual Studio 2012</a>
  2926. </li>
  2927. <li class="">
  2928. <a href="http://msdn.microsoft.com/en-us/library/t6tay6cz(d=printer,v=vs.100).aspx">Visual Studio 2010</a>
  2929. </li>
  2930. <li class="archived">
  2931. <a href="http://msdn.microsoft.com/en-us/library/t6tay6cz(d=printer,v=vs.90).aspx">Visual Studio 2008</a>
  2932. </li>
  2933. <li class="archived">
  2934. <a href="http://msdn.microsoft.com/en-us/library/t6tay6cz(d=printer,v=vs.80).aspx">Visual Studio 2005</a>
  2935. </li>
  2936. <li class="archived">
  2937. <a href="http://msdn.microsoft.com/en-us/library/t6tay6cz(d=printer,v=vs.71).aspx">Visual Studio .NET 2003</a>
  2938. </li>
  2939. <li id="vsExpand">
  2940. <span class="breadcrumbEllipsis">
  2941. <a href="http://msdn.microsoft.com/#"></a>
  2942. </span>
  2943. </li>
  2944. </ul>
  2945. </div>
  2946. </div>
  2947. <div style="clear:both;"></div>
  2948. <div id="mainSection">
  2949. <div id="mainBody">&nbsp;<div class="introduction"><p>The Debug Interface Access (DIA) SDK supplies you with instructional documentation and a sample that illustrates how to use the DIA API. Use the interfaces and methods in the DIA SDK to develop custom applications that open the .pdb and .dbg files and search their content for symbols, values, attributes, addresses, and other debugging information. This SDK also provides reference tables for the properties associated with symbols found in C++ applications.</p><p>To best use the DIA SDK, you should be familiar with the following: </p><ul class="unordered"><li><p>C++ programming language</p></li><li><p>COM programming</p></li><li><p>Visual Studio integrated development environment (IDE) for compiling the samples</p></li></ul><p>The DIA SDK is normally installed with Visual Studio and its default location is <em>[drive]</em>\Program Files\Microsoft Visual Studio 9.0\DIA SDK. As part of the installation, the msdia90.dll, which implements the DIA SDK, is automatically registered so all that you need to do to use it is to include <span class="code">dia2.h</span> in your program and link to <span class="code">diaguids.lib</span>.</p><p>Header: include\dia2.h</p><p>Library: lib\diaguids.lib</p><p>DLL: bin\msdia80.dll</p><p>IDL: idl\dia2.idl</p></div><div><h2 class="LW_CollapsibleArea_TitleDiv"><div><a href="javascript:void(0)" class="LW_CollapsibleArea_TitleAhref" title="Collapse" role="button"><span class="cl_CollapsibleArea_expanding LW_CollapsibleArea_Img"></span><span class="LW_CollapsibleArea_Title">In This Section</span></a><div id="Anchor_0" class="LW_CollapsibleArea_Anchor_Div"><a href="http://msdn.microsoft.com/en-us/library/t6tay6cz(d=printer).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book#Anchor_0" class="LW_CollapsibleArea_Anchor_Img" title="Right-click to copy and share the link for this section"></a></div><div class="LW_CollapsibleArea_HrDiv"><hr class="LW_CollapsibleArea_Hr"></div></div></h2><div class="sectionblock"><div class="section"><dl class="definitionTable"><dt><a href="https://msdn.microsoft.com/en-us/library/dkx24d4d.aspx">Overview (Debug Interface Access SDK)</a></dt><dd><p>Reviews the basic architecture of DIA.</p></dd><dt><a href="https://msdn.microsoft.com/en-us/library/eee38t3h.aspx">Querying the .Pdb File</a></dt><dd><p>Provides step-by-step instructions on how to use the DIA API to query a .pdb file.</p></dd></dl></div></div></div><div><h2 class="LW_CollapsibleArea_TitleDiv"><div><a href="javascript:void(0)" class="LW_CollapsibleArea_TitleAhref" title="Collapse" role="button"><span class="cl_CollapsibleArea_expanding LW_CollapsibleArea_Img"></span><span class="LW_CollapsibleArea_Title">See Also</span></a><div id="Anchor_1" class="LW_CollapsibleArea_Anchor_Div"><a href="http://msdn.microsoft.com/en-us/library/t6tay6cz(d=printer).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book#Anchor_1" class="LW_CollapsibleArea_Anchor_Img" title="Right-click to copy and share the link for this section"></a></div><div class="LW_CollapsibleArea_HrDiv"><hr class="LW_CollapsibleArea_Hr"></div></div></h2><div class="sectionblock"><p><a href="https://msdn.microsoft.com/en-us/library/x93ctkx8.aspx">Debug Interface Access SDK</a><br></p></div></div></div>
  2950. </div>
  2951. </div>
  2952. </div>
  2953. </div>
  2954. </div>
  2955. <div class="clear"></div>
  2956. <input name="__RequestVerificationToken" type="hidden" value="fC5irECx0_9LBUGAQFUsV3BZh0ogC461uz755VhjPUWni-F__CXnBpmm4K4gxHF0e64Ojkr8wg-Rk0KvNk5qaSSBH_k1">
  2957. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/t6tay6cz(d=printer).aspx">
  2958. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/t6tay6cz(d=printer).aspx">
  2959. <input id="isTopicRated" type="hidden" value="false">
  2960. <div id="lib-footer" ms.pgarea="body">
  2961. <link type="text/css" rel="stylesheet">
  2962. <div id="ux-footer" class="" style="" dir="ltr">
  2963. <div id="footerSock" class="librarySock both">
  2964. <div id="footerSockInner">
  2965. <a name="feedback"></a>
  2966. <div class="rating">
  2967. <div id="ratingSection1">
  2968. <div class="title">
  2969. Was this page helpful?
  2970. </div>
  2971. <div class="description">
  2972. Your feedback about this content is important.<br>Let us know what you think.
  2973. </div>
  2974. <div class="buttons">
  2975. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  2976. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  2977. </div>
  2978. <input id="ratingValue" type="hidden" value="">
  2979. </div>
  2980. <div id="ratingSection2">
  2981. <div class="title left">
  2982. Additional feedback?
  2983. </div>
  2984. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  2985. <div class="right">
  2986. <div class="counter">
  2987. <span id="feedbackTextCounter">1500</span> characters remaining
  2988. </div>
  2989. <div class="buttons">
  2990. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  2991. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  2992. </div>
  2993. </div>
  2994. </div>
  2995. <div id="ratingSection3">
  2996. <div class="title">
  2997. Thank you!
  2998. </div>
  2999. <div class="description">
  3000. We appreciate your feedback.
  3001. </div>
  3002. </div>
  3003. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  3004. </div>
  3005. <div class="userVoice">
  3006. <div class="title">
  3007. Help us improve MSDN.
  3008. </div>
  3009. <div class="description">
  3010. Visit our UserVoice Page to submit and vote on ideas!
  3011. </div>
  3012. <div class="buttons">
  3013. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  3014. </div>
  3015. </div>
  3016. <div class="clear"></div>
  3017. </div>
  3018. </div>
  3019. <footer class="top">
  3020. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  3021. <div class="linkList">
  3022. <div class="linkListTitle">Dev centers</div>
  3023. <ul class="links">
  3024. <li>
  3025. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  3026. </li>
  3027. <li>
  3028. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  3029. </li>
  3030. <li>
  3031. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  3032. </li>
  3033. <li>
  3034. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  3035. </li>
  3036. <li>
  3037. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  3038. </li>
  3039. </ul>
  3040. </div>
  3041. </div>
  3042. <div id="rightLinks">
  3043. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  3044. <div class="linkList">
  3045. <div class="linkListTitle">Learning resources</div>
  3046. <ul class="links">
  3047. <li>
  3048. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  3049. </li>
  3050. <li>
  3051. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  3052. </li>
  3053. <li>
  3054. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  3055. </li>
  3056. </ul>
  3057. </div>
  3058. </div>
  3059. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  3060. <div class="linkList">
  3061. <div class="linkListTitle">Community</div>
  3062. <ul class="links">
  3063. <li>
  3064. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  3065. </li>
  3066. <li>
  3067. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  3068. </li>
  3069. <li>
  3070. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  3071. </li>
  3072. </ul>
  3073. </div>
  3074. </div>
  3075. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  3076. <div class="linkList">
  3077. <div class="linkListTitle">Support</div>
  3078. <ul class="links">
  3079. <li>
  3080. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  3081. </li>
  3082. </ul>
  3083. </div>
  3084. </div>
  3085. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  3086. <div class="linkList">
  3087. <div class="linkListTitle">Programs</div>
  3088. <ul class="links">
  3089. <li>
  3090. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  3091. </li>
  3092. <li>
  3093. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  3094. </li>
  3095. <li>
  3096. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  3097. </li>
  3098. </ul>
  3099. </div>
  3100. </div>
  3101. </div>
  3102. </footer>
  3103. <footer class="bottom">
  3104. <span class="localeContainer">
  3105. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  3106. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2ft6tay6cz(d%3dprinter).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  3107. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  3108. </form>
  3109. </span>
  3110. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  3111. <div class="linkList">
  3112. <ul class="links horizontal">
  3113. <li>
  3114. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  3115. </li>
  3116. <li>
  3117. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  3118. </li>
  3119. <li>
  3120. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  3121. </li>
  3122. <li>
  3123. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  3124. </li>
  3125. </ul>
  3126. </div>
  3127. </div>
  3128. <span class="logoLegal">
  3129. <span class="logo"></span>
  3130. <span class="copyright">© 2016 Microsoft</span>
  3131. </span>
  3132. </footer>
  3133. </div>
  3134. </div>
  3135. <div class="footerPrintView">
  3136. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  3137. </div>
  3138. <input id="tocPaddingPerLevel" type="hidden" value="17">
  3139. <input id="MtpsDevice" type="hidden" value="Printer">
  3140. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  3141. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  3142. <div id="globalRequestVerification">
  3143. <input name="__RequestVerificationToken" type="hidden" value="UJW6uluSJzJMbANdA-5ZQj5mmW0SbNy_FeT0JzRkocBaC3eMRwF_Vbomc7i8wzOu9_hQYcHq682nphcgnQZ6VAca0V01">
  3144. </div>
  3145. </div>
  3146. <script type="text/javascript" class="mtps-injected">
  3147. /*<![CDATA[*/
  3148. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  3149. MTPS.injectScripts([
  3150. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  3151. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/t6tay6cz(d=printer,l=en-us,v=vs.140).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_devtools_lang\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  3152. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  3153. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=F664E7A9238E1F224D24BE082A3197DF" },
  3154. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  3155. { url: "https://i2-msdn.sec.s-msft.com/Areas/Library/Themes/Base/Content/PrintExportButton.js" },
  3156. { txt: "MTPS = window.MTPS || {}; MTPS.LocalizedStrings = window.MTPS.LocalizedStrings || {}; MTPS.LocalizedStrings.ExpandButtonTooltip = \u0027Expand\u0027; MTPS.LocalizedStrings.CollapseButtonTooltip = \u0027Collapse\u0027; MTPS.LocalizedStrings.EnhancedExpandTooltip = \u0027Click to expand. Double-click to expand all.\u0027; MTPS.LocalizedStrings.EnhancedCollapseTooltip = \u0027Click to collapse. Double-click to collapse all.\u0027; MTPS.LocalizedStrings.ExpandAllButtonTooltip = \u0027Expand All\u0027; MTPS.LocalizedStrings.CollapseAllButtonTooltip = \u0027Collapse All\u0027;" },
  3157. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Toc_Fixed,0:CodeSnippet,0:TopicNotInScope,0:CollapsibleArea,0:VersionSelector,0:SurveyBroker;/Areas/Epx/Content/Scripts:0\u0026amp;hashKey=8DC15B34541884CA29DF06F58B5CA754\u0026amp;v=F664E7A9238E1F224D24BE082A3197DF" },
  3158. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  3159. ]);
  3160. /*]]>*/
  3161. </script>
  3162. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  3163. <div id="page">
  3164. <link type="text/css" rel="stylesheet">
  3165. <input type="hidden" id="isHeaderBleeding" value="true">
  3166. <div id="ux-header" dir="ltr" class="ltr msdn">
  3167. <header>
  3168. <span id="singleCol"></span>
  3169. <span id="doubleCol"></span>
  3170. <span id="isMobile"></span>
  3171. <div>
  3172. <div class="row topRow">
  3173. <div class="top">
  3174. <div class="left">
  3175. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  3176. <div id="msft-logo" class="msft-logo"></div>
  3177. </a>
  3178. <div class="GrayPipe"></div>
  3179. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  3180. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  3181. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  3182. </div>
  3183. <div class="right">
  3184. <div id="signIn">
  3185. <div class="profileImage"></div>
  3186. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376401&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554731%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  3187. <div class="auxNav">
  3188. <div>
  3189. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  3190. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  3191. </div>
  3192. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  3193. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  3194. </div>
  3195. </div>
  3196. <div>
  3197. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  3198. <div class="linkList">
  3199. <ul class="links horizontal">
  3200. <li>
  3201. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  3202. </li>
  3203. <li>
  3204. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  3205. </li>
  3206. <li>
  3207. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  3208. </li>
  3209. </ul>
  3210. </div>
  3211. </div>
  3212. </div>
  3213. </div>
  3214. </div>
  3215. </div>
  3216. </div>
  3217. <div class="row middleRow">
  3218. <div class="expandTop">
  3219. <div class="left"></div>
  3220. <div class="right"></div>
  3221. </div>
  3222. </div>
  3223. </div>
  3224. <div id="buttomRowWrapper" class="bg_default">
  3225. <div class="row buttomRow bg_default">
  3226. <div class="bottom">
  3227. <div class="left">
  3228. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  3229. <div id="drawer">
  3230. <div class="toc">
  3231. <nav>
  3232. <ul class="navL1">
  3233. <li class="inactive toggle">
  3234. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  3235. <ul class="navL2">
  3236. <li class="inactive">
  3237. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  3238. </li>
  3239. <li class="inactive">
  3240. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  3241. </li>
  3242. <li class="inactive">
  3243. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  3244. </li>
  3245. <li class="inactive">
  3246. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  3247. </li>
  3248. <li class="inactive">
  3249. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  3250. </li>
  3251. <li class="inactive">
  3252. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  3253. </li>
  3254. </ul>
  3255. </li>
  3256. <li class="inactive toggle">
  3257. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  3258. <ul class="navL2">
  3259. <li class="inactive">
  3260. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  3261. </li>
  3262. <li class="inactive">
  3263. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  3264. </li>
  3265. <li class="inactive">
  3266. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  3267. </li>
  3268. <li class="inactive toggle">
  3269. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  3270. <ul class="navL3">
  3271. <li class="inactive">
  3272. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  3273. </li>
  3274. <li class="inactive">
  3275. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  3276. </li>
  3277. <li class="inactive">
  3278. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  3279. </li>
  3280. <li class="inactive">
  3281. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  3282. </li>
  3283. <li class="inactive">
  3284. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  3285. </li>
  3286. </ul>
  3287. </li>
  3288. </ul>
  3289. </li>
  3290. <li class="inactive toggle">
  3291. <a href="javascript:void(0)" title="Programs">Programs</a>
  3292. <ul class="navL2">
  3293. <li class="inactive toggle">
  3294. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  3295. <ul class="navL3">
  3296. <li class="inactive">
  3297. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  3298. </li>
  3299. <li class="inactive">
  3300. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  3301. </li>
  3302. <li class="inactive">
  3303. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  3304. </li>
  3305. </ul>
  3306. </li>
  3307. <li class="inactive toggle">
  3308. <a href="javascript:void(0)" title="Students">Students</a>
  3309. <ul class="navL3">
  3310. <li class="inactive">
  3311. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  3312. </li>
  3313. <li class="inactive">
  3314. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  3315. </li>
  3316. </ul>
  3317. </li>
  3318. <li class="inactive toggle">
  3319. <a href="javascript:void(0)" title="Architects">Architects</a>
  3320. <ul class="navL3">
  3321. <li class="inactive">
  3322. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  3323. </li>
  3324. <li class="inactive">
  3325. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  3326. </li>
  3327. <li class="inactive">
  3328. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  3329. </li>
  3330. <li class="inactive">
  3331. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  3332. </li>
  3333. <li class="inactive">
  3334. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  3335. </li>
  3336. </ul>
  3337. </li>
  3338. <li class="inactive">
  3339. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  3340. </li>
  3341. <li class="inactive">
  3342. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  3343. </li>
  3344. <li class="inactive">
  3345. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  3346. </li>
  3347. <li class="inactive">
  3348. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  3349. </li>
  3350. </ul>
  3351. </li>
  3352. <li class="inactive toggle">
  3353. <a href="javascript:void(0)" title="Community">Community</a>
  3354. <ul class="navL2">
  3355. <li class="inactive">
  3356. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  3357. </li>
  3358. <li class="inactive">
  3359. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  3360. </li>
  3361. <li class="inactive">
  3362. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  3363. </li>
  3364. <li class="inactive">
  3365. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  3366. </li>
  3367. <li class="inactive">
  3368. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  3369. </li>
  3370. </ul>
  3371. </li>
  3372. <li class="inactive current toggle">
  3373. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  3374. <ul class="navL2">
  3375. <li class="inactive current">
  3376. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  3377. </li>
  3378. <li class="inactive">
  3379. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  3380. </li>
  3381. </ul>
  3382. </li>
  3383. <li class="inactive">
  3384. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  3385. </li>
  3386. </ul>
  3387. </nav>
  3388. </div>
  3389. </div>
  3390. </div>
  3391. <div class="right">
  3392. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  3393. <div class="SearchBox">
  3394. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  3395. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  3396. <div id="search-finder" class="search-finder"></div>
  3397. </button>
  3398. <button id="HeaderSearchButton" style="display:none"></button>
  3399. <div id="searchSplitter"></div>
  3400. <div id="searchCloseIcon" class="search-clear-x"></div>
  3401. <div id="searchTextContainer" style="width: 0;">
  3402. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  3403. </div>
  3404. </form>
  3405. </div>
  3406. </div>
  3407. </div>
  3408. </div>
  3409. </div>
  3410. </div>
  3411. </header>
  3412. </div>
  3413. <div class="printExportMenus ltr">
  3414. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fff554731(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  3415. Export (<span class="count">0</span>)
  3416. </a>
  3417. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/ff554731(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  3418. Print
  3419. </a>
  3420. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  3421. </a>
  3422. </div>
  3423. <div class="printExportMenus ltr">
  3424. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  3425. </div>
  3426. <div id="body" ms.pgarea="body">
  3427. <span id="tabletView_large"></span>
  3428. <span id="tabletView_small"></span>
  3429. <span id="mobileView"></span>
  3430. <div id="content" class="content">
  3431. <input type="hidden" id="printForPab" value="true">
  3432. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  3433. <h1 class="title">Concepts for all driver developers</h1>
  3434. <div id="mainSection">
  3435. <div class="clsServerSDKContent">
  3436. </div>
  3437. <p>In this section:</p>
  3438. <ul>
  3439. <li>
  3440. <a href="https://msdn.microsoft.com/en-us/library/ff554836(v=vs.85).aspx">User mode and kernel mode</a>
  3441. </li>
  3442. <li>
  3443. <a href="https://msdn.microsoft.com/en-us/library/hh439648(v=vs.85).aspx">Virtual address spaces</a>
  3444. </li>
  3445. <li>
  3446. <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a>
  3447. </li>
  3448. <li>
  3449. <a href="https://msdn.microsoft.com/en-us/library/hh439638(v=vs.85).aspx">I/O request packets</a>
  3450. </li>
  3451. <li>
  3452. <a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx">Driver stacks</a>
  3453. </li>
  3454. <li>
  3455. <a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx">Minidrivers and driver pairs</a>
  3456. </li>
  3457. <li>
  3458. <a href="https://msdn.microsoft.com/en-us/library/ff554695(v=vs.85).aspx">Header files in the Windows Driver Kit</a>
  3459. </li>
  3460. <li>
  3461. <a href="https://msdn.microsoft.com/en-us/library/ff554887(v=vs.85).aspx">Writing drivers for different versions of Windows</a>
  3462. </li>
  3463. </ul>
  3464. <p>&nbsp;</p>
  3465. <p>&nbsp;</p>
  3466. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Concepts%20%20for%20all%20driver%20developers%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  3467. </div>
  3468. </div>
  3469. </div>
  3470. </div>
  3471. <div class="clear"></div>
  3472. <input name="__RequestVerificationToken" type="hidden" value="t76Kx9in0yOgfbe6qotdxH_Nw5Qf3MT8lt9pt9EhFOUvN8v8YOkSM6LEHVtvd99rZgIRQrA9ilOAqonMlnQKSdUP9RU1">
  3473. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/ff554731(d=printer,v=vs.85).aspx">
  3474. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/ff554731(d=printer,v=vs.85).aspx">
  3475. <input id="isTopicRated" type="hidden" value="false">
  3476. <div id="lib-footer" ms.pgarea="body">
  3477. <link type="text/css" rel="stylesheet">
  3478. <div id="ux-footer" class="" style="" dir="ltr">
  3479. <div id="footerSock" class="librarySock both">
  3480. <div id="footerSockInner">
  3481. <a name="feedback"></a>
  3482. <div class="rating">
  3483. <div id="ratingSection1">
  3484. <div class="title">
  3485. Was this page helpful?
  3486. </div>
  3487. <div class="description">
  3488. Your feedback about this content is important.<br>Let us know what you think.
  3489. </div>
  3490. <div class="buttons">
  3491. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  3492. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  3493. </div>
  3494. <input id="ratingValue" type="hidden" value="">
  3495. </div>
  3496. <div id="ratingSection2">
  3497. <div class="title left">
  3498. Additional feedback?
  3499. </div>
  3500. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  3501. <div class="right">
  3502. <div class="counter">
  3503. <span id="feedbackTextCounter">1500</span> characters remaining
  3504. </div>
  3505. <div class="buttons">
  3506. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  3507. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  3508. </div>
  3509. </div>
  3510. </div>
  3511. <div id="ratingSection3">
  3512. <div class="title">
  3513. Thank you!
  3514. </div>
  3515. <div class="description">
  3516. We appreciate your feedback.
  3517. </div>
  3518. </div>
  3519. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  3520. </div>
  3521. <div class="userVoice">
  3522. <div class="title">
  3523. Help us improve MSDN.
  3524. </div>
  3525. <div class="description">
  3526. Visit our UserVoice Page to submit and vote on ideas!
  3527. </div>
  3528. <div class="buttons">
  3529. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  3530. </div>
  3531. </div>
  3532. <div class="clear"></div>
  3533. </div>
  3534. </div>
  3535. <footer class="top">
  3536. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  3537. <div class="linkList">
  3538. <div class="linkListTitle">Dev centers</div>
  3539. <ul class="links">
  3540. <li>
  3541. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  3542. </li>
  3543. <li>
  3544. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  3545. </li>
  3546. <li>
  3547. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  3548. </li>
  3549. <li>
  3550. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  3551. </li>
  3552. <li>
  3553. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  3554. </li>
  3555. </ul>
  3556. </div>
  3557. </div>
  3558. <div id="rightLinks">
  3559. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  3560. <div class="linkList">
  3561. <div class="linkListTitle">Learning resources</div>
  3562. <ul class="links">
  3563. <li>
  3564. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  3565. </li>
  3566. <li>
  3567. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  3568. </li>
  3569. <li>
  3570. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  3571. </li>
  3572. </ul>
  3573. </div>
  3574. </div>
  3575. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  3576. <div class="linkList">
  3577. <div class="linkListTitle">Community</div>
  3578. <ul class="links">
  3579. <li>
  3580. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  3581. </li>
  3582. <li>
  3583. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  3584. </li>
  3585. <li>
  3586. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  3587. </li>
  3588. </ul>
  3589. </div>
  3590. </div>
  3591. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  3592. <div class="linkList">
  3593. <div class="linkListTitle">Support</div>
  3594. <ul class="links">
  3595. <li>
  3596. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  3597. </li>
  3598. </ul>
  3599. </div>
  3600. </div>
  3601. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  3602. <div class="linkList">
  3603. <div class="linkListTitle">Programs</div>
  3604. <ul class="links">
  3605. <li>
  3606. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  3607. </li>
  3608. <li>
  3609. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  3610. </li>
  3611. <li>
  3612. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  3613. </li>
  3614. </ul>
  3615. </div>
  3616. </div>
  3617. </div>
  3618. </footer>
  3619. <footer class="bottom">
  3620. <span class="localeContainer">
  3621. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  3622. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554731(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  3623. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  3624. </form>
  3625. </span>
  3626. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  3627. <div class="linkList">
  3628. <ul class="links horizontal">
  3629. <li>
  3630. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  3631. </li>
  3632. <li>
  3633. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  3634. </li>
  3635. <li>
  3636. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  3637. </li>
  3638. <li>
  3639. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  3640. </li>
  3641. </ul>
  3642. </div>
  3643. </div>
  3644. <span class="logoLegal">
  3645. <span class="logo"></span>
  3646. <span class="copyright">© 2016 Microsoft</span>
  3647. </span>
  3648. </footer>
  3649. </div>
  3650. </div>
  3651. <div class="footerPrintView">
  3652. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  3653. </div>
  3654. <input id="tocPaddingPerLevel" type="hidden" value="17">
  3655. <input id="MtpsDevice" type="hidden" value="Printer">
  3656. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  3657. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  3658. <div id="globalRequestVerification">
  3659. <input name="__RequestVerificationToken" type="hidden" value="q0uOrQwQMQm251YKk2G9L-mMFZTvnfY2fez-znh11k_hjzxk06dyZhtbgB9cGL9H5NLfbp0TovGTftXRNPg2pP0eKUw1">
  3660. </div>
  3661. </div>
  3662. <script type="text/javascript" class="mtps-injected">
  3663. /*<![CDATA[*/
  3664. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  3665. MTPS.injectScripts([
  3666. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  3667. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/ff554731(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  3668. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  3669. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  3670. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  3671. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  3672. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  3673. ]);
  3674. /*]]>*/
  3675. </script>
  3676. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  3677. <div id="page">
  3678. <link type="text/css" rel="stylesheet">
  3679. <input type="hidden" id="isHeaderBleeding" value="true">
  3680. <div id="ux-header" dir="ltr" class="ltr msdn">
  3681. <header>
  3682. <span id="singleCol"></span>
  3683. <span id="doubleCol"></span>
  3684. <span id="isMobile"></span>
  3685. <div>
  3686. <div class="row topRow">
  3687. <div class="top">
  3688. <div class="left">
  3689. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  3690. <div id="msft-logo" class="msft-logo"></div>
  3691. </a>
  3692. <div class="GrayPipe"></div>
  3693. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  3694. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  3695. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  3696. </div>
  3697. <div class="right">
  3698. <div id="signIn">
  3699. <div class="profileImage"></div>
  3700. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376402&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554836%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  3701. <div class="auxNav">
  3702. <div>
  3703. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  3704. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  3705. </div>
  3706. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  3707. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  3708. </div>
  3709. </div>
  3710. <div>
  3711. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  3712. <div class="linkList">
  3713. <ul class="links horizontal">
  3714. <li>
  3715. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  3716. </li>
  3717. <li>
  3718. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  3719. </li>
  3720. <li>
  3721. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  3722. </li>
  3723. </ul>
  3724. </div>
  3725. </div>
  3726. </div>
  3727. </div>
  3728. </div>
  3729. </div>
  3730. </div>
  3731. <div class="row middleRow">
  3732. <div class="expandTop">
  3733. <div class="left"></div>
  3734. <div class="right"></div>
  3735. </div>
  3736. </div>
  3737. </div>
  3738. <div id="buttomRowWrapper" class="bg_default">
  3739. <div class="row buttomRow bg_default">
  3740. <div class="bottom">
  3741. <div class="left">
  3742. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  3743. <div id="drawer">
  3744. <div class="toc">
  3745. <nav>
  3746. <ul class="navL1">
  3747. <li class="inactive toggle">
  3748. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  3749. <ul class="navL2">
  3750. <li class="inactive">
  3751. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  3752. </li>
  3753. <li class="inactive">
  3754. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  3755. </li>
  3756. <li class="inactive">
  3757. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  3758. </li>
  3759. <li class="inactive">
  3760. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  3761. </li>
  3762. <li class="inactive">
  3763. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  3764. </li>
  3765. <li class="inactive">
  3766. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  3767. </li>
  3768. </ul>
  3769. </li>
  3770. <li class="inactive toggle">
  3771. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  3772. <ul class="navL2">
  3773. <li class="inactive">
  3774. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  3775. </li>
  3776. <li class="inactive">
  3777. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  3778. </li>
  3779. <li class="inactive">
  3780. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  3781. </li>
  3782. <li class="inactive toggle">
  3783. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  3784. <ul class="navL3">
  3785. <li class="inactive">
  3786. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  3787. </li>
  3788. <li class="inactive">
  3789. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  3790. </li>
  3791. <li class="inactive">
  3792. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  3793. </li>
  3794. <li class="inactive">
  3795. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  3796. </li>
  3797. <li class="inactive">
  3798. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  3799. </li>
  3800. </ul>
  3801. </li>
  3802. </ul>
  3803. </li>
  3804. <li class="inactive toggle">
  3805. <a href="javascript:void(0)" title="Programs">Programs</a>
  3806. <ul class="navL2">
  3807. <li class="inactive toggle">
  3808. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  3809. <ul class="navL3">
  3810. <li class="inactive">
  3811. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  3812. </li>
  3813. <li class="inactive">
  3814. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  3815. </li>
  3816. <li class="inactive">
  3817. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  3818. </li>
  3819. </ul>
  3820. </li>
  3821. <li class="inactive toggle">
  3822. <a href="javascript:void(0)" title="Students">Students</a>
  3823. <ul class="navL3">
  3824. <li class="inactive">
  3825. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  3826. </li>
  3827. <li class="inactive">
  3828. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  3829. </li>
  3830. </ul>
  3831. </li>
  3832. <li class="inactive toggle">
  3833. <a href="javascript:void(0)" title="Architects">Architects</a>
  3834. <ul class="navL3">
  3835. <li class="inactive">
  3836. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  3837. </li>
  3838. <li class="inactive">
  3839. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  3840. </li>
  3841. <li class="inactive">
  3842. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  3843. </li>
  3844. <li class="inactive">
  3845. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  3846. </li>
  3847. <li class="inactive">
  3848. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  3849. </li>
  3850. </ul>
  3851. </li>
  3852. <li class="inactive">
  3853. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  3854. </li>
  3855. <li class="inactive">
  3856. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  3857. </li>
  3858. <li class="inactive">
  3859. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  3860. </li>
  3861. <li class="inactive">
  3862. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  3863. </li>
  3864. </ul>
  3865. </li>
  3866. <li class="inactive toggle">
  3867. <a href="javascript:void(0)" title="Community">Community</a>
  3868. <ul class="navL2">
  3869. <li class="inactive">
  3870. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  3871. </li>
  3872. <li class="inactive">
  3873. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  3874. </li>
  3875. <li class="inactive">
  3876. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  3877. </li>
  3878. <li class="inactive">
  3879. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  3880. </li>
  3881. <li class="inactive">
  3882. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  3883. </li>
  3884. </ul>
  3885. </li>
  3886. <li class="inactive current toggle">
  3887. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  3888. <ul class="navL2">
  3889. <li class="inactive current">
  3890. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  3891. </li>
  3892. <li class="inactive">
  3893. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  3894. </li>
  3895. </ul>
  3896. </li>
  3897. <li class="inactive">
  3898. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  3899. </li>
  3900. </ul>
  3901. </nav>
  3902. </div>
  3903. </div>
  3904. </div>
  3905. <div class="right">
  3906. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  3907. <div class="SearchBox">
  3908. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  3909. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  3910. <div id="search-finder" class="search-finder"></div>
  3911. </button>
  3912. <button id="HeaderSearchButton" style="display:none"></button>
  3913. <div id="searchSplitter"></div>
  3914. <div id="searchCloseIcon" class="search-clear-x"></div>
  3915. <div id="searchTextContainer" style="width: 0;">
  3916. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  3917. </div>
  3918. </form>
  3919. </div>
  3920. </div>
  3921. </div>
  3922. </div>
  3923. </div>
  3924. </div>
  3925. </header>
  3926. </div>
  3927. <div class="printExportMenus ltr">
  3928. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fff554836(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  3929. Export (<span class="count">0</span>)
  3930. </a>
  3931. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/ff554836(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  3932. Print
  3933. </a>
  3934. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  3935. </a>
  3936. </div>
  3937. <div class="printExportMenus ltr">
  3938. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  3939. </div>
  3940. <div id="body" ms.pgarea="body">
  3941. <span id="tabletView_large"></span>
  3942. <span id="tabletView_small"></span>
  3943. <span id="mobileView"></span>
  3944. <div id="content" class="content">
  3945. <input type="hidden" id="printForPab" value="true">
  3946. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  3947. <h1 class="title">User mode and kernel mode</h1>
  3948. <div id="mainSection">
  3949. <div class="clsServerSDKContent">
  3950. </div>
  3951. <p>A processor in a computer running Windows has two different modes: <em>user mode</em> and <em>kernel mode</em>. The processor switches between the two modes depending on what type of code is running on the processor. Applications run in user mode, and core operating system components run in kernel mode. While many drivers run in kernel mode, some drivers may run in user mode.</p>
  3952. <p>When you start a user-mode application, Windows creates a <em>process</em> for the application. The process provides the application with a private <em>virtual address space</em> and a private <em>handle table</em>. Because an application's virtual address space is private, one application cannot alter data that belongs to another application. Each application runs in isolation, and if an application crashes, the crash is limited to that one application. Other applications and the operating system are not affected by the crash.</p>
  3953. <p>In addition to being private, the virtual address space of a user-mode application is limited. A processor running in user mode cannot access virtual addresses that are reserved for the operating system. Limiting the virtual address space of a user-mode application prevents the application from altering, and possibly damaging, critical operating system data.</p>
  3954. <p>All code that runs in kernel mode shares a single virtual address space. This means that a kernel-mode driver is not isolated from other drivers and the operating system itself. If a kernel-mode driver accidentally writes to the wrong virtual address, data that belongs to the operating system or another driver could be compromised. If a kernel-mode driver crashes, the entire operating system crashes.</p>
  3955. <p>This diagram illustrates communication between user-mode and kernel-mode components.</p><img id="UserAndKernelMode01" alt="Block diagram of user-mode and kernel-mode components" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535109.png" title="Block diagram of user-mode and kernel-mode components" xmlns=""><h2><a id="related_topics"></a>Related topics</h2>
  3956. <dl>
  3957. <dt>
  3958. <a href="https://msdn.microsoft.com/en-us/library/hh439648(v=vs.85).aspx">Virtual Address Spaces</a>
  3959. </dt>
  3960. </dl>
  3961. <p>&nbsp;</p>
  3962. <p>&nbsp;</p>
  3963. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20User%20mode%20and%20kernel%20mode%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  3964. </div>
  3965. </div>
  3966. </div>
  3967. </div>
  3968. <div class="clear"></div>
  3969. <input name="__RequestVerificationToken" type="hidden" value="f479RiBDFQ9pMjoUqDZoqYnbXyhYSWyu_WRZ0a8KOwQUI1AuuUz5DX2igUpWJPsiWcZQSkDJ-jqtkkPr1rH9CCrmgcY1">
  3970. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/ff554836(d=printer,v=vs.85).aspx">
  3971. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/ff554836(d=printer,v=vs.85).aspx">
  3972. <input id="isTopicRated" type="hidden" value="false">
  3973. <div id="lib-footer" ms.pgarea="body">
  3974. <link type="text/css" rel="stylesheet">
  3975. <div id="ux-footer" class="" style="" dir="ltr">
  3976. <div id="footerSock" class="librarySock both">
  3977. <div id="footerSockInner">
  3978. <a name="feedback"></a>
  3979. <div class="rating">
  3980. <div id="ratingSection1">
  3981. <div class="title">
  3982. Was this page helpful?
  3983. </div>
  3984. <div class="description">
  3985. Your feedback about this content is important.<br>Let us know what you think.
  3986. </div>
  3987. <div class="buttons">
  3988. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  3989. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  3990. </div>
  3991. <input id="ratingValue" type="hidden" value="">
  3992. </div>
  3993. <div id="ratingSection2">
  3994. <div class="title left">
  3995. Additional feedback?
  3996. </div>
  3997. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  3998. <div class="right">
  3999. <div class="counter">
  4000. <span id="feedbackTextCounter">1500</span> characters remaining
  4001. </div>
  4002. <div class="buttons">
  4003. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  4004. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  4005. </div>
  4006. </div>
  4007. </div>
  4008. <div id="ratingSection3">
  4009. <div class="title">
  4010. Thank you!
  4011. </div>
  4012. <div class="description">
  4013. We appreciate your feedback.
  4014. </div>
  4015. </div>
  4016. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  4017. </div>
  4018. <div class="userVoice">
  4019. <div class="title">
  4020. Help us improve MSDN.
  4021. </div>
  4022. <div class="description">
  4023. Visit our UserVoice Page to submit and vote on ideas!
  4024. </div>
  4025. <div class="buttons">
  4026. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  4027. </div>
  4028. </div>
  4029. <div class="clear"></div>
  4030. </div>
  4031. </div>
  4032. <footer class="top">
  4033. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  4034. <div class="linkList">
  4035. <div class="linkListTitle">Dev centers</div>
  4036. <ul class="links">
  4037. <li>
  4038. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  4039. </li>
  4040. <li>
  4041. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  4042. </li>
  4043. <li>
  4044. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  4045. </li>
  4046. <li>
  4047. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  4048. </li>
  4049. <li>
  4050. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  4051. </li>
  4052. </ul>
  4053. </div>
  4054. </div>
  4055. <div id="rightLinks">
  4056. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  4057. <div class="linkList">
  4058. <div class="linkListTitle">Learning resources</div>
  4059. <ul class="links">
  4060. <li>
  4061. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  4062. </li>
  4063. <li>
  4064. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  4065. </li>
  4066. <li>
  4067. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  4068. </li>
  4069. </ul>
  4070. </div>
  4071. </div>
  4072. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  4073. <div class="linkList">
  4074. <div class="linkListTitle">Community</div>
  4075. <ul class="links">
  4076. <li>
  4077. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  4078. </li>
  4079. <li>
  4080. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  4081. </li>
  4082. <li>
  4083. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  4084. </li>
  4085. </ul>
  4086. </div>
  4087. </div>
  4088. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  4089. <div class="linkList">
  4090. <div class="linkListTitle">Support</div>
  4091. <ul class="links">
  4092. <li>
  4093. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  4094. </li>
  4095. </ul>
  4096. </div>
  4097. </div>
  4098. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  4099. <div class="linkList">
  4100. <div class="linkListTitle">Programs</div>
  4101. <ul class="links">
  4102. <li>
  4103. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  4104. </li>
  4105. <li>
  4106. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  4107. </li>
  4108. <li>
  4109. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  4110. </li>
  4111. </ul>
  4112. </div>
  4113. </div>
  4114. </div>
  4115. </footer>
  4116. <footer class="bottom">
  4117. <span class="localeContainer">
  4118. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  4119. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554836(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  4120. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  4121. </form>
  4122. </span>
  4123. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  4124. <div class="linkList">
  4125. <ul class="links horizontal">
  4126. <li>
  4127. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  4128. </li>
  4129. <li>
  4130. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  4131. </li>
  4132. <li>
  4133. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  4134. </li>
  4135. <li>
  4136. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  4137. </li>
  4138. </ul>
  4139. </div>
  4140. </div>
  4141. <span class="logoLegal">
  4142. <span class="logo"></span>
  4143. <span class="copyright">© 2016 Microsoft</span>
  4144. </span>
  4145. </footer>
  4146. </div>
  4147. </div>
  4148. <div class="footerPrintView">
  4149. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  4150. </div>
  4151. <input id="tocPaddingPerLevel" type="hidden" value="17">
  4152. <input id="MtpsDevice" type="hidden" value="Printer">
  4153. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  4154. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  4155. <div id="globalRequestVerification">
  4156. <input name="__RequestVerificationToken" type="hidden" value="6k8g70Z0LcG5CGNyQxheMXiaImIWx_X6S7EuuaPiRPvAXPtBQVy1V0XDGIa2N1jbRv3ntTVA9VG46UnmJ4K6osO_NtI1">
  4157. </div>
  4158. </div>
  4159. <script type="text/javascript" class="mtps-injected">
  4160. /*<![CDATA[*/
  4161. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  4162. MTPS.injectScripts([
  4163. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  4164. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/ff554836(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  4165. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  4166. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  4167. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  4168. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  4169. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  4170. ]);
  4171. /*]]>*/
  4172. </script>
  4173. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  4174. <div id="page">
  4175. <link type="text/css" rel="stylesheet">
  4176. <input type="hidden" id="isHeaderBleeding" value="true">
  4177. <div id="ux-header" dir="ltr" class="ltr msdn">
  4178. <header>
  4179. <span id="singleCol"></span>
  4180. <span id="doubleCol"></span>
  4181. <span id="isMobile"></span>
  4182. <div>
  4183. <div class="row topRow">
  4184. <div class="top">
  4185. <div class="left">
  4186. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  4187. <div id="msft-logo" class="msft-logo"></div>
  4188. </a>
  4189. <div class="GrayPipe"></div>
  4190. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  4191. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  4192. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  4193. </div>
  4194. <div class="right">
  4195. <div id="signIn">
  4196. <div class="profileImage"></div>
  4197. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376404&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439648%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  4198. <div class="auxNav">
  4199. <div>
  4200. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  4201. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  4202. </div>
  4203. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  4204. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  4205. </div>
  4206. </div>
  4207. <div>
  4208. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  4209. <div class="linkList">
  4210. <ul class="links horizontal">
  4211. <li>
  4212. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  4213. </li>
  4214. <li>
  4215. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  4216. </li>
  4217. <li>
  4218. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  4219. </li>
  4220. </ul>
  4221. </div>
  4222. </div>
  4223. </div>
  4224. </div>
  4225. </div>
  4226. </div>
  4227. </div>
  4228. <div class="row middleRow">
  4229. <div class="expandTop">
  4230. <div class="left"></div>
  4231. <div class="right"></div>
  4232. </div>
  4233. </div>
  4234. </div>
  4235. <div id="buttomRowWrapper" class="bg_default">
  4236. <div class="row buttomRow bg_default">
  4237. <div class="bottom">
  4238. <div class="left">
  4239. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  4240. <div id="drawer">
  4241. <div class="toc">
  4242. <nav>
  4243. <ul class="navL1">
  4244. <li class="inactive toggle">
  4245. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  4246. <ul class="navL2">
  4247. <li class="inactive">
  4248. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  4249. </li>
  4250. <li class="inactive">
  4251. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  4252. </li>
  4253. <li class="inactive">
  4254. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  4255. </li>
  4256. <li class="inactive">
  4257. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  4258. </li>
  4259. <li class="inactive">
  4260. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  4261. </li>
  4262. <li class="inactive">
  4263. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  4264. </li>
  4265. </ul>
  4266. </li>
  4267. <li class="inactive toggle">
  4268. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  4269. <ul class="navL2">
  4270. <li class="inactive">
  4271. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  4272. </li>
  4273. <li class="inactive">
  4274. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  4275. </li>
  4276. <li class="inactive">
  4277. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  4278. </li>
  4279. <li class="inactive toggle">
  4280. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  4281. <ul class="navL3">
  4282. <li class="inactive">
  4283. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  4284. </li>
  4285. <li class="inactive">
  4286. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  4287. </li>
  4288. <li class="inactive">
  4289. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  4290. </li>
  4291. <li class="inactive">
  4292. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  4293. </li>
  4294. <li class="inactive">
  4295. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  4296. </li>
  4297. </ul>
  4298. </li>
  4299. </ul>
  4300. </li>
  4301. <li class="inactive toggle">
  4302. <a href="javascript:void(0)" title="Programs">Programs</a>
  4303. <ul class="navL2">
  4304. <li class="inactive toggle">
  4305. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  4306. <ul class="navL3">
  4307. <li class="inactive">
  4308. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  4309. </li>
  4310. <li class="inactive">
  4311. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  4312. </li>
  4313. <li class="inactive">
  4314. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  4315. </li>
  4316. </ul>
  4317. </li>
  4318. <li class="inactive toggle">
  4319. <a href="javascript:void(0)" title="Students">Students</a>
  4320. <ul class="navL3">
  4321. <li class="inactive">
  4322. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  4323. </li>
  4324. <li class="inactive">
  4325. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  4326. </li>
  4327. </ul>
  4328. </li>
  4329. <li class="inactive toggle">
  4330. <a href="javascript:void(0)" title="Architects">Architects</a>
  4331. <ul class="navL3">
  4332. <li class="inactive">
  4333. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  4334. </li>
  4335. <li class="inactive">
  4336. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  4337. </li>
  4338. <li class="inactive">
  4339. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  4340. </li>
  4341. <li class="inactive">
  4342. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  4343. </li>
  4344. <li class="inactive">
  4345. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  4346. </li>
  4347. </ul>
  4348. </li>
  4349. <li class="inactive">
  4350. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  4351. </li>
  4352. <li class="inactive">
  4353. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  4354. </li>
  4355. <li class="inactive">
  4356. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  4357. </li>
  4358. <li class="inactive">
  4359. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  4360. </li>
  4361. </ul>
  4362. </li>
  4363. <li class="inactive toggle">
  4364. <a href="javascript:void(0)" title="Community">Community</a>
  4365. <ul class="navL2">
  4366. <li class="inactive">
  4367. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  4368. </li>
  4369. <li class="inactive">
  4370. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  4371. </li>
  4372. <li class="inactive">
  4373. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  4374. </li>
  4375. <li class="inactive">
  4376. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  4377. </li>
  4378. <li class="inactive">
  4379. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  4380. </li>
  4381. </ul>
  4382. </li>
  4383. <li class="inactive current toggle">
  4384. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  4385. <ul class="navL2">
  4386. <li class="inactive current">
  4387. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  4388. </li>
  4389. <li class="inactive">
  4390. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  4391. </li>
  4392. </ul>
  4393. </li>
  4394. <li class="inactive">
  4395. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  4396. </li>
  4397. </ul>
  4398. </nav>
  4399. </div>
  4400. </div>
  4401. </div>
  4402. <div class="right">
  4403. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  4404. <div class="SearchBox">
  4405. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  4406. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  4407. <div id="search-finder" class="search-finder"></div>
  4408. </button>
  4409. <button id="HeaderSearchButton" style="display:none"></button>
  4410. <div id="searchSplitter"></div>
  4411. <div id="searchCloseIcon" class="search-clear-x"></div>
  4412. <div id="searchTextContainer" style="width: 0;">
  4413. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  4414. </div>
  4415. </form>
  4416. </div>
  4417. </div>
  4418. </div>
  4419. </div>
  4420. </div>
  4421. </div>
  4422. </header>
  4423. </div>
  4424. <div class="printExportMenus ltr">
  4425. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh439648(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  4426. Export (<span class="count">0</span>)
  4427. </a>
  4428. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh439648(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  4429. Print
  4430. </a>
  4431. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  4432. </a>
  4433. </div>
  4434. <div class="printExportMenus ltr">
  4435. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  4436. </div>
  4437. <div id="body" ms.pgarea="body">
  4438. <span id="tabletView_large"></span>
  4439. <span id="tabletView_small"></span>
  4440. <span id="mobileView"></span>
  4441. <div id="content" class="content">
  4442. <input type="hidden" id="printForPab" value="true">
  4443. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  4444. <h1 class="title">Virtual address spaces</h1>
  4445. <div id="mainSection">
  4446. <div class="clsServerSDKContent">
  4447. </div>
  4448. <p>When a processor reads or writes to a memory location, it uses a virtual address. As part of the read or write operation, the processor translates the virtual address to a physical address. Accessing memory through a virtual address has these advantages:</p>
  4449. <ul>
  4450. <li>
  4451. <p>A program can use a contiguous range of virtual addresses to access a large memory buffer that is not contiguous in physical memory.</p>
  4452. </li>
  4453. <li>
  4454. <p> A program can use a range of virtual addresses to access a memory buffer that is larger than the available physical memory. As the supply of physical memory becomes small, the memory manager saves pages of physical memory (typically 4 kilobytes in size) to a disk file. Pages of data or code are moved between physical memory and the disk as needed.</p>
  4455. </li>
  4456. <li>
  4457. <p>The virtual addresses used by different processes are isolated from each other. The code in one process cannot alter the physical memory that is being used by another process or the operating system.</p>
  4458. </li>
  4459. </ul>
  4460. <p>The range of virtual addresses that is available to a process is called the <em>virtual address space</em> for the process. Each user-mode process has its own private virtual address space.
  4461. For a 32-bit process, the virtual address space is usually the 2-gigabyte range 0x00000000 through 0x7FFFFFFF. For a 64-bit process, the virtual address space is the 8-terabyte range 0x000'00000000 through 0x7FF'FFFFFFFF. A range of virtual addresses is sometimes called a range of <em>virtual memory</em>.</p>
  4462. <p>This diagram illustrates some of the key features of virtual address spaces.</p><img id="virtualaddressspace01" alt="Diagram of virtual address spaces for two processes" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535110.png" title="Diagram of virtual address spaces for two processes" xmlns=""><p>The diagram shows the virtual address spaces for two 64-bit processes: Notepad.exe and MyApp.exe. Each process has its own virtual address space that goes from 0x000'0000000 through 0x7FF'FFFFFFFF. Each shaded block represents one page (4 kilobytes in size) of virtual or physical memory. Notice that the Notepad process uses three contiguous pages of virtual addresses, starting at 0x7F7'93950000. But those three contiguous pages of virtual addresses are mapped to noncontiguous pages in physical memory. Also notice that both processes use a page of virtual memory beginning at 0x7F7'93950000, but those virtual pages are mapped to different pages of physical memory.</p>
  4463. <h2><a id="User_space_and_system_space"></a><a id="user_space_and_system_space"></a><a id="USER_SPACE_AND_SYSTEM_SPACE"></a>User space and system space</h2>
  4464. <p>Processes like Notepad.exe and MyApp.exe run in user mode. Core operating system components and many drivers run in the more privileged kernel mode. For more information about processor modes, see <a href="https://msdn.microsoft.com/en-us/library/ff554836(v=vs.85).aspx">User mode and kernel mode</a>. Each user-mode process has its own private virtual address space, but all code that runs in kernel mode shares a single virtual address space called <em>system space</em>. The virtual address space for the current user-mode process is called <em>user space</em>.</p>
  4465. <p>In 32-bit Windows, the total available virtual address space is 2^32 bytes (4 gigabytes). Usually the lower 2 gigabytes are used for user space, and the upper 2 gigabytes are used for system space.</p><img id="VirtualAddressSpace02" alt="Diagram of system space" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535111.png" title="Diagram of system space" xmlns=""><p>In 32-bit Windows, you have the option of specifying (at boot time) that more than 2 gigabytes are available for user space. The consequence is that fewer virtual addresses are available for system space. You can increase the size of user space to as much as 3 gigabytes, in which case only 1 gigabyte is available for system space. To increase the size of user space, use <a href="https://msdn.microsoft.com/en-us/library/ff542202(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">BCDEdit /set increaseuserva</strong></a>.</p>
  4466. <p>In 64-bit Windows, the theoretical amount of virtual address space is 2^64 bytes (16 exabytes), but only a small portion of the 16-exabyte range is actually used. The 8-terabyte range from 0x000'00000000 through 0x7FF'FFFFFFFF is used for user space, and portions of the 248-terabyte range from 0xFFFF0800'00000000 through 0xFFFFFFFF'FFFFFFFF are used for system space.</p><img id="VirtualAddressSpace03" alt="Diagram of paged pool and nonpaged pool" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535112.png" title="Diagram of paged pool and nonpaged pool" xmlns=""><p>Code running in user mode has access to user space but does not have access to system space. This restriction prevents user-mode code from reading or altering protected operating system data structures. Code running in kernel mode has access to both user space and system space. That is, code running in kernel mode has access to system space and the virtual address space of the current user-mode process.</p>
  4467. <p>Drivers that run in kernel mode must be very careful about directly reading from or writing to addresses in user space. This scenario illustrates why.</p>
  4468. <ol>
  4469. <li>
  4470. <p>A user-mode program initiates a request to read some data from a device. The program supplies the starting address of a buffer to receive the data.</p>
  4471. </li>
  4472. <li>
  4473. <p>A device driver routine, running in kernel mode, starts the read operation and returns control to its caller.</p>
  4474. </li>
  4475. <li>Later the device interrupts whatever thread is currently running to say that the read operation is complete. The interrupt is handled by kernel-mode driver routines running on this arbitrary thread, which belongs to an arbitrary process.</li>
  4476. <li>At this point, the driver must not write the data to the starting address that the user-mode program supplied in Step 1. This address is in the virtual address space of the process that initiated the request, which is most likely not the same as the current process.</li>
  4477. </ol>
  4478. <h2><a id="Paged_pool_and_Nonpaged_pool"></a><a id="paged_pool_and_nonpaged_pool"></a><a id="PAGED_POOL_AND_NONPAGED_POOL"></a>Paged pool and Nonpaged pool</h2>
  4479. <p>In user space, all physical memory pages can be paged out to a disk file as needed. In system space, some physical pages can be paged out and others cannot. System space has two regions for dynamically allocating memory: paged pool and nonpaged pool. In 64-bit Windows, paged pool is the 128-gigabyte range of virtual addresses that goes from 0xFFFFA800'00000000 through 0xFFFFA81F'FFFFFFFF. Nonpaged pool is the 128-gigabyte range of virtual addresses that goes from 0xFFFFAC00'00000000 through 0xFFFFAC1F'FFFFFFFF.</p>
  4480. <p>Memory that is allocated in paged pool can be paged out to a disk file as needed. Memory that is allocated in nonpaged pool can never be paged out to a disk file.</p><img id="VirtualAddressSpace04" alt="Diagram comparing memory allocation in paged pool to that in nonpaged pool" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535113.png" title="Diagram comparing memory allocation in paged pool to that in nonpaged pool" xmlns=""><h2><a id="related_topics"></a>Related topics</h2>
  4481. <dl>
  4482. <dt>
  4483. <a href="https://msdn.microsoft.com/en-us/library/ff554836(v=vs.85).aspx">User mode and kernel mode</a>
  4484. </dt>
  4485. </dl>
  4486. <p>&nbsp;</p>
  4487. <p>&nbsp;</p>
  4488. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Virtual%20address%20spaces%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  4489. </div>
  4490. </div>
  4491. </div>
  4492. </div>
  4493. <div class="clear"></div>
  4494. <input name="__RequestVerificationToken" type="hidden" value="YJvB6t-X6o5K9H-mdvkogj1GnkaPMpiAWMpAgkmBGjXM917nAqNtpYQdLzwZlURUt1SxknJuYD0Jb8rX9hAicDlm9n81">
  4495. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh439648(d=printer,v=vs.85).aspx">
  4496. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh439648(d=printer,v=vs.85).aspx">
  4497. <input id="isTopicRated" type="hidden" value="false">
  4498. <div id="lib-footer" ms.pgarea="body">
  4499. <link type="text/css" rel="stylesheet">
  4500. <div id="ux-footer" class="" style="" dir="ltr">
  4501. <div id="footerSock" class="librarySock both">
  4502. <div id="footerSockInner">
  4503. <a name="feedback"></a>
  4504. <div class="rating">
  4505. <div id="ratingSection1">
  4506. <div class="title">
  4507. Was this page helpful?
  4508. </div>
  4509. <div class="description">
  4510. Your feedback about this content is important.<br>Let us know what you think.
  4511. </div>
  4512. <div class="buttons">
  4513. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  4514. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  4515. </div>
  4516. <input id="ratingValue" type="hidden" value="">
  4517. </div>
  4518. <div id="ratingSection2">
  4519. <div class="title left">
  4520. Additional feedback?
  4521. </div>
  4522. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  4523. <div class="right">
  4524. <div class="counter">
  4525. <span id="feedbackTextCounter">1500</span> characters remaining
  4526. </div>
  4527. <div class="buttons">
  4528. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  4529. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  4530. </div>
  4531. </div>
  4532. </div>
  4533. <div id="ratingSection3">
  4534. <div class="title">
  4535. Thank you!
  4536. </div>
  4537. <div class="description">
  4538. We appreciate your feedback.
  4539. </div>
  4540. </div>
  4541. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  4542. </div>
  4543. <div class="userVoice">
  4544. <div class="title">
  4545. Help us improve MSDN.
  4546. </div>
  4547. <div class="description">
  4548. Visit our UserVoice Page to submit and vote on ideas!
  4549. </div>
  4550. <div class="buttons">
  4551. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  4552. </div>
  4553. </div>
  4554. <div class="clear"></div>
  4555. </div>
  4556. </div>
  4557. <footer class="top">
  4558. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  4559. <div class="linkList">
  4560. <div class="linkListTitle">Dev centers</div>
  4561. <ul class="links">
  4562. <li>
  4563. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  4564. </li>
  4565. <li>
  4566. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  4567. </li>
  4568. <li>
  4569. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  4570. </li>
  4571. <li>
  4572. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  4573. </li>
  4574. <li>
  4575. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  4576. </li>
  4577. </ul>
  4578. </div>
  4579. </div>
  4580. <div id="rightLinks">
  4581. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  4582. <div class="linkList">
  4583. <div class="linkListTitle">Learning resources</div>
  4584. <ul class="links">
  4585. <li>
  4586. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  4587. </li>
  4588. <li>
  4589. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  4590. </li>
  4591. <li>
  4592. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  4593. </li>
  4594. </ul>
  4595. </div>
  4596. </div>
  4597. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  4598. <div class="linkList">
  4599. <div class="linkListTitle">Community</div>
  4600. <ul class="links">
  4601. <li>
  4602. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  4603. </li>
  4604. <li>
  4605. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  4606. </li>
  4607. <li>
  4608. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  4609. </li>
  4610. </ul>
  4611. </div>
  4612. </div>
  4613. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  4614. <div class="linkList">
  4615. <div class="linkListTitle">Support</div>
  4616. <ul class="links">
  4617. <li>
  4618. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  4619. </li>
  4620. </ul>
  4621. </div>
  4622. </div>
  4623. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  4624. <div class="linkList">
  4625. <div class="linkListTitle">Programs</div>
  4626. <ul class="links">
  4627. <li>
  4628. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  4629. </li>
  4630. <li>
  4631. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  4632. </li>
  4633. <li>
  4634. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  4635. </li>
  4636. </ul>
  4637. </div>
  4638. </div>
  4639. </div>
  4640. </footer>
  4641. <footer class="bottom">
  4642. <span class="localeContainer">
  4643. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  4644. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439648(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  4645. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  4646. </form>
  4647. </span>
  4648. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  4649. <div class="linkList">
  4650. <ul class="links horizontal">
  4651. <li>
  4652. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  4653. </li>
  4654. <li>
  4655. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  4656. </li>
  4657. <li>
  4658. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  4659. </li>
  4660. <li>
  4661. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  4662. </li>
  4663. </ul>
  4664. </div>
  4665. </div>
  4666. <span class="logoLegal">
  4667. <span class="logo"></span>
  4668. <span class="copyright">© 2016 Microsoft</span>
  4669. </span>
  4670. </footer>
  4671. </div>
  4672. </div>
  4673. <div class="footerPrintView">
  4674. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  4675. </div>
  4676. <input id="tocPaddingPerLevel" type="hidden" value="17">
  4677. <input id="MtpsDevice" type="hidden" value="Printer">
  4678. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  4679. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  4680. <div id="globalRequestVerification">
  4681. <input name="__RequestVerificationToken" type="hidden" value="cAa61Ys8haZc-sNlfiSoESGwIaQN00zm3WZ3tipZ4A1WFduFuqMNc7DulQz41eAbl71fkqEo7sVNQS6xbbJ3rKwxn8w1">
  4682. </div>
  4683. </div>
  4684. <script type="text/javascript" class="mtps-injected">
  4685. /*<![CDATA[*/
  4686. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  4687. MTPS.injectScripts([
  4688. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  4689. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh439648(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  4690. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  4691. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  4692. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  4693. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  4694. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  4695. ]);
  4696. /*]]>*/
  4697. </script>
  4698. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  4699. <div id="page">
  4700. <link type="text/css" rel="stylesheet">
  4701. <input type="hidden" id="isHeaderBleeding" value="true">
  4702. <div id="ux-header" dir="ltr" class="ltr msdn">
  4703. <header>
  4704. <span id="singleCol"></span>
  4705. <span id="doubleCol"></span>
  4706. <span id="isMobile"></span>
  4707. <div>
  4708. <div class="row topRow">
  4709. <div class="top">
  4710. <div class="left">
  4711. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  4712. <div id="msft-logo" class="msft-logo"></div>
  4713. </a>
  4714. <div class="GrayPipe"></div>
  4715. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  4716. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  4717. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  4718. </div>
  4719. <div class="right">
  4720. <div id="signIn">
  4721. <div class="profileImage"></div>
  4722. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376405&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554721%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  4723. <div class="auxNav">
  4724. <div>
  4725. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  4726. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  4727. </div>
  4728. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  4729. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  4730. </div>
  4731. </div>
  4732. <div>
  4733. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  4734. <div class="linkList">
  4735. <ul class="links horizontal">
  4736. <li>
  4737. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  4738. </li>
  4739. <li>
  4740. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  4741. </li>
  4742. <li>
  4743. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  4744. </li>
  4745. </ul>
  4746. </div>
  4747. </div>
  4748. </div>
  4749. </div>
  4750. </div>
  4751. </div>
  4752. </div>
  4753. <div class="row middleRow">
  4754. <div class="expandTop">
  4755. <div class="left"></div>
  4756. <div class="right"></div>
  4757. </div>
  4758. </div>
  4759. </div>
  4760. <div id="buttomRowWrapper" class="bg_default">
  4761. <div class="row buttomRow bg_default">
  4762. <div class="bottom">
  4763. <div class="left">
  4764. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  4765. <div id="drawer">
  4766. <div class="toc">
  4767. <nav>
  4768. <ul class="navL1">
  4769. <li class="inactive toggle">
  4770. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  4771. <ul class="navL2">
  4772. <li class="inactive">
  4773. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  4774. </li>
  4775. <li class="inactive">
  4776. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  4777. </li>
  4778. <li class="inactive">
  4779. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  4780. </li>
  4781. <li class="inactive">
  4782. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  4783. </li>
  4784. <li class="inactive">
  4785. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  4786. </li>
  4787. <li class="inactive">
  4788. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  4789. </li>
  4790. </ul>
  4791. </li>
  4792. <li class="inactive toggle">
  4793. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  4794. <ul class="navL2">
  4795. <li class="inactive">
  4796. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  4797. </li>
  4798. <li class="inactive">
  4799. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  4800. </li>
  4801. <li class="inactive">
  4802. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  4803. </li>
  4804. <li class="inactive toggle">
  4805. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  4806. <ul class="navL3">
  4807. <li class="inactive">
  4808. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  4809. </li>
  4810. <li class="inactive">
  4811. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  4812. </li>
  4813. <li class="inactive">
  4814. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  4815. </li>
  4816. <li class="inactive">
  4817. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  4818. </li>
  4819. <li class="inactive">
  4820. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  4821. </li>
  4822. </ul>
  4823. </li>
  4824. </ul>
  4825. </li>
  4826. <li class="inactive toggle">
  4827. <a href="javascript:void(0)" title="Programs">Programs</a>
  4828. <ul class="navL2">
  4829. <li class="inactive toggle">
  4830. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  4831. <ul class="navL3">
  4832. <li class="inactive">
  4833. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  4834. </li>
  4835. <li class="inactive">
  4836. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  4837. </li>
  4838. <li class="inactive">
  4839. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  4840. </li>
  4841. </ul>
  4842. </li>
  4843. <li class="inactive toggle">
  4844. <a href="javascript:void(0)" title="Students">Students</a>
  4845. <ul class="navL3">
  4846. <li class="inactive">
  4847. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  4848. </li>
  4849. <li class="inactive">
  4850. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  4851. </li>
  4852. </ul>
  4853. </li>
  4854. <li class="inactive toggle">
  4855. <a href="javascript:void(0)" title="Architects">Architects</a>
  4856. <ul class="navL3">
  4857. <li class="inactive">
  4858. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  4859. </li>
  4860. <li class="inactive">
  4861. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  4862. </li>
  4863. <li class="inactive">
  4864. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  4865. </li>
  4866. <li class="inactive">
  4867. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  4868. </li>
  4869. <li class="inactive">
  4870. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  4871. </li>
  4872. </ul>
  4873. </li>
  4874. <li class="inactive">
  4875. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  4876. </li>
  4877. <li class="inactive">
  4878. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  4879. </li>
  4880. <li class="inactive">
  4881. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  4882. </li>
  4883. <li class="inactive">
  4884. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  4885. </li>
  4886. </ul>
  4887. </li>
  4888. <li class="inactive toggle">
  4889. <a href="javascript:void(0)" title="Community">Community</a>
  4890. <ul class="navL2">
  4891. <li class="inactive">
  4892. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  4893. </li>
  4894. <li class="inactive">
  4895. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  4896. </li>
  4897. <li class="inactive">
  4898. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  4899. </li>
  4900. <li class="inactive">
  4901. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  4902. </li>
  4903. <li class="inactive">
  4904. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  4905. </li>
  4906. </ul>
  4907. </li>
  4908. <li class="inactive current toggle">
  4909. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  4910. <ul class="navL2">
  4911. <li class="inactive current">
  4912. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  4913. </li>
  4914. <li class="inactive">
  4915. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  4916. </li>
  4917. </ul>
  4918. </li>
  4919. <li class="inactive">
  4920. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  4921. </li>
  4922. </ul>
  4923. </nav>
  4924. </div>
  4925. </div>
  4926. </div>
  4927. <div class="right">
  4928. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  4929. <div class="SearchBox">
  4930. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  4931. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  4932. <div id="search-finder" class="search-finder"></div>
  4933. </button>
  4934. <button id="HeaderSearchButton" style="display:none"></button>
  4935. <div id="searchSplitter"></div>
  4936. <div id="searchCloseIcon" class="search-clear-x"></div>
  4937. <div id="searchTextContainer" style="width: 0;">
  4938. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  4939. </div>
  4940. </form>
  4941. </div>
  4942. </div>
  4943. </div>
  4944. </div>
  4945. </div>
  4946. </div>
  4947. </header>
  4948. </div>
  4949. <div class="printExportMenus ltr">
  4950. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fff554721(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  4951. Export (<span class="count">0</span>)
  4952. </a>
  4953. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/ff554721(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  4954. Print
  4955. </a>
  4956. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  4957. </a>
  4958. </div>
  4959. <div class="printExportMenus ltr">
  4960. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  4961. </div>
  4962. <div id="body" ms.pgarea="body">
  4963. <span id="tabletView_large"></span>
  4964. <span id="tabletView_small"></span>
  4965. <span id="mobileView"></span>
  4966. <div id="content" class="content">
  4967. <input type="hidden" id="printForPab" value="true">
  4968. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  4969. <h1 class="title">Device nodes and device stacks</h1>
  4970. <div id="mainSection">
  4971. <div class="clsServerSDKContent">
  4972. </div>
  4973. <p>
  4974. </p><p>In Windows, devices are represented by device nodes in the Plug and Play (PnP) device tree. Typically, when an I/O request is sent to a device, several drivers help handle the request. Each of these drivers is associated with a device object, and the device objects are arranged in a stack. The sequence of device objects along with their associated drivers is called a device stack. Each device node has its own device stack.</p>
  4975. <h2><a id="Device_nodes_and_the_Plug_and_Play_device_tree"></a><a id="device_nodes_and_the_plug_and_play_device_tree"></a><a id="DEVICE_NODES_AND_THE_PLUG_AND_PLAY_DEVICE_TREE"></a>Device nodes and the Plug and Play device tree</h2>
  4976. <p>Windows organizes devices in a tree structure called the <em>Plug and Play device tree</em>, or simply the <em>device tree</em>. Typically, a node in the device tree represents either a device or an individual function on a composite device. However, some nodes represent software components that have no association with physical devices.</p>
  4977. <p>A node in the device tree is called a <em>device node</em>. The root node of the device tree is called the <em>root device node</em>. By convention, the root device node is drawn at the bottom of the device tree, as shown in the following diagram. </p><img id="DeviceTree01" alt="Diagram of the device tree, showing device nodes" src="./Windows Kernel Development Articles (2016-03-30)_files/IC559043.png" title="Diagram of the device tree, showing device nodes" xmlns=""><p>The device tree illustrates the parent/child relationships that are inherent in the PnP environment. Several of the nodes in the device tree represent buses that have child devices connected to them. For example, the PCI Bus node represents the physical PCI bus on the motherboard. During startup, the PnP manager asks the PCI bus driver to enumerate the devices that are connected to the PCI bus. Those devices are represented by child nodes of the PCI Bus node. In the preceding diagram, the PCI Bus node has child nodes for several devices that are connected to the PCI bus, including USB host controllers, an audio controller, and a PCI Express port.</p>
  4978. <p>Some of the devices connected to the PCI bus are buses themselves. The PnP manager asks each of these buses to enumerate the devices that are connected to it. In the preceding diagram, we can see that the audio controller is a bus that has an audio device connected to it. We can see that the PCI Express port is a bus that has a display adapter connected to it, and the display adapter is a bus that has one monitor connected to it.</p>
  4979. <p>Whether you think of a node as representing a device or a bus depends on your point of view. For example, you can think of the display adapter as a device that plays a key role in preparing frames that appear on the screen. However, you can also think of the display adapter as a bus that is capable of detecting and enumerating connected monitors. </p>
  4980. <h2><a id="Device_objects_and_device_stacks"></a><a id="device_objects_and_device_stacks"></a><a id="DEVICE_OBJECTS_AND_DEVICE_STACKS"></a>Device objects and device stacks</h2>
  4981. <p>A <em>device object</em> is an instance of a <a href="https://msdn.microsoft.com/en-us/library/ff543147(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DEVICE_OBJECT</strong></a> structure. Each device node in the PnP device tree has an ordered list of device objects, and each of these device objects is associated with a driver. The ordered list of device objects, along with their associated drivers, is called the <em>device stack</em> for the device node.</p>
  4982. <p>You can think of a device stack in several ways. In the most formal sense, a device stack is an ordered list of (device object, driver) pairs. However, in certain contexts it might be useful to think of the device stack as an ordered list of device objects. In other contexts, it might be useful to think of the device stack as an ordered list of drivers.</p>
  4983. <p>By convention, a device stack has a top and a bottom. The first device object to be created in the device stack is at the bottom, and the last device object to be created and attached to the device stack is at the top.</p>
  4984. <p>In the following diagram, the Proseware Gizmo device node has a device stack that contains three (device object, driver) pairs. The top device object is associated with the driver AfterThought.sys, the middle device object is associated with the driver Proseware.sys, and the bottom device object is associated with the driver Pci.sys. The PCI Bus node in the center of the diagram has a device stack that contains two (device object, driver) pairs--a device object associated with Pci.sys and a device object associated with Acpi.sys.</p><img id="prosewaredevicenode01" alt="Diagram showing device objects ordered in device stacks in the Proseware Gizmo and PCI device nodes" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535098.png" title="Diagram showing device objects ordered in device stacks in the Proseware Gizmo and PCI device nodes" xmlns=""><h2><a id="How_does_a_device_stack_get_constructed_"></a><a id="how_does_a_device_stack_get_constructed_"></a><a id="HOW_DOES_A_DEVICE_STACK_GET_CONSTRUCTED_"></a>How does a device stack get constructed?</h2>
  4985. <p>During startup, the PnP manager asks the driver for each bus to enumerate child devices that are connected to the bus. For example, the PnP manager asks the PCI bus driver (Pci.sys) to enumerate the devices that are connected to the PCI bus. In response to this request, Pci.sys creates a device object for each device that is connected to the PCI bus. Each of these device objects is called a <em>physical device object</em> (PDO). Shortly after Pci.sys creates the set of PDOs, the device tree looks like the one shown in the following diagram.</p><img id="prosewaredevicenode04" alt="Diagram of PCI node and physical device objects for child devices" src="./Windows Kernel Development Articles (2016-03-30)_files/IC559044.png" title="Diagram of PCI node and physical device objects for child devices" xmlns=""><p>The PnP manager associates a device node with each newly created PDO and looks in the registry to determine which drivers need to be part of the device stack for the node. The device stack must have one (and only one) <em>function driver</em> and can optionally have one or more <em>filter drivers</em>. The function driver is the main driver for the device stack and is responsible for handling read, write, and device control requests. Filter drivers play auxiliary roles in processing read, write, and device control requests. As each function and filter driver is loaded, it creates a device object and attaches itself to the device stack. A device object created by the function driver is called a <em>functional device object</em> (FDO), and a device object created by a filter driver is called a <em>filter device object</em> (Filter DO). Now the device tree looks something like this diagram.</p><img id="prosewaredevicenode02" alt="Diagram of a device tree showing the filter, function, and physical device objects in the Proseware Gizmo device node" src="./Windows Kernel Development Articles (2016-03-30)_files/IC559045.png" title="Diagram of a device tree showing the filter, function, and physical device objects in the Proseware Gizmo device node" xmlns=""><p>In the diagram, notice that in one node, the filter driver is above the function driver, and in the other node, the filter driver is below the function driver. A filter driver that is above the function driver in a device stack is called an <em>upper filter driver</em>. A filter driver that is below the function driver is called a <em>lower filter driver</em>.</p>
  4986. <p>The PDO is always the bottom device object in a device stack. This results from the way a device stack is constructed. The PDO is created first, and as additional device objects are attached to the stack, they are attached to the top of the existing stack.</p>
  4987. <div class="alert"><strong>Note</strong>&nbsp;&nbsp;<p class="note">When the drivers for a device are installed, the installer uses information in an information (INF) file to determine which driver is the function driver and which drivers are filters. Typically the INF file is provided either by Microsoft or by the hardware vendor. After the drivers for a device are installed, the PnP manager can determine the function and filter drivers for the device by looking in the registry.</p>
  4988. <p class="note"></p>
  4989. </div>
  4990. <div>&nbsp;</div>
  4991. <h2><a id="Bus_drivers"></a><a id="bus_drivers"></a><a id="BUS_DRIVERS"></a>Bus drivers</h2>
  4992. <p>In the preceding diagram, you can see that the driver Pci.sys plays two roles. First, Pci.sys is associated with the FDO in the PCI Bus device node. In fact, it created the FDO in the PCI Bus device node. So Pci.sys is the function driver for the PCI bus. Second, Pci.sys is associated with the PDO in each child of the PCI Bus node. Recall that it created the PDOs for the child devices. The driver that creates the PDO for a device node is called the <em>bus driver</em> for the node.</p>
  4993. <p>If your point of reference is the PCI bus, then Pci.sys is the function driver. But if your point of reference is the Proseware Gizmo device, then Pci.sys is the bus driver. This dual role is typical in the PnP device tree. A driver that serves as function driver for a bus also serves as bus driver for a child device of the bus.</p>
  4994. <h2><a id="User-mode_device_stacks"></a><a id="user-mode_device_stacks"></a><a id="USER-MODE_DEVICE_STACKS"></a>User-mode device stacks</h2>
  4995. <p>So far we've been discussing kernel-mode device stacks. That is, the drivers in the stacks run in kernel mode, and the device objects are mapped into system space, which is the address space that is available only to code running in kernel mode. For information about the difference between kernel mode and user mode, see <a href="https://msdn.microsoft.com/en-us/library/ff554836(v=vs.85).aspx">User mode and kernel mode</a>.</p>
  4996. <p>In some cases, a device has a user-mode device stack in addition to its kernel-mode device stack. User-mode drivers are often based on the User-Mode Driver Framework (UMDF), which is one of the driver models provided by the <a href="https://msdn.microsoft.com/en-us/library/ff557565(v=vs.85).aspx">Windows Driver Frameworks (WDF)</a>. In UMDF, the drivers are user-mode DLLs, and the device objects are COM objects that implement the <a href="https://msdn.microsoft.com/en-us/library/ff556917(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">IWDFDevice</strong></a> interface. A device object in a UMDF device stack is called a <em>WDF device object</em> (WDF DO).</p>
  4997. <p>The following diagram shows the device node, kernel-mode device stack, and the user-mode device stack for a USB-FX-2 device. The drivers in both the user-mode and kernel-mode stacks participate in I/O requests that are directed at the USB-FX-2 device.</p><img id="UserAndKernelDeviceStacks01" alt="Diagram showing user-mode and kernel-mode device stacks" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535101.png" title="Diagram showing user-mode and kernel-mode device stacks" xmlns=""><h2><a id="related_topics"></a>Related topics</h2>
  4998. <dl>
  4999. <dt>
  5000. <a href="https://msdn.microsoft.com/en-us/library/ff554731(v=vs.85).aspx">Concepts for all driver developers</a>
  5001. </dt>
  5002. <dt>
  5003. <a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx">Driver stacks</a>
  5004. </dt>
  5005. </dl>
  5006. <p>&nbsp;</p>
  5007. <p>&nbsp;</p>
  5008. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Device%20nodes%20and%20device%20stacks%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  5009. </div>
  5010. </div>
  5011. </div>
  5012. </div>
  5013. <div class="clear"></div>
  5014. <input name="__RequestVerificationToken" type="hidden" value="jCYMiDP681esnBmCmEL1IKtpwppIJiV6ZuB4RNW_-6CoQXhy_BPtqp_b6Vk9eP0bzYLpa3cttm-m9DDCz1WCTK3jRLE1">
  5015. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/ff554721(d=printer,v=vs.85).aspx">
  5016. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/ff554721(d=printer,v=vs.85).aspx">
  5017. <input id="isTopicRated" type="hidden" value="false">
  5018. <div id="lib-footer" ms.pgarea="body">
  5019. <link type="text/css" rel="stylesheet">
  5020. <div id="ux-footer" class="" style="" dir="ltr">
  5021. <div id="footerSock" class="librarySock both">
  5022. <div id="footerSockInner">
  5023. <a name="feedback"></a>
  5024. <div class="rating">
  5025. <div id="ratingSection1">
  5026. <div class="title">
  5027. Was this page helpful?
  5028. </div>
  5029. <div class="description">
  5030. Your feedback about this content is important.<br>Let us know what you think.
  5031. </div>
  5032. <div class="buttons">
  5033. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  5034. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  5035. </div>
  5036. <input id="ratingValue" type="hidden" value="">
  5037. </div>
  5038. <div id="ratingSection2">
  5039. <div class="title left">
  5040. Additional feedback?
  5041. </div>
  5042. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  5043. <div class="right">
  5044. <div class="counter">
  5045. <span id="feedbackTextCounter">1500</span> characters remaining
  5046. </div>
  5047. <div class="buttons">
  5048. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  5049. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  5050. </div>
  5051. </div>
  5052. </div>
  5053. <div id="ratingSection3">
  5054. <div class="title">
  5055. Thank you!
  5056. </div>
  5057. <div class="description">
  5058. We appreciate your feedback.
  5059. </div>
  5060. </div>
  5061. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  5062. </div>
  5063. <div class="userVoice">
  5064. <div class="title">
  5065. Help us improve MSDN.
  5066. </div>
  5067. <div class="description">
  5068. Visit our UserVoice Page to submit and vote on ideas!
  5069. </div>
  5070. <div class="buttons">
  5071. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  5072. </div>
  5073. </div>
  5074. <div class="clear"></div>
  5075. </div>
  5076. </div>
  5077. <footer class="top">
  5078. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  5079. <div class="linkList">
  5080. <div class="linkListTitle">Dev centers</div>
  5081. <ul class="links">
  5082. <li>
  5083. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  5084. </li>
  5085. <li>
  5086. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  5087. </li>
  5088. <li>
  5089. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  5090. </li>
  5091. <li>
  5092. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  5093. </li>
  5094. <li>
  5095. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  5096. </li>
  5097. </ul>
  5098. </div>
  5099. </div>
  5100. <div id="rightLinks">
  5101. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  5102. <div class="linkList">
  5103. <div class="linkListTitle">Learning resources</div>
  5104. <ul class="links">
  5105. <li>
  5106. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  5107. </li>
  5108. <li>
  5109. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  5110. </li>
  5111. <li>
  5112. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  5113. </li>
  5114. </ul>
  5115. </div>
  5116. </div>
  5117. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  5118. <div class="linkList">
  5119. <div class="linkListTitle">Community</div>
  5120. <ul class="links">
  5121. <li>
  5122. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  5123. </li>
  5124. <li>
  5125. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  5126. </li>
  5127. <li>
  5128. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  5129. </li>
  5130. </ul>
  5131. </div>
  5132. </div>
  5133. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  5134. <div class="linkList">
  5135. <div class="linkListTitle">Support</div>
  5136. <ul class="links">
  5137. <li>
  5138. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  5139. </li>
  5140. </ul>
  5141. </div>
  5142. </div>
  5143. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  5144. <div class="linkList">
  5145. <div class="linkListTitle">Programs</div>
  5146. <ul class="links">
  5147. <li>
  5148. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  5149. </li>
  5150. <li>
  5151. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  5152. </li>
  5153. <li>
  5154. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  5155. </li>
  5156. </ul>
  5157. </div>
  5158. </div>
  5159. </div>
  5160. </footer>
  5161. <footer class="bottom">
  5162. <span class="localeContainer">
  5163. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  5164. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554721(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  5165. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  5166. </form>
  5167. </span>
  5168. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  5169. <div class="linkList">
  5170. <ul class="links horizontal">
  5171. <li>
  5172. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  5173. </li>
  5174. <li>
  5175. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  5176. </li>
  5177. <li>
  5178. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  5179. </li>
  5180. <li>
  5181. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  5182. </li>
  5183. </ul>
  5184. </div>
  5185. </div>
  5186. <span class="logoLegal">
  5187. <span class="logo"></span>
  5188. <span class="copyright">© 2016 Microsoft</span>
  5189. </span>
  5190. </footer>
  5191. </div>
  5192. </div>
  5193. <div class="footerPrintView">
  5194. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  5195. </div>
  5196. <input id="tocPaddingPerLevel" type="hidden" value="17">
  5197. <input id="MtpsDevice" type="hidden" value="Printer">
  5198. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  5199. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  5200. <div id="globalRequestVerification">
  5201. <input name="__RequestVerificationToken" type="hidden" value="e9oeGUDGYoaEybG8lg054JSz--DS_hylYEiWuAdF4WTLBFkat-3Q6A-u547xm-M7PW_SKCE8HS1HKCAKYZjS99_ggZo1">
  5202. </div>
  5203. </div>
  5204. <script type="text/javascript" class="mtps-injected">
  5205. /*<![CDATA[*/
  5206. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  5207. MTPS.injectScripts([
  5208. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  5209. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/ff554721(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  5210. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  5211. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  5212. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  5213. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  5214. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  5215. ]);
  5216. /*]]>*/
  5217. </script>
  5218. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  5219. <div id="page">
  5220. <link type="text/css" rel="stylesheet">
  5221. <input type="hidden" id="isHeaderBleeding" value="true">
  5222. <div id="ux-header" dir="ltr" class="ltr msdn">
  5223. <header>
  5224. <span id="singleCol"></span>
  5225. <span id="doubleCol"></span>
  5226. <span id="isMobile"></span>
  5227. <div>
  5228. <div class="row topRow">
  5229. <div class="top">
  5230. <div class="left">
  5231. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  5232. <div id="msft-logo" class="msft-logo"></div>
  5233. </a>
  5234. <div class="GrayPipe"></div>
  5235. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  5236. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  5237. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  5238. </div>
  5239. <div class="right">
  5240. <div id="signIn">
  5241. <div class="profileImage"></div>
  5242. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376406&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439638%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  5243. <div class="auxNav">
  5244. <div>
  5245. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  5246. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  5247. </div>
  5248. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  5249. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  5250. </div>
  5251. </div>
  5252. <div>
  5253. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  5254. <div class="linkList">
  5255. <ul class="links horizontal">
  5256. <li>
  5257. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  5258. </li>
  5259. <li>
  5260. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  5261. </li>
  5262. <li>
  5263. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  5264. </li>
  5265. </ul>
  5266. </div>
  5267. </div>
  5268. </div>
  5269. </div>
  5270. </div>
  5271. </div>
  5272. </div>
  5273. <div class="row middleRow">
  5274. <div class="expandTop">
  5275. <div class="left"></div>
  5276. <div class="right"></div>
  5277. </div>
  5278. </div>
  5279. </div>
  5280. <div id="buttomRowWrapper" class="bg_default">
  5281. <div class="row buttomRow bg_default">
  5282. <div class="bottom">
  5283. <div class="left">
  5284. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  5285. <div id="drawer">
  5286. <div class="toc">
  5287. <nav>
  5288. <ul class="navL1">
  5289. <li class="inactive toggle">
  5290. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  5291. <ul class="navL2">
  5292. <li class="inactive">
  5293. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  5294. </li>
  5295. <li class="inactive">
  5296. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  5297. </li>
  5298. <li class="inactive">
  5299. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  5300. </li>
  5301. <li class="inactive">
  5302. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  5303. </li>
  5304. <li class="inactive">
  5305. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  5306. </li>
  5307. <li class="inactive">
  5308. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  5309. </li>
  5310. </ul>
  5311. </li>
  5312. <li class="inactive toggle">
  5313. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  5314. <ul class="navL2">
  5315. <li class="inactive">
  5316. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  5317. </li>
  5318. <li class="inactive">
  5319. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  5320. </li>
  5321. <li class="inactive">
  5322. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  5323. </li>
  5324. <li class="inactive toggle">
  5325. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  5326. <ul class="navL3">
  5327. <li class="inactive">
  5328. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  5329. </li>
  5330. <li class="inactive">
  5331. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  5332. </li>
  5333. <li class="inactive">
  5334. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  5335. </li>
  5336. <li class="inactive">
  5337. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  5338. </li>
  5339. <li class="inactive">
  5340. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  5341. </li>
  5342. </ul>
  5343. </li>
  5344. </ul>
  5345. </li>
  5346. <li class="inactive toggle">
  5347. <a href="javascript:void(0)" title="Programs">Programs</a>
  5348. <ul class="navL2">
  5349. <li class="inactive toggle">
  5350. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  5351. <ul class="navL3">
  5352. <li class="inactive">
  5353. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  5354. </li>
  5355. <li class="inactive">
  5356. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  5357. </li>
  5358. <li class="inactive">
  5359. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  5360. </li>
  5361. </ul>
  5362. </li>
  5363. <li class="inactive toggle">
  5364. <a href="javascript:void(0)" title="Students">Students</a>
  5365. <ul class="navL3">
  5366. <li class="inactive">
  5367. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  5368. </li>
  5369. <li class="inactive">
  5370. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  5371. </li>
  5372. </ul>
  5373. </li>
  5374. <li class="inactive toggle">
  5375. <a href="javascript:void(0)" title="Architects">Architects</a>
  5376. <ul class="navL3">
  5377. <li class="inactive">
  5378. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  5379. </li>
  5380. <li class="inactive">
  5381. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  5382. </li>
  5383. <li class="inactive">
  5384. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  5385. </li>
  5386. <li class="inactive">
  5387. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  5388. </li>
  5389. <li class="inactive">
  5390. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  5391. </li>
  5392. </ul>
  5393. </li>
  5394. <li class="inactive">
  5395. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  5396. </li>
  5397. <li class="inactive">
  5398. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  5399. </li>
  5400. <li class="inactive">
  5401. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  5402. </li>
  5403. <li class="inactive">
  5404. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  5405. </li>
  5406. </ul>
  5407. </li>
  5408. <li class="inactive toggle">
  5409. <a href="javascript:void(0)" title="Community">Community</a>
  5410. <ul class="navL2">
  5411. <li class="inactive">
  5412. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  5413. </li>
  5414. <li class="inactive">
  5415. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  5416. </li>
  5417. <li class="inactive">
  5418. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  5419. </li>
  5420. <li class="inactive">
  5421. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  5422. </li>
  5423. <li class="inactive">
  5424. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  5425. </li>
  5426. </ul>
  5427. </li>
  5428. <li class="inactive current toggle">
  5429. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  5430. <ul class="navL2">
  5431. <li class="inactive current">
  5432. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  5433. </li>
  5434. <li class="inactive">
  5435. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  5436. </li>
  5437. </ul>
  5438. </li>
  5439. <li class="inactive">
  5440. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  5441. </li>
  5442. </ul>
  5443. </nav>
  5444. </div>
  5445. </div>
  5446. </div>
  5447. <div class="right">
  5448. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  5449. <div class="SearchBox">
  5450. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  5451. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  5452. <div id="search-finder" class="search-finder"></div>
  5453. </button>
  5454. <button id="HeaderSearchButton" style="display:none"></button>
  5455. <div id="searchSplitter"></div>
  5456. <div id="searchCloseIcon" class="search-clear-x"></div>
  5457. <div id="searchTextContainer" style="width: 0;">
  5458. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  5459. </div>
  5460. </form>
  5461. </div>
  5462. </div>
  5463. </div>
  5464. </div>
  5465. </div>
  5466. </div>
  5467. </header>
  5468. </div>
  5469. <div class="printExportMenus ltr">
  5470. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh439638(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  5471. Export (<span class="count">0</span>)
  5472. </a>
  5473. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh439638(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  5474. Print
  5475. </a>
  5476. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  5477. </a>
  5478. </div>
  5479. <div class="printExportMenus ltr">
  5480. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  5481. </div>
  5482. <div id="body" ms.pgarea="body">
  5483. <span id="tabletView_large"></span>
  5484. <span id="tabletView_small"></span>
  5485. <span id="mobileView"></span>
  5486. <div id="content" class="content">
  5487. <input type="hidden" id="printForPab" value="true">
  5488. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  5489. <h1 class="title">I/O request packets</h1>
  5490. <div id="mainSection">
  5491. <div class="clsServerSDKContent">
  5492. </div>
  5493. <p>Most of the requests that are sent to device drivers are packaged in I/O request packets (<a href="https://msdn.microsoft.com/en-us/library/ff550694(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">IRP</strong></a>s). An operating system component or a driver sends an IRP to a driver by calling <a href="https://msdn.microsoft.com/en-us/library/ff548336(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">IoCallDriver</strong></a>, which has two parameters: a pointer to a <a href="https://msdn.microsoft.com/en-us/library/ff543147(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DEVICE_OBJECT</strong></a> and a pointer to an <strong>IRP</strong>. The <strong>DEVICE_OBJECT</strong> has a pointer to an associated <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a>. When a component calls <strong>IoCallDriver</strong>, we say the component <em>sends the IRP to the device object</em> or <em>sends the IRP to the driver associated with the device object</em>. Sometimes we use the phrase <em>passes the IRP</em> or <em>forwards the IRP</em> instead of <em>sends the IRP</em>.</p>
  5494. <p>Typically an IRP is processed by several drivers that are arranged in a stack. Each driver in the stack is associated with a device object. For more information, see <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a>. When an <a href="https://msdn.microsoft.com/en-us/library/ff550694(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">IRP</strong></a> is processed by a device stack, the <strong>IRP</strong> is usually sent first to the top device object in the device stack. For example, if an <strong>IRP</strong> is processed by the device stack shown in this diagram, the IRP would be sent first to the filter device object (Filter DO) at the top of the device stack.</p><img id="ProsewareDeviceNode03" alt="Diagram of a device node and its device stack" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535107.png" title="Diagram of a device node and its device stack" xmlns=""><h2><a id="Passing_an_IRP_down_the_device_stack"></a><a id="passing_an_irp_down_the_device_stack"></a><a id="PASSING_AN_IRP_DOWN_THE_DEVICE_STACK"></a>Passing an IRP down the device stack</h2>
  5495. <p>Suppose the I/O manager sends an IRP to the Filter DO in the diagram. The driver associated with the Filter DO, AfterThought.sys, processes the IRP and then passes it to the functional device object (FDO), which is the next lower device object in the device stack. When a driver passes an IRP to the next lower device object in the device stack, we say the driver <em>passes the IRP down the device stack</em>.</p>
  5496. <p>Some IRPs are passed all the way down the device stack to the physical device object (PDO). Other IRPs never reach the PDO because they are completed by one of the drivers above the PDO.</p>
  5497. <h2><a id="IRPs_are_self-contained"></a><a id="irps_are_self-contained"></a><a id="IRPS_ARE_SELF-CONTAINED"></a>IRPs are self-contained</h2>
  5498. <p>The IRP structure is self-contained in the sense that it holds all of the information that a driver needs to handle an I/0 request. Some parts of the IRP structure hold information that is common to all of the participating drivers in the stack. Other parts of the IRP hold information that is specific to a particular driver in the stack.</p>
  5499. <p>&nbsp;</p>
  5500. <p>&nbsp;</p>
  5501. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20I/O%20request%20packets%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  5502. </div>
  5503. </div>
  5504. </div>
  5505. </div>
  5506. <div class="clear"></div>
  5507. <input name="__RequestVerificationToken" type="hidden" value="t8spR-QgGPJ3gewNcsyRxxW9z38K2-eaXb8a5wuIxHRkCpe5nqAlBs2aOAMkm7wj-MYvB8yxrWaRBCEQNyhATix7g5A1">
  5508. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh439638(d=printer,v=vs.85).aspx">
  5509. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh439638(d=printer,v=vs.85).aspx">
  5510. <input id="isTopicRated" type="hidden" value="false">
  5511. <div id="lib-footer" ms.pgarea="body">
  5512. <link type="text/css" rel="stylesheet">
  5513. <div id="ux-footer" class="" style="" dir="ltr">
  5514. <div id="footerSock" class="librarySock both">
  5515. <div id="footerSockInner">
  5516. <a name="feedback"></a>
  5517. <div class="rating">
  5518. <div id="ratingSection1">
  5519. <div class="title">
  5520. Was this page helpful?
  5521. </div>
  5522. <div class="description">
  5523. Your feedback about this content is important.<br>Let us know what you think.
  5524. </div>
  5525. <div class="buttons">
  5526. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  5527. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  5528. </div>
  5529. <input id="ratingValue" type="hidden" value="">
  5530. </div>
  5531. <div id="ratingSection2">
  5532. <div class="title left">
  5533. Additional feedback?
  5534. </div>
  5535. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  5536. <div class="right">
  5537. <div class="counter">
  5538. <span id="feedbackTextCounter">1500</span> characters remaining
  5539. </div>
  5540. <div class="buttons">
  5541. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  5542. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  5543. </div>
  5544. </div>
  5545. </div>
  5546. <div id="ratingSection3">
  5547. <div class="title">
  5548. Thank you!
  5549. </div>
  5550. <div class="description">
  5551. We appreciate your feedback.
  5552. </div>
  5553. </div>
  5554. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  5555. </div>
  5556. <div class="userVoice">
  5557. <div class="title">
  5558. Help us improve MSDN.
  5559. </div>
  5560. <div class="description">
  5561. Visit our UserVoice Page to submit and vote on ideas!
  5562. </div>
  5563. <div class="buttons">
  5564. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  5565. </div>
  5566. </div>
  5567. <div class="clear"></div>
  5568. </div>
  5569. </div>
  5570. <footer class="top">
  5571. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  5572. <div class="linkList">
  5573. <div class="linkListTitle">Dev centers</div>
  5574. <ul class="links">
  5575. <li>
  5576. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  5577. </li>
  5578. <li>
  5579. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  5580. </li>
  5581. <li>
  5582. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  5583. </li>
  5584. <li>
  5585. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  5586. </li>
  5587. <li>
  5588. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  5589. </li>
  5590. </ul>
  5591. </div>
  5592. </div>
  5593. <div id="rightLinks">
  5594. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  5595. <div class="linkList">
  5596. <div class="linkListTitle">Learning resources</div>
  5597. <ul class="links">
  5598. <li>
  5599. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  5600. </li>
  5601. <li>
  5602. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  5603. </li>
  5604. <li>
  5605. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  5606. </li>
  5607. </ul>
  5608. </div>
  5609. </div>
  5610. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  5611. <div class="linkList">
  5612. <div class="linkListTitle">Community</div>
  5613. <ul class="links">
  5614. <li>
  5615. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  5616. </li>
  5617. <li>
  5618. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  5619. </li>
  5620. <li>
  5621. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  5622. </li>
  5623. </ul>
  5624. </div>
  5625. </div>
  5626. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  5627. <div class="linkList">
  5628. <div class="linkListTitle">Support</div>
  5629. <ul class="links">
  5630. <li>
  5631. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  5632. </li>
  5633. </ul>
  5634. </div>
  5635. </div>
  5636. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  5637. <div class="linkList">
  5638. <div class="linkListTitle">Programs</div>
  5639. <ul class="links">
  5640. <li>
  5641. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  5642. </li>
  5643. <li>
  5644. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  5645. </li>
  5646. <li>
  5647. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  5648. </li>
  5649. </ul>
  5650. </div>
  5651. </div>
  5652. </div>
  5653. </footer>
  5654. <footer class="bottom">
  5655. <span class="localeContainer">
  5656. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  5657. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439638(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  5658. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  5659. </form>
  5660. </span>
  5661. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  5662. <div class="linkList">
  5663. <ul class="links horizontal">
  5664. <li>
  5665. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  5666. </li>
  5667. <li>
  5668. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  5669. </li>
  5670. <li>
  5671. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  5672. </li>
  5673. <li>
  5674. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  5675. </li>
  5676. </ul>
  5677. </div>
  5678. </div>
  5679. <span class="logoLegal">
  5680. <span class="logo"></span>
  5681. <span class="copyright">© 2016 Microsoft</span>
  5682. </span>
  5683. </footer>
  5684. </div>
  5685. </div>
  5686. <div class="footerPrintView">
  5687. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  5688. </div>
  5689. <input id="tocPaddingPerLevel" type="hidden" value="17">
  5690. <input id="MtpsDevice" type="hidden" value="Printer">
  5691. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  5692. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  5693. <div id="globalRequestVerification">
  5694. <input name="__RequestVerificationToken" type="hidden" value="BMuVa0ZtcT1GmCQtSM0m-XaYu_IFOSJjUxviiFXAoQ5jMi4BOfbgf-OoH3ZyiDl6IAt59wjB3Q09DhUpZyn1aT5CdW41">
  5695. </div>
  5696. </div>
  5697. <script type="text/javascript" class="mtps-injected">
  5698. /*<![CDATA[*/
  5699. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  5700. MTPS.injectScripts([
  5701. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  5702. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh439638(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  5703. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  5704. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  5705. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  5706. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  5707. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  5708. ]);
  5709. /*]]>*/
  5710. </script>
  5711. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  5712. <div id="page">
  5713. <link type="text/css" rel="stylesheet">
  5714. <input type="hidden" id="isHeaderBleeding" value="true">
  5715. <div id="ux-header" dir="ltr" class="ltr msdn">
  5716. <header>
  5717. <span id="singleCol"></span>
  5718. <span id="doubleCol"></span>
  5719. <span id="isMobile"></span>
  5720. <div>
  5721. <div class="row topRow">
  5722. <div class="top">
  5723. <div class="left">
  5724. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  5725. <div id="msft-logo" class="msft-logo"></div>
  5726. </a>
  5727. <div class="GrayPipe"></div>
  5728. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  5729. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  5730. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  5731. </div>
  5732. <div class="right">
  5733. <div id="signIn">
  5734. <div class="profileImage"></div>
  5735. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376407&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439632%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  5736. <div class="auxNav">
  5737. <div>
  5738. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  5739. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  5740. </div>
  5741. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  5742. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  5743. </div>
  5744. </div>
  5745. <div>
  5746. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  5747. <div class="linkList">
  5748. <ul class="links horizontal">
  5749. <li>
  5750. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  5751. </li>
  5752. <li>
  5753. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  5754. </li>
  5755. <li>
  5756. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  5757. </li>
  5758. </ul>
  5759. </div>
  5760. </div>
  5761. </div>
  5762. </div>
  5763. </div>
  5764. </div>
  5765. </div>
  5766. <div class="row middleRow">
  5767. <div class="expandTop">
  5768. <div class="left"></div>
  5769. <div class="right"></div>
  5770. </div>
  5771. </div>
  5772. </div>
  5773. <div id="buttomRowWrapper" class="bg_default">
  5774. <div class="row buttomRow bg_default">
  5775. <div class="bottom">
  5776. <div class="left">
  5777. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  5778. <div id="drawer">
  5779. <div class="toc">
  5780. <nav>
  5781. <ul class="navL1">
  5782. <li class="inactive toggle">
  5783. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  5784. <ul class="navL2">
  5785. <li class="inactive">
  5786. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  5787. </li>
  5788. <li class="inactive">
  5789. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  5790. </li>
  5791. <li class="inactive">
  5792. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  5793. </li>
  5794. <li class="inactive">
  5795. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  5796. </li>
  5797. <li class="inactive">
  5798. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  5799. </li>
  5800. <li class="inactive">
  5801. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  5802. </li>
  5803. </ul>
  5804. </li>
  5805. <li class="inactive toggle">
  5806. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  5807. <ul class="navL2">
  5808. <li class="inactive">
  5809. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  5810. </li>
  5811. <li class="inactive">
  5812. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  5813. </li>
  5814. <li class="inactive">
  5815. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  5816. </li>
  5817. <li class="inactive toggle">
  5818. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  5819. <ul class="navL3">
  5820. <li class="inactive">
  5821. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  5822. </li>
  5823. <li class="inactive">
  5824. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  5825. </li>
  5826. <li class="inactive">
  5827. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  5828. </li>
  5829. <li class="inactive">
  5830. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  5831. </li>
  5832. <li class="inactive">
  5833. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  5834. </li>
  5835. </ul>
  5836. </li>
  5837. </ul>
  5838. </li>
  5839. <li class="inactive toggle">
  5840. <a href="javascript:void(0)" title="Programs">Programs</a>
  5841. <ul class="navL2">
  5842. <li class="inactive toggle">
  5843. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  5844. <ul class="navL3">
  5845. <li class="inactive">
  5846. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  5847. </li>
  5848. <li class="inactive">
  5849. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  5850. </li>
  5851. <li class="inactive">
  5852. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  5853. </li>
  5854. </ul>
  5855. </li>
  5856. <li class="inactive toggle">
  5857. <a href="javascript:void(0)" title="Students">Students</a>
  5858. <ul class="navL3">
  5859. <li class="inactive">
  5860. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  5861. </li>
  5862. <li class="inactive">
  5863. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  5864. </li>
  5865. </ul>
  5866. </li>
  5867. <li class="inactive toggle">
  5868. <a href="javascript:void(0)" title="Architects">Architects</a>
  5869. <ul class="navL3">
  5870. <li class="inactive">
  5871. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  5872. </li>
  5873. <li class="inactive">
  5874. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  5875. </li>
  5876. <li class="inactive">
  5877. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  5878. </li>
  5879. <li class="inactive">
  5880. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  5881. </li>
  5882. <li class="inactive">
  5883. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  5884. </li>
  5885. </ul>
  5886. </li>
  5887. <li class="inactive">
  5888. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  5889. </li>
  5890. <li class="inactive">
  5891. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  5892. </li>
  5893. <li class="inactive">
  5894. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  5895. </li>
  5896. <li class="inactive">
  5897. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  5898. </li>
  5899. </ul>
  5900. </li>
  5901. <li class="inactive toggle">
  5902. <a href="javascript:void(0)" title="Community">Community</a>
  5903. <ul class="navL2">
  5904. <li class="inactive">
  5905. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  5906. </li>
  5907. <li class="inactive">
  5908. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  5909. </li>
  5910. <li class="inactive">
  5911. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  5912. </li>
  5913. <li class="inactive">
  5914. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  5915. </li>
  5916. <li class="inactive">
  5917. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  5918. </li>
  5919. </ul>
  5920. </li>
  5921. <li class="inactive current toggle">
  5922. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  5923. <ul class="navL2">
  5924. <li class="inactive current">
  5925. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  5926. </li>
  5927. <li class="inactive">
  5928. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  5929. </li>
  5930. </ul>
  5931. </li>
  5932. <li class="inactive">
  5933. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  5934. </li>
  5935. </ul>
  5936. </nav>
  5937. </div>
  5938. </div>
  5939. </div>
  5940. <div class="right">
  5941. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  5942. <div class="SearchBox">
  5943. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  5944. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  5945. <div id="search-finder" class="search-finder"></div>
  5946. </button>
  5947. <button id="HeaderSearchButton" style="display:none"></button>
  5948. <div id="searchSplitter"></div>
  5949. <div id="searchCloseIcon" class="search-clear-x"></div>
  5950. <div id="searchTextContainer" style="width: 0;">
  5951. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  5952. </div>
  5953. </form>
  5954. </div>
  5955. </div>
  5956. </div>
  5957. </div>
  5958. </div>
  5959. </div>
  5960. </header>
  5961. </div>
  5962. <div class="printExportMenus ltr">
  5963. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh439632(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  5964. Export (<span class="count">0</span>)
  5965. </a>
  5966. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh439632(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  5967. Print
  5968. </a>
  5969. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  5970. </a>
  5971. </div>
  5972. <div class="printExportMenus ltr">
  5973. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  5974. </div>
  5975. <div id="body" ms.pgarea="body">
  5976. <span id="tabletView_large"></span>
  5977. <span id="tabletView_small"></span>
  5978. <span id="mobileView"></span>
  5979. <div id="content" class="content">
  5980. <input type="hidden" id="printForPab" value="true">
  5981. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  5982. <h1 class="title">Driver stacks</h1>
  5983. <div id="mainSection">
  5984. <div class="clsServerSDKContent">
  5985. </div>
  5986. <p>
  5987. </p><p>Most of the requests that are sent to device drivers are packaged in <a href="https://msdn.microsoft.com/en-us/library/hh439638(v=vs.85).aspx">I/O request packets</a> (IRPs). Each device is represented by a device node, and each device node has a device stack. For more information, see <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a>. To send a read, write, or control request to a device, the I/O manager locates the device node for the device and then sends an IRP to the device stack of that node. Sometimes more than one device stack is involved in processing an I/O request. Regardless of how many device stacks are involved, the overall sequence of drivers that participate in an I/O request is called the <em>driver stack</em> for the request. We also use the term <em>driver stack</em> to refer to the layered set of drivers for a particular technology.</p>
  5988. <h2><a id="I_O_requests_that_are_processed_by_several_device_stacks"></a><a id="i_o_requests_that_are_processed_by_several_device_stacks"></a><a id="I_O_REQUESTS_THAT_ARE_PROCESSED_BY_SEVERAL_DEVICE_STACKS"></a>I/O requests that are processed by several device stacks</h2>
  5989. <p>In some cases, more than one device stack is involved in processing an IRP. The following diagram illustrates a case where four device stacks are involved in processing a single IRP. </p><img id="Chain01" alt="Diagram of four device nodes, each with a device stack" src="./Windows Kernel Development Articles (2016-03-30)_files/IC596026.png" title="Diagram of four device nodes, each with a device stack" xmlns=""><p>Here is how the IRP is processed at each numbered stage in the diagram:</p>
  5990. <ol>
  5991. <li>
  5992. <p>The IRP is created by Disk.sys, which is the function driver in the device stack for the My USB Storage Device node. Disk.sys passes the IRP down the device stack to Usbstor.sys.</p>
  5993. </li>
  5994. <li>Notice that Usbstor.sys is the PDO driver for the My USB Storage Device node and the FDO driver for the USB Mass Storage Device node. At this point, it is not important to decide whether the IRP is owned by the (PDO, Usbstor.sys) pair or the (FDO, Usbstor.sys) pair. The IRP is owned by the driver, Usbstor.sys, and the driver has access to both the PDO and the FDO.</li>
  5995. <li>
  5996. <p>When Usbstor.sys has finished processing the IRP, it passes the IRP to Usbhub.sys. Usbhub.sys is the PDO driver for the USB Mass Storage Device node and the FDO driver for the USB Root Hub node. It is not important to decide whether the IRP is owned by the (PDO, Usbhub.sys) pair or the (FDO, Usbhub.sys) pair. The IRP is owned by the driver, Usbhub.sys, and the driver has access to both the PDO and the FDO.</p>
  5997. </li>
  5998. <li>
  5999. <p>When Usbhub.sys has finished processing the IRP, it passes the IRP to the (Usbuhci.sys, Usbport.sys) pair.</p>
  6000. <p>Usbuhci.sys is a miniport driver, and Usbport.sys is a port driver. The (miniport, port) pair plays the role of a single driver. In this case, both the miniport driver and the port driver are written by Microsoft. The (Usbuhci.sys, Usbport.sys) pair is the PDO driver for the USB Root Hub node, and the (Usbuhci.sys, Usbport.sys) pair is also the FDO driver for the USB Host Controller node. The (Usbuhci.sys, Usbport.sys) pair does the actual communication with the host controller hardware, which in turn communicates with the physical USB storage device.</p>
  6001. </li>
  6002. </ol>
  6003. <h2><a id="The_driver_stack_for_an_I_O_request"></a><a id="the_driver_stack_for_an_i_o_request"></a><a id="THE_DRIVER_STACK_FOR_AN_I_O_REQUEST"></a>The driver stack for an I/O request</h2>
  6004. <p>Consider the sequence of four drivers that participated in the I/O request illustrated in the preceding diagram. We can get another view of the sequence by focusing on the drivers rather than on the device nodes and their individual device stacks. The following diagram shows the drivers in sequence from top to bottom. Notice that Disk.sys is associated with one device object, but each of the other three drivers is associated with two device objects.</p><img id="DriverStack01" alt="Diagram of a driver stack, showing the top driver associated with an FDO only, and the other three drivers associated with a PDO and an FDO" src="./Windows Kernel Development Articles (2016-03-30)_files/IC559047.png" title="Diagram of a driver stack, showing the top driver associated with an FDO only, and the other three drivers associated with a PDO and an FDO" xmlns=""><p>The sequence of drivers that participate in an I/O request is called the <em>driver stack for the I/O request</em>. To illustrate a driver stack for an I/O request, we draw the drivers from top to bottom in the order that they participate in the request.</p>
  6005. <p>Notice that the driver stack for an I/O request is quite different from the device stack for a device node. Also notice that the driver stack for an I/O request does not necessarily remain in one branch of the device tree.</p>
  6006. <h2><a id="Technology_driver_stacks"></a><a id="technology_driver_stacks"></a><a id="TECHNOLOGY_DRIVER_STACKS"></a>Technology driver stacks</h2>
  6007. <p>Consider the driver stack for the I/O request shown in the preceding diagram. If we give each of the drivers a friendly name and make some slight changes to the diagram, we have a block diagram that is similar to many of those that appear in the Windows Driver Kit (WDK) documentation.</p><img id="DriverStack02" alt="Diagram of a driver stack showing friendly names for the drivers: Disk Class Driver on top followed by USB Storage Port Driver, and then USB Hub Driver and (USB 2 Miniport, USB Port) Driver" src="./Windows Kernel Development Articles (2016-03-30)_files/IC559048.png" title="Diagram of a driver stack showing friendly names for the drivers: Disk Class Driver on top followed by USB Storage Port Driver, and then USB Hub Driver and (USB 2 Miniport, USB Port) Driver" xmlns=""><p> In the diagram, the driver stack is divided into three sections. We can think of each section as belonging to a particular technology or to a particular component or portion of the operating system. For example, we might say that the first section at the top of the driver stack belongs to the Volume Manager, the second section belongs to the storage component of the operating system, and the third section belongs to the core USB portion of the operating system.</p>
  6008. <p>Consider the drivers in the third section. These drivers are a subset of a larger set of core USB drivers that Microsoft provides for handling various kinds of USB requests and USB hardware. The following diagram shows what the entire USB core block diagram might look like.</p><img id="TechnologyStack01" alt="Diagram showing the technology driver stack for possible USB core block " src="./Windows Kernel Development Articles (2016-03-30)_files/IC553386.png" title="Diagram showing the technology driver stack for possible USB core block " xmlns=""><p>A block diagram that shows all of the drivers for a particular technology or a particular component or portion of the operating system is called a <em>technology driver stack</em>. Typically, technology driver stacks are given names like the USB Core Driver Stack, the Storage Stack, the 1394 Driver Stack, and the Audio Driver Stack.</p>
  6009. <div class="alert"><strong>Note</strong>&nbsp;&nbsp;The USB core block diagram in this topic shows one of several possible ways to illustrate the technology driver stacks for USB 1.0 and 2.0. For the official diagrams of the USB 1.0, 2.0, and 3.0 driver stacks, see <a href="https://msdn.microsoft.com/en-us/library/hh406256(v=vs.85).aspx">USB Driver Stack Architecture</a>.</div>
  6010. <div>&nbsp;</div>
  6011. <h2><a id="related_topics"></a>Related topics</h2>
  6012. <dl>
  6013. <dt>
  6014. <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a>
  6015. </dt>
  6016. <dt>
  6017. <a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx">Minidrivers and driver pairs</a>
  6018. </dt>
  6019. <dt>
  6020. <a href="https://msdn.microsoft.com/en-us/library/ff554731(v=vs.85).aspx">Concepts for all driver developers</a>
  6021. </dt>
  6022. </dl>
  6023. <p>&nbsp;</p>
  6024. <p>&nbsp;</p>
  6025. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Driver%20stacks%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  6026. </div>
  6027. </div>
  6028. </div>
  6029. </div>
  6030. <div class="clear"></div>
  6031. <input name="__RequestVerificationToken" type="hidden" value="CgeUHee47de-1inmYpUWao4YWoU1B-irz9M_EyqE-InS_wWV6IaBrWCSfc4SXMDEx_FtovW0avtyekSqoiy7-WTPPVQ1">
  6032. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh439632(d=printer,v=vs.85).aspx">
  6033. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh439632(d=printer,v=vs.85).aspx">
  6034. <input id="isTopicRated" type="hidden" value="false">
  6035. <div id="lib-footer" ms.pgarea="body">
  6036. <link type="text/css" rel="stylesheet">
  6037. <div id="ux-footer" class="" style="" dir="ltr">
  6038. <div id="footerSock" class="librarySock both">
  6039. <div id="footerSockInner">
  6040. <a name="feedback"></a>
  6041. <div class="rating">
  6042. <div id="ratingSection1">
  6043. <div class="title">
  6044. Was this page helpful?
  6045. </div>
  6046. <div class="description">
  6047. Your feedback about this content is important.<br>Let us know what you think.
  6048. </div>
  6049. <div class="buttons">
  6050. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  6051. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  6052. </div>
  6053. <input id="ratingValue" type="hidden" value="">
  6054. </div>
  6055. <div id="ratingSection2">
  6056. <div class="title left">
  6057. Additional feedback?
  6058. </div>
  6059. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  6060. <div class="right">
  6061. <div class="counter">
  6062. <span id="feedbackTextCounter">1500</span> characters remaining
  6063. </div>
  6064. <div class="buttons">
  6065. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  6066. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  6067. </div>
  6068. </div>
  6069. </div>
  6070. <div id="ratingSection3">
  6071. <div class="title">
  6072. Thank you!
  6073. </div>
  6074. <div class="description">
  6075. We appreciate your feedback.
  6076. </div>
  6077. </div>
  6078. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  6079. </div>
  6080. <div class="userVoice">
  6081. <div class="title">
  6082. Help us improve MSDN.
  6083. </div>
  6084. <div class="description">
  6085. Visit our UserVoice Page to submit and vote on ideas!
  6086. </div>
  6087. <div class="buttons">
  6088. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  6089. </div>
  6090. </div>
  6091. <div class="clear"></div>
  6092. </div>
  6093. </div>
  6094. <footer class="top">
  6095. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  6096. <div class="linkList">
  6097. <div class="linkListTitle">Dev centers</div>
  6098. <ul class="links">
  6099. <li>
  6100. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  6101. </li>
  6102. <li>
  6103. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  6104. </li>
  6105. <li>
  6106. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  6107. </li>
  6108. <li>
  6109. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  6110. </li>
  6111. <li>
  6112. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  6113. </li>
  6114. </ul>
  6115. </div>
  6116. </div>
  6117. <div id="rightLinks">
  6118. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  6119. <div class="linkList">
  6120. <div class="linkListTitle">Learning resources</div>
  6121. <ul class="links">
  6122. <li>
  6123. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  6124. </li>
  6125. <li>
  6126. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  6127. </li>
  6128. <li>
  6129. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  6130. </li>
  6131. </ul>
  6132. </div>
  6133. </div>
  6134. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  6135. <div class="linkList">
  6136. <div class="linkListTitle">Community</div>
  6137. <ul class="links">
  6138. <li>
  6139. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  6140. </li>
  6141. <li>
  6142. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  6143. </li>
  6144. <li>
  6145. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  6146. </li>
  6147. </ul>
  6148. </div>
  6149. </div>
  6150. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  6151. <div class="linkList">
  6152. <div class="linkListTitle">Support</div>
  6153. <ul class="links">
  6154. <li>
  6155. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  6156. </li>
  6157. </ul>
  6158. </div>
  6159. </div>
  6160. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  6161. <div class="linkList">
  6162. <div class="linkListTitle">Programs</div>
  6163. <ul class="links">
  6164. <li>
  6165. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  6166. </li>
  6167. <li>
  6168. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  6169. </li>
  6170. <li>
  6171. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  6172. </li>
  6173. </ul>
  6174. </div>
  6175. </div>
  6176. </div>
  6177. </footer>
  6178. <footer class="bottom">
  6179. <span class="localeContainer">
  6180. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  6181. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439632(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  6182. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  6183. </form>
  6184. </span>
  6185. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  6186. <div class="linkList">
  6187. <ul class="links horizontal">
  6188. <li>
  6189. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  6190. </li>
  6191. <li>
  6192. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  6193. </li>
  6194. <li>
  6195. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  6196. </li>
  6197. <li>
  6198. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  6199. </li>
  6200. </ul>
  6201. </div>
  6202. </div>
  6203. <span class="logoLegal">
  6204. <span class="logo"></span>
  6205. <span class="copyright">© 2016 Microsoft</span>
  6206. </span>
  6207. </footer>
  6208. </div>
  6209. </div>
  6210. <div class="footerPrintView">
  6211. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  6212. </div>
  6213. <input id="tocPaddingPerLevel" type="hidden" value="17">
  6214. <input id="MtpsDevice" type="hidden" value="Printer">
  6215. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  6216. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  6217. <div id="globalRequestVerification">
  6218. <input name="__RequestVerificationToken" type="hidden" value="uyL6T2D0J5N4AhTTzSN3c-ODWarbKxq8eppbKe9Q_rYQaMvbPZ7zmGTSMGkCYbT7wCEpf8e8wu2tbb6fI4g078oXvdQ1">
  6219. </div>
  6220. </div>
  6221. <script type="text/javascript" class="mtps-injected">
  6222. /*<![CDATA[*/
  6223. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  6224. MTPS.injectScripts([
  6225. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  6226. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh439632(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  6227. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  6228. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  6229. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  6230. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  6231. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  6232. ]);
  6233. /*]]>*/
  6234. </script>
  6235. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  6236. <div id="page">
  6237. <link type="text/css" rel="stylesheet">
  6238. <input type="hidden" id="isHeaderBleeding" value="true">
  6239. <div id="ux-header" dir="ltr" class="ltr msdn">
  6240. <header>
  6241. <span id="singleCol"></span>
  6242. <span id="doubleCol"></span>
  6243. <span id="isMobile"></span>
  6244. <div>
  6245. <div class="row topRow">
  6246. <div class="top">
  6247. <div class="left">
  6248. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  6249. <div id="msft-logo" class="msft-logo"></div>
  6250. </a>
  6251. <div class="GrayPipe"></div>
  6252. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  6253. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  6254. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  6255. </div>
  6256. <div class="right">
  6257. <div id="signIn">
  6258. <div class="profileImage"></div>
  6259. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376408&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439643%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  6260. <div class="auxNav">
  6261. <div>
  6262. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  6263. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  6264. </div>
  6265. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  6266. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  6267. </div>
  6268. </div>
  6269. <div>
  6270. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  6271. <div class="linkList">
  6272. <ul class="links horizontal">
  6273. <li>
  6274. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  6275. </li>
  6276. <li>
  6277. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  6278. </li>
  6279. <li>
  6280. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  6281. </li>
  6282. </ul>
  6283. </div>
  6284. </div>
  6285. </div>
  6286. </div>
  6287. </div>
  6288. </div>
  6289. </div>
  6290. <div class="row middleRow">
  6291. <div class="expandTop">
  6292. <div class="left"></div>
  6293. <div class="right"></div>
  6294. </div>
  6295. </div>
  6296. </div>
  6297. <div id="buttomRowWrapper" class="bg_default">
  6298. <div class="row buttomRow bg_default">
  6299. <div class="bottom">
  6300. <div class="left">
  6301. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  6302. <div id="drawer">
  6303. <div class="toc">
  6304. <nav>
  6305. <ul class="navL1">
  6306. <li class="inactive toggle">
  6307. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  6308. <ul class="navL2">
  6309. <li class="inactive">
  6310. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  6311. </li>
  6312. <li class="inactive">
  6313. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  6314. </li>
  6315. <li class="inactive">
  6316. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  6317. </li>
  6318. <li class="inactive">
  6319. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  6320. </li>
  6321. <li class="inactive">
  6322. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  6323. </li>
  6324. <li class="inactive">
  6325. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  6326. </li>
  6327. </ul>
  6328. </li>
  6329. <li class="inactive toggle">
  6330. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  6331. <ul class="navL2">
  6332. <li class="inactive">
  6333. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  6334. </li>
  6335. <li class="inactive">
  6336. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  6337. </li>
  6338. <li class="inactive">
  6339. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  6340. </li>
  6341. <li class="inactive toggle">
  6342. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  6343. <ul class="navL3">
  6344. <li class="inactive">
  6345. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  6346. </li>
  6347. <li class="inactive">
  6348. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  6349. </li>
  6350. <li class="inactive">
  6351. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  6352. </li>
  6353. <li class="inactive">
  6354. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  6355. </li>
  6356. <li class="inactive">
  6357. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  6358. </li>
  6359. </ul>
  6360. </li>
  6361. </ul>
  6362. </li>
  6363. <li class="inactive toggle">
  6364. <a href="javascript:void(0)" title="Programs">Programs</a>
  6365. <ul class="navL2">
  6366. <li class="inactive toggle">
  6367. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  6368. <ul class="navL3">
  6369. <li class="inactive">
  6370. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  6371. </li>
  6372. <li class="inactive">
  6373. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  6374. </li>
  6375. <li class="inactive">
  6376. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  6377. </li>
  6378. </ul>
  6379. </li>
  6380. <li class="inactive toggle">
  6381. <a href="javascript:void(0)" title="Students">Students</a>
  6382. <ul class="navL3">
  6383. <li class="inactive">
  6384. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  6385. </li>
  6386. <li class="inactive">
  6387. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  6388. </li>
  6389. </ul>
  6390. </li>
  6391. <li class="inactive toggle">
  6392. <a href="javascript:void(0)" title="Architects">Architects</a>
  6393. <ul class="navL3">
  6394. <li class="inactive">
  6395. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  6396. </li>
  6397. <li class="inactive">
  6398. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  6399. </li>
  6400. <li class="inactive">
  6401. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  6402. </li>
  6403. <li class="inactive">
  6404. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  6405. </li>
  6406. <li class="inactive">
  6407. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  6408. </li>
  6409. </ul>
  6410. </li>
  6411. <li class="inactive">
  6412. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  6413. </li>
  6414. <li class="inactive">
  6415. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  6416. </li>
  6417. <li class="inactive">
  6418. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  6419. </li>
  6420. <li class="inactive">
  6421. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  6422. </li>
  6423. </ul>
  6424. </li>
  6425. <li class="inactive toggle">
  6426. <a href="javascript:void(0)" title="Community">Community</a>
  6427. <ul class="navL2">
  6428. <li class="inactive">
  6429. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  6430. </li>
  6431. <li class="inactive">
  6432. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  6433. </li>
  6434. <li class="inactive">
  6435. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  6436. </li>
  6437. <li class="inactive">
  6438. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  6439. </li>
  6440. <li class="inactive">
  6441. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  6442. </li>
  6443. </ul>
  6444. </li>
  6445. <li class="inactive current toggle">
  6446. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  6447. <ul class="navL2">
  6448. <li class="inactive current">
  6449. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  6450. </li>
  6451. <li class="inactive">
  6452. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  6453. </li>
  6454. </ul>
  6455. </li>
  6456. <li class="inactive">
  6457. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  6458. </li>
  6459. </ul>
  6460. </nav>
  6461. </div>
  6462. </div>
  6463. </div>
  6464. <div class="right">
  6465. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  6466. <div class="SearchBox">
  6467. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  6468. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  6469. <div id="search-finder" class="search-finder"></div>
  6470. </button>
  6471. <button id="HeaderSearchButton" style="display:none"></button>
  6472. <div id="searchSplitter"></div>
  6473. <div id="searchCloseIcon" class="search-clear-x"></div>
  6474. <div id="searchTextContainer" style="width: 0;">
  6475. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  6476. </div>
  6477. </form>
  6478. </div>
  6479. </div>
  6480. </div>
  6481. </div>
  6482. </div>
  6483. </div>
  6484. </header>
  6485. </div>
  6486. <div class="printExportMenus ltr">
  6487. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh439643(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  6488. Export (<span class="count">0</span>)
  6489. </a>
  6490. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh439643(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  6491. Print
  6492. </a>
  6493. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  6494. </a>
  6495. </div>
  6496. <div class="printExportMenus ltr">
  6497. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  6498. </div>
  6499. <div id="body" ms.pgarea="body">
  6500. <span id="tabletView_large"></span>
  6501. <span id="tabletView_small"></span>
  6502. <span id="mobileView"></span>
  6503. <div id="content" class="content">
  6504. <input type="hidden" id="printForPab" value="true">
  6505. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  6506. <h1 class="title">Minidrivers, Miniport drivers, and driver pairs</h1>
  6507. <div id="mainSection">
  6508. <div class="clsServerSDKContent">
  6509. </div>
  6510. <p></p>
  6511. <p>A minidriver or a miniport driver acts as half of a driver pair. Driver pairs like (miniport, port) can make driver development easier. In a driver pair, one driver handles general tasks that are common to a whole collection of devices, while the other driver handles tasks that are specific to an individual device. The drivers that handle device-specific tasks go by a variety of names, including miniport driver, miniclass driver, and minidriver.</p>
  6512. <p>Microsoft provides the general driver, and typically an independent hardware vendor provides the specific driver. Before you read this topic, you should understand the ideas presented in <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a> and <a href="https://msdn.microsoft.com/en-us/library/hh439638(v=vs.85).aspx">I/O request packets</a>.</p>
  6513. <p>Every kernel-mode driver must implement a function named <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a>, which gets called shortly after the driver is loaded. The <strong>DriverEntry</strong> function fills in certain members of a <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a> structure with pointers to several other functions that the driver implements. For example, the <strong>DriverEntry</strong> function fills in the <strong>Unload</strong> member of the <strong>DRIVER_OBJECT</strong> structure with a pointer to the driver's <a href="https://msdn.microsoft.com/en-us/library/ff564886(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">Unload</em></a> function, as shown in the following diagram.</p><img id="DriverFunctionPointers02" alt="Diagram showing the DRIVER_OBJECT structure with the Unload member" src="./Windows Kernel Development Articles (2016-03-30)_files/IC553387.png" title="Diagram showing the DRIVER_OBJECT structure with the Unload member" xmlns=""><p>The <strong>MajorFunction</strong> member of the <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a> structure is an array of pointers to functions that handle I/O request packets (<a href="https://msdn.microsoft.com/en-us/library/ff550694(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">IRP</strong></a>s), as shown in the following diagram. Typically the driver fills in several members of the <strong>MajorFunction</strong> array with pointers to functions (implemented by the driver) that handle various kinds of IRPs. </p><img id="DriverFunctionPointers03" alt="Diagram showing the DRIVER_OBJECT structure with the MajorFunction member" src="./Windows Kernel Development Articles (2016-03-30)_files/IC553388.png" title="Diagram showing the DRIVER_OBJECT structure with the MajorFunction member" xmlns=""><p>An IRP can be categorized according to its major function code, which is identified by a constant, such as <strong>IRP_MJ_READ</strong>, <strong>IRP_MJ_WRITE</strong>, or <strong>IRP_MJ_PNP</strong>. The constants that identify major function code serve as indices in the <strong>MajorFunction</strong> array. For example, suppose the driver implements a dispatch function to handle IRPs that have the major function code <strong>IRP_MJ_WRITE</strong>. In this case, the driver must fill in the <strong>MajorFunction</strong>[IRP_MJ_WRITE] element of the array with a pointer to the dispatch function.</p>
  6514. <p>Typically the driver fills in some of the elements of the <strong>MajorFunction</strong> array and leaves the remaining elements set to default values provided by the I/O manager. The following example shows how to use the <a href="https://msdn.microsoft.com/en-us/library/ff562408(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">!drvobj</strong></a> debugger extension to inspect the function pointers for the parport driver.</p>
  6515. <div id="code-snippet-1" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  6516. <div class="codeSnippetContainerTabs">
  6517. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  6518. <a></a>
  6519. </div>
  6520. </div>
  6521. <div class="codeSnippetContainerCodeContainer">
  6522. <div class="codeSnippetToolBar"></div>
  6523. <div class="codeSnippetContainerCode" dir="ltr">
  6524. <div style="color:Black;"><pre>0: kd&gt; !drvobj parport 2
  6525. Driver object (fffffa80048d9e70) is for:
  6526. \Driver\Parport
  6527. DriverEntry: fffff880065ea070 parport!GsDriverEntry
  6528. DriverStartIo: 00000000
  6529. DriverUnload: fffff880065e131c parport!PptUnload
  6530. AddDevice: fffff880065d2008 parport!P5AddDevice
  6531. Dispatch routines:
  6532. [00] IRP_MJ_CREATE fffff880065d49d0 parport!PptDispatchCreateOpen
  6533. [01] IRP_MJ_CREATE_NAMED_PIPE fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6534. [02] IRP_MJ_CLOSE fffff880065d4a78 parport!PptDispatchClose
  6535. [03] IRP_MJ_READ fffff880065d4bac parport!PptDispatchRead
  6536. [04] IRP_MJ_WRITE fffff880065d4bac parport!PptDispatchRead
  6537. [05] IRP_MJ_QUERY_INFORMATION fffff880065d4c40 parport!PptDispatchQueryInformation
  6538. [06] IRP_MJ_SET_INFORMATION fffff880065d4ce4 parport!PptDispatchSetInformation
  6539. [07] IRP_MJ_QUERY_EA fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6540. [08] IRP_MJ_SET_EA fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6541. [09] IRP_MJ_FLUSH_BUFFERS fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6542. [0a] IRP_MJ_QUERY_VOLUME_INFORMATION fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6543. [0b] IRP_MJ_SET_VOLUME_INFORMATION fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6544. [0c] IRP_MJ_DIRECTORY_CONTROL fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6545. [0d] IRP_MJ_FILE_SYSTEM_CONTROL fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6546. [0e] IRP_MJ_DEVICE_CONTROL fffff880065d4be8 parport!PptDispatchDeviceControl
  6547. [0f] IRP_MJ_INTERNAL_DEVICE_CONTROL fffff880065d4c24 parport!PptDispatchInternalDeviceControl
  6548. [10] IRP_MJ_SHUTDOWN fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6549. [11] IRP_MJ_LOCK_CONTROL fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6550. [12] IRP_MJ_CLEANUP fffff880065d4af4 parport!PptDispatchCleanup
  6551. [13] IRP_MJ_CREATE_MAILSLOT fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6552. [14] IRP_MJ_QUERY_SECURITY fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6553. [15] IRP_MJ_SET_SECURITY fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6554. [16] IRP_MJ_POWER fffff880065d491c parport!PptDispatchPower
  6555. [17] IRP_MJ_SYSTEM_CONTROL fffff880065d4d4c parport!PptDispatchSystemControl
  6556. [18] IRP_MJ_DEVICE_CHANGE fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6557. [19] IRP_MJ_QUERY_QUOTA fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6558. [1a] IRP_MJ_SET_QUOTA fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  6559. [1b] IRP_MJ_PNP fffff880065d4840 parport!PptDispatchPnp
  6560. </pre></div>
  6561. </div>
  6562. </div>
  6563. </div>
  6564. <p>In the debugger output, you can see that parport.sys implements <strong>GsDriverEntry</strong>, the entry point for the driver. <strong>GsDriverEntry</strong>, which was generated automatically when the driver was built, performs some initialization and then calls <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a>, which was implemented by the driver developer.</p>
  6565. <p>You can also see that the parport driver (in its <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a> function) provides pointers to dispatch functions for these major function codes:</p>
  6566. <ul>
  6567. <li>IRP_MJ_CREATE</li>
  6568. <li>IRP_MJ_CLOSE</li>
  6569. <li>IRP_MJ_READ</li>
  6570. <li>IRP_MJ_WRITE</li>
  6571. <li>IRP_MJ_QUERY_INFORMATION</li>
  6572. <li>IRP_MJ_SET_INFORMATION</li>
  6573. <li>IRP_MJ_DEVICE_CONTROL</li>
  6574. <li>IRP_MJ_INTERNAL_DEVICE_CONTROL</li>
  6575. <li>IRP_MJ_CLEANUP</li>
  6576. <li>IRP_MJ_POWER</li>
  6577. <li>IRP_MJ_SYSTEM_CONTROL</li>
  6578. <li>IRP_MJ_PNP</li>
  6579. </ul>
  6580. <p>The remaining elements of the <strong>MajorFunction</strong> array hold pointers to the default dispatch function <strong>nt!IopInvalidDeviceRequest</strong>.</p>
  6581. <p>In the debugger output, you can see that the parport driver provided function pointers for <a href="https://msdn.microsoft.com/en-us/library/ff564886(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">Unload</em></a> and <a href="https://msdn.microsoft.com/en-us/library/ff540521(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">AddDevice</em></a>, but did not provide a function pointer for <a href="https://msdn.microsoft.com/en-us/library/ff563858(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">StartIo</em></a>. The <em>AddDevice</em> function is unusual because its function pointer is not stored in the <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a> structure. Instead, it is stored in the <strong>AddDevice</strong> member of an extension to the <strong>DRIVER_OBJECT</strong> structure. The following diagram illustrates the function pointers that the parport driver provided in its <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a> function. The function pointers provided by parport are shaded.</p><img id="DriverFunctionPointers01" alt="Diagram of function pointers in a DRIVER_OBJECT structure" src="./Windows Kernel Development Articles (2016-03-30)_files/IC553389.png" title="Diagram of function pointers in a DRIVER_OBJECT structure" xmlns=""><h2><a id="Making_it_easier_by_using_driver_pairs"></a><a id="making_it_easier_by_using_driver_pairs"></a><a id="MAKING_IT_EASIER_BY_USING_DRIVER_PAIRS"></a>Making it easier by using driver pairs</h2>
  6582. <p>Over a period of time, as driver developers inside and outside of Microsoft gained experience with the Windows Driver Model (WDM), they realized a couple of things about dispatch functions:</p>
  6583. <ul>
  6584. <li>Dispatch functions are largely boilerplate. For example, much of the code in the dispatch function for IRP_MJ_PNP is the same for all drivers. It is only a small portion of the Plug and Play (PnP) code that is specific to an individual driver that controls an individual piece of hardware.</li>
  6585. <li>Dispatch functions are complicated and difficult to get right. Implementing features like thread synchronization, IRP queuing, and IRP cancellation is challenging and requires a deep understanding of how the operating system works.</li>
  6586. </ul>
  6587. <p>To make things easier for driver developers, Microsoft created several technology-specific driver models. At first glance, the technology-specific models seem quite different from each other, but a closer look reveals that many of them are based on this paradigm:</p>
  6588. <ul>
  6589. <li>The driver is split into two pieces: one that handles the general processing and one that handles processing specific to a particular device.</li>
  6590. <li>The general piece is written by Microsoft.</li>
  6591. <li>The specific piece may be written by Microsoft or an independent hardware vendor.</li>
  6592. </ul>
  6593. <p>Suppose that the Proseware and Contoso companies both make a toy robot that requires a WDM driver. Also suppose that Microsoft provides a General Robot Driver called GeneralRobot.sys. Proseware and Contoso can each write small drivers that handle the requirements of their specific robots. For example, Proseware could write ProsewareRobot.sys, and the pair of drivers (ProsewareRobot.sys, GeneralRobot.sys) could be combined to form a single WDM driver. Likewise, the pair of drivers (ContosoRobot.sys, GeneralRobot.sys) could combine to form a single WDM driver. In its most general form, the idea is that you can create drivers by using (specific.sys, general.sys) pairs.</p>
  6594. <h2><a id="Function_pointers_in_driver_pairs"></a><a id="function_pointers_in_driver_pairs"></a><a id="FUNCTION_POINTERS_IN_DRIVER_PAIRS"></a>Function pointers in driver pairs</h2>
  6595. <p> In a (specific.sys, general.sys) pair, Windows loads specific.sys and calls its <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a> function. The <strong>DriverEntry</strong> function of specific.sys receives a pointer to a <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a> structure. Normally you would expect <strong>DriverEntry</strong> to fill in several elements of the <strong>MajorFunction</strong> array with pointers to dispatch functions. Also you would expect <strong>DriverEntry</strong> to fill in the <strong>Unload</strong> member (and possibly the <strong>StartIo</strong> member) of the <strong>DRIVER_OBJECT</strong> structure and the <strong>AddDevice</strong> member of the driver object extension. However, in a driver pair model, <strong>DriverEntry</strong> does not necessarily do this. Instead the <strong>DriverEntry</strong> function of specific.sys passes the <strong>DRIVER_OBJECT</strong> structure along to an initialization function implemented by general.sys. The following code example shows how the initialization function might be called in the (ProsewareRobot.sys, GeneralRobot.sys) pair.</p>
  6596. <div id="code-snippet-2" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  6597. <div class="codeSnippetContainerTabs">
  6598. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  6599. <a>C++</a>
  6600. </div>
  6601. </div>
  6602. <div class="codeSnippetContainerCodeContainer">
  6603. <div class="codeSnippetToolBar"></div>
  6604. <div class="codeSnippetContainerCode" dir="ltr">
  6605. <div style="color:Black;"><pre>
  6606. PVOID g_ProsewareRobottCallbacks[3] = {DeviceControlCallback, PnpCallback, PowerCallback};
  6607. <span style="color:Green;">// DriverEntry function in ProsewareRobot.sys</span>
  6608. NTSTATUS DriverEntry (DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath)
  6609. {
  6610. <span style="color:Green;">// Call the initialization function implemented by GeneralRobot.sys.</span>
  6611. <span style="color:Blue;">return</span> GeneralRobotInit(DriverObject, RegistryPath, g_ProsewareRobottCallbacks);
  6612. }
  6613. </pre></div>
  6614. </div>
  6615. </div>
  6616. </div>
  6617. <p>The initialization function in GeneralRobot.sys writes function pointers to the appropriate members of the <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a> structure (and its extension) and the appropriate elements of the <strong>MajorFunction</strong> array. The idea is that when the I/O manager sends an IRP to the driver pair, the IRP goes first to a dispatch function implemented by GeneralRobot.sys. If GeneralRobot.sys can handle the IRP on its own, then the specific driver, ProsewareRobot.sys, does not have to be involved. If GeneralRobot.sys can handle some, but not all, of the IRP processing, it gets help from one of the callback functions implemented by ProsewareRobot.sys. GeneralRobot.sys receives pointers to the ProsewareRobot callbacks in the GeneralRobotInit call.</p>
  6618. <p>At some point after <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a> returns, a device stack gets constructed for the Proseware Robot device node. The device stack might look like this.</p><img id="driverpairs01" alt="Diagram of the Proseware Robot device node, showing three device objects in the device stack: AfterThought.sys (Filter DO), ProsewareRobot.sys, GeneralRobot.sys (FDO), and Pci.sys (PDO)" src="./Windows Kernel Development Articles (2016-03-30)_files/IC553390.png" title="Diagram of the Proseware Robot device node, showing three device objects in the device stack: AfterThought.sys (Filter DO), ProsewareRobot.sys, GeneralRobot.sys (FDO), and Pci.sys (PDO)" xmlns=""><p>As shown in the preceding diagram, the device stack for Proseware Robot has three device objects. The top device object is a filter device object (Filter DO) associated with the filter driver AfterThought.sys. The middle device object is a functional device object (FDO) associated with the driver pair (ProsewareRobot.sys, GeneralRobot.sys). The driver pair serves as the function driver for the device stack. The bottom device object is a physical device object (PDO) associated with Pci.sys.</p>
  6619. <p>Notice that the driver pair occupies only one level in the device stack and is associated with only one device object: the FDO. When GeneralRobot.sys processes an IRP, it might call ProsewareRobot.sys for assistance, but that is not the same as passing the request down the device stack. The driver pair forms a single WDM driver that is at one level in the device stack. The driver pair either completes the IRP or passes it down the device stack to the PDO, which is associated with Pci.sys.</p>
  6620. <h2><a id="Example_of_a_driver_pair"></a><a id="example_of_a_driver_pair"></a><a id="EXAMPLE_OF_A_DRIVER_PAIR"></a>Example of a driver pair</h2>
  6621. <p>Suppose you have a wireless network card in your laptop computer, and by looking in Device Manager, you determine that netwlv64.sys is the driver for the network card. You can use the <a href="https://msdn.microsoft.com/en-us/library/ff562408(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">!drvobj</strong></a> debugger extension to inspect the function pointers for netwlv64.sys.</p>
  6622. <div id="code-snippet-3" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  6623. <div class="codeSnippetContainerTabs">
  6624. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  6625. <a></a>
  6626. </div>
  6627. </div>
  6628. <div class="codeSnippetContainerCodeContainer">
  6629. <div class="codeSnippetToolBar"></div>
  6630. <div class="codeSnippetContainerCode" dir="ltr">
  6631. <div style="color:Black;"><pre>1: kd&gt; !drvobj netwlv64 2
  6632. Driver object (fffffa8002e5f420) is for:
  6633. \Driver\netwlv64
  6634. DriverEntry: fffff8800482f064 netwlv64!GsDriverEntry
  6635. DriverStartIo: 00000000
  6636. DriverUnload: fffff8800195c5f4 ndis!ndisMUnloadEx
  6637. AddDevice: fffff88001940d30 ndis!ndisPnPAddDevice
  6638. Dispatch routines:
  6639. [00] IRP_MJ_CREATE fffff880018b5530 ndis!ndisCreateIrpHandler
  6640. [01] IRP_MJ_CREATE_NAMED_PIPE fffff88001936f00 ndis!ndisDummyIrpHandler
  6641. [02] IRP_MJ_CLOSE fffff880018b5870 ndis!ndisCloseIrpHandler
  6642. [03] IRP_MJ_READ fffff88001936f00 ndis!ndisDummyIrpHandler
  6643. [04] IRP_MJ_WRITE fffff88001936f00 ndis!ndisDummyIrpHandler
  6644. [05] IRP_MJ_QUERY_INFORMATION fffff88001936f00 ndis!ndisDummyIrpHandler
  6645. [06] IRP_MJ_SET_INFORMATION fffff88001936f00 ndis!ndisDummyIrpHandler
  6646. [07] IRP_MJ_QUERY_EA fffff88001936f00 ndis!ndisDummyIrpHandler
  6647. [08] IRP_MJ_SET_EA fffff88001936f00 ndis!ndisDummyIrpHandler
  6648. [09] IRP_MJ_FLUSH_BUFFERS fffff88001936f00 ndis!ndisDummyIrpHandler
  6649. [0a] IRP_MJ_QUERY_VOLUME_INFORMATION fffff88001936f00 ndis!ndisDummyIrpHandler
  6650. [0b] IRP_MJ_SET_VOLUME_INFORMATION fffff88001936f00 ndis!ndisDummyIrpHandler
  6651. [0c] IRP_MJ_DIRECTORY_CONTROL fffff88001936f00 ndis!ndisDummyIrpHandler
  6652. [0d] IRP_MJ_FILE_SYSTEM_CONTROL fffff88001936f00 ndis!ndisDummyIrpHandler
  6653. [0e] IRP_MJ_DEVICE_CONTROL fffff8800193696c ndis!ndisDeviceControlIrpHandler
  6654. [0f] IRP_MJ_INTERNAL_DEVICE_CONTROL fffff880018f9114 ndis!ndisDeviceInternalIrpDispatch
  6655. [10] IRP_MJ_SHUTDOWN fffff88001936f00 ndis!ndisDummyIrpHandler
  6656. [11] IRP_MJ_LOCK_CONTROL fffff88001936f00 ndis!ndisDummyIrpHandler
  6657. [12] IRP_MJ_CLEANUP fffff88001936f00 ndis!ndisDummyIrpHandler
  6658. [13] IRP_MJ_CREATE_MAILSLOT fffff88001936f00 ndis!ndisDummyIrpHandler
  6659. [14] IRP_MJ_QUERY_SECURITY fffff88001936f00 ndis!ndisDummyIrpHandler
  6660. [15] IRP_MJ_SET_SECURITY fffff88001936f00 ndis!ndisDummyIrpHandler
  6661. [16] IRP_MJ_POWER fffff880018c35e8 ndis!ndisPowerDispatch
  6662. [17] IRP_MJ_SYSTEM_CONTROL fffff880019392c8 ndis!ndisWMIDispatch
  6663. [18] IRP_MJ_DEVICE_CHANGE fffff88001936f00 ndis!ndisDummyIrpHandler
  6664. [19] IRP_MJ_QUERY_QUOTA fffff88001936f00 ndis!ndisDummyIrpHandler
  6665. [1a] IRP_MJ_SET_QUOTA fffff88001936f00 ndis!ndisDummyIrpHandler
  6666. [1b] IRP_MJ_PNP fffff8800193e518 ndis!ndisPnPDispatch
  6667. </pre></div>
  6668. </div>
  6669. </div>
  6670. </div>
  6671. <p>In the debugger output, you can see that netwlv64.sys implements <strong>GsDriverEntry</strong>, the entry point for the driver. <strong>GsDriverEntry</strong>, which was automatically generated when the driver was built, performs some initialization and then calls <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a>, which was written by the driver developer.</p>
  6672. <p>In this example, netwlv64.sys implements <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a>, but ndis.sys implements <a href="https://msdn.microsoft.com/en-us/library/ff540521(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">AddDevice</em></a>, <a href="https://msdn.microsoft.com/en-us/library/ff564886(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">Unload</em></a>, and several dispatch functions. Netwlv64.sys is called an NDIS miniport driver, and ndis.sys is called the NDIS Library. Together, the two modules form an (NDIS miniport, NDIS Library) pair.</p>
  6673. <p>This diagram shows the device stack for the wireless network card. Notice that the driver pair (netwlv64.sys, ndis.sys) occupies only one level in the device stack and is associated with only one device object: the FDO.</p><img id="DriverPairs02A" alt="Diagram of the Wireless network card device stack, showing Netwlv64.sys, ndis.sys as the driver pair associated with the FDO and Pci.sys associated with the PDO " src="./Windows Kernel Development Articles (2016-03-30)_files/IC559049.png" title="Diagram of the Wireless network card device stack, showing Netwlv64.sys, ndis.sys as the driver pair associated with the FDO and Pci.sys associated with the PDO " xmlns=""><h2><a id="Available_driver_pairs"></a><a id="available_driver_pairs"></a><a id="AVAILABLE_DRIVER_PAIRS"></a>Available driver pairs</h2>
  6674. <p>The different technology-specific driver models use a variety of names for the specific and general pieces of a driver pair. In many cases, the specific portion of the pair has the prefix "mini." Here are some of (specific, general) pairs that are available:</p><ul>
  6675. <li>(display miniport driver, display port driver)</li>
  6676. <li>(audio miniport driver, audio port driver)</li>
  6677. <li>(storage miniport driver, storage port driver)</li>
  6678. <li>(battery miniclass driver, battery class driver)</li>
  6679. <li>(HID minidriver, HID class driver)</li>
  6680. <li>(changer miniclass driver, changer port driver)</li>
  6681. <li>(NDIS miniport driver, NDIS library)</li>
  6682. </ul>
  6683. <div class="alert"><strong>Note</strong>&nbsp;&nbsp;As you can see in the list, several of the models use the term <em>class driver</em> for the general portion of a driver pair. This kind of class driver is different from a standalone class driver and different from a class filter driver.</div>
  6684. <div>&nbsp;</div>
  6685. <h2><a id="related_topics"></a>Related topics</h2>
  6686. <dl>
  6687. <dt>
  6688. <a href="https://msdn.microsoft.com/en-us/library/ff554731(v=vs.85).aspx">Concepts for all driver developers</a>
  6689. </dt>
  6690. <dt>
  6691. <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a>
  6692. </dt>
  6693. <dt>
  6694. <a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx">Driver stacks</a>
  6695. </dt>
  6696. </dl>
  6697. <p>&nbsp;</p>
  6698. <p>&nbsp;</p>
  6699. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Minidrivers,%20Miniport%20drivers,%20and%20driver%20pairs%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  6700. </div>
  6701. </div>
  6702. </div>
  6703. </div>
  6704. <div class="clear"></div>
  6705. <input name="__RequestVerificationToken" type="hidden" value="_1zXsUVhlhFQw2NfPwDMBnXkjrzCJpMi3cYqbuklqtWie-ORuhlQEtPtBHlxWqhp7LQrO_Ni9m0DhBERCsptGSO81Xw1">
  6706. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh439643(d=printer,v=vs.85).aspx">
  6707. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh439643(d=printer,v=vs.85).aspx">
  6708. <input id="isTopicRated" type="hidden" value="false">
  6709. <div id="lib-footer" ms.pgarea="body">
  6710. <link type="text/css" rel="stylesheet">
  6711. <div id="ux-footer" class="" style="" dir="ltr">
  6712. <div id="footerSock" class="librarySock both">
  6713. <div id="footerSockInner">
  6714. <a name="feedback"></a>
  6715. <div class="rating">
  6716. <div id="ratingSection1">
  6717. <div class="title">
  6718. Was this page helpful?
  6719. </div>
  6720. <div class="description">
  6721. Your feedback about this content is important.<br>Let us know what you think.
  6722. </div>
  6723. <div class="buttons">
  6724. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  6725. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  6726. </div>
  6727. <input id="ratingValue" type="hidden" value="">
  6728. </div>
  6729. <div id="ratingSection2">
  6730. <div class="title left">
  6731. Additional feedback?
  6732. </div>
  6733. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  6734. <div class="right">
  6735. <div class="counter">
  6736. <span id="feedbackTextCounter">1500</span> characters remaining
  6737. </div>
  6738. <div class="buttons">
  6739. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  6740. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  6741. </div>
  6742. </div>
  6743. </div>
  6744. <div id="ratingSection3">
  6745. <div class="title">
  6746. Thank you!
  6747. </div>
  6748. <div class="description">
  6749. We appreciate your feedback.
  6750. </div>
  6751. </div>
  6752. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  6753. </div>
  6754. <div class="userVoice">
  6755. <div class="title">
  6756. Help us improve MSDN.
  6757. </div>
  6758. <div class="description">
  6759. Visit our UserVoice Page to submit and vote on ideas!
  6760. </div>
  6761. <div class="buttons">
  6762. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  6763. </div>
  6764. </div>
  6765. <div class="clear"></div>
  6766. </div>
  6767. </div>
  6768. <footer class="top">
  6769. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  6770. <div class="linkList">
  6771. <div class="linkListTitle">Dev centers</div>
  6772. <ul class="links">
  6773. <li>
  6774. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  6775. </li>
  6776. <li>
  6777. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  6778. </li>
  6779. <li>
  6780. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  6781. </li>
  6782. <li>
  6783. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  6784. </li>
  6785. <li>
  6786. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  6787. </li>
  6788. </ul>
  6789. </div>
  6790. </div>
  6791. <div id="rightLinks">
  6792. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  6793. <div class="linkList">
  6794. <div class="linkListTitle">Learning resources</div>
  6795. <ul class="links">
  6796. <li>
  6797. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  6798. </li>
  6799. <li>
  6800. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  6801. </li>
  6802. <li>
  6803. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  6804. </li>
  6805. </ul>
  6806. </div>
  6807. </div>
  6808. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  6809. <div class="linkList">
  6810. <div class="linkListTitle">Community</div>
  6811. <ul class="links">
  6812. <li>
  6813. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  6814. </li>
  6815. <li>
  6816. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  6817. </li>
  6818. <li>
  6819. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  6820. </li>
  6821. </ul>
  6822. </div>
  6823. </div>
  6824. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  6825. <div class="linkList">
  6826. <div class="linkListTitle">Support</div>
  6827. <ul class="links">
  6828. <li>
  6829. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  6830. </li>
  6831. </ul>
  6832. </div>
  6833. </div>
  6834. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  6835. <div class="linkList">
  6836. <div class="linkListTitle">Programs</div>
  6837. <ul class="links">
  6838. <li>
  6839. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  6840. </li>
  6841. <li>
  6842. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  6843. </li>
  6844. <li>
  6845. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  6846. </li>
  6847. </ul>
  6848. </div>
  6849. </div>
  6850. </div>
  6851. </footer>
  6852. <footer class="bottom">
  6853. <span class="localeContainer">
  6854. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  6855. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439643(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  6856. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  6857. </form>
  6858. </span>
  6859. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  6860. <div class="linkList">
  6861. <ul class="links horizontal">
  6862. <li>
  6863. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  6864. </li>
  6865. <li>
  6866. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  6867. </li>
  6868. <li>
  6869. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  6870. </li>
  6871. <li>
  6872. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  6873. </li>
  6874. </ul>
  6875. </div>
  6876. </div>
  6877. <span class="logoLegal">
  6878. <span class="logo"></span>
  6879. <span class="copyright">© 2016 Microsoft</span>
  6880. </span>
  6881. </footer>
  6882. </div>
  6883. </div>
  6884. <div class="footerPrintView">
  6885. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  6886. </div>
  6887. <input id="tocPaddingPerLevel" type="hidden" value="17">
  6888. <input id="MtpsDevice" type="hidden" value="Printer">
  6889. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  6890. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  6891. <div id="globalRequestVerification">
  6892. <input name="__RequestVerificationToken" type="hidden" value="8xrmLK8jU6CoR5m_-OyOzHYoxoUkl2_LPKXhqYrZskXjmf7WbLs1MFcGsHEg2VxLr5botbrOs-2GQMLNfRrJ_C7Q9EE1">
  6893. </div>
  6894. </div>
  6895. <script type="text/javascript" class="mtps-injected">
  6896. /*<![CDATA[*/
  6897. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  6898. MTPS.injectScripts([
  6899. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  6900. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh439643(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  6901. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  6902. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  6903. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  6904. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  6905. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  6906. ]);
  6907. /*]]>*/
  6908. </script>
  6909. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  6910. <div id="page">
  6911. <link type="text/css" rel="stylesheet">
  6912. <input type="hidden" id="isHeaderBleeding" value="true">
  6913. <div id="ux-header" dir="ltr" class="ltr msdn">
  6914. <header>
  6915. <span id="singleCol"></span>
  6916. <span id="doubleCol"></span>
  6917. <span id="isMobile"></span>
  6918. <div>
  6919. <div class="row topRow">
  6920. <div class="top">
  6921. <div class="left">
  6922. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  6923. <div id="msft-logo" class="msft-logo"></div>
  6924. </a>
  6925. <div class="GrayPipe"></div>
  6926. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  6927. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  6928. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  6929. </div>
  6930. <div class="right">
  6931. <div id="signIn">
  6932. <div class="profileImage"></div>
  6933. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376410&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706279%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  6934. <div class="auxNav">
  6935. <div>
  6936. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  6937. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  6938. </div>
  6939. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  6940. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  6941. </div>
  6942. </div>
  6943. <div>
  6944. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  6945. <div class="linkList">
  6946. <ul class="links horizontal">
  6947. <li>
  6948. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  6949. </li>
  6950. <li>
  6951. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  6952. </li>
  6953. <li>
  6954. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  6955. </li>
  6956. </ul>
  6957. </div>
  6958. </div>
  6959. </div>
  6960. </div>
  6961. </div>
  6962. </div>
  6963. </div>
  6964. <div class="row middleRow">
  6965. <div class="expandTop">
  6966. <div class="left"></div>
  6967. <div class="right"></div>
  6968. </div>
  6969. </div>
  6970. </div>
  6971. <div id="buttomRowWrapper" class="bg_default">
  6972. <div class="row buttomRow bg_default">
  6973. <div class="bottom">
  6974. <div class="left">
  6975. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  6976. <div id="drawer">
  6977. <div class="toc">
  6978. <nav>
  6979. <ul class="navL1">
  6980. <li class="inactive toggle">
  6981. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  6982. <ul class="navL2">
  6983. <li class="inactive">
  6984. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  6985. </li>
  6986. <li class="inactive">
  6987. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  6988. </li>
  6989. <li class="inactive">
  6990. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  6991. </li>
  6992. <li class="inactive">
  6993. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  6994. </li>
  6995. <li class="inactive">
  6996. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  6997. </li>
  6998. <li class="inactive">
  6999. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  7000. </li>
  7001. </ul>
  7002. </li>
  7003. <li class="inactive toggle">
  7004. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  7005. <ul class="navL2">
  7006. <li class="inactive">
  7007. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  7008. </li>
  7009. <li class="inactive">
  7010. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  7011. </li>
  7012. <li class="inactive">
  7013. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  7014. </li>
  7015. <li class="inactive toggle">
  7016. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  7017. <ul class="navL3">
  7018. <li class="inactive">
  7019. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  7020. </li>
  7021. <li class="inactive">
  7022. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  7023. </li>
  7024. <li class="inactive">
  7025. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  7026. </li>
  7027. <li class="inactive">
  7028. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  7029. </li>
  7030. <li class="inactive">
  7031. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  7032. </li>
  7033. </ul>
  7034. </li>
  7035. </ul>
  7036. </li>
  7037. <li class="inactive toggle">
  7038. <a href="javascript:void(0)" title="Programs">Programs</a>
  7039. <ul class="navL2">
  7040. <li class="inactive toggle">
  7041. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  7042. <ul class="navL3">
  7043. <li class="inactive">
  7044. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  7045. </li>
  7046. <li class="inactive">
  7047. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  7048. </li>
  7049. <li class="inactive">
  7050. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  7051. </li>
  7052. </ul>
  7053. </li>
  7054. <li class="inactive toggle">
  7055. <a href="javascript:void(0)" title="Students">Students</a>
  7056. <ul class="navL3">
  7057. <li class="inactive">
  7058. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  7059. </li>
  7060. <li class="inactive">
  7061. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  7062. </li>
  7063. </ul>
  7064. </li>
  7065. <li class="inactive toggle">
  7066. <a href="javascript:void(0)" title="Architects">Architects</a>
  7067. <ul class="navL3">
  7068. <li class="inactive">
  7069. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  7070. </li>
  7071. <li class="inactive">
  7072. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  7073. </li>
  7074. <li class="inactive">
  7075. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  7076. </li>
  7077. <li class="inactive">
  7078. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  7079. </li>
  7080. <li class="inactive">
  7081. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  7082. </li>
  7083. </ul>
  7084. </li>
  7085. <li class="inactive">
  7086. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  7087. </li>
  7088. <li class="inactive">
  7089. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  7090. </li>
  7091. <li class="inactive">
  7092. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  7093. </li>
  7094. <li class="inactive">
  7095. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  7096. </li>
  7097. </ul>
  7098. </li>
  7099. <li class="inactive toggle">
  7100. <a href="javascript:void(0)" title="Community">Community</a>
  7101. <ul class="navL2">
  7102. <li class="inactive">
  7103. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  7104. </li>
  7105. <li class="inactive">
  7106. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  7107. </li>
  7108. <li class="inactive">
  7109. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  7110. </li>
  7111. <li class="inactive">
  7112. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  7113. </li>
  7114. <li class="inactive">
  7115. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  7116. </li>
  7117. </ul>
  7118. </li>
  7119. <li class="inactive current toggle">
  7120. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  7121. <ul class="navL2">
  7122. <li class="inactive current">
  7123. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  7124. </li>
  7125. <li class="inactive">
  7126. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  7127. </li>
  7128. </ul>
  7129. </li>
  7130. <li class="inactive">
  7131. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  7132. </li>
  7133. </ul>
  7134. </nav>
  7135. </div>
  7136. </div>
  7137. </div>
  7138. <div class="right">
  7139. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  7140. <div class="SearchBox">
  7141. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  7142. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  7143. <div id="search-finder" class="search-finder"></div>
  7144. </button>
  7145. <button id="HeaderSearchButton" style="display:none"></button>
  7146. <div id="searchSplitter"></div>
  7147. <div id="searchCloseIcon" class="search-clear-x"></div>
  7148. <div id="searchTextContainer" style="width: 0;">
  7149. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  7150. </div>
  7151. </form>
  7152. </div>
  7153. </div>
  7154. </div>
  7155. </div>
  7156. </div>
  7157. </div>
  7158. </header>
  7159. </div>
  7160. <div class="printExportMenus ltr">
  7161. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh706279(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  7162. Export (<span class="count">0</span>)
  7163. </a>
  7164. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh706279(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  7165. Print
  7166. </a>
  7167. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  7168. </a>
  7169. </div>
  7170. <div class="printExportMenus ltr">
  7171. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  7172. </div>
  7173. <div id="body" ms.pgarea="body">
  7174. <span id="tabletView_large"></span>
  7175. <span id="tabletView_small"></span>
  7176. <span id="mobileView"></span>
  7177. <div id="content" class="content">
  7178. <input type="hidden" id="printForPab" value="true">
  7179. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  7180. <h1 class="title">KMDF as a generic driver pair model</h1>
  7181. <div id="mainSection">
  7182. <div class="clsServerSDKContent">
  7183. </div>
  7184. <p>In this topic, we discuss the idea that the Kernel Mode Driver Framework can be viewed as a generic driver pair model. Before you read this topic, you should understand the ideas presented in <a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx">Minidrivers and driver pairs</a>.</p>
  7185. <p>Over the years, Microsoft has created several technology-specific driver models that use this paradigm:</p>
  7186. <ul>
  7187. <li>The driver is split into two pieces: one that handles general processing and one that handles processing that is specific to a particular device.</li>
  7188. <li>The general piece, called the Framework, is written by Microsoft.</li>
  7189. <li>The specific piece, called the KMDF driver, may be written by Microsoft or an independent hardware vendor.</li>
  7190. </ul><img id="kmdfdriverpair" alt="Diagram of KMDF as a Generic Driver Pair" src="./Windows Kernel Development Articles (2016-03-30)_files/IC831360.png" title="Diagram of KMDF as a Generic Driver Pair" xmlns=""><p>The Framework portion of the driver pair performs general tasks that are common to a wide variety of drivers. For example, the Framework can handle I/O request queues, thread synchronization, and a large portion of the power management duties.</p>
  7191. <p>The Framework owns the dispatch table for the KMDF driver, so when someone sends an I/O request packet (IRP) to the (KMDF driver, Framework) pair, the IRP goes to Framework. If the Framework can handle the IRP by itself, the KMDF driver is not involved. If the Framework cannot handle the IRP by itself, it gets help by calling event handlers implemented by the KMDF driver. Here are some examples of event handlers that might be implemented by a KMDF driver.</p>
  7192. <ul>
  7193. <li>
  7194. <a href="https://msdn.microsoft.com/en-us/library/ff540880(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtDevicePrepareHardware</em></a>
  7195. </li>
  7196. <li>
  7197. <a href="https://msdn.microsoft.com/en-us/library/ff541776(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtIoRead</em></a>
  7198. </li>
  7199. <li>
  7200. <a href="https://msdn.microsoft.com/en-us/library/ff541758(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtIoDeviceControl</em></a>
  7201. </li>
  7202. <li>
  7203. <a href="https://msdn.microsoft.com/en-us/library/ff541735(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtInterruptIsr</em></a>
  7204. </li>
  7205. <li>
  7206. <a href="https://msdn.microsoft.com/en-us/library/ff541721(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtInterruptDpc</em></a>
  7207. </li>
  7208. <li>
  7209. <a href="https://msdn.microsoft.com/en-us/library/ff540874(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtDevicePnpStateChange</em></a>
  7210. </li>
  7211. </ul>
  7212. <p>For example, a USB 2.0 host controller driver has a specific piece named usbehci.sys and a general piece named usbport.sys. Usbehci.sys, which is called the USB 2.0 Miniport driver, has code that is specific to USB 2.0 host controllers. Usbport.sys, which is called the USB Port driver, has general code that applies to both USB 2.0 and USB 1.0. The pair of drivers (usbehci.sys, usbport.sys) combine to form a single WDM driver for a USB 2.0 host controller.</p>
  7213. <p> The (specific, general) driver pairs have a variety of names across different device technologies. Most of the device-specific drivers have the prefix <em>mini</em>. The general drivers are often called port or class drivers. Here are some examples of (specific, general) pairs:</p>
  7214. <ul>
  7215. <li>(display miniport driver, display port driver)</li>
  7216. <li>(USB miniport driver, USB port driver)</li>
  7217. <li>(battery miniclass driver, battery class driver)</li>
  7218. <li>(HID minidriver, HID class driver)</li>
  7219. <li>(storage miniport driver, storage port driver)</li>
  7220. </ul>
  7221. <p>As more and more driver pair models were developed, it became difficult to keep track of all the different ways to write a driver. Each model has it's own interface for communication between the device-specific driver and the general driver. The body of knowledge required to develop drivers for one device technology (for example, Audio) can be quite different from the body of knowledge required to develop drivers for another device technology (for example, Storage).</p>
  7222. <p>Over time, developers realized that it would be good to have a single unified model for kernel-mode driver pairs. The Kernel Mode Driver Framework (KMDF), which was first available in Windows Vista, fulfills that need. A driver based on KMDF uses a paradigm that is similar to many of the technology-specific driver pair models.</p>
  7223. <ul>
  7224. <li>The driver is split into two pieces: one that handles general processing and one that handles processing that is specific to a particular device.</li>
  7225. <li>The general piece, which is written by Microsoft, is called the Framework.</li>
  7226. <li>The specific piece, which is written by Microsoft or an independent hardware vendor, is called the KMDF driver.</li>
  7227. </ul>
  7228. <p>The USB 3.0 host controller driver is an example of a driver based on KMDF. In this example, both drivers in the pair are written by Microsoft. The general driver is the Framework, and the device-specific driver is the USB 3.0 Host Controller Driver. This diagram illustrates the device node and device stack for a USB 3.0 host controller.</p><img id="KmdfAsPair01" alt="Diagram of device stack for USB 3 host controller" src="./Windows Kernel Development Articles (2016-03-30)_files/IC554550.png" title="Diagram of device stack for USB 3 host controller" xmlns=""><p>In the diagram, Usbxhci.sys is the USB 3.0 host controller driver. It is paired with Wdf01000.sys, which is the Framework. The (usbxhci.sys, wdf01000.sys) pair forms a single WDM driver that serves as the function driver for the USB 3.0 host controller. Notice that the driver pair occupies one level in the device stack and is represented by single device object. The single device object that represents the (usbxhci.sys, wdf01000.sys) pair is the functional device object (FDO) for the USB 3.0 host controller. </p>
  7229. <p>In a (KMDF driver, Framework) pair, the Framework handles tasks that are common to a wide variety of kernel-mode drivers. For example, the Framework can handle queuing of I/O requests, thread synchronization, most of the Plug and Play tasks, and most of the power management tasks. The KMDF driver handles tasks that require interaction with a specific device. The KMDF driver participates in processing requests by registering event handlers that the Framework calls as needed.</p>
  7230. <h2><a id="related_topics"></a>Related topics</h2>
  7231. <dl>
  7232. <dt>
  7233. <a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx">Minidrivers and driver pairs</a>
  7234. </dt>
  7235. <dt>
  7236. <a href="https://msdn.microsoft.com/en-us/library/ff544396(v=vs.85).aspx">Kernel-Mode Driver Framework</a>
  7237. </dt>
  7238. </dl>
  7239. <p>&nbsp;</p>
  7240. <p>&nbsp;</p>
  7241. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20KMDF%20as%20a%20generic%20driver%20pair%20model%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  7242. </div>
  7243. </div>
  7244. </div>
  7245. </div>
  7246. <div class="clear"></div>
  7247. <input name="__RequestVerificationToken" type="hidden" value="0QcrQhmjK3IIeTiVHfybcTWcmiWXdmewHbIcxSsefJPzQEpzFqa0nwpLvVMCd7MoVDvK21HVosGeppIgkMHWlTQM_fc1">
  7248. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh706279(d=printer,v=vs.85).aspx">
  7249. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh706279(d=printer,v=vs.85).aspx">
  7250. <input id="isTopicRated" type="hidden" value="false">
  7251. <div id="lib-footer" ms.pgarea="body">
  7252. <link type="text/css" rel="stylesheet">
  7253. <div id="ux-footer" class="" style="" dir="ltr">
  7254. <div id="footerSock" class="librarySock both">
  7255. <div id="footerSockInner">
  7256. <a name="feedback"></a>
  7257. <div class="rating">
  7258. <div id="ratingSection1">
  7259. <div class="title">
  7260. Was this page helpful?
  7261. </div>
  7262. <div class="description">
  7263. Your feedback about this content is important.<br>Let us know what you think.
  7264. </div>
  7265. <div class="buttons">
  7266. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  7267. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  7268. </div>
  7269. <input id="ratingValue" type="hidden" value="">
  7270. </div>
  7271. <div id="ratingSection2">
  7272. <div class="title left">
  7273. Additional feedback?
  7274. </div>
  7275. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  7276. <div class="right">
  7277. <div class="counter">
  7278. <span id="feedbackTextCounter">1500</span> characters remaining
  7279. </div>
  7280. <div class="buttons">
  7281. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  7282. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  7283. </div>
  7284. </div>
  7285. </div>
  7286. <div id="ratingSection3">
  7287. <div class="title">
  7288. Thank you!
  7289. </div>
  7290. <div class="description">
  7291. We appreciate your feedback.
  7292. </div>
  7293. </div>
  7294. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  7295. </div>
  7296. <div class="userVoice">
  7297. <div class="title">
  7298. Help us improve MSDN.
  7299. </div>
  7300. <div class="description">
  7301. Visit our UserVoice Page to submit and vote on ideas!
  7302. </div>
  7303. <div class="buttons">
  7304. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  7305. </div>
  7306. </div>
  7307. <div class="clear"></div>
  7308. </div>
  7309. </div>
  7310. <footer class="top">
  7311. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  7312. <div class="linkList">
  7313. <div class="linkListTitle">Dev centers</div>
  7314. <ul class="links">
  7315. <li>
  7316. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  7317. </li>
  7318. <li>
  7319. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  7320. </li>
  7321. <li>
  7322. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  7323. </li>
  7324. <li>
  7325. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  7326. </li>
  7327. <li>
  7328. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  7329. </li>
  7330. </ul>
  7331. </div>
  7332. </div>
  7333. <div id="rightLinks">
  7334. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  7335. <div class="linkList">
  7336. <div class="linkListTitle">Learning resources</div>
  7337. <ul class="links">
  7338. <li>
  7339. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  7340. </li>
  7341. <li>
  7342. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  7343. </li>
  7344. <li>
  7345. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  7346. </li>
  7347. </ul>
  7348. </div>
  7349. </div>
  7350. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  7351. <div class="linkList">
  7352. <div class="linkListTitle">Community</div>
  7353. <ul class="links">
  7354. <li>
  7355. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  7356. </li>
  7357. <li>
  7358. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  7359. </li>
  7360. <li>
  7361. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  7362. </li>
  7363. </ul>
  7364. </div>
  7365. </div>
  7366. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  7367. <div class="linkList">
  7368. <div class="linkListTitle">Support</div>
  7369. <ul class="links">
  7370. <li>
  7371. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  7372. </li>
  7373. </ul>
  7374. </div>
  7375. </div>
  7376. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  7377. <div class="linkList">
  7378. <div class="linkListTitle">Programs</div>
  7379. <ul class="links">
  7380. <li>
  7381. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  7382. </li>
  7383. <li>
  7384. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  7385. </li>
  7386. <li>
  7387. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  7388. </li>
  7389. </ul>
  7390. </div>
  7391. </div>
  7392. </div>
  7393. </footer>
  7394. <footer class="bottom">
  7395. <span class="localeContainer">
  7396. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  7397. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706279(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  7398. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  7399. </form>
  7400. </span>
  7401. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  7402. <div class="linkList">
  7403. <ul class="links horizontal">
  7404. <li>
  7405. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  7406. </li>
  7407. <li>
  7408. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  7409. </li>
  7410. <li>
  7411. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  7412. </li>
  7413. <li>
  7414. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  7415. </li>
  7416. </ul>
  7417. </div>
  7418. </div>
  7419. <span class="logoLegal">
  7420. <span class="logo"></span>
  7421. <span class="copyright">© 2016 Microsoft</span>
  7422. </span>
  7423. </footer>
  7424. </div>
  7425. </div>
  7426. <div class="footerPrintView">
  7427. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  7428. </div>
  7429. <input id="tocPaddingPerLevel" type="hidden" value="17">
  7430. <input id="MtpsDevice" type="hidden" value="Printer">
  7431. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  7432. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  7433. <div id="globalRequestVerification">
  7434. <input name="__RequestVerificationToken" type="hidden" value="nZiQ3CFcIrEEZwZQ_WPJmjSPfVh-WesE05vrl49yAyjsceTwvVLwjvi3c8d0TQkFpFADnFJsQfKGL28DZa_-g5MXGRg1">
  7435. </div>
  7436. </div>
  7437. <script type="text/javascript" class="mtps-injected">
  7438. /*<![CDATA[*/
  7439. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  7440. MTPS.injectScripts([
  7441. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  7442. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh706279(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  7443. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  7444. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  7445. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  7446. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  7447. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  7448. ]);
  7449. /*]]>*/
  7450. </script>
  7451. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  7452. <div id="page">
  7453. <link type="text/css" rel="stylesheet">
  7454. <input type="hidden" id="isHeaderBleeding" value="true">
  7455. <div id="ux-header" dir="ltr" class="ltr msdn">
  7456. <header>
  7457. <span id="singleCol"></span>
  7458. <span id="doubleCol"></span>
  7459. <span id="isMobile"></span>
  7460. <div>
  7461. <div class="row topRow">
  7462. <div class="top">
  7463. <div class="left">
  7464. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  7465. <div id="msft-logo" class="msft-logo"></div>
  7466. </a>
  7467. <div class="GrayPipe"></div>
  7468. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  7469. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  7470. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  7471. </div>
  7472. <div class="right">
  7473. <div id="signIn">
  7474. <div class="profileImage"></div>
  7475. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376412&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706278%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  7476. <div class="auxNav">
  7477. <div>
  7478. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  7479. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  7480. </div>
  7481. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  7482. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  7483. </div>
  7484. </div>
  7485. <div>
  7486. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  7487. <div class="linkList">
  7488. <ul class="links horizontal">
  7489. <li>
  7490. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  7491. </li>
  7492. <li>
  7493. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  7494. </li>
  7495. <li>
  7496. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  7497. </li>
  7498. </ul>
  7499. </div>
  7500. </div>
  7501. </div>
  7502. </div>
  7503. </div>
  7504. </div>
  7505. </div>
  7506. <div class="row middleRow">
  7507. <div class="expandTop">
  7508. <div class="left"></div>
  7509. <div class="right"></div>
  7510. </div>
  7511. </div>
  7512. </div>
  7513. <div id="buttomRowWrapper" class="bg_default">
  7514. <div class="row buttomRow bg_default">
  7515. <div class="bottom">
  7516. <div class="left">
  7517. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  7518. <div id="drawer">
  7519. <div class="toc">
  7520. <nav>
  7521. <ul class="navL1">
  7522. <li class="inactive toggle">
  7523. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  7524. <ul class="navL2">
  7525. <li class="inactive">
  7526. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  7527. </li>
  7528. <li class="inactive">
  7529. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  7530. </li>
  7531. <li class="inactive">
  7532. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  7533. </li>
  7534. <li class="inactive">
  7535. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  7536. </li>
  7537. <li class="inactive">
  7538. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  7539. </li>
  7540. <li class="inactive">
  7541. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  7542. </li>
  7543. </ul>
  7544. </li>
  7545. <li class="inactive toggle">
  7546. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  7547. <ul class="navL2">
  7548. <li class="inactive">
  7549. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  7550. </li>
  7551. <li class="inactive">
  7552. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  7553. </li>
  7554. <li class="inactive">
  7555. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  7556. </li>
  7557. <li class="inactive toggle">
  7558. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  7559. <ul class="navL3">
  7560. <li class="inactive">
  7561. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  7562. </li>
  7563. <li class="inactive">
  7564. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  7565. </li>
  7566. <li class="inactive">
  7567. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  7568. </li>
  7569. <li class="inactive">
  7570. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  7571. </li>
  7572. <li class="inactive">
  7573. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  7574. </li>
  7575. </ul>
  7576. </li>
  7577. </ul>
  7578. </li>
  7579. <li class="inactive toggle">
  7580. <a href="javascript:void(0)" title="Programs">Programs</a>
  7581. <ul class="navL2">
  7582. <li class="inactive toggle">
  7583. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  7584. <ul class="navL3">
  7585. <li class="inactive">
  7586. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  7587. </li>
  7588. <li class="inactive">
  7589. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  7590. </li>
  7591. <li class="inactive">
  7592. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  7593. </li>
  7594. </ul>
  7595. </li>
  7596. <li class="inactive toggle">
  7597. <a href="javascript:void(0)" title="Students">Students</a>
  7598. <ul class="navL3">
  7599. <li class="inactive">
  7600. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  7601. </li>
  7602. <li class="inactive">
  7603. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  7604. </li>
  7605. </ul>
  7606. </li>
  7607. <li class="inactive toggle">
  7608. <a href="javascript:void(0)" title="Architects">Architects</a>
  7609. <ul class="navL3">
  7610. <li class="inactive">
  7611. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  7612. </li>
  7613. <li class="inactive">
  7614. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  7615. </li>
  7616. <li class="inactive">
  7617. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  7618. </li>
  7619. <li class="inactive">
  7620. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  7621. </li>
  7622. <li class="inactive">
  7623. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  7624. </li>
  7625. </ul>
  7626. </li>
  7627. <li class="inactive">
  7628. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  7629. </li>
  7630. <li class="inactive">
  7631. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  7632. </li>
  7633. <li class="inactive">
  7634. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  7635. </li>
  7636. <li class="inactive">
  7637. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  7638. </li>
  7639. </ul>
  7640. </li>
  7641. <li class="inactive toggle">
  7642. <a href="javascript:void(0)" title="Community">Community</a>
  7643. <ul class="navL2">
  7644. <li class="inactive">
  7645. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  7646. </li>
  7647. <li class="inactive">
  7648. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  7649. </li>
  7650. <li class="inactive">
  7651. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  7652. </li>
  7653. <li class="inactive">
  7654. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  7655. </li>
  7656. <li class="inactive">
  7657. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  7658. </li>
  7659. </ul>
  7660. </li>
  7661. <li class="inactive current toggle">
  7662. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  7663. <ul class="navL2">
  7664. <li class="inactive current">
  7665. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  7666. </li>
  7667. <li class="inactive">
  7668. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  7669. </li>
  7670. </ul>
  7671. </li>
  7672. <li class="inactive">
  7673. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  7674. </li>
  7675. </ul>
  7676. </nav>
  7677. </div>
  7678. </div>
  7679. </div>
  7680. <div class="right">
  7681. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  7682. <div class="SearchBox">
  7683. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  7684. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  7685. <div id="search-finder" class="search-finder"></div>
  7686. </button>
  7687. <button id="HeaderSearchButton" style="display:none"></button>
  7688. <div id="searchSplitter"></div>
  7689. <div id="searchCloseIcon" class="search-clear-x"></div>
  7690. <div id="searchTextContainer" style="width: 0;">
  7691. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  7692. </div>
  7693. </form>
  7694. </div>
  7695. </div>
  7696. </div>
  7697. </div>
  7698. </div>
  7699. </div>
  7700. </header>
  7701. </div>
  7702. <div class="printExportMenus ltr">
  7703. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh706278(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  7704. Export (<span class="count">0</span>)
  7705. </a>
  7706. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh706278(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  7707. Print
  7708. </a>
  7709. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  7710. </a>
  7711. </div>
  7712. <div class="printExportMenus ltr">
  7713. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  7714. </div>
  7715. <div id="body" ms.pgarea="body">
  7716. <span id="tabletView_large"></span>
  7717. <span id="tabletView_small"></span>
  7718. <span id="mobileView"></span>
  7719. <div id="content" class="content">
  7720. <input type="hidden" id="printForPab" value="true">
  7721. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  7722. <h1 class="title">KMDF extensions and driver triples</h1>
  7723. <div id="mainSection">
  7724. <div class="clsServerSDKContent">
  7725. </div>
  7726. <p>In this topic, we discuss class-based extensions to the Kernel Mode Driver Framework (KMDF). Before you read this topic, you should understand the ideas presented in <a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx">Minidrivers and driver pairs</a> and <a href="https://msdn.microsoft.com/en-us/library/hh706279(v=vs.85).aspx">KMDF as a Generic Driver Pair Model</a>.</p>
  7727. <p>For some device classes, Microsoft provides KMDF extensions that further reduce the amount of processing that must be performed by KMDF drivers. A driver that uses a class-based KMDF extension has these three pieces, which we call a <em>driver triple</em>.</p>
  7728. <ul>
  7729. <li>The Framework, which handles tasks common to most all drivers</li>
  7730. <li>The class-based framework extension, which handles tasks that are specific to a particular class of devices</li>
  7731. <li>The KMDF driver, which handles tasks that are specific to a particular device.</li>
  7732. </ul>
  7733. <p>The three drivers in a driver triple (KMDF driver, device-class KMDF extension, Framework) combine to form a single WDM driver.</p>
  7734. <p>An example of a device-class KMDF extension is SpbCx.sys, which is the KMDF extension for the Simple Peripheral Bus (SPB) device class. The SPB class includes synchronous serial buses such as I2C and SPI. A driver triple for an I2C bus controller would look like this:</p>
  7735. <ul>
  7736. <li>The Framework handles general tasks that are common to most all drivers.</li>
  7737. <li>SpbCx.sys handles tasks that are specific to the SPB bus class. These are tasks that are common to all SPB busses.</li>
  7738. <li>The KMDF driver handles tasks that are specific to an I2C bus. Let's call this driver MyI2CBusDriver.sys.</li>
  7739. </ul><img id="kmdfdrivertriple" alt="KMDF Driver Triple Extension" src="./Windows Kernel Development Articles (2016-03-30)_files/IC831359.png" title="KMDF Driver Triple Extension" xmlns=""><p>The three drivers in the driver triple (MyI2CBusDriver.sys, SpbCx.sys, Wdf01000.sys) combine to form a single WDM driver that serves as the function driver for the I2C bus controller. Wdf01000.sys (the Framework) owns the dispatch table for this driver, so when someone sends an IRP to the driver triple, it goes to the wdf01000.sys. If the wdf01000.sys can handle the IRP by itself, SpbCx.sys and MyI2CBusDriver.sys are not involved. If wdf01000.sys cannot handle the IRP by itself, it gets help by calling an event handler in SbpCx.sys.</p>
  7740. <p></p>
  7741. <p>Here are some examples of event handlers that might be implemented by MyI2CBusDriver.sys:</p>
  7742. <ul>
  7743. <li>EvtSpbControllerLock</li>
  7744. <li>EvtSpbIoRead</li>
  7745. <li>EvtSpbIoSequence</li>
  7746. </ul>
  7747. <p>Here are some examples of event handlers that are implemented by SpbCx.sys</p>
  7748. <ul>
  7749. <li>EvtIoRead</li>
  7750. </ul>
  7751. <p>&nbsp;</p>
  7752. <p>&nbsp;</p>
  7753. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20KMDF%20extensions%20and%20driver%20triples%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  7754. </div>
  7755. </div>
  7756. </div>
  7757. </div>
  7758. <div class="clear"></div>
  7759. <input name="__RequestVerificationToken" type="hidden" value="Y_ZLItitR82NdFjxHP5UW2gToOKbN8RShlDCjhIrdLflp57W4KvRLLTiguwAiZ2R8xqx8LkapnKrs7Fvc2_90byLNbY1">
  7760. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh706278(d=printer,v=vs.85).aspx">
  7761. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh706278(d=printer,v=vs.85).aspx">
  7762. <input id="isTopicRated" type="hidden" value="false">
  7763. <div id="lib-footer" ms.pgarea="body">
  7764. <link type="text/css" rel="stylesheet">
  7765. <div id="ux-footer" class="" style="" dir="ltr">
  7766. <div id="footerSock" class="librarySock both">
  7767. <div id="footerSockInner">
  7768. <a name="feedback"></a>
  7769. <div class="rating">
  7770. <div id="ratingSection1">
  7771. <div class="title">
  7772. Was this page helpful?
  7773. </div>
  7774. <div class="description">
  7775. Your feedback about this content is important.<br>Let us know what you think.
  7776. </div>
  7777. <div class="buttons">
  7778. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  7779. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  7780. </div>
  7781. <input id="ratingValue" type="hidden" value="">
  7782. </div>
  7783. <div id="ratingSection2">
  7784. <div class="title left">
  7785. Additional feedback?
  7786. </div>
  7787. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  7788. <div class="right">
  7789. <div class="counter">
  7790. <span id="feedbackTextCounter">1500</span> characters remaining
  7791. </div>
  7792. <div class="buttons">
  7793. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  7794. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  7795. </div>
  7796. </div>
  7797. </div>
  7798. <div id="ratingSection3">
  7799. <div class="title">
  7800. Thank you!
  7801. </div>
  7802. <div class="description">
  7803. We appreciate your feedback.
  7804. </div>
  7805. </div>
  7806. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  7807. </div>
  7808. <div class="userVoice">
  7809. <div class="title">
  7810. Help us improve MSDN.
  7811. </div>
  7812. <div class="description">
  7813. Visit our UserVoice Page to submit and vote on ideas!
  7814. </div>
  7815. <div class="buttons">
  7816. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  7817. </div>
  7818. </div>
  7819. <div class="clear"></div>
  7820. </div>
  7821. </div>
  7822. <footer class="top">
  7823. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  7824. <div class="linkList">
  7825. <div class="linkListTitle">Dev centers</div>
  7826. <ul class="links">
  7827. <li>
  7828. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  7829. </li>
  7830. <li>
  7831. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  7832. </li>
  7833. <li>
  7834. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  7835. </li>
  7836. <li>
  7837. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  7838. </li>
  7839. <li>
  7840. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  7841. </li>
  7842. </ul>
  7843. </div>
  7844. </div>
  7845. <div id="rightLinks">
  7846. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  7847. <div class="linkList">
  7848. <div class="linkListTitle">Learning resources</div>
  7849. <ul class="links">
  7850. <li>
  7851. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  7852. </li>
  7853. <li>
  7854. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  7855. </li>
  7856. <li>
  7857. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  7858. </li>
  7859. </ul>
  7860. </div>
  7861. </div>
  7862. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  7863. <div class="linkList">
  7864. <div class="linkListTitle">Community</div>
  7865. <ul class="links">
  7866. <li>
  7867. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  7868. </li>
  7869. <li>
  7870. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  7871. </li>
  7872. <li>
  7873. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  7874. </li>
  7875. </ul>
  7876. </div>
  7877. </div>
  7878. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  7879. <div class="linkList">
  7880. <div class="linkListTitle">Support</div>
  7881. <ul class="links">
  7882. <li>
  7883. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  7884. </li>
  7885. </ul>
  7886. </div>
  7887. </div>
  7888. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  7889. <div class="linkList">
  7890. <div class="linkListTitle">Programs</div>
  7891. <ul class="links">
  7892. <li>
  7893. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  7894. </li>
  7895. <li>
  7896. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  7897. </li>
  7898. <li>
  7899. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  7900. </li>
  7901. </ul>
  7902. </div>
  7903. </div>
  7904. </div>
  7905. </footer>
  7906. <footer class="bottom">
  7907. <span class="localeContainer">
  7908. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  7909. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706278(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  7910. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  7911. </form>
  7912. </span>
  7913. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  7914. <div class="linkList">
  7915. <ul class="links horizontal">
  7916. <li>
  7917. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  7918. </li>
  7919. <li>
  7920. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  7921. </li>
  7922. <li>
  7923. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  7924. </li>
  7925. <li>
  7926. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  7927. </li>
  7928. </ul>
  7929. </div>
  7930. </div>
  7931. <span class="logoLegal">
  7932. <span class="logo"></span>
  7933. <span class="copyright">© 2016 Microsoft</span>
  7934. </span>
  7935. </footer>
  7936. </div>
  7937. </div>
  7938. <div class="footerPrintView">
  7939. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  7940. </div>
  7941. <input id="tocPaddingPerLevel" type="hidden" value="17">
  7942. <input id="MtpsDevice" type="hidden" value="Printer">
  7943. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  7944. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  7945. <div id="globalRequestVerification">
  7946. <input name="__RequestVerificationToken" type="hidden" value="hLUjEzoA1cBRbA7FPIW3B8W8LZfU3iaKD4FYPhl7wfyuJWRFbGrSYt1Tx2zig8XjIYVCWXJvMwR2H3DteKkomDs33C81">
  7947. </div>
  7948. </div>
  7949. <script type="text/javascript" class="mtps-injected">
  7950. /*<![CDATA[*/
  7951. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  7952. MTPS.injectScripts([
  7953. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  7954. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh706278(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  7955. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  7956. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  7957. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  7958. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  7959. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  7960. ]);
  7961. /*]]>*/
  7962. </script>
  7963. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  7964. <div id="page">
  7965. <link type="text/css" rel="stylesheet">
  7966. <input type="hidden" id="isHeaderBleeding" value="true">
  7967. <div id="ux-header" dir="ltr" class="ltr msdn">
  7968. <header>
  7969. <span id="singleCol"></span>
  7970. <span id="doubleCol"></span>
  7971. <span id="isMobile"></span>
  7972. <div>
  7973. <div class="row topRow">
  7974. <div class="top">
  7975. <div class="left">
  7976. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  7977. <div id="msft-logo" class="msft-logo"></div>
  7978. </a>
  7979. <div class="GrayPipe"></div>
  7980. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  7981. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  7982. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  7983. </div>
  7984. <div class="right">
  7985. <div id="signIn">
  7986. <div class="profileImage"></div>
  7987. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376413&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706280%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  7988. <div class="auxNav">
  7989. <div>
  7990. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  7991. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  7992. </div>
  7993. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  7994. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  7995. </div>
  7996. </div>
  7997. <div>
  7998. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  7999. <div class="linkList">
  8000. <ul class="links horizontal">
  8001. <li>
  8002. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  8003. </li>
  8004. <li>
  8005. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  8006. </li>
  8007. <li>
  8008. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  8009. </li>
  8010. </ul>
  8011. </div>
  8012. </div>
  8013. </div>
  8014. </div>
  8015. </div>
  8016. </div>
  8017. </div>
  8018. <div class="row middleRow">
  8019. <div class="expandTop">
  8020. <div class="left"></div>
  8021. <div class="right"></div>
  8022. </div>
  8023. </div>
  8024. </div>
  8025. <div id="buttomRowWrapper" class="bg_default">
  8026. <div class="row buttomRow bg_default">
  8027. <div class="bottom">
  8028. <div class="left">
  8029. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  8030. <div id="drawer">
  8031. <div class="toc">
  8032. <nav>
  8033. <ul class="navL1">
  8034. <li class="inactive toggle">
  8035. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  8036. <ul class="navL2">
  8037. <li class="inactive">
  8038. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  8039. </li>
  8040. <li class="inactive">
  8041. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  8042. </li>
  8043. <li class="inactive">
  8044. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  8045. </li>
  8046. <li class="inactive">
  8047. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  8048. </li>
  8049. <li class="inactive">
  8050. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  8051. </li>
  8052. <li class="inactive">
  8053. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  8054. </li>
  8055. </ul>
  8056. </li>
  8057. <li class="inactive toggle">
  8058. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  8059. <ul class="navL2">
  8060. <li class="inactive">
  8061. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  8062. </li>
  8063. <li class="inactive">
  8064. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  8065. </li>
  8066. <li class="inactive">
  8067. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  8068. </li>
  8069. <li class="inactive toggle">
  8070. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  8071. <ul class="navL3">
  8072. <li class="inactive">
  8073. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  8074. </li>
  8075. <li class="inactive">
  8076. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  8077. </li>
  8078. <li class="inactive">
  8079. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  8080. </li>
  8081. <li class="inactive">
  8082. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  8083. </li>
  8084. <li class="inactive">
  8085. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  8086. </li>
  8087. </ul>
  8088. </li>
  8089. </ul>
  8090. </li>
  8091. <li class="inactive toggle">
  8092. <a href="javascript:void(0)" title="Programs">Programs</a>
  8093. <ul class="navL2">
  8094. <li class="inactive toggle">
  8095. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  8096. <ul class="navL3">
  8097. <li class="inactive">
  8098. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  8099. </li>
  8100. <li class="inactive">
  8101. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  8102. </li>
  8103. <li class="inactive">
  8104. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  8105. </li>
  8106. </ul>
  8107. </li>
  8108. <li class="inactive toggle">
  8109. <a href="javascript:void(0)" title="Students">Students</a>
  8110. <ul class="navL3">
  8111. <li class="inactive">
  8112. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  8113. </li>
  8114. <li class="inactive">
  8115. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  8116. </li>
  8117. </ul>
  8118. </li>
  8119. <li class="inactive toggle">
  8120. <a href="javascript:void(0)" title="Architects">Architects</a>
  8121. <ul class="navL3">
  8122. <li class="inactive">
  8123. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  8124. </li>
  8125. <li class="inactive">
  8126. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  8127. </li>
  8128. <li class="inactive">
  8129. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  8130. </li>
  8131. <li class="inactive">
  8132. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  8133. </li>
  8134. <li class="inactive">
  8135. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  8136. </li>
  8137. </ul>
  8138. </li>
  8139. <li class="inactive">
  8140. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  8141. </li>
  8142. <li class="inactive">
  8143. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  8144. </li>
  8145. <li class="inactive">
  8146. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  8147. </li>
  8148. <li class="inactive">
  8149. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  8150. </li>
  8151. </ul>
  8152. </li>
  8153. <li class="inactive toggle">
  8154. <a href="javascript:void(0)" title="Community">Community</a>
  8155. <ul class="navL2">
  8156. <li class="inactive">
  8157. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  8158. </li>
  8159. <li class="inactive">
  8160. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  8161. </li>
  8162. <li class="inactive">
  8163. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  8164. </li>
  8165. <li class="inactive">
  8166. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  8167. </li>
  8168. <li class="inactive">
  8169. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  8170. </li>
  8171. </ul>
  8172. </li>
  8173. <li class="inactive current toggle">
  8174. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  8175. <ul class="navL2">
  8176. <li class="inactive current">
  8177. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  8178. </li>
  8179. <li class="inactive">
  8180. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  8181. </li>
  8182. </ul>
  8183. </li>
  8184. <li class="inactive">
  8185. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  8186. </li>
  8187. </ul>
  8188. </nav>
  8189. </div>
  8190. </div>
  8191. </div>
  8192. <div class="right">
  8193. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  8194. <div class="SearchBox">
  8195. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  8196. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  8197. <div id="search-finder" class="search-finder"></div>
  8198. </button>
  8199. <button id="HeaderSearchButton" style="display:none"></button>
  8200. <div id="searchSplitter"></div>
  8201. <div id="searchCloseIcon" class="search-clear-x"></div>
  8202. <div id="searchTextContainer" style="width: 0;">
  8203. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  8204. </div>
  8205. </form>
  8206. </div>
  8207. </div>
  8208. </div>
  8209. </div>
  8210. </div>
  8211. </div>
  8212. </header>
  8213. </div>
  8214. <div class="printExportMenus ltr">
  8215. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh706280(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  8216. Export (<span class="count">0</span>)
  8217. </a>
  8218. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh706280(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  8219. Print
  8220. </a>
  8221. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  8222. </a>
  8223. </div>
  8224. <div class="printExportMenus ltr">
  8225. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  8226. </div>
  8227. <div id="body" ms.pgarea="body">
  8228. <span id="tabletView_large"></span>
  8229. <span id="tabletView_small"></span>
  8230. <span id="mobileView"></span>
  8231. <div id="content" class="content">
  8232. <input type="hidden" id="printForPab" value="true">
  8233. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  8234. <h1 class="title">Upper and lower edges of drivers</h1>
  8235. <div id="mainSection">
  8236. <div class="clsServerSDKContent">
  8237. </div>
  8238. <p>The sequence of drivers that participate in an I/O request is called the driver stack for the request. A driver can call into the upper edge of a lower driver in the stack. A driver can also call into the lower edge of a higher driver in the stack.</p>
  8239. <p>Before you read this topic, you should understand the ideas presented in <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a> and <a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx">Driver stacks</a>.</p>
  8240. <p> I/O requests are processed first by the top driver in the driver stack, then by the next lower driver, and so on until the request is fully processed. </p>
  8241. <p>When a driver implements a set of functions that a higher driver can call, that set of functions is called the <em>upper edge</em> of the driver or the <em>upper-edge interface</em> of the driver.</p>
  8242. <p>When a driver implements a set of functions that a lower driver can call, that set of functions is called the <em>lower edge</em> of the driver or the <em>lower-edge interface</em> of the driver.</p>
  8243. <h3><a id="Audio_example"></a><a id="audio_example"></a><a id="AUDIO_EXAMPLE"></a>Audio example</h3>
  8244. <p>We can think of an audio miniport driver sitting below an audio port driver in a driver stack. The port driver makes calls to the miniport driver's upper edge. The miniport driver makes calls to the port driver's lower edge.</p><img id="AudioDrvStack" alt="Diagram of audio port driver above miniport driver" src="./Windows Kernel Development Articles (2016-03-30)_files/IC534970.png" title="Diagram of audio port driver above miniport driver" xmlns=""><p>The preceding diagram illustrates that it is sometimes useful to think of a port driver sitting above a miniport driver in a driver stack. Because I/O requests are processed first by the port driver and then by the miniport driver, it is reasonable to think of the port driver as being above the miniport driver. Keep in mind, however, that a (miniport, port) driver pair usually sits at a single level in a device stack, as shown here.</p><img id="upperloweredge01" alt="Diagram of device stack with (miniport/port) pair" src="./Windows Kernel Development Articles (2016-03-30)_files/IC554551.png" title="Diagram of device stack with (miniport/port) pair" xmlns=""><p>Note that a <em>device stack</em> is not the same thing as a <em>driver stack</em>. For definitions of these terms, and for a discussion of how a pair of drivers can form a single WDM driver that occupies one level in a device stack, see <a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx">Minidrivers and driver pairs</a>. </p>
  8245. <p>Here's another way to draw a diagram of the same device node and device stack:</p><img id="upperloweredge02" alt="Diagram of device stack with port driver above miniport" src="./Windows Kernel Development Articles (2016-03-30)_files/IC554552.png" title="Diagram of device stack with port driver above miniport" xmlns=""><p>In the preceding diagram, we see that the (miniport, port) pair forms a single WDM driver that is associated with a single device object (the FDO) in the device stack; that is, the (miniport, port) pair occupies only one level in the device stack. But we also see a vertical relationship between the miniport and port drivers. The port driver is shown above the miniport driver to indicate that the port driver processes I/O requests first and then calls into the miniport driver for additional processing.</p>
  8246. <p>The key point is that when the port driver calls into the miniport driver's upper-edge interface, that is not the same as passing an I/O request down the device stack. In a driver stack (not device stack) you can choose to draw a port driver above a miniport driver, but that does not mean that the port driver is above the miniport driver in the device stack.</p>
  8247. <h3><a id="NDIS_example"></a><a id="ndis_example"></a><a id="NDIS_EXAMPLE"></a>NDIS example</h3>
  8248. <p>Sometimes a driver calls the upper edge of a lower driver indirectly. For example, suppose a <a href="https://msdn.microsoft.com/en-us/library/ff556929(v=vs.85).aspx">TCP/IP protocol driver</a> sits above an <a href="https://msdn.microsoft.com/en-us/library/ff565448(v=vs.85).aspx">NDIS</a> miniport driver in a driver stack. The miniport driver implements a set of <em>MiniportXxx</em> functions that form the miniport driver's upper edge. We say that the TCP/IP protocol driver <em>binds</em> to the upper edge of the NDIS miniport driver. But the TCP/IP driver does not call the <em>MiniportXxx</em> functions directly. Instead, it calls functions in the NDIS library, which then call the <em>MiniportXxx</em> functions.</p><img id="UpperLowerEdge03" alt="Diagram of TCP/IP and NDIS miniport stack" src="./Windows Kernel Development Articles (2016-03-30)_files/IC686629.png" title="Diagram of TCP/IP and NDIS miniport stack" xmlns=""><p>The preceding diagram shows a driver stack. Here's another view of the same drivers.</p><img id="UpperLowerEdge04" alt="Diagram of device stack for a network card" src="./Windows Kernel Development Articles (2016-03-30)_files/IC686630.png" title="Diagram of device stack for a network card" xmlns=""><p>The preceding diagram shows the device node for a network interface card (NIC). The device node has a position in the Plug and Play (PnP) device tree. The device node for the NIC has a device stack with three device objects. Notice that the NDIS miniport driver and the NDIS library work as a pair. The pair (MyMiniport.sys, Ndis.sys) forms a single WDM driver that is represented by the functional device object (FDO).</p>
  8249. <p>Also notice that the protocol driver Tcpip.sys is not part of the device stack for the NIC. In fact, Tcpip.sys is not part of the PnP device tree at all.</p>
  8250. <h2><a id="Summary"></a><a id="summary"></a><a id="SUMMARY"></a>Summary</h2>
  8251. <p>The terms <em>upper edge</em> and <em>lower edge</em> are used to describe the interfaces that drivers in a stack use to communicate with each other. A <a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">driver stack</em></a> is not the same thing as <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">device stack</em></a>. Two drivers that are shown vertically in a driver stack might form a driver pair that sits at a single level in a device stack. Some drivers are not part of the PnP device tree.</p>
  8252. <h2><a id="related_topics"></a>Related topics</h2>
  8253. <dl>
  8254. <dt>
  8255. <a href="https://msdn.microsoft.com/en-us/library/ff554731(v=vs.85).aspx">Concepts for all driver developers</a>
  8256. </dt>
  8257. <dt>
  8258. <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a>
  8259. </dt>
  8260. <dt>
  8261. <a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx">Driver stacks</a>
  8262. </dt>
  8263. <dt>
  8264. <a href="https://msdn.microsoft.com/en-us/library/ff537760(v=vs.85).aspx">Audio Devices</a>
  8265. </dt>
  8266. <dt>
  8267. <a href="https://msdn.microsoft.com/en-us/library/ff570021(v=vs.85).aspx">Network Drivers Starting with Windows Vista</a>
  8268. </dt>
  8269. </dl>
  8270. <p>&nbsp;</p>
  8271. <p>&nbsp;</p>
  8272. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Upper%20and%20lower%20edges%20of%20drivers%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  8273. </div>
  8274. </div>
  8275. </div>
  8276. </div>
  8277. <div class="clear"></div>
  8278. <input name="__RequestVerificationToken" type="hidden" value="tVn6GYeM4ftFPo661EPjc8mNQv64fPdD8CqPp4VdlNAkYf_JW0v3kgQRRgZH5P90oLlTspSAG0M_tRVCTYxzS95ZOr41">
  8279. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh706280(d=printer,v=vs.85).aspx">
  8280. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh706280(d=printer,v=vs.85).aspx">
  8281. <input id="isTopicRated" type="hidden" value="false">
  8282. <div id="lib-footer" ms.pgarea="body">
  8283. <link type="text/css" rel="stylesheet">
  8284. <div id="ux-footer" class="" style="" dir="ltr">
  8285. <div id="footerSock" class="librarySock both">
  8286. <div id="footerSockInner">
  8287. <a name="feedback"></a>
  8288. <div class="rating">
  8289. <div id="ratingSection1">
  8290. <div class="title">
  8291. Was this page helpful?
  8292. </div>
  8293. <div class="description">
  8294. Your feedback about this content is important.<br>Let us know what you think.
  8295. </div>
  8296. <div class="buttons">
  8297. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  8298. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  8299. </div>
  8300. <input id="ratingValue" type="hidden" value="">
  8301. </div>
  8302. <div id="ratingSection2">
  8303. <div class="title left">
  8304. Additional feedback?
  8305. </div>
  8306. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  8307. <div class="right">
  8308. <div class="counter">
  8309. <span id="feedbackTextCounter">1500</span> characters remaining
  8310. </div>
  8311. <div class="buttons">
  8312. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  8313. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  8314. </div>
  8315. </div>
  8316. </div>
  8317. <div id="ratingSection3">
  8318. <div class="title">
  8319. Thank you!
  8320. </div>
  8321. <div class="description">
  8322. We appreciate your feedback.
  8323. </div>
  8324. </div>
  8325. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  8326. </div>
  8327. <div class="userVoice">
  8328. <div class="title">
  8329. Help us improve MSDN.
  8330. </div>
  8331. <div class="description">
  8332. Visit our UserVoice Page to submit and vote on ideas!
  8333. </div>
  8334. <div class="buttons">
  8335. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  8336. </div>
  8337. </div>
  8338. <div class="clear"></div>
  8339. </div>
  8340. </div>
  8341. <footer class="top">
  8342. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  8343. <div class="linkList">
  8344. <div class="linkListTitle">Dev centers</div>
  8345. <ul class="links">
  8346. <li>
  8347. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  8348. </li>
  8349. <li>
  8350. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  8351. </li>
  8352. <li>
  8353. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  8354. </li>
  8355. <li>
  8356. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  8357. </li>
  8358. <li>
  8359. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  8360. </li>
  8361. </ul>
  8362. </div>
  8363. </div>
  8364. <div id="rightLinks">
  8365. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  8366. <div class="linkList">
  8367. <div class="linkListTitle">Learning resources</div>
  8368. <ul class="links">
  8369. <li>
  8370. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  8371. </li>
  8372. <li>
  8373. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  8374. </li>
  8375. <li>
  8376. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  8377. </li>
  8378. </ul>
  8379. </div>
  8380. </div>
  8381. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  8382. <div class="linkList">
  8383. <div class="linkListTitle">Community</div>
  8384. <ul class="links">
  8385. <li>
  8386. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  8387. </li>
  8388. <li>
  8389. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  8390. </li>
  8391. <li>
  8392. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  8393. </li>
  8394. </ul>
  8395. </div>
  8396. </div>
  8397. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  8398. <div class="linkList">
  8399. <div class="linkListTitle">Support</div>
  8400. <ul class="links">
  8401. <li>
  8402. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  8403. </li>
  8404. </ul>
  8405. </div>
  8406. </div>
  8407. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  8408. <div class="linkList">
  8409. <div class="linkListTitle">Programs</div>
  8410. <ul class="links">
  8411. <li>
  8412. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  8413. </li>
  8414. <li>
  8415. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  8416. </li>
  8417. <li>
  8418. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  8419. </li>
  8420. </ul>
  8421. </div>
  8422. </div>
  8423. </div>
  8424. </footer>
  8425. <footer class="bottom">
  8426. <span class="localeContainer">
  8427. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  8428. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706280(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  8429. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  8430. </form>
  8431. </span>
  8432. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  8433. <div class="linkList">
  8434. <ul class="links horizontal">
  8435. <li>
  8436. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  8437. </li>
  8438. <li>
  8439. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  8440. </li>
  8441. <li>
  8442. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  8443. </li>
  8444. <li>
  8445. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  8446. </li>
  8447. </ul>
  8448. </div>
  8449. </div>
  8450. <span class="logoLegal">
  8451. <span class="logo"></span>
  8452. <span class="copyright">© 2016 Microsoft</span>
  8453. </span>
  8454. </footer>
  8455. </div>
  8456. </div>
  8457. <div class="footerPrintView">
  8458. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  8459. </div>
  8460. <input id="tocPaddingPerLevel" type="hidden" value="17">
  8461. <input id="MtpsDevice" type="hidden" value="Printer">
  8462. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  8463. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  8464. <div id="globalRequestVerification">
  8465. <input name="__RequestVerificationToken" type="hidden" value="BE6aMRYKDuQYpxoPXSaq9djjAFfYUOv6ZJQiEFptVgKqBjoyuSfjhk4MAuwV4HxSNyyuyO39O0VGK-CQv2jMue2Wwmc1">
  8466. </div>
  8467. </div>
  8468. <script type="text/javascript" class="mtps-injected">
  8469. /*<![CDATA[*/
  8470. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  8471. MTPS.injectScripts([
  8472. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  8473. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh706280(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  8474. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  8475. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  8476. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  8477. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  8478. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  8479. ]);
  8480. /*]]>*/
  8481. </script>
  8482. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  8483. <div id="page">
  8484. <link type="text/css" rel="stylesheet">
  8485. <input type="hidden" id="isHeaderBleeding" value="true">
  8486. <div id="ux-header" dir="ltr" class="ltr msdn">
  8487. <header>
  8488. <span id="singleCol"></span>
  8489. <span id="doubleCol"></span>
  8490. <span id="isMobile"></span>
  8491. <div>
  8492. <div class="row topRow">
  8493. <div class="top">
  8494. <div class="left">
  8495. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  8496. <div id="msft-logo" class="msft-logo"></div>
  8497. </a>
  8498. <div class="GrayPipe"></div>
  8499. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  8500. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  8501. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  8502. </div>
  8503. <div class="right">
  8504. <div id="signIn">
  8505. <div class="profileImage"></div>
  8506. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376414&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554695%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  8507. <div class="auxNav">
  8508. <div>
  8509. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  8510. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  8511. </div>
  8512. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  8513. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  8514. </div>
  8515. </div>
  8516. <div>
  8517. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  8518. <div class="linkList">
  8519. <ul class="links horizontal">
  8520. <li>
  8521. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  8522. </li>
  8523. <li>
  8524. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  8525. </li>
  8526. <li>
  8527. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  8528. </li>
  8529. </ul>
  8530. </div>
  8531. </div>
  8532. </div>
  8533. </div>
  8534. </div>
  8535. </div>
  8536. </div>
  8537. <div class="row middleRow">
  8538. <div class="expandTop">
  8539. <div class="left"></div>
  8540. <div class="right"></div>
  8541. </div>
  8542. </div>
  8543. </div>
  8544. <div id="buttomRowWrapper" class="bg_default">
  8545. <div class="row buttomRow bg_default">
  8546. <div class="bottom">
  8547. <div class="left">
  8548. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  8549. <div id="drawer">
  8550. <div class="toc">
  8551. <nav>
  8552. <ul class="navL1">
  8553. <li class="inactive toggle">
  8554. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  8555. <ul class="navL2">
  8556. <li class="inactive">
  8557. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  8558. </li>
  8559. <li class="inactive">
  8560. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  8561. </li>
  8562. <li class="inactive">
  8563. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  8564. </li>
  8565. <li class="inactive">
  8566. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  8567. </li>
  8568. <li class="inactive">
  8569. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  8570. </li>
  8571. <li class="inactive">
  8572. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  8573. </li>
  8574. </ul>
  8575. </li>
  8576. <li class="inactive toggle">
  8577. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  8578. <ul class="navL2">
  8579. <li class="inactive">
  8580. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  8581. </li>
  8582. <li class="inactive">
  8583. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  8584. </li>
  8585. <li class="inactive">
  8586. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  8587. </li>
  8588. <li class="inactive toggle">
  8589. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  8590. <ul class="navL3">
  8591. <li class="inactive">
  8592. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  8593. </li>
  8594. <li class="inactive">
  8595. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  8596. </li>
  8597. <li class="inactive">
  8598. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  8599. </li>
  8600. <li class="inactive">
  8601. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  8602. </li>
  8603. <li class="inactive">
  8604. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  8605. </li>
  8606. </ul>
  8607. </li>
  8608. </ul>
  8609. </li>
  8610. <li class="inactive toggle">
  8611. <a href="javascript:void(0)" title="Programs">Programs</a>
  8612. <ul class="navL2">
  8613. <li class="inactive toggle">
  8614. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  8615. <ul class="navL3">
  8616. <li class="inactive">
  8617. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  8618. </li>
  8619. <li class="inactive">
  8620. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  8621. </li>
  8622. <li class="inactive">
  8623. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  8624. </li>
  8625. </ul>
  8626. </li>
  8627. <li class="inactive toggle">
  8628. <a href="javascript:void(0)" title="Students">Students</a>
  8629. <ul class="navL3">
  8630. <li class="inactive">
  8631. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  8632. </li>
  8633. <li class="inactive">
  8634. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  8635. </li>
  8636. </ul>
  8637. </li>
  8638. <li class="inactive toggle">
  8639. <a href="javascript:void(0)" title="Architects">Architects</a>
  8640. <ul class="navL3">
  8641. <li class="inactive">
  8642. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  8643. </li>
  8644. <li class="inactive">
  8645. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  8646. </li>
  8647. <li class="inactive">
  8648. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  8649. </li>
  8650. <li class="inactive">
  8651. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  8652. </li>
  8653. <li class="inactive">
  8654. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  8655. </li>
  8656. </ul>
  8657. </li>
  8658. <li class="inactive">
  8659. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  8660. </li>
  8661. <li class="inactive">
  8662. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  8663. </li>
  8664. <li class="inactive">
  8665. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  8666. </li>
  8667. <li class="inactive">
  8668. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  8669. </li>
  8670. </ul>
  8671. </li>
  8672. <li class="inactive toggle">
  8673. <a href="javascript:void(0)" title="Community">Community</a>
  8674. <ul class="navL2">
  8675. <li class="inactive">
  8676. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  8677. </li>
  8678. <li class="inactive">
  8679. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  8680. </li>
  8681. <li class="inactive">
  8682. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  8683. </li>
  8684. <li class="inactive">
  8685. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  8686. </li>
  8687. <li class="inactive">
  8688. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  8689. </li>
  8690. </ul>
  8691. </li>
  8692. <li class="inactive current toggle">
  8693. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  8694. <ul class="navL2">
  8695. <li class="inactive current">
  8696. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  8697. </li>
  8698. <li class="inactive">
  8699. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  8700. </li>
  8701. </ul>
  8702. </li>
  8703. <li class="inactive">
  8704. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  8705. </li>
  8706. </ul>
  8707. </nav>
  8708. </div>
  8709. </div>
  8710. </div>
  8711. <div class="right">
  8712. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  8713. <div class="SearchBox">
  8714. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  8715. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  8716. <div id="search-finder" class="search-finder"></div>
  8717. </button>
  8718. <button id="HeaderSearchButton" style="display:none"></button>
  8719. <div id="searchSplitter"></div>
  8720. <div id="searchCloseIcon" class="search-clear-x"></div>
  8721. <div id="searchTextContainer" style="width: 0;">
  8722. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  8723. </div>
  8724. </form>
  8725. </div>
  8726. </div>
  8727. </div>
  8728. </div>
  8729. </div>
  8730. </div>
  8731. </header>
  8732. </div>
  8733. <div class="printExportMenus ltr">
  8734. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fff554695(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  8735. Export (<span class="count">0</span>)
  8736. </a>
  8737. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/ff554695(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  8738. Print
  8739. </a>
  8740. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  8741. </a>
  8742. </div>
  8743. <div class="printExportMenus ltr">
  8744. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  8745. </div>
  8746. <div id="body" ms.pgarea="body">
  8747. <span id="tabletView_large"></span>
  8748. <span id="tabletView_small"></span>
  8749. <span id="mobileView"></span>
  8750. <div id="content" class="content">
  8751. <input type="hidden" id="printForPab" value="true">
  8752. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  8753. <h1 class="title">Header files in the Windows Driver Kit</h1>
  8754. <div id="mainSection">
  8755. <div class="clsServerSDKContent">
  8756. </div>
  8757. <p>The <a href="https://msdn.microsoft.com/en-us/library/ff557573(v=vs.85).aspx">Windows Driver Kit (WDK)</a> contains all the header files (.h files) that you need to build kernel-mode and user-mode drivers. Header files are in the Include folder in your WDK installation folder. Example: C:\Program Files (x86)\Windows Kits\10\Include.</p>
  8758. <p>The header files contain version information so that you can use the same set of header files regardless of which version of Windows your driver will run on.</p>
  8759. <h2><a id="Constants_that_represent_Windows_versions"></a><a id="constants_that_represent_windows_versions"></a><a id="CONSTANTS_THAT_REPRESENT_WINDOWS_VERSIONS"></a>Constants that represent Windows versions</h2>
  8760. <p>Header files in the WDK contain conditional statements that specify programming elements that are available only in certain versions of the Windows operating system. The versioned elements include functions, enumerations, structures, and structure members.</p>
  8761. <p>To specify the programming elements that are available in each operating system version, the header files contain preprocessor conditionals that compare the value of NTDDI_VERSION with a set of predefined constant values that are defined in Sdkddkver.h.</p>
  8762. <p>Here are the predefined constant values that represent versions of the Microsoft Windows operating system. </p>
  8763. <table responsive="true">
  8764. <tbody><tr responsive="true"><th>Constant</th><th>Operating system version</th></tr>
  8765. <tr><td data-th="Constant">
  8766. <p>NTDDI_WIN10</p>
  8767. </td><td data-th="Operating system version">
  8768. <p>Windows&nbsp;10</p>
  8769. </td></tr>
  8770. <tr><td data-th="Constant">
  8771. <p>NTDDI_WINBLUE</p>
  8772. </td><td data-th="Operating system version">
  8773. <p>Windows&nbsp;8.1</p>
  8774. </td></tr>
  8775. <tr><td data-th="Constant">
  8776. <p>NTDDI_WIN8</p>
  8777. </td><td data-th="Operating system version">
  8778. <p>Windows&nbsp;8</p>
  8779. </td></tr>
  8780. <tr><td data-th="Constant">
  8781. <p>NTDDI_WIN7</p>
  8782. </td><td data-th="Operating system version">
  8783. <p>Windows 7</p>
  8784. </td></tr>
  8785. <tr><td data-th="Constant">
  8786. <p>NTDDI_WS08SP4</p>
  8787. </td><td data-th="Operating system version">
  8788. <p>Windows Server 2008 with SP4</p>
  8789. </td></tr>
  8790. <tr><td data-th="Constant">
  8791. <p>NTDDI_WS08SP3</p>
  8792. </td><td data-th="Operating system version">
  8793. <p>Windows Server 2008 with SP3</p>
  8794. </td></tr>
  8795. <tr><td data-th="Constant">
  8796. <p>NTDDI_WS08SP2</p>
  8797. </td><td data-th="Operating system version">
  8798. <p>Windows Server 2008 with SP2</p>
  8799. </td></tr>
  8800. <tr><td data-th="Constant">
  8801. <p>NTDDI_WS08</p>
  8802. </td><td data-th="Operating system version">
  8803. <p>Windows Server 2008</p>
  8804. </td></tr>
  8805. </tbody></table>
  8806. <p>&nbsp;</p>
  8807. <p>You can see many examples of version-specific DDI elements in the WDK header files. This conditional declaration appears in Wdm.h, which is a header file that might be included by a kernel-mode driver.</p>
  8808. <div id="code-snippet-1" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  8809. <div class="codeSnippetContainerTabs">
  8810. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  8811. <a></a>
  8812. </div>
  8813. </div>
  8814. <div class="codeSnippetContainerCodeContainer">
  8815. <div class="codeSnippetToolBar"></div>
  8816. <div class="codeSnippetContainerCode" dir="ltr">
  8817. <div style="color:Black;"><pre>
  8818. #if (NTDDI_VERSION &gt;= NTDDI_WIN7)
  8819. _Must_inspect_result_
  8820. NTKERNELAPI
  8821. NTSTATUS
  8822. KeSetTargetProcessorDpcEx (
  8823. _Inout_ PKDPC Dpc,
  8824. _In_ PPROCESSOR_NUMBER ProcNumber
  8825. );
  8826. #endif
  8827. </pre></div>
  8828. </div>
  8829. </div>
  8830. </div>
  8831. <p>In the example you can see that the <a href="https://msdn.microsoft.com/en-us/library/ff553279(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeSetTargetProcessorDpcEx</strong></a> function is available only in Windows 7 and later versions of Windows. </p>
  8832. <p>This conditional declaration appears in Winspool.h, which is a header file that might be included by a user-mode driver. </p>
  8833. <div id="code-snippet-2" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  8834. <div class="codeSnippetContainerTabs">
  8835. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  8836. <a>C++</a>
  8837. </div>
  8838. </div>
  8839. <div class="codeSnippetContainerCodeContainer">
  8840. <div class="codeSnippetToolBar"></div>
  8841. <div class="codeSnippetContainerCode" dir="ltr">
  8842. <div style="color:Black;"><pre>
  8843. #<span style="color:Blue;">if</span> (NTDDI_VERSION &gt;= NTDDI_WIN7)
  8844. ...
  8845. BOOL
  8846. WINAPI
  8847. GetPrintExecutionData(
  8848. _Out_ PRINT_EXECUTION_DATA *pData
  8849. );
  8850. #endif <span style="color:Green;">// (NTDDI_VERSION &gt;= NTDDI_WIN7)</span>
  8851. </pre></div>
  8852. </div>
  8853. </div>
  8854. </div>
  8855. <p>In the example can see that the <a href="https://msdn.microsoft.com/en-us/library/ee264322(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">GetPrintExecutionData</strong></a> function is available only in Windows 7 and later versions of Windows. </p>
  8856. <h2><a id="Header_files_for_the_Kernel_Mode_Driver_Framework"></a><a id="header_files_for_the_kernel_mode_driver_framework"></a><a id="HEADER_FILES_FOR_THE_KERNEL_MODE_DRIVER_FRAMEWORK"></a>Header files for the Kernel Mode Driver Framework</h2>
  8857. <p>The WDK supports several versions of Windows, and it also supports several versions of the Kernel Mode Driver Framework (KMDF) and User Mode Driver Framework (UMDF). The versioning information in the WDK header files pertains to Windows versions, but not to KMDF or UMDF versions. Header files for different versions of KMDF and UMDF are placed in separate directories.</p>
  8858. <p>&nbsp;</p>
  8859. <p>&nbsp;</p>
  8860. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Header%20files%20in%20the%20Windows%20Driver%20Kit%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  8861. </div>
  8862. </div>
  8863. </div>
  8864. </div>
  8865. <div class="clear"></div>
  8866. <input name="__RequestVerificationToken" type="hidden" value="NDOAP4ydnCeXVTkbs8_etxTOIxbnyFkDAmJiTzol8bVT7QVAQITtrc6U9NwZfF9-XUeygryaBELEdW2PHTFozuN0YgQ1">
  8867. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/ff554695(d=printer,v=vs.85).aspx">
  8868. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/ff554695(d=printer,v=vs.85).aspx">
  8869. <input id="isTopicRated" type="hidden" value="false">
  8870. <div id="lib-footer" ms.pgarea="body">
  8871. <link type="text/css" rel="stylesheet">
  8872. <div id="ux-footer" class="" style="" dir="ltr">
  8873. <div id="footerSock" class="librarySock both">
  8874. <div id="footerSockInner">
  8875. <a name="feedback"></a>
  8876. <div class="rating">
  8877. <div id="ratingSection1">
  8878. <div class="title">
  8879. Was this page helpful?
  8880. </div>
  8881. <div class="description">
  8882. Your feedback about this content is important.<br>Let us know what you think.
  8883. </div>
  8884. <div class="buttons">
  8885. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  8886. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  8887. </div>
  8888. <input id="ratingValue" type="hidden" value="">
  8889. </div>
  8890. <div id="ratingSection2">
  8891. <div class="title left">
  8892. Additional feedback?
  8893. </div>
  8894. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  8895. <div class="right">
  8896. <div class="counter">
  8897. <span id="feedbackTextCounter">1500</span> characters remaining
  8898. </div>
  8899. <div class="buttons">
  8900. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  8901. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  8902. </div>
  8903. </div>
  8904. </div>
  8905. <div id="ratingSection3">
  8906. <div class="title">
  8907. Thank you!
  8908. </div>
  8909. <div class="description">
  8910. We appreciate your feedback.
  8911. </div>
  8912. </div>
  8913. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  8914. </div>
  8915. <div class="userVoice">
  8916. <div class="title">
  8917. Help us improve MSDN.
  8918. </div>
  8919. <div class="description">
  8920. Visit our UserVoice Page to submit and vote on ideas!
  8921. </div>
  8922. <div class="buttons">
  8923. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  8924. </div>
  8925. </div>
  8926. <div class="clear"></div>
  8927. </div>
  8928. </div>
  8929. <footer class="top">
  8930. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  8931. <div class="linkList">
  8932. <div class="linkListTitle">Dev centers</div>
  8933. <ul class="links">
  8934. <li>
  8935. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  8936. </li>
  8937. <li>
  8938. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  8939. </li>
  8940. <li>
  8941. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  8942. </li>
  8943. <li>
  8944. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  8945. </li>
  8946. <li>
  8947. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  8948. </li>
  8949. </ul>
  8950. </div>
  8951. </div>
  8952. <div id="rightLinks">
  8953. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  8954. <div class="linkList">
  8955. <div class="linkListTitle">Learning resources</div>
  8956. <ul class="links">
  8957. <li>
  8958. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  8959. </li>
  8960. <li>
  8961. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  8962. </li>
  8963. <li>
  8964. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  8965. </li>
  8966. </ul>
  8967. </div>
  8968. </div>
  8969. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  8970. <div class="linkList">
  8971. <div class="linkListTitle">Community</div>
  8972. <ul class="links">
  8973. <li>
  8974. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  8975. </li>
  8976. <li>
  8977. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  8978. </li>
  8979. <li>
  8980. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  8981. </li>
  8982. </ul>
  8983. </div>
  8984. </div>
  8985. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  8986. <div class="linkList">
  8987. <div class="linkListTitle">Support</div>
  8988. <ul class="links">
  8989. <li>
  8990. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  8991. </li>
  8992. </ul>
  8993. </div>
  8994. </div>
  8995. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  8996. <div class="linkList">
  8997. <div class="linkListTitle">Programs</div>
  8998. <ul class="links">
  8999. <li>
  9000. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  9001. </li>
  9002. <li>
  9003. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  9004. </li>
  9005. <li>
  9006. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  9007. </li>
  9008. </ul>
  9009. </div>
  9010. </div>
  9011. </div>
  9012. </footer>
  9013. <footer class="bottom">
  9014. <span class="localeContainer">
  9015. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  9016. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554695(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  9017. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  9018. </form>
  9019. </span>
  9020. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  9021. <div class="linkList">
  9022. <ul class="links horizontal">
  9023. <li>
  9024. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  9025. </li>
  9026. <li>
  9027. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  9028. </li>
  9029. <li>
  9030. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  9031. </li>
  9032. <li>
  9033. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  9034. </li>
  9035. </ul>
  9036. </div>
  9037. </div>
  9038. <span class="logoLegal">
  9039. <span class="logo"></span>
  9040. <span class="copyright">© 2016 Microsoft</span>
  9041. </span>
  9042. </footer>
  9043. </div>
  9044. </div>
  9045. <div class="footerPrintView">
  9046. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  9047. </div>
  9048. <input id="tocPaddingPerLevel" type="hidden" value="17">
  9049. <input id="MtpsDevice" type="hidden" value="Printer">
  9050. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  9051. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  9052. <div id="globalRequestVerification">
  9053. <input name="__RequestVerificationToken" type="hidden" value="L_DNcd7E8DOypCKm58U4eCbmsUqplJBnse1z2Q6_0_BM27ciZ0MIuUahfkZYKIsQ6PhxF836fkNGWxY3JrS-RkFTQcc1">
  9054. </div>
  9055. </div>
  9056. <script type="text/javascript" class="mtps-injected">
  9057. /*<![CDATA[*/
  9058. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  9059. MTPS.injectScripts([
  9060. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  9061. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/ff554695(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  9062. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  9063. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  9064. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  9065. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  9066. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  9067. ]);
  9068. /*]]>*/
  9069. </script>
  9070. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  9071. <div id="page">
  9072. <link type="text/css" rel="stylesheet">
  9073. <input type="hidden" id="isHeaderBleeding" value="true">
  9074. <div id="ux-header" dir="ltr" class="ltr msdn">
  9075. <header>
  9076. <span id="singleCol"></span>
  9077. <span id="doubleCol"></span>
  9078. <span id="isMobile"></span>
  9079. <div>
  9080. <div class="row topRow">
  9081. <div class="top">
  9082. <div class="left">
  9083. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  9084. <div id="msft-logo" class="msft-logo"></div>
  9085. </a>
  9086. <div class="GrayPipe"></div>
  9087. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  9088. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  9089. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  9090. </div>
  9091. <div class="right">
  9092. <div id="signIn">
  9093. <div class="profileImage"></div>
  9094. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376415&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554887%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  9095. <div class="auxNav">
  9096. <div>
  9097. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  9098. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  9099. </div>
  9100. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  9101. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  9102. </div>
  9103. </div>
  9104. <div>
  9105. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  9106. <div class="linkList">
  9107. <ul class="links horizontal">
  9108. <li>
  9109. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  9110. </li>
  9111. <li>
  9112. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  9113. </li>
  9114. <li>
  9115. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  9116. </li>
  9117. </ul>
  9118. </div>
  9119. </div>
  9120. </div>
  9121. </div>
  9122. </div>
  9123. </div>
  9124. </div>
  9125. <div class="row middleRow">
  9126. <div class="expandTop">
  9127. <div class="left"></div>
  9128. <div class="right"></div>
  9129. </div>
  9130. </div>
  9131. </div>
  9132. <div id="buttomRowWrapper" class="bg_default">
  9133. <div class="row buttomRow bg_default">
  9134. <div class="bottom">
  9135. <div class="left">
  9136. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  9137. <div id="drawer">
  9138. <div class="toc">
  9139. <nav>
  9140. <ul class="navL1">
  9141. <li class="inactive toggle">
  9142. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  9143. <ul class="navL2">
  9144. <li class="inactive">
  9145. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  9146. </li>
  9147. <li class="inactive">
  9148. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  9149. </li>
  9150. <li class="inactive">
  9151. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  9152. </li>
  9153. <li class="inactive">
  9154. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  9155. </li>
  9156. <li class="inactive">
  9157. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  9158. </li>
  9159. <li class="inactive">
  9160. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  9161. </li>
  9162. </ul>
  9163. </li>
  9164. <li class="inactive toggle">
  9165. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  9166. <ul class="navL2">
  9167. <li class="inactive">
  9168. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  9169. </li>
  9170. <li class="inactive">
  9171. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  9172. </li>
  9173. <li class="inactive">
  9174. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  9175. </li>
  9176. <li class="inactive toggle">
  9177. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  9178. <ul class="navL3">
  9179. <li class="inactive">
  9180. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  9181. </li>
  9182. <li class="inactive">
  9183. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  9184. </li>
  9185. <li class="inactive">
  9186. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  9187. </li>
  9188. <li class="inactive">
  9189. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  9190. </li>
  9191. <li class="inactive">
  9192. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  9193. </li>
  9194. </ul>
  9195. </li>
  9196. </ul>
  9197. </li>
  9198. <li class="inactive toggle">
  9199. <a href="javascript:void(0)" title="Programs">Programs</a>
  9200. <ul class="navL2">
  9201. <li class="inactive toggle">
  9202. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  9203. <ul class="navL3">
  9204. <li class="inactive">
  9205. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  9206. </li>
  9207. <li class="inactive">
  9208. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  9209. </li>
  9210. <li class="inactive">
  9211. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  9212. </li>
  9213. </ul>
  9214. </li>
  9215. <li class="inactive toggle">
  9216. <a href="javascript:void(0)" title="Students">Students</a>
  9217. <ul class="navL3">
  9218. <li class="inactive">
  9219. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  9220. </li>
  9221. <li class="inactive">
  9222. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  9223. </li>
  9224. </ul>
  9225. </li>
  9226. <li class="inactive toggle">
  9227. <a href="javascript:void(0)" title="Architects">Architects</a>
  9228. <ul class="navL3">
  9229. <li class="inactive">
  9230. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  9231. </li>
  9232. <li class="inactive">
  9233. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  9234. </li>
  9235. <li class="inactive">
  9236. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  9237. </li>
  9238. <li class="inactive">
  9239. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  9240. </li>
  9241. <li class="inactive">
  9242. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  9243. </li>
  9244. </ul>
  9245. </li>
  9246. <li class="inactive">
  9247. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  9248. </li>
  9249. <li class="inactive">
  9250. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  9251. </li>
  9252. <li class="inactive">
  9253. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  9254. </li>
  9255. <li class="inactive">
  9256. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  9257. </li>
  9258. </ul>
  9259. </li>
  9260. <li class="inactive toggle">
  9261. <a href="javascript:void(0)" title="Community">Community</a>
  9262. <ul class="navL2">
  9263. <li class="inactive">
  9264. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  9265. </li>
  9266. <li class="inactive">
  9267. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  9268. </li>
  9269. <li class="inactive">
  9270. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  9271. </li>
  9272. <li class="inactive">
  9273. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  9274. </li>
  9275. <li class="inactive">
  9276. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  9277. </li>
  9278. </ul>
  9279. </li>
  9280. <li class="inactive current toggle">
  9281. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  9282. <ul class="navL2">
  9283. <li class="inactive current">
  9284. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  9285. </li>
  9286. <li class="inactive">
  9287. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  9288. </li>
  9289. </ul>
  9290. </li>
  9291. <li class="inactive">
  9292. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  9293. </li>
  9294. </ul>
  9295. </nav>
  9296. </div>
  9297. </div>
  9298. </div>
  9299. <div class="right">
  9300. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  9301. <div class="SearchBox">
  9302. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  9303. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  9304. <div id="search-finder" class="search-finder"></div>
  9305. </button>
  9306. <button id="HeaderSearchButton" style="display:none"></button>
  9307. <div id="searchSplitter"></div>
  9308. <div id="searchCloseIcon" class="search-clear-x"></div>
  9309. <div id="searchTextContainer" style="width: 0;">
  9310. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  9311. </div>
  9312. </form>
  9313. </div>
  9314. </div>
  9315. </div>
  9316. </div>
  9317. </div>
  9318. </div>
  9319. </header>
  9320. </div>
  9321. <div class="printExportMenus ltr">
  9322. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fff554887(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  9323. Export (<span class="count">0</span>)
  9324. </a>
  9325. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/ff554887(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  9326. Print
  9327. </a>
  9328. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  9329. </a>
  9330. </div>
  9331. <div class="printExportMenus ltr">
  9332. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  9333. </div>
  9334. <div id="body" ms.pgarea="body">
  9335. <span id="tabletView_large"></span>
  9336. <span id="tabletView_small"></span>
  9337. <span id="mobileView"></span>
  9338. <div id="content" class="content">
  9339. <input type="hidden" id="printForPab" value="true">
  9340. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  9341. <h1 class="title">Writing drivers for different versions of Windows</h1>
  9342. <div id="mainSection">
  9343. <div class="clsServerSDKContent">
  9344. </div>
  9345. <p>When you create a driver project, you specify the minimum target operating system, which is the minimum version of Windows that your driver will run on. For example, you could specify that Windows 7 is the minimum target operating system. In that case, your driver would run on Windows 7 and later versions of Windows.</p>
  9346. <div class="alert"><strong>Note</strong>&nbsp;&nbsp;If you develop a driver for a particular minimum version of Windows and you want your driver to work on later versions of Windows, you must not use any undocumented functions, and you must not use documented functions in any way other than how it is described in the documentation. Otherwise your driver might fail to run on the later versions of Windows. Even if you have been careful to use only documented functions, you should test your driver on the new version of Windows each time one is released.</div>
  9347. <div>&nbsp;</div>
  9348. <h2><a id="Writing_a_multiversion_driver_using_only_common_features"></a><a id="writing_a_multiversion_driver_using_only_common_features"></a><a id="WRITING_A_MULTIVERSION_DRIVER_USING_ONLY_COMMON_FEATURES"></a>Writing a multiversion driver using only common features</h2>
  9349. <p>When you design a driver that will run on multiple versions of Windows, the simplest approach is to allow the driver to use only DDI functions and structures that are common to all versions of Windows that the driver will run on. In this situation, you set the minimum target operating system to the earliest version of Windows that the driver will support.</p>
  9350. <p>For example, to support all versions of Windows, starting with Windows 7, you should:</p>
  9351. <ol>
  9352. <li>
  9353. <p>Design and implement the driver so that it uses only those features that are present in Windows 7. </p>
  9354. </li>
  9355. <li>
  9356. <p>When you build your driver, specify Windows 7 as the minimum target operating system.</p>
  9357. </li>
  9358. </ol>
  9359. <p>While this process is simple, it might restrict the driver to use only a subset of the functionality that is available on later versions of Windows. </p>
  9360. <h2><a id="Writing_a_multiversion_driver_that_uses_version-dependent_features"></a><a id="writing_a_multiversion_driver_that_uses_version-dependent_features"></a><a id="WRITING_A_MULTIVERSION_DRIVER_THAT_USES_VERSION-DEPENDENT_FEATURES"></a>Writing a multiversion driver that uses version-dependent features</h2>
  9361. <p>A kernel-mode driver can dynamically determine which version of Windows it is running on and choose to use features that are available in that version. For example, a driver that must support all versions of Windows, starting with Windows 7, can determine, at run time, the version of Windows that it is running on. If the driver is running on Windows 7, it must use only the DDI functions that Windows 7 supports. However, the same driver can use additional DDI functions that are unique to Windows&nbsp;8, for example, when its run-time check determines that it is running on Windows&nbsp;8.</p>
  9362. <h3><a id="determining_the_windows_version"></a><a id="DETERMINING_THE_WINDOWS_VERSION"></a>Determining the Windows version</h3>
  9363. <p>
  9364. <a href="https://msdn.microsoft.com/en-us/library/ff561954(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">RtlIsNtDdiVersionAvailable</strong></a> is a function that drivers can use to determine, at run time, if the features that are provided by a particular version of Windows are available. The prototype for this function is as follows:</p>
  9365. <div id="code-snippet-1" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  9366. <div class="codeSnippetContainerTabs">
  9367. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  9368. <a></a>
  9369. </div>
  9370. </div>
  9371. <div class="codeSnippetContainerCodeContainer">
  9372. <div class="codeSnippetToolBar"></div>
  9373. <div class="codeSnippetContainerCode" dir="ltr">
  9374. <div style="color:Black;"><pre>
  9375. BOOLEAN RtlIsNtDdiVersionAvailable(IN ULONG Version)
  9376. </pre></div>
  9377. </div>
  9378. </div>
  9379. </div>
  9380. <p>In this prototype, <em>Version</em> is a value that indicates the required version of the Windows DDI. This value must be one of the DDI version constants, defined in sdkddkver.h, such as NTDDI_WIN8 or NTDDI_WIN7.</p>
  9381. <p>
  9382. <a href="https://msdn.microsoft.com/en-us/library/ff561954(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">RtlIsNtDdiVersionAvailable</strong></a> returns TRUE when the caller is running on a version of Windows that is the same as, or later than, the one that is specified by <em>Version.</em></p>
  9383. <p>Your driver can also check for a specific service pack by calling the <a href="https://msdn.microsoft.com/en-us/library/ff561956(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">RtlIsServicePackVersionInstalled</strong></a> function. The prototype for this function is as follows:</p>
  9384. <div id="code-snippet-2" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  9385. <div class="codeSnippetContainerTabs">
  9386. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  9387. <a></a>
  9388. </div>
  9389. </div>
  9390. <div class="codeSnippetContainerCodeContainer">
  9391. <div class="codeSnippetToolBar"></div>
  9392. <div class="codeSnippetContainerCode" dir="ltr">
  9393. <div style="color:Black;"><pre>
  9394. BOOLEAN RtlIsServicePackVersionInstalled(IN ULONG Version)
  9395. </pre></div>
  9396. </div>
  9397. </div>
  9398. </div>
  9399. <p>In this prototype, <em>Version</em> is a value that indicates the required Windows version and service pack. This value must be one of the DDI version constants, defined in sdkddkver.h, such as NTDDI_WS08SP3.</p>
  9400. <p>Note that <a href="https://msdn.microsoft.com/en-us/library/ff561956(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">RtlIsServicePackVersionInstalled</strong></a> returns TRUE only when the operating system version exactly matches the specified version. Thus, a call to <strong>RtlIsServicePackVersionInstalled</strong> with <em>Version</em> set to NTDDI_WS08SP3 will fail if the driver is not running on Windows Server 2008 with SP4.</p>
  9401. <h3><a id="conditionally_calling_windows_version_dependent_functions"></a><a id="CONDITIONALLY_CALLING_WINDOWS_VERSION_DEPENDENT_FUNCTIONS"></a>Conditionally calling Windows version-dependent functions</h3>
  9402. <p>After a driver determines that a specific operating system version is available on the computer, the driver can use the <a href="https://msdn.microsoft.com/en-us/library/ff554563(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">MmGetSystemRoutineAddress</strong></a> function to dynamically locate the routine and call it through a pointer. This function is available in Windows 7 and later operating system versions.</p>
  9403. <div class="alert"><strong>Note</strong>&nbsp;&nbsp;To help preserve type checking and prevent unintentional errors, you should create a typedef that mirrors the original function type. </div>
  9404. <div>&nbsp;</div>
  9405. <h3><a id="example__determining_the_windows_version_and_conditionally_calling_a_v"></a><a id="EXAMPLE__DETERMINING_THE_WINDOWS_VERSION_AND_CONDITIONALLY_CALLING_A_V"></a>Example: Determining the Windows version and conditionally calling a version-dependent function</h3>
  9406. <p>This code example, which is from a driver's header file, defines the PAISQSL type as a pointer to the <a href="https://msdn.microsoft.com/en-us/library/ff551899(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeAcquireInStackQueuedSpinLock</strong></a> function. The example then declares a <code>AcquireInStackQueuedSpinLock</code> variable with this type.</p>
  9407. <div id="code-snippet-3" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  9408. <div class="codeSnippetContainerTabs">
  9409. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  9410. <a></a>
  9411. </div>
  9412. </div>
  9413. <div class="codeSnippetContainerCodeContainer">
  9414. <div class="codeSnippetToolBar"></div>
  9415. <div class="codeSnippetContainerCode" dir="ltr">
  9416. <div style="color:Black;"><pre>
  9417. ...
  9418. //
  9419. // Pointer to the ordered spin lock function.
  9420. // This function is only available on Windows 7 and
  9421. // later systems
  9422. typedef (* PAISQSL) (KeAcquireInStackQueuedSpinLock);
  9423. PAISQSL AcquireInStackQueued = NULL;
  9424. ...
  9425. </pre></div>
  9426. </div>
  9427. </div>
  9428. </div>
  9429. <p>This code example, which is from the driver's initialization code, determines whether the driver is running on Windows 7 or a later operating system. If it is, the code retrieves a pointer to <a href="https://msdn.microsoft.com/en-us/library/ff551899(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeAcquireInStackQueuedSpinLock</strong></a>. </p>
  9430. <div id="code-snippet-4" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  9431. <div class="codeSnippetContainerTabs">
  9432. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  9433. <a></a>
  9434. </div>
  9435. </div>
  9436. <div class="codeSnippetContainerCodeContainer">
  9437. <div class="codeSnippetToolBar"></div>
  9438. <div class="codeSnippetContainerCode" dir="ltr">
  9439. <div style="color:Black;"><pre>
  9440. ...
  9441. //
  9442. // Are we running on Windows 7 or later?
  9443. //
  9444. if (RtlIsNtDdiVersionAvailable(NTDDI_WIN7) ) {
  9445. //
  9446. // Yes... Windows 7 or later it is!
  9447. //
  9448. RtlInitUnicodeString(&amp;funcName,
  9449. L"KeAcquireInStackQueuedSpinLock");
  9450. //
  9451. // Get a pointer to Windows implementation
  9452. // of KeAcquireInStackQueuedSpinLock into our
  9453. // variable "AcquireInStackQueued"
  9454. AcquireInStackQueued = (PAISQSL)
  9455. MmGetSystemRoutineAddress(&amp;funcName);
  9456. }
  9457. ...
  9458. // Acquire a spin lock.
  9459. if( NULL != AcquireInStackQueued) {
  9460. (AcquireInStackQueued)(&amp;SpinLock, &amp;lockHandle);
  9461. } else {
  9462. KeAcquireSpinLock(&amp;SpinLock);
  9463. }
  9464. </pre></div>
  9465. </div>
  9466. </div>
  9467. </div>
  9468. <p>In the example the driver calls <a href="https://msdn.microsoft.com/en-us/library/ff561954(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">RtlIsNtDdiVersionAvailable</strong></a> to determine whether the driver is running on Windows 7 or later. If the version is Windows 7 or later, the driver calls <a href="https://msdn.microsoft.com/en-us/library/ff554563(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">MmGetSystemRoutineAddress</strong></a> to get a pointer to the <a href="https://msdn.microsoft.com/en-us/library/ff551899(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeAcquireInStackQueuedSpinLock</strong></a> function and stores this pointer in the variable named <code>AcquireInStackQueued</code> (which was declared as a PAISQSL type).</p>
  9469. <p>Later, when the driver must acquire a spin lock, it checks to see whether it has received a pointer to the <a href="https://msdn.microsoft.com/en-us/library/ff551899(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeAcquireInStackQueuedSpinLock</strong></a> function. If the driver has received this pointer, the driver uses the pointer to call <strong>KeAcquireInStackQueuedSpinLock</strong>. If the pointer to <strong>KeAcquireInStackQueuedSpinLock</strong> is null, the driver uses <a href="https://msdn.microsoft.com/en-us/library/ff551917(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeAcquireSpinLock</strong></a> to acquire the spin lock.</p>
  9470. <p>&nbsp;</p>
  9471. <p>&nbsp;</p>
  9472. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Writing%20drivers%20for%20different%20versions%20of%20Windows%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  9473. </div>
  9474. </div>
  9475. </div>
  9476. </div>
  9477. <div class="clear"></div>
  9478. <input name="__RequestVerificationToken" type="hidden" value="dZZNelX9yaiOV34zTyWsGLcf6Xdbozpvu9O1UxNmf22OxtGr2e-p3Do81mDONBD4U5FfYRKBN2RQnQO0xjm8EIO4hUk1">
  9479. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/ff554887(d=printer,v=vs.85).aspx">
  9480. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/ff554887(d=printer,v=vs.85).aspx">
  9481. <input id="isTopicRated" type="hidden" value="false">
  9482. <div id="lib-footer" ms.pgarea="body">
  9483. <link type="text/css" rel="stylesheet">
  9484. <div id="ux-footer" class="" style="" dir="ltr">
  9485. <div id="footerSock" class="librarySock both">
  9486. <div id="footerSockInner">
  9487. <a name="feedback"></a>
  9488. <div class="rating">
  9489. <div id="ratingSection1">
  9490. <div class="title">
  9491. Was this page helpful?
  9492. </div>
  9493. <div class="description">
  9494. Your feedback about this content is important.<br>Let us know what you think.
  9495. </div>
  9496. <div class="buttons">
  9497. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  9498. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  9499. </div>
  9500. <input id="ratingValue" type="hidden" value="">
  9501. </div>
  9502. <div id="ratingSection2">
  9503. <div class="title left">
  9504. Additional feedback?
  9505. </div>
  9506. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  9507. <div class="right">
  9508. <div class="counter">
  9509. <span id="feedbackTextCounter">1500</span> characters remaining
  9510. </div>
  9511. <div class="buttons">
  9512. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  9513. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  9514. </div>
  9515. </div>
  9516. </div>
  9517. <div id="ratingSection3">
  9518. <div class="title">
  9519. Thank you!
  9520. </div>
  9521. <div class="description">
  9522. We appreciate your feedback.
  9523. </div>
  9524. </div>
  9525. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  9526. </div>
  9527. <div class="userVoice">
  9528. <div class="title">
  9529. Help us improve MSDN.
  9530. </div>
  9531. <div class="description">
  9532. Visit our UserVoice Page to submit and vote on ideas!
  9533. </div>
  9534. <div class="buttons">
  9535. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  9536. </div>
  9537. </div>
  9538. <div class="clear"></div>
  9539. </div>
  9540. </div>
  9541. <footer class="top">
  9542. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  9543. <div class="linkList">
  9544. <div class="linkListTitle">Dev centers</div>
  9545. <ul class="links">
  9546. <li>
  9547. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  9548. </li>
  9549. <li>
  9550. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  9551. </li>
  9552. <li>
  9553. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  9554. </li>
  9555. <li>
  9556. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  9557. </li>
  9558. <li>
  9559. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  9560. </li>
  9561. </ul>
  9562. </div>
  9563. </div>
  9564. <div id="rightLinks">
  9565. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  9566. <div class="linkList">
  9567. <div class="linkListTitle">Learning resources</div>
  9568. <ul class="links">
  9569. <li>
  9570. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  9571. </li>
  9572. <li>
  9573. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  9574. </li>
  9575. <li>
  9576. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  9577. </li>
  9578. </ul>
  9579. </div>
  9580. </div>
  9581. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  9582. <div class="linkList">
  9583. <div class="linkListTitle">Community</div>
  9584. <ul class="links">
  9585. <li>
  9586. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  9587. </li>
  9588. <li>
  9589. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  9590. </li>
  9591. <li>
  9592. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  9593. </li>
  9594. </ul>
  9595. </div>
  9596. </div>
  9597. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  9598. <div class="linkList">
  9599. <div class="linkListTitle">Support</div>
  9600. <ul class="links">
  9601. <li>
  9602. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  9603. </li>
  9604. </ul>
  9605. </div>
  9606. </div>
  9607. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  9608. <div class="linkList">
  9609. <div class="linkListTitle">Programs</div>
  9610. <ul class="links">
  9611. <li>
  9612. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  9613. </li>
  9614. <li>
  9615. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  9616. </li>
  9617. <li>
  9618. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  9619. </li>
  9620. </ul>
  9621. </div>
  9622. </div>
  9623. </div>
  9624. </footer>
  9625. <footer class="bottom">
  9626. <span class="localeContainer">
  9627. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  9628. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554887(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  9629. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  9630. </form>
  9631. </span>
  9632. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  9633. <div class="linkList">
  9634. <ul class="links horizontal">
  9635. <li>
  9636. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  9637. </li>
  9638. <li>
  9639. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  9640. </li>
  9641. <li>
  9642. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  9643. </li>
  9644. <li>
  9645. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  9646. </li>
  9647. </ul>
  9648. </div>
  9649. </div>
  9650. <span class="logoLegal">
  9651. <span class="logo"></span>
  9652. <span class="copyright">© 2016 Microsoft</span>
  9653. </span>
  9654. </footer>
  9655. </div>
  9656. </div>
  9657. <div class="footerPrintView">
  9658. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  9659. </div>
  9660. <input id="tocPaddingPerLevel" type="hidden" value="17">
  9661. <input id="MtpsDevice" type="hidden" value="Printer">
  9662. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  9663. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  9664. <div id="globalRequestVerification">
  9665. <input name="__RequestVerificationToken" type="hidden" value="dGTGdAuZv1Dw-RKn4XPQ10DD0hz77r3UT5zU9c9Mrj8sCntf_YyDobkMFMYB-vKJjLDUDmSimu42KrDGbynV1wnaP3w1">
  9666. </div>
  9667. </div>
  9668. <script type="text/javascript" class="mtps-injected">
  9669. /*<![CDATA[*/
  9670. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  9671. MTPS.injectScripts([
  9672. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  9673. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/ff554887(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  9674. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  9675. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  9676. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  9677. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  9678. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  9679. ]);
  9680. /*]]>*/
  9681. </script>
  9682. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  9683. <div id="page">
  9684. <link type="text/css" rel="stylesheet">
  9685. <input type="hidden" id="isHeaderBleeding" value="true">
  9686. <div id="ux-header" dir="ltr" class="ltr msdn">
  9687. <header>
  9688. <span id="singleCol"></span>
  9689. <span id="doubleCol"></span>
  9690. <span id="isMobile"></span>
  9691. <div>
  9692. <div class="row topRow">
  9693. <div class="top">
  9694. <div class="left">
  9695. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  9696. <div id="msft-logo" class="msft-logo"></div>
  9697. </a>
  9698. <div class="GrayPipe"></div>
  9699. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  9700. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  9701. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  9702. </div>
  9703. <div class="right">
  9704. <div id="signIn">
  9705. <div class="profileImage"></div>
  9706. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376416&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554836%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  9707. <div class="auxNav">
  9708. <div>
  9709. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  9710. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  9711. </div>
  9712. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  9713. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  9714. </div>
  9715. </div>
  9716. <div>
  9717. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  9718. <div class="linkList">
  9719. <ul class="links horizontal">
  9720. <li>
  9721. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  9722. </li>
  9723. <li>
  9724. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  9725. </li>
  9726. <li>
  9727. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  9728. </li>
  9729. </ul>
  9730. </div>
  9731. </div>
  9732. </div>
  9733. </div>
  9734. </div>
  9735. </div>
  9736. </div>
  9737. <div class="row middleRow">
  9738. <div class="expandTop">
  9739. <div class="left"></div>
  9740. <div class="right"></div>
  9741. </div>
  9742. </div>
  9743. </div>
  9744. <div id="buttomRowWrapper" class="bg_default">
  9745. <div class="row buttomRow bg_default">
  9746. <div class="bottom">
  9747. <div class="left">
  9748. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  9749. <div id="drawer">
  9750. <div class="toc">
  9751. <nav>
  9752. <ul class="navL1">
  9753. <li class="inactive toggle">
  9754. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  9755. <ul class="navL2">
  9756. <li class="inactive">
  9757. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  9758. </li>
  9759. <li class="inactive">
  9760. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  9761. </li>
  9762. <li class="inactive">
  9763. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  9764. </li>
  9765. <li class="inactive">
  9766. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  9767. </li>
  9768. <li class="inactive">
  9769. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  9770. </li>
  9771. <li class="inactive">
  9772. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  9773. </li>
  9774. </ul>
  9775. </li>
  9776. <li class="inactive toggle">
  9777. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  9778. <ul class="navL2">
  9779. <li class="inactive">
  9780. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  9781. </li>
  9782. <li class="inactive">
  9783. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  9784. </li>
  9785. <li class="inactive">
  9786. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  9787. </li>
  9788. <li class="inactive toggle">
  9789. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  9790. <ul class="navL3">
  9791. <li class="inactive">
  9792. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  9793. </li>
  9794. <li class="inactive">
  9795. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  9796. </li>
  9797. <li class="inactive">
  9798. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  9799. </li>
  9800. <li class="inactive">
  9801. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  9802. </li>
  9803. <li class="inactive">
  9804. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  9805. </li>
  9806. </ul>
  9807. </li>
  9808. </ul>
  9809. </li>
  9810. <li class="inactive toggle">
  9811. <a href="javascript:void(0)" title="Programs">Programs</a>
  9812. <ul class="navL2">
  9813. <li class="inactive toggle">
  9814. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  9815. <ul class="navL3">
  9816. <li class="inactive">
  9817. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  9818. </li>
  9819. <li class="inactive">
  9820. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  9821. </li>
  9822. <li class="inactive">
  9823. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  9824. </li>
  9825. </ul>
  9826. </li>
  9827. <li class="inactive toggle">
  9828. <a href="javascript:void(0)" title="Students">Students</a>
  9829. <ul class="navL3">
  9830. <li class="inactive">
  9831. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  9832. </li>
  9833. <li class="inactive">
  9834. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  9835. </li>
  9836. </ul>
  9837. </li>
  9838. <li class="inactive toggle">
  9839. <a href="javascript:void(0)" title="Architects">Architects</a>
  9840. <ul class="navL3">
  9841. <li class="inactive">
  9842. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  9843. </li>
  9844. <li class="inactive">
  9845. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  9846. </li>
  9847. <li class="inactive">
  9848. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  9849. </li>
  9850. <li class="inactive">
  9851. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  9852. </li>
  9853. <li class="inactive">
  9854. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  9855. </li>
  9856. </ul>
  9857. </li>
  9858. <li class="inactive">
  9859. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  9860. </li>
  9861. <li class="inactive">
  9862. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  9863. </li>
  9864. <li class="inactive">
  9865. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  9866. </li>
  9867. <li class="inactive">
  9868. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  9869. </li>
  9870. </ul>
  9871. </li>
  9872. <li class="inactive toggle">
  9873. <a href="javascript:void(0)" title="Community">Community</a>
  9874. <ul class="navL2">
  9875. <li class="inactive">
  9876. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  9877. </li>
  9878. <li class="inactive">
  9879. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  9880. </li>
  9881. <li class="inactive">
  9882. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  9883. </li>
  9884. <li class="inactive">
  9885. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  9886. </li>
  9887. <li class="inactive">
  9888. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  9889. </li>
  9890. </ul>
  9891. </li>
  9892. <li class="inactive current toggle">
  9893. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  9894. <ul class="navL2">
  9895. <li class="inactive current">
  9896. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  9897. </li>
  9898. <li class="inactive">
  9899. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  9900. </li>
  9901. </ul>
  9902. </li>
  9903. <li class="inactive">
  9904. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  9905. </li>
  9906. </ul>
  9907. </nav>
  9908. </div>
  9909. </div>
  9910. </div>
  9911. <div class="right">
  9912. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  9913. <div class="SearchBox">
  9914. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  9915. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  9916. <div id="search-finder" class="search-finder"></div>
  9917. </button>
  9918. <button id="HeaderSearchButton" style="display:none"></button>
  9919. <div id="searchSplitter"></div>
  9920. <div id="searchCloseIcon" class="search-clear-x"></div>
  9921. <div id="searchTextContainer" style="width: 0;">
  9922. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  9923. </div>
  9924. </form>
  9925. </div>
  9926. </div>
  9927. </div>
  9928. </div>
  9929. </div>
  9930. </div>
  9931. </header>
  9932. </div>
  9933. <div class="printExportMenus ltr">
  9934. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fff554836(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  9935. Export (<span class="count">0</span>)
  9936. </a>
  9937. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/ff554836(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  9938. Print
  9939. </a>
  9940. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  9941. </a>
  9942. </div>
  9943. <div class="printExportMenus ltr">
  9944. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  9945. </div>
  9946. <div id="body" ms.pgarea="body">
  9947. <span id="tabletView_large"></span>
  9948. <span id="tabletView_small"></span>
  9949. <span id="mobileView"></span>
  9950. <div id="content" class="content">
  9951. <input type="hidden" id="printForPab" value="true">
  9952. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  9953. <h1 class="title">User mode and kernel mode</h1>
  9954. <div id="mainSection">
  9955. <div class="clsServerSDKContent">
  9956. </div>
  9957. <p>A processor in a computer running Windows has two different modes: <em>user mode</em> and <em>kernel mode</em>. The processor switches between the two modes depending on what type of code is running on the processor. Applications run in user mode, and core operating system components run in kernel mode. While many drivers run in kernel mode, some drivers may run in user mode.</p>
  9958. <p>When you start a user-mode application, Windows creates a <em>process</em> for the application. The process provides the application with a private <em>virtual address space</em> and a private <em>handle table</em>. Because an application's virtual address space is private, one application cannot alter data that belongs to another application. Each application runs in isolation, and if an application crashes, the crash is limited to that one application. Other applications and the operating system are not affected by the crash.</p>
  9959. <p>In addition to being private, the virtual address space of a user-mode application is limited. A processor running in user mode cannot access virtual addresses that are reserved for the operating system. Limiting the virtual address space of a user-mode application prevents the application from altering, and possibly damaging, critical operating system data.</p>
  9960. <p>All code that runs in kernel mode shares a single virtual address space. This means that a kernel-mode driver is not isolated from other drivers and the operating system itself. If a kernel-mode driver accidentally writes to the wrong virtual address, data that belongs to the operating system or another driver could be compromised. If a kernel-mode driver crashes, the entire operating system crashes.</p>
  9961. <p>This diagram illustrates communication between user-mode and kernel-mode components.</p><img id="UserAndKernelMode01" alt="Block diagram of user-mode and kernel-mode components" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535109.png" title="Block diagram of user-mode and kernel-mode components" xmlns=""><h2><a id="related_topics"></a>Related topics</h2>
  9962. <dl>
  9963. <dt>
  9964. <a href="https://msdn.microsoft.com/en-us/library/hh439648(v=vs.85).aspx">Virtual Address Spaces</a>
  9965. </dt>
  9966. </dl>
  9967. <p>&nbsp;</p>
  9968. <p>&nbsp;</p>
  9969. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20User%20mode%20and%20kernel%20mode%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  9970. </div>
  9971. </div>
  9972. </div>
  9973. </div>
  9974. <div class="clear"></div>
  9975. <input name="__RequestVerificationToken" type="hidden" value="1HT-Fl1br4F22hULe4HdQ5nlS2eg-g34sKYbo8IFxTbjaQ705E4eaESjWLry9TLqkpk-VM7Ana81ZQ_5CIVEmPGuDHA1">
  9976. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/ff554836(d=printer,v=vs.85).aspx">
  9977. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/ff554836(d=printer,v=vs.85).aspx">
  9978. <input id="isTopicRated" type="hidden" value="false">
  9979. <div id="lib-footer" ms.pgarea="body">
  9980. <link type="text/css" rel="stylesheet">
  9981. <div id="ux-footer" class="" style="" dir="ltr">
  9982. <div id="footerSock" class="librarySock both">
  9983. <div id="footerSockInner">
  9984. <a name="feedback"></a>
  9985. <div class="rating">
  9986. <div id="ratingSection1">
  9987. <div class="title">
  9988. Was this page helpful?
  9989. </div>
  9990. <div class="description">
  9991. Your feedback about this content is important.<br>Let us know what you think.
  9992. </div>
  9993. <div class="buttons">
  9994. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  9995. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  9996. </div>
  9997. <input id="ratingValue" type="hidden" value="">
  9998. </div>
  9999. <div id="ratingSection2">
  10000. <div class="title left">
  10001. Additional feedback?
  10002. </div>
  10003. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  10004. <div class="right">
  10005. <div class="counter">
  10006. <span id="feedbackTextCounter">1500</span> characters remaining
  10007. </div>
  10008. <div class="buttons">
  10009. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  10010. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  10011. </div>
  10012. </div>
  10013. </div>
  10014. <div id="ratingSection3">
  10015. <div class="title">
  10016. Thank you!
  10017. </div>
  10018. <div class="description">
  10019. We appreciate your feedback.
  10020. </div>
  10021. </div>
  10022. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  10023. </div>
  10024. <div class="userVoice">
  10025. <div class="title">
  10026. Help us improve MSDN.
  10027. </div>
  10028. <div class="description">
  10029. Visit our UserVoice Page to submit and vote on ideas!
  10030. </div>
  10031. <div class="buttons">
  10032. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  10033. </div>
  10034. </div>
  10035. <div class="clear"></div>
  10036. </div>
  10037. </div>
  10038. <footer class="top">
  10039. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  10040. <div class="linkList">
  10041. <div class="linkListTitle">Dev centers</div>
  10042. <ul class="links">
  10043. <li>
  10044. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  10045. </li>
  10046. <li>
  10047. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  10048. </li>
  10049. <li>
  10050. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  10051. </li>
  10052. <li>
  10053. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  10054. </li>
  10055. <li>
  10056. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  10057. </li>
  10058. </ul>
  10059. </div>
  10060. </div>
  10061. <div id="rightLinks">
  10062. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  10063. <div class="linkList">
  10064. <div class="linkListTitle">Learning resources</div>
  10065. <ul class="links">
  10066. <li>
  10067. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  10068. </li>
  10069. <li>
  10070. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  10071. </li>
  10072. <li>
  10073. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  10074. </li>
  10075. </ul>
  10076. </div>
  10077. </div>
  10078. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  10079. <div class="linkList">
  10080. <div class="linkListTitle">Community</div>
  10081. <ul class="links">
  10082. <li>
  10083. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  10084. </li>
  10085. <li>
  10086. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  10087. </li>
  10088. <li>
  10089. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  10090. </li>
  10091. </ul>
  10092. </div>
  10093. </div>
  10094. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  10095. <div class="linkList">
  10096. <div class="linkListTitle">Support</div>
  10097. <ul class="links">
  10098. <li>
  10099. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  10100. </li>
  10101. </ul>
  10102. </div>
  10103. </div>
  10104. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  10105. <div class="linkList">
  10106. <div class="linkListTitle">Programs</div>
  10107. <ul class="links">
  10108. <li>
  10109. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  10110. </li>
  10111. <li>
  10112. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  10113. </li>
  10114. <li>
  10115. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  10116. </li>
  10117. </ul>
  10118. </div>
  10119. </div>
  10120. </div>
  10121. </footer>
  10122. <footer class="bottom">
  10123. <span class="localeContainer">
  10124. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  10125. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554836(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  10126. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  10127. </form>
  10128. </span>
  10129. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  10130. <div class="linkList">
  10131. <ul class="links horizontal">
  10132. <li>
  10133. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  10134. </li>
  10135. <li>
  10136. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  10137. </li>
  10138. <li>
  10139. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  10140. </li>
  10141. <li>
  10142. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  10143. </li>
  10144. </ul>
  10145. </div>
  10146. </div>
  10147. <span class="logoLegal">
  10148. <span class="logo"></span>
  10149. <span class="copyright">© 2016 Microsoft</span>
  10150. </span>
  10151. </footer>
  10152. </div>
  10153. </div>
  10154. <div class="footerPrintView">
  10155. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  10156. </div>
  10157. <input id="tocPaddingPerLevel" type="hidden" value="17">
  10158. <input id="MtpsDevice" type="hidden" value="Printer">
  10159. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  10160. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  10161. <div id="globalRequestVerification">
  10162. <input name="__RequestVerificationToken" type="hidden" value="yY9QaV5wxiQXWunZwglMNq3sBluYn47snmgR9GvGdJqLFgoVRF7H_VcShsbt3TjPL548T2nP35TkiMKrbfQhLFHIf781">
  10163. </div>
  10164. </div>
  10165. <script type="text/javascript" class="mtps-injected">
  10166. /*<![CDATA[*/
  10167. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  10168. MTPS.injectScripts([
  10169. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  10170. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/ff554836(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  10171. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  10172. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  10173. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  10174. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  10175. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  10176. ]);
  10177. /*]]>*/
  10178. </script>
  10179. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  10180. <div id="page">
  10181. <link type="text/css" rel="stylesheet">
  10182. <input type="hidden" id="isHeaderBleeding" value="true">
  10183. <div id="ux-header" dir="ltr" class="ltr msdn">
  10184. <header>
  10185. <span id="singleCol"></span>
  10186. <span id="doubleCol"></span>
  10187. <span id="isMobile"></span>
  10188. <div>
  10189. <div class="row topRow">
  10190. <div class="top">
  10191. <div class="left">
  10192. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  10193. <div id="msft-logo" class="msft-logo"></div>
  10194. </a>
  10195. <div class="GrayPipe"></div>
  10196. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  10197. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  10198. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  10199. </div>
  10200. <div class="right">
  10201. <div id="signIn">
  10202. <div class="profileImage"></div>
  10203. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376417&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439648%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  10204. <div class="auxNav">
  10205. <div>
  10206. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  10207. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  10208. </div>
  10209. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  10210. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  10211. </div>
  10212. </div>
  10213. <div>
  10214. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  10215. <div class="linkList">
  10216. <ul class="links horizontal">
  10217. <li>
  10218. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  10219. </li>
  10220. <li>
  10221. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  10222. </li>
  10223. <li>
  10224. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  10225. </li>
  10226. </ul>
  10227. </div>
  10228. </div>
  10229. </div>
  10230. </div>
  10231. </div>
  10232. </div>
  10233. </div>
  10234. <div class="row middleRow">
  10235. <div class="expandTop">
  10236. <div class="left"></div>
  10237. <div class="right"></div>
  10238. </div>
  10239. </div>
  10240. </div>
  10241. <div id="buttomRowWrapper" class="bg_default">
  10242. <div class="row buttomRow bg_default">
  10243. <div class="bottom">
  10244. <div class="left">
  10245. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  10246. <div id="drawer">
  10247. <div class="toc">
  10248. <nav>
  10249. <ul class="navL1">
  10250. <li class="inactive toggle">
  10251. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  10252. <ul class="navL2">
  10253. <li class="inactive">
  10254. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  10255. </li>
  10256. <li class="inactive">
  10257. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  10258. </li>
  10259. <li class="inactive">
  10260. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  10261. </li>
  10262. <li class="inactive">
  10263. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  10264. </li>
  10265. <li class="inactive">
  10266. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  10267. </li>
  10268. <li class="inactive">
  10269. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  10270. </li>
  10271. </ul>
  10272. </li>
  10273. <li class="inactive toggle">
  10274. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  10275. <ul class="navL2">
  10276. <li class="inactive">
  10277. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  10278. </li>
  10279. <li class="inactive">
  10280. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  10281. </li>
  10282. <li class="inactive">
  10283. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  10284. </li>
  10285. <li class="inactive toggle">
  10286. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  10287. <ul class="navL3">
  10288. <li class="inactive">
  10289. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  10290. </li>
  10291. <li class="inactive">
  10292. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  10293. </li>
  10294. <li class="inactive">
  10295. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  10296. </li>
  10297. <li class="inactive">
  10298. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  10299. </li>
  10300. <li class="inactive">
  10301. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  10302. </li>
  10303. </ul>
  10304. </li>
  10305. </ul>
  10306. </li>
  10307. <li class="inactive toggle">
  10308. <a href="javascript:void(0)" title="Programs">Programs</a>
  10309. <ul class="navL2">
  10310. <li class="inactive toggle">
  10311. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  10312. <ul class="navL3">
  10313. <li class="inactive">
  10314. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  10315. </li>
  10316. <li class="inactive">
  10317. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  10318. </li>
  10319. <li class="inactive">
  10320. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  10321. </li>
  10322. </ul>
  10323. </li>
  10324. <li class="inactive toggle">
  10325. <a href="javascript:void(0)" title="Students">Students</a>
  10326. <ul class="navL3">
  10327. <li class="inactive">
  10328. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  10329. </li>
  10330. <li class="inactive">
  10331. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  10332. </li>
  10333. </ul>
  10334. </li>
  10335. <li class="inactive toggle">
  10336. <a href="javascript:void(0)" title="Architects">Architects</a>
  10337. <ul class="navL3">
  10338. <li class="inactive">
  10339. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  10340. </li>
  10341. <li class="inactive">
  10342. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  10343. </li>
  10344. <li class="inactive">
  10345. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  10346. </li>
  10347. <li class="inactive">
  10348. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  10349. </li>
  10350. <li class="inactive">
  10351. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  10352. </li>
  10353. </ul>
  10354. </li>
  10355. <li class="inactive">
  10356. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  10357. </li>
  10358. <li class="inactive">
  10359. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  10360. </li>
  10361. <li class="inactive">
  10362. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  10363. </li>
  10364. <li class="inactive">
  10365. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  10366. </li>
  10367. </ul>
  10368. </li>
  10369. <li class="inactive toggle">
  10370. <a href="javascript:void(0)" title="Community">Community</a>
  10371. <ul class="navL2">
  10372. <li class="inactive">
  10373. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  10374. </li>
  10375. <li class="inactive">
  10376. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  10377. </li>
  10378. <li class="inactive">
  10379. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  10380. </li>
  10381. <li class="inactive">
  10382. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  10383. </li>
  10384. <li class="inactive">
  10385. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  10386. </li>
  10387. </ul>
  10388. </li>
  10389. <li class="inactive current toggle">
  10390. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  10391. <ul class="navL2">
  10392. <li class="inactive current">
  10393. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  10394. </li>
  10395. <li class="inactive">
  10396. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  10397. </li>
  10398. </ul>
  10399. </li>
  10400. <li class="inactive">
  10401. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  10402. </li>
  10403. </ul>
  10404. </nav>
  10405. </div>
  10406. </div>
  10407. </div>
  10408. <div class="right">
  10409. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  10410. <div class="SearchBox">
  10411. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  10412. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  10413. <div id="search-finder" class="search-finder"></div>
  10414. </button>
  10415. <button id="HeaderSearchButton" style="display:none"></button>
  10416. <div id="searchSplitter"></div>
  10417. <div id="searchCloseIcon" class="search-clear-x"></div>
  10418. <div id="searchTextContainer" style="width: 0;">
  10419. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  10420. </div>
  10421. </form>
  10422. </div>
  10423. </div>
  10424. </div>
  10425. </div>
  10426. </div>
  10427. </div>
  10428. </header>
  10429. </div>
  10430. <div class="printExportMenus ltr">
  10431. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh439648(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  10432. Export (<span class="count">0</span>)
  10433. </a>
  10434. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh439648(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  10435. Print
  10436. </a>
  10437. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  10438. </a>
  10439. </div>
  10440. <div class="printExportMenus ltr">
  10441. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  10442. </div>
  10443. <div id="body" ms.pgarea="body">
  10444. <span id="tabletView_large"></span>
  10445. <span id="tabletView_small"></span>
  10446. <span id="mobileView"></span>
  10447. <div id="content" class="content">
  10448. <input type="hidden" id="printForPab" value="true">
  10449. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  10450. <h1 class="title">Virtual address spaces</h1>
  10451. <div id="mainSection">
  10452. <div class="clsServerSDKContent">
  10453. </div>
  10454. <p>When a processor reads or writes to a memory location, it uses a virtual address. As part of the read or write operation, the processor translates the virtual address to a physical address. Accessing memory through a virtual address has these advantages:</p>
  10455. <ul>
  10456. <li>
  10457. <p>A program can use a contiguous range of virtual addresses to access a large memory buffer that is not contiguous in physical memory.</p>
  10458. </li>
  10459. <li>
  10460. <p> A program can use a range of virtual addresses to access a memory buffer that is larger than the available physical memory. As the supply of physical memory becomes small, the memory manager saves pages of physical memory (typically 4 kilobytes in size) to a disk file. Pages of data or code are moved between physical memory and the disk as needed.</p>
  10461. </li>
  10462. <li>
  10463. <p>The virtual addresses used by different processes are isolated from each other. The code in one process cannot alter the physical memory that is being used by another process or the operating system.</p>
  10464. </li>
  10465. </ul>
  10466. <p>The range of virtual addresses that is available to a process is called the <em>virtual address space</em> for the process. Each user-mode process has its own private virtual address space.
  10467. For a 32-bit process, the virtual address space is usually the 2-gigabyte range 0x00000000 through 0x7FFFFFFF. For a 64-bit process, the virtual address space is the 8-terabyte range 0x000'00000000 through 0x7FF'FFFFFFFF. A range of virtual addresses is sometimes called a range of <em>virtual memory</em>.</p>
  10468. <p>This diagram illustrates some of the key features of virtual address spaces.</p><img id="virtualaddressspace01" alt="Diagram of virtual address spaces for two processes" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535110.png" title="Diagram of virtual address spaces for two processes" xmlns=""><p>The diagram shows the virtual address spaces for two 64-bit processes: Notepad.exe and MyApp.exe. Each process has its own virtual address space that goes from 0x000'0000000 through 0x7FF'FFFFFFFF. Each shaded block represents one page (4 kilobytes in size) of virtual or physical memory. Notice that the Notepad process uses three contiguous pages of virtual addresses, starting at 0x7F7'93950000. But those three contiguous pages of virtual addresses are mapped to noncontiguous pages in physical memory. Also notice that both processes use a page of virtual memory beginning at 0x7F7'93950000, but those virtual pages are mapped to different pages of physical memory.</p>
  10469. <h2><a id="User_space_and_system_space"></a><a id="user_space_and_system_space"></a><a id="USER_SPACE_AND_SYSTEM_SPACE"></a>User space and system space</h2>
  10470. <p>Processes like Notepad.exe and MyApp.exe run in user mode. Core operating system components and many drivers run in the more privileged kernel mode. For more information about processor modes, see <a href="https://msdn.microsoft.com/en-us/library/ff554836(v=vs.85).aspx">User mode and kernel mode</a>. Each user-mode process has its own private virtual address space, but all code that runs in kernel mode shares a single virtual address space called <em>system space</em>. The virtual address space for the current user-mode process is called <em>user space</em>.</p>
  10471. <p>In 32-bit Windows, the total available virtual address space is 2^32 bytes (4 gigabytes). Usually the lower 2 gigabytes are used for user space, and the upper 2 gigabytes are used for system space.</p><img id="VirtualAddressSpace02" alt="Diagram of system space" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535111.png" title="Diagram of system space" xmlns=""><p>In 32-bit Windows, you have the option of specifying (at boot time) that more than 2 gigabytes are available for user space. The consequence is that fewer virtual addresses are available for system space. You can increase the size of user space to as much as 3 gigabytes, in which case only 1 gigabyte is available for system space. To increase the size of user space, use <a href="https://msdn.microsoft.com/en-us/library/ff542202(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">BCDEdit /set increaseuserva</strong></a>.</p>
  10472. <p>In 64-bit Windows, the theoretical amount of virtual address space is 2^64 bytes (16 exabytes), but only a small portion of the 16-exabyte range is actually used. The 8-terabyte range from 0x000'00000000 through 0x7FF'FFFFFFFF is used for user space, and portions of the 248-terabyte range from 0xFFFF0800'00000000 through 0xFFFFFFFF'FFFFFFFF are used for system space.</p><img id="VirtualAddressSpace03" alt="Diagram of paged pool and nonpaged pool" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535112.png" title="Diagram of paged pool and nonpaged pool" xmlns=""><p>Code running in user mode has access to user space but does not have access to system space. This restriction prevents user-mode code from reading or altering protected operating system data structures. Code running in kernel mode has access to both user space and system space. That is, code running in kernel mode has access to system space and the virtual address space of the current user-mode process.</p>
  10473. <p>Drivers that run in kernel mode must be very careful about directly reading from or writing to addresses in user space. This scenario illustrates why.</p>
  10474. <ol>
  10475. <li>
  10476. <p>A user-mode program initiates a request to read some data from a device. The program supplies the starting address of a buffer to receive the data.</p>
  10477. </li>
  10478. <li>
  10479. <p>A device driver routine, running in kernel mode, starts the read operation and returns control to its caller.</p>
  10480. </li>
  10481. <li>Later the device interrupts whatever thread is currently running to say that the read operation is complete. The interrupt is handled by kernel-mode driver routines running on this arbitrary thread, which belongs to an arbitrary process.</li>
  10482. <li>At this point, the driver must not write the data to the starting address that the user-mode program supplied in Step 1. This address is in the virtual address space of the process that initiated the request, which is most likely not the same as the current process.</li>
  10483. </ol>
  10484. <h2><a id="Paged_pool_and_Nonpaged_pool"></a><a id="paged_pool_and_nonpaged_pool"></a><a id="PAGED_POOL_AND_NONPAGED_POOL"></a>Paged pool and Nonpaged pool</h2>
  10485. <p>In user space, all physical memory pages can be paged out to a disk file as needed. In system space, some physical pages can be paged out and others cannot. System space has two regions for dynamically allocating memory: paged pool and nonpaged pool. In 64-bit Windows, paged pool is the 128-gigabyte range of virtual addresses that goes from 0xFFFFA800'00000000 through 0xFFFFA81F'FFFFFFFF. Nonpaged pool is the 128-gigabyte range of virtual addresses that goes from 0xFFFFAC00'00000000 through 0xFFFFAC1F'FFFFFFFF.</p>
  10486. <p>Memory that is allocated in paged pool can be paged out to a disk file as needed. Memory that is allocated in nonpaged pool can never be paged out to a disk file.</p><img id="VirtualAddressSpace04" alt="Diagram comparing memory allocation in paged pool to that in nonpaged pool" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535113.png" title="Diagram comparing memory allocation in paged pool to that in nonpaged pool" xmlns=""><h2><a id="related_topics"></a>Related topics</h2>
  10487. <dl>
  10488. <dt>
  10489. <a href="https://msdn.microsoft.com/en-us/library/ff554836(v=vs.85).aspx">User mode and kernel mode</a>
  10490. </dt>
  10491. </dl>
  10492. <p>&nbsp;</p>
  10493. <p>&nbsp;</p>
  10494. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Virtual%20address%20spaces%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  10495. </div>
  10496. </div>
  10497. </div>
  10498. </div>
  10499. <div class="clear"></div>
  10500. <input name="__RequestVerificationToken" type="hidden" value="9NzOA4NRSJk34bEo35Zi5eb41FYP4aXBvl8_28dHfRRQJ_5oHOP74PufZNern-EHnlXcMZ7uRQw508ifuarrPhul0QE1">
  10501. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh439648(d=printer,v=vs.85).aspx">
  10502. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh439648(d=printer,v=vs.85).aspx">
  10503. <input id="isTopicRated" type="hidden" value="false">
  10504. <div id="lib-footer" ms.pgarea="body">
  10505. <link type="text/css" rel="stylesheet">
  10506. <div id="ux-footer" class="" style="" dir="ltr">
  10507. <div id="footerSock" class="librarySock both">
  10508. <div id="footerSockInner">
  10509. <a name="feedback"></a>
  10510. <div class="rating">
  10511. <div id="ratingSection1">
  10512. <div class="title">
  10513. Was this page helpful?
  10514. </div>
  10515. <div class="description">
  10516. Your feedback about this content is important.<br>Let us know what you think.
  10517. </div>
  10518. <div class="buttons">
  10519. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  10520. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  10521. </div>
  10522. <input id="ratingValue" type="hidden" value="">
  10523. </div>
  10524. <div id="ratingSection2">
  10525. <div class="title left">
  10526. Additional feedback?
  10527. </div>
  10528. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  10529. <div class="right">
  10530. <div class="counter">
  10531. <span id="feedbackTextCounter">1500</span> characters remaining
  10532. </div>
  10533. <div class="buttons">
  10534. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  10535. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  10536. </div>
  10537. </div>
  10538. </div>
  10539. <div id="ratingSection3">
  10540. <div class="title">
  10541. Thank you!
  10542. </div>
  10543. <div class="description">
  10544. We appreciate your feedback.
  10545. </div>
  10546. </div>
  10547. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  10548. </div>
  10549. <div class="userVoice">
  10550. <div class="title">
  10551. Help us improve MSDN.
  10552. </div>
  10553. <div class="description">
  10554. Visit our UserVoice Page to submit and vote on ideas!
  10555. </div>
  10556. <div class="buttons">
  10557. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  10558. </div>
  10559. </div>
  10560. <div class="clear"></div>
  10561. </div>
  10562. </div>
  10563. <footer class="top">
  10564. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  10565. <div class="linkList">
  10566. <div class="linkListTitle">Dev centers</div>
  10567. <ul class="links">
  10568. <li>
  10569. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  10570. </li>
  10571. <li>
  10572. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  10573. </li>
  10574. <li>
  10575. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  10576. </li>
  10577. <li>
  10578. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  10579. </li>
  10580. <li>
  10581. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  10582. </li>
  10583. </ul>
  10584. </div>
  10585. </div>
  10586. <div id="rightLinks">
  10587. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  10588. <div class="linkList">
  10589. <div class="linkListTitle">Learning resources</div>
  10590. <ul class="links">
  10591. <li>
  10592. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  10593. </li>
  10594. <li>
  10595. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  10596. </li>
  10597. <li>
  10598. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  10599. </li>
  10600. </ul>
  10601. </div>
  10602. </div>
  10603. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  10604. <div class="linkList">
  10605. <div class="linkListTitle">Community</div>
  10606. <ul class="links">
  10607. <li>
  10608. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  10609. </li>
  10610. <li>
  10611. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  10612. </li>
  10613. <li>
  10614. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  10615. </li>
  10616. </ul>
  10617. </div>
  10618. </div>
  10619. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  10620. <div class="linkList">
  10621. <div class="linkListTitle">Support</div>
  10622. <ul class="links">
  10623. <li>
  10624. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  10625. </li>
  10626. </ul>
  10627. </div>
  10628. </div>
  10629. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  10630. <div class="linkList">
  10631. <div class="linkListTitle">Programs</div>
  10632. <ul class="links">
  10633. <li>
  10634. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  10635. </li>
  10636. <li>
  10637. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  10638. </li>
  10639. <li>
  10640. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  10641. </li>
  10642. </ul>
  10643. </div>
  10644. </div>
  10645. </div>
  10646. </footer>
  10647. <footer class="bottom">
  10648. <span class="localeContainer">
  10649. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  10650. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439648(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  10651. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  10652. </form>
  10653. </span>
  10654. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  10655. <div class="linkList">
  10656. <ul class="links horizontal">
  10657. <li>
  10658. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  10659. </li>
  10660. <li>
  10661. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  10662. </li>
  10663. <li>
  10664. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  10665. </li>
  10666. <li>
  10667. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  10668. </li>
  10669. </ul>
  10670. </div>
  10671. </div>
  10672. <span class="logoLegal">
  10673. <span class="logo"></span>
  10674. <span class="copyright">© 2016 Microsoft</span>
  10675. </span>
  10676. </footer>
  10677. </div>
  10678. </div>
  10679. <div class="footerPrintView">
  10680. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  10681. </div>
  10682. <input id="tocPaddingPerLevel" type="hidden" value="17">
  10683. <input id="MtpsDevice" type="hidden" value="Printer">
  10684. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  10685. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  10686. <div id="globalRequestVerification">
  10687. <input name="__RequestVerificationToken" type="hidden" value="r5S--CICQofBUkSvFFHT8fBz3PnwzkwVB_4fBLnoBn4RyL4zR51FkOFiL7Btyjv3yAemnW9JnZTqbR7eo-xgAaT9d7g1">
  10688. </div>
  10689. </div>
  10690. <script type="text/javascript" class="mtps-injected">
  10691. /*<![CDATA[*/
  10692. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  10693. MTPS.injectScripts([
  10694. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  10695. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh439648(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  10696. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  10697. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  10698. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  10699. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  10700. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  10701. ]);
  10702. /*]]>*/
  10703. </script>
  10704. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  10705. <div id="page">
  10706. <link type="text/css" rel="stylesheet">
  10707. <input type="hidden" id="isHeaderBleeding" value="true">
  10708. <div id="ux-header" dir="ltr" class="ltr msdn">
  10709. <header>
  10710. <span id="singleCol"></span>
  10711. <span id="doubleCol"></span>
  10712. <span id="isMobile"></span>
  10713. <div>
  10714. <div class="row topRow">
  10715. <div class="top">
  10716. <div class="left">
  10717. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  10718. <div id="msft-logo" class="msft-logo"></div>
  10719. </a>
  10720. <div class="GrayPipe"></div>
  10721. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  10722. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  10723. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  10724. </div>
  10725. <div class="right">
  10726. <div id="signIn">
  10727. <div class="profileImage"></div>
  10728. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376418&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554721%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  10729. <div class="auxNav">
  10730. <div>
  10731. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  10732. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  10733. </div>
  10734. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  10735. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  10736. </div>
  10737. </div>
  10738. <div>
  10739. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  10740. <div class="linkList">
  10741. <ul class="links horizontal">
  10742. <li>
  10743. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  10744. </li>
  10745. <li>
  10746. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  10747. </li>
  10748. <li>
  10749. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  10750. </li>
  10751. </ul>
  10752. </div>
  10753. </div>
  10754. </div>
  10755. </div>
  10756. </div>
  10757. </div>
  10758. </div>
  10759. <div class="row middleRow">
  10760. <div class="expandTop">
  10761. <div class="left"></div>
  10762. <div class="right"></div>
  10763. </div>
  10764. </div>
  10765. </div>
  10766. <div id="buttomRowWrapper" class="bg_default">
  10767. <div class="row buttomRow bg_default">
  10768. <div class="bottom">
  10769. <div class="left">
  10770. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  10771. <div id="drawer">
  10772. <div class="toc">
  10773. <nav>
  10774. <ul class="navL1">
  10775. <li class="inactive toggle">
  10776. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  10777. <ul class="navL2">
  10778. <li class="inactive">
  10779. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  10780. </li>
  10781. <li class="inactive">
  10782. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  10783. </li>
  10784. <li class="inactive">
  10785. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  10786. </li>
  10787. <li class="inactive">
  10788. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  10789. </li>
  10790. <li class="inactive">
  10791. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  10792. </li>
  10793. <li class="inactive">
  10794. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  10795. </li>
  10796. </ul>
  10797. </li>
  10798. <li class="inactive toggle">
  10799. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  10800. <ul class="navL2">
  10801. <li class="inactive">
  10802. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  10803. </li>
  10804. <li class="inactive">
  10805. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  10806. </li>
  10807. <li class="inactive">
  10808. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  10809. </li>
  10810. <li class="inactive toggle">
  10811. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  10812. <ul class="navL3">
  10813. <li class="inactive">
  10814. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  10815. </li>
  10816. <li class="inactive">
  10817. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  10818. </li>
  10819. <li class="inactive">
  10820. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  10821. </li>
  10822. <li class="inactive">
  10823. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  10824. </li>
  10825. <li class="inactive">
  10826. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  10827. </li>
  10828. </ul>
  10829. </li>
  10830. </ul>
  10831. </li>
  10832. <li class="inactive toggle">
  10833. <a href="javascript:void(0)" title="Programs">Programs</a>
  10834. <ul class="navL2">
  10835. <li class="inactive toggle">
  10836. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  10837. <ul class="navL3">
  10838. <li class="inactive">
  10839. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  10840. </li>
  10841. <li class="inactive">
  10842. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  10843. </li>
  10844. <li class="inactive">
  10845. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  10846. </li>
  10847. </ul>
  10848. </li>
  10849. <li class="inactive toggle">
  10850. <a href="javascript:void(0)" title="Students">Students</a>
  10851. <ul class="navL3">
  10852. <li class="inactive">
  10853. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  10854. </li>
  10855. <li class="inactive">
  10856. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  10857. </li>
  10858. </ul>
  10859. </li>
  10860. <li class="inactive toggle">
  10861. <a href="javascript:void(0)" title="Architects">Architects</a>
  10862. <ul class="navL3">
  10863. <li class="inactive">
  10864. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  10865. </li>
  10866. <li class="inactive">
  10867. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  10868. </li>
  10869. <li class="inactive">
  10870. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  10871. </li>
  10872. <li class="inactive">
  10873. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  10874. </li>
  10875. <li class="inactive">
  10876. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  10877. </li>
  10878. </ul>
  10879. </li>
  10880. <li class="inactive">
  10881. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  10882. </li>
  10883. <li class="inactive">
  10884. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  10885. </li>
  10886. <li class="inactive">
  10887. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  10888. </li>
  10889. <li class="inactive">
  10890. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  10891. </li>
  10892. </ul>
  10893. </li>
  10894. <li class="inactive toggle">
  10895. <a href="javascript:void(0)" title="Community">Community</a>
  10896. <ul class="navL2">
  10897. <li class="inactive">
  10898. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  10899. </li>
  10900. <li class="inactive">
  10901. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  10902. </li>
  10903. <li class="inactive">
  10904. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  10905. </li>
  10906. <li class="inactive">
  10907. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  10908. </li>
  10909. <li class="inactive">
  10910. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  10911. </li>
  10912. </ul>
  10913. </li>
  10914. <li class="inactive current toggle">
  10915. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  10916. <ul class="navL2">
  10917. <li class="inactive current">
  10918. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  10919. </li>
  10920. <li class="inactive">
  10921. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  10922. </li>
  10923. </ul>
  10924. </li>
  10925. <li class="inactive">
  10926. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  10927. </li>
  10928. </ul>
  10929. </nav>
  10930. </div>
  10931. </div>
  10932. </div>
  10933. <div class="right">
  10934. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  10935. <div class="SearchBox">
  10936. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  10937. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  10938. <div id="search-finder" class="search-finder"></div>
  10939. </button>
  10940. <button id="HeaderSearchButton" style="display:none"></button>
  10941. <div id="searchSplitter"></div>
  10942. <div id="searchCloseIcon" class="search-clear-x"></div>
  10943. <div id="searchTextContainer" style="width: 0;">
  10944. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  10945. </div>
  10946. </form>
  10947. </div>
  10948. </div>
  10949. </div>
  10950. </div>
  10951. </div>
  10952. </div>
  10953. </header>
  10954. </div>
  10955. <div class="printExportMenus ltr">
  10956. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fff554721(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  10957. Export (<span class="count">0</span>)
  10958. </a>
  10959. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/ff554721(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  10960. Print
  10961. </a>
  10962. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  10963. </a>
  10964. </div>
  10965. <div class="printExportMenus ltr">
  10966. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  10967. </div>
  10968. <div id="body" ms.pgarea="body">
  10969. <span id="tabletView_large"></span>
  10970. <span id="tabletView_small"></span>
  10971. <span id="mobileView"></span>
  10972. <div id="content" class="content">
  10973. <input type="hidden" id="printForPab" value="true">
  10974. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  10975. <h1 class="title">Device nodes and device stacks</h1>
  10976. <div id="mainSection">
  10977. <div class="clsServerSDKContent">
  10978. </div>
  10979. <p>
  10980. </p><p>In Windows, devices are represented by device nodes in the Plug and Play (PnP) device tree. Typically, when an I/O request is sent to a device, several drivers help handle the request. Each of these drivers is associated with a device object, and the device objects are arranged in a stack. The sequence of device objects along with their associated drivers is called a device stack. Each device node has its own device stack.</p>
  10981. <h2><a id="Device_nodes_and_the_Plug_and_Play_device_tree"></a><a id="device_nodes_and_the_plug_and_play_device_tree"></a><a id="DEVICE_NODES_AND_THE_PLUG_AND_PLAY_DEVICE_TREE"></a>Device nodes and the Plug and Play device tree</h2>
  10982. <p>Windows organizes devices in a tree structure called the <em>Plug and Play device tree</em>, or simply the <em>device tree</em>. Typically, a node in the device tree represents either a device or an individual function on a composite device. However, some nodes represent software components that have no association with physical devices.</p>
  10983. <p>A node in the device tree is called a <em>device node</em>. The root node of the device tree is called the <em>root device node</em>. By convention, the root device node is drawn at the bottom of the device tree, as shown in the following diagram. </p><img id="DeviceTree01" alt="Diagram of the device tree, showing device nodes" src="./Windows Kernel Development Articles (2016-03-30)_files/IC559043.png" title="Diagram of the device tree, showing device nodes" xmlns=""><p>The device tree illustrates the parent/child relationships that are inherent in the PnP environment. Several of the nodes in the device tree represent buses that have child devices connected to them. For example, the PCI Bus node represents the physical PCI bus on the motherboard. During startup, the PnP manager asks the PCI bus driver to enumerate the devices that are connected to the PCI bus. Those devices are represented by child nodes of the PCI Bus node. In the preceding diagram, the PCI Bus node has child nodes for several devices that are connected to the PCI bus, including USB host controllers, an audio controller, and a PCI Express port.</p>
  10984. <p>Some of the devices connected to the PCI bus are buses themselves. The PnP manager asks each of these buses to enumerate the devices that are connected to it. In the preceding diagram, we can see that the audio controller is a bus that has an audio device connected to it. We can see that the PCI Express port is a bus that has a display adapter connected to it, and the display adapter is a bus that has one monitor connected to it.</p>
  10985. <p>Whether you think of a node as representing a device or a bus depends on your point of view. For example, you can think of the display adapter as a device that plays a key role in preparing frames that appear on the screen. However, you can also think of the display adapter as a bus that is capable of detecting and enumerating connected monitors. </p>
  10986. <h2><a id="Device_objects_and_device_stacks"></a><a id="device_objects_and_device_stacks"></a><a id="DEVICE_OBJECTS_AND_DEVICE_STACKS"></a>Device objects and device stacks</h2>
  10987. <p>A <em>device object</em> is an instance of a <a href="https://msdn.microsoft.com/en-us/library/ff543147(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DEVICE_OBJECT</strong></a> structure. Each device node in the PnP device tree has an ordered list of device objects, and each of these device objects is associated with a driver. The ordered list of device objects, along with their associated drivers, is called the <em>device stack</em> for the device node.</p>
  10988. <p>You can think of a device stack in several ways. In the most formal sense, a device stack is an ordered list of (device object, driver) pairs. However, in certain contexts it might be useful to think of the device stack as an ordered list of device objects. In other contexts, it might be useful to think of the device stack as an ordered list of drivers.</p>
  10989. <p>By convention, a device stack has a top and a bottom. The first device object to be created in the device stack is at the bottom, and the last device object to be created and attached to the device stack is at the top.</p>
  10990. <p>In the following diagram, the Proseware Gizmo device node has a device stack that contains three (device object, driver) pairs. The top device object is associated with the driver AfterThought.sys, the middle device object is associated with the driver Proseware.sys, and the bottom device object is associated with the driver Pci.sys. The PCI Bus node in the center of the diagram has a device stack that contains two (device object, driver) pairs--a device object associated with Pci.sys and a device object associated with Acpi.sys.</p><img id="prosewaredevicenode01" alt="Diagram showing device objects ordered in device stacks in the Proseware Gizmo and PCI device nodes" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535098.png" title="Diagram showing device objects ordered in device stacks in the Proseware Gizmo and PCI device nodes" xmlns=""><h2><a id="How_does_a_device_stack_get_constructed_"></a><a id="how_does_a_device_stack_get_constructed_"></a><a id="HOW_DOES_A_DEVICE_STACK_GET_CONSTRUCTED_"></a>How does a device stack get constructed?</h2>
  10991. <p>During startup, the PnP manager asks the driver for each bus to enumerate child devices that are connected to the bus. For example, the PnP manager asks the PCI bus driver (Pci.sys) to enumerate the devices that are connected to the PCI bus. In response to this request, Pci.sys creates a device object for each device that is connected to the PCI bus. Each of these device objects is called a <em>physical device object</em> (PDO). Shortly after Pci.sys creates the set of PDOs, the device tree looks like the one shown in the following diagram.</p><img id="prosewaredevicenode04" alt="Diagram of PCI node and physical device objects for child devices" src="./Windows Kernel Development Articles (2016-03-30)_files/IC559044.png" title="Diagram of PCI node and physical device objects for child devices" xmlns=""><p>The PnP manager associates a device node with each newly created PDO and looks in the registry to determine which drivers need to be part of the device stack for the node. The device stack must have one (and only one) <em>function driver</em> and can optionally have one or more <em>filter drivers</em>. The function driver is the main driver for the device stack and is responsible for handling read, write, and device control requests. Filter drivers play auxiliary roles in processing read, write, and device control requests. As each function and filter driver is loaded, it creates a device object and attaches itself to the device stack. A device object created by the function driver is called a <em>functional device object</em> (FDO), and a device object created by a filter driver is called a <em>filter device object</em> (Filter DO). Now the device tree looks something like this diagram.</p><img id="prosewaredevicenode02" alt="Diagram of a device tree showing the filter, function, and physical device objects in the Proseware Gizmo device node" src="./Windows Kernel Development Articles (2016-03-30)_files/IC559045.png" title="Diagram of a device tree showing the filter, function, and physical device objects in the Proseware Gizmo device node" xmlns=""><p>In the diagram, notice that in one node, the filter driver is above the function driver, and in the other node, the filter driver is below the function driver. A filter driver that is above the function driver in a device stack is called an <em>upper filter driver</em>. A filter driver that is below the function driver is called a <em>lower filter driver</em>.</p>
  10992. <p>The PDO is always the bottom device object in a device stack. This results from the way a device stack is constructed. The PDO is created first, and as additional device objects are attached to the stack, they are attached to the top of the existing stack.</p>
  10993. <div class="alert"><strong>Note</strong>&nbsp;&nbsp;<p class="note">When the drivers for a device are installed, the installer uses information in an information (INF) file to determine which driver is the function driver and which drivers are filters. Typically the INF file is provided either by Microsoft or by the hardware vendor. After the drivers for a device are installed, the PnP manager can determine the function and filter drivers for the device by looking in the registry.</p>
  10994. <p class="note"></p>
  10995. </div>
  10996. <div>&nbsp;</div>
  10997. <h2><a id="Bus_drivers"></a><a id="bus_drivers"></a><a id="BUS_DRIVERS"></a>Bus drivers</h2>
  10998. <p>In the preceding diagram, you can see that the driver Pci.sys plays two roles. First, Pci.sys is associated with the FDO in the PCI Bus device node. In fact, it created the FDO in the PCI Bus device node. So Pci.sys is the function driver for the PCI bus. Second, Pci.sys is associated with the PDO in each child of the PCI Bus node. Recall that it created the PDOs for the child devices. The driver that creates the PDO for a device node is called the <em>bus driver</em> for the node.</p>
  10999. <p>If your point of reference is the PCI bus, then Pci.sys is the function driver. But if your point of reference is the Proseware Gizmo device, then Pci.sys is the bus driver. This dual role is typical in the PnP device tree. A driver that serves as function driver for a bus also serves as bus driver for a child device of the bus.</p>
  11000. <h2><a id="User-mode_device_stacks"></a><a id="user-mode_device_stacks"></a><a id="USER-MODE_DEVICE_STACKS"></a>User-mode device stacks</h2>
  11001. <p>So far we've been discussing kernel-mode device stacks. That is, the drivers in the stacks run in kernel mode, and the device objects are mapped into system space, which is the address space that is available only to code running in kernel mode. For information about the difference between kernel mode and user mode, see <a href="https://msdn.microsoft.com/en-us/library/ff554836(v=vs.85).aspx">User mode and kernel mode</a>.</p>
  11002. <p>In some cases, a device has a user-mode device stack in addition to its kernel-mode device stack. User-mode drivers are often based on the User-Mode Driver Framework (UMDF), which is one of the driver models provided by the <a href="https://msdn.microsoft.com/en-us/library/ff557565(v=vs.85).aspx">Windows Driver Frameworks (WDF)</a>. In UMDF, the drivers are user-mode DLLs, and the device objects are COM objects that implement the <a href="https://msdn.microsoft.com/en-us/library/ff556917(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">IWDFDevice</strong></a> interface. A device object in a UMDF device stack is called a <em>WDF device object</em> (WDF DO).</p>
  11003. <p>The following diagram shows the device node, kernel-mode device stack, and the user-mode device stack for a USB-FX-2 device. The drivers in both the user-mode and kernel-mode stacks participate in I/O requests that are directed at the USB-FX-2 device.</p><img id="UserAndKernelDeviceStacks01" alt="Diagram showing user-mode and kernel-mode device stacks" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535101.png" title="Diagram showing user-mode and kernel-mode device stacks" xmlns=""><h2><a id="related_topics"></a>Related topics</h2>
  11004. <dl>
  11005. <dt>
  11006. <a href="https://msdn.microsoft.com/en-us/library/ff554731(v=vs.85).aspx">Concepts for all driver developers</a>
  11007. </dt>
  11008. <dt>
  11009. <a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx">Driver stacks</a>
  11010. </dt>
  11011. </dl>
  11012. <p>&nbsp;</p>
  11013. <p>&nbsp;</p>
  11014. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Device%20nodes%20and%20device%20stacks%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  11015. </div>
  11016. </div>
  11017. </div>
  11018. </div>
  11019. <div class="clear"></div>
  11020. <input name="__RequestVerificationToken" type="hidden" value="1qOJfzuR_p7gXH73v8KxXqhgkt-wp4O1Hagt5QWbtAXo_D3o-pznD8XW_qPbrUB6QhrE5rvqHvEOI2Cj1pZA9lHusK81">
  11021. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/ff554721(d=printer,v=vs.85).aspx">
  11022. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/ff554721(d=printer,v=vs.85).aspx">
  11023. <input id="isTopicRated" type="hidden" value="false">
  11024. <div id="lib-footer" ms.pgarea="body">
  11025. <link type="text/css" rel="stylesheet">
  11026. <div id="ux-footer" class="" style="" dir="ltr">
  11027. <div id="footerSock" class="librarySock both">
  11028. <div id="footerSockInner">
  11029. <a name="feedback"></a>
  11030. <div class="rating">
  11031. <div id="ratingSection1">
  11032. <div class="title">
  11033. Was this page helpful?
  11034. </div>
  11035. <div class="description">
  11036. Your feedback about this content is important.<br>Let us know what you think.
  11037. </div>
  11038. <div class="buttons">
  11039. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  11040. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  11041. </div>
  11042. <input id="ratingValue" type="hidden" value="">
  11043. </div>
  11044. <div id="ratingSection2">
  11045. <div class="title left">
  11046. Additional feedback?
  11047. </div>
  11048. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  11049. <div class="right">
  11050. <div class="counter">
  11051. <span id="feedbackTextCounter">1500</span> characters remaining
  11052. </div>
  11053. <div class="buttons">
  11054. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  11055. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  11056. </div>
  11057. </div>
  11058. </div>
  11059. <div id="ratingSection3">
  11060. <div class="title">
  11061. Thank you!
  11062. </div>
  11063. <div class="description">
  11064. We appreciate your feedback.
  11065. </div>
  11066. </div>
  11067. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  11068. </div>
  11069. <div class="userVoice">
  11070. <div class="title">
  11071. Help us improve MSDN.
  11072. </div>
  11073. <div class="description">
  11074. Visit our UserVoice Page to submit and vote on ideas!
  11075. </div>
  11076. <div class="buttons">
  11077. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  11078. </div>
  11079. </div>
  11080. <div class="clear"></div>
  11081. </div>
  11082. </div>
  11083. <footer class="top">
  11084. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  11085. <div class="linkList">
  11086. <div class="linkListTitle">Dev centers</div>
  11087. <ul class="links">
  11088. <li>
  11089. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  11090. </li>
  11091. <li>
  11092. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  11093. </li>
  11094. <li>
  11095. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  11096. </li>
  11097. <li>
  11098. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  11099. </li>
  11100. <li>
  11101. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  11102. </li>
  11103. </ul>
  11104. </div>
  11105. </div>
  11106. <div id="rightLinks">
  11107. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  11108. <div class="linkList">
  11109. <div class="linkListTitle">Learning resources</div>
  11110. <ul class="links">
  11111. <li>
  11112. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  11113. </li>
  11114. <li>
  11115. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  11116. </li>
  11117. <li>
  11118. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  11119. </li>
  11120. </ul>
  11121. </div>
  11122. </div>
  11123. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  11124. <div class="linkList">
  11125. <div class="linkListTitle">Community</div>
  11126. <ul class="links">
  11127. <li>
  11128. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  11129. </li>
  11130. <li>
  11131. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  11132. </li>
  11133. <li>
  11134. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  11135. </li>
  11136. </ul>
  11137. </div>
  11138. </div>
  11139. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  11140. <div class="linkList">
  11141. <div class="linkListTitle">Support</div>
  11142. <ul class="links">
  11143. <li>
  11144. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  11145. </li>
  11146. </ul>
  11147. </div>
  11148. </div>
  11149. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  11150. <div class="linkList">
  11151. <div class="linkListTitle">Programs</div>
  11152. <ul class="links">
  11153. <li>
  11154. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  11155. </li>
  11156. <li>
  11157. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  11158. </li>
  11159. <li>
  11160. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  11161. </li>
  11162. </ul>
  11163. </div>
  11164. </div>
  11165. </div>
  11166. </footer>
  11167. <footer class="bottom">
  11168. <span class="localeContainer">
  11169. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  11170. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554721(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  11171. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  11172. </form>
  11173. </span>
  11174. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  11175. <div class="linkList">
  11176. <ul class="links horizontal">
  11177. <li>
  11178. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  11179. </li>
  11180. <li>
  11181. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  11182. </li>
  11183. <li>
  11184. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  11185. </li>
  11186. <li>
  11187. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  11188. </li>
  11189. </ul>
  11190. </div>
  11191. </div>
  11192. <span class="logoLegal">
  11193. <span class="logo"></span>
  11194. <span class="copyright">© 2016 Microsoft</span>
  11195. </span>
  11196. </footer>
  11197. </div>
  11198. </div>
  11199. <div class="footerPrintView">
  11200. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  11201. </div>
  11202. <input id="tocPaddingPerLevel" type="hidden" value="17">
  11203. <input id="MtpsDevice" type="hidden" value="Printer">
  11204. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  11205. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  11206. <div id="globalRequestVerification">
  11207. <input name="__RequestVerificationToken" type="hidden" value="CKbxvcOcjlV_jeS5Kn4Ogtv1fQHuO9uOZvG-aKBA5-WQxvXocW30LK8RANjr63BqkXYvgjjvi1UsmdbCqIM3Dps-e7I1">
  11208. </div>
  11209. </div>
  11210. <script type="text/javascript" class="mtps-injected">
  11211. /*<![CDATA[*/
  11212. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  11213. MTPS.injectScripts([
  11214. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  11215. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/ff554721(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  11216. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  11217. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  11218. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  11219. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  11220. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  11221. ]);
  11222. /*]]>*/
  11223. </script>
  11224. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  11225. <div id="page">
  11226. <link type="text/css" rel="stylesheet">
  11227. <input type="hidden" id="isHeaderBleeding" value="true">
  11228. <div id="ux-header" dir="ltr" class="ltr msdn">
  11229. <header>
  11230. <span id="singleCol"></span>
  11231. <span id="doubleCol"></span>
  11232. <span id="isMobile"></span>
  11233. <div>
  11234. <div class="row topRow">
  11235. <div class="top">
  11236. <div class="left">
  11237. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  11238. <div id="msft-logo" class="msft-logo"></div>
  11239. </a>
  11240. <div class="GrayPipe"></div>
  11241. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  11242. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  11243. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  11244. </div>
  11245. <div class="right">
  11246. <div id="signIn">
  11247. <div class="profileImage"></div>
  11248. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376419&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439638%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  11249. <div class="auxNav">
  11250. <div>
  11251. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  11252. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  11253. </div>
  11254. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  11255. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  11256. </div>
  11257. </div>
  11258. <div>
  11259. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  11260. <div class="linkList">
  11261. <ul class="links horizontal">
  11262. <li>
  11263. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  11264. </li>
  11265. <li>
  11266. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  11267. </li>
  11268. <li>
  11269. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  11270. </li>
  11271. </ul>
  11272. </div>
  11273. </div>
  11274. </div>
  11275. </div>
  11276. </div>
  11277. </div>
  11278. </div>
  11279. <div class="row middleRow">
  11280. <div class="expandTop">
  11281. <div class="left"></div>
  11282. <div class="right"></div>
  11283. </div>
  11284. </div>
  11285. </div>
  11286. <div id="buttomRowWrapper" class="bg_default">
  11287. <div class="row buttomRow bg_default">
  11288. <div class="bottom">
  11289. <div class="left">
  11290. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  11291. <div id="drawer">
  11292. <div class="toc">
  11293. <nav>
  11294. <ul class="navL1">
  11295. <li class="inactive toggle">
  11296. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  11297. <ul class="navL2">
  11298. <li class="inactive">
  11299. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  11300. </li>
  11301. <li class="inactive">
  11302. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  11303. </li>
  11304. <li class="inactive">
  11305. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  11306. </li>
  11307. <li class="inactive">
  11308. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  11309. </li>
  11310. <li class="inactive">
  11311. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  11312. </li>
  11313. <li class="inactive">
  11314. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  11315. </li>
  11316. </ul>
  11317. </li>
  11318. <li class="inactive toggle">
  11319. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  11320. <ul class="navL2">
  11321. <li class="inactive">
  11322. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  11323. </li>
  11324. <li class="inactive">
  11325. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  11326. </li>
  11327. <li class="inactive">
  11328. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  11329. </li>
  11330. <li class="inactive toggle">
  11331. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  11332. <ul class="navL3">
  11333. <li class="inactive">
  11334. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  11335. </li>
  11336. <li class="inactive">
  11337. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  11338. </li>
  11339. <li class="inactive">
  11340. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  11341. </li>
  11342. <li class="inactive">
  11343. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  11344. </li>
  11345. <li class="inactive">
  11346. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  11347. </li>
  11348. </ul>
  11349. </li>
  11350. </ul>
  11351. </li>
  11352. <li class="inactive toggle">
  11353. <a href="javascript:void(0)" title="Programs">Programs</a>
  11354. <ul class="navL2">
  11355. <li class="inactive toggle">
  11356. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  11357. <ul class="navL3">
  11358. <li class="inactive">
  11359. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  11360. </li>
  11361. <li class="inactive">
  11362. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  11363. </li>
  11364. <li class="inactive">
  11365. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  11366. </li>
  11367. </ul>
  11368. </li>
  11369. <li class="inactive toggle">
  11370. <a href="javascript:void(0)" title="Students">Students</a>
  11371. <ul class="navL3">
  11372. <li class="inactive">
  11373. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  11374. </li>
  11375. <li class="inactive">
  11376. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  11377. </li>
  11378. </ul>
  11379. </li>
  11380. <li class="inactive toggle">
  11381. <a href="javascript:void(0)" title="Architects">Architects</a>
  11382. <ul class="navL3">
  11383. <li class="inactive">
  11384. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  11385. </li>
  11386. <li class="inactive">
  11387. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  11388. </li>
  11389. <li class="inactive">
  11390. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  11391. </li>
  11392. <li class="inactive">
  11393. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  11394. </li>
  11395. <li class="inactive">
  11396. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  11397. </li>
  11398. </ul>
  11399. </li>
  11400. <li class="inactive">
  11401. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  11402. </li>
  11403. <li class="inactive">
  11404. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  11405. </li>
  11406. <li class="inactive">
  11407. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  11408. </li>
  11409. <li class="inactive">
  11410. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  11411. </li>
  11412. </ul>
  11413. </li>
  11414. <li class="inactive toggle">
  11415. <a href="javascript:void(0)" title="Community">Community</a>
  11416. <ul class="navL2">
  11417. <li class="inactive">
  11418. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  11419. </li>
  11420. <li class="inactive">
  11421. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  11422. </li>
  11423. <li class="inactive">
  11424. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  11425. </li>
  11426. <li class="inactive">
  11427. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  11428. </li>
  11429. <li class="inactive">
  11430. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  11431. </li>
  11432. </ul>
  11433. </li>
  11434. <li class="inactive current toggle">
  11435. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  11436. <ul class="navL2">
  11437. <li class="inactive current">
  11438. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  11439. </li>
  11440. <li class="inactive">
  11441. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  11442. </li>
  11443. </ul>
  11444. </li>
  11445. <li class="inactive">
  11446. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  11447. </li>
  11448. </ul>
  11449. </nav>
  11450. </div>
  11451. </div>
  11452. </div>
  11453. <div class="right">
  11454. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  11455. <div class="SearchBox">
  11456. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  11457. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  11458. <div id="search-finder" class="search-finder"></div>
  11459. </button>
  11460. <button id="HeaderSearchButton" style="display:none"></button>
  11461. <div id="searchSplitter"></div>
  11462. <div id="searchCloseIcon" class="search-clear-x"></div>
  11463. <div id="searchTextContainer" style="width: 0;">
  11464. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  11465. </div>
  11466. </form>
  11467. </div>
  11468. </div>
  11469. </div>
  11470. </div>
  11471. </div>
  11472. </div>
  11473. </header>
  11474. </div>
  11475. <div class="printExportMenus ltr">
  11476. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh439638(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  11477. Export (<span class="count">0</span>)
  11478. </a>
  11479. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh439638(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  11480. Print
  11481. </a>
  11482. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  11483. </a>
  11484. </div>
  11485. <div class="printExportMenus ltr">
  11486. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  11487. </div>
  11488. <div id="body" ms.pgarea="body">
  11489. <span id="tabletView_large"></span>
  11490. <span id="tabletView_small"></span>
  11491. <span id="mobileView"></span>
  11492. <div id="content" class="content">
  11493. <input type="hidden" id="printForPab" value="true">
  11494. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  11495. <h1 class="title">I/O request packets</h1>
  11496. <div id="mainSection">
  11497. <div class="clsServerSDKContent">
  11498. </div>
  11499. <p>Most of the requests that are sent to device drivers are packaged in I/O request packets (<a href="https://msdn.microsoft.com/en-us/library/ff550694(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">IRP</strong></a>s). An operating system component or a driver sends an IRP to a driver by calling <a href="https://msdn.microsoft.com/en-us/library/ff548336(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">IoCallDriver</strong></a>, which has two parameters: a pointer to a <a href="https://msdn.microsoft.com/en-us/library/ff543147(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DEVICE_OBJECT</strong></a> and a pointer to an <strong>IRP</strong>. The <strong>DEVICE_OBJECT</strong> has a pointer to an associated <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a>. When a component calls <strong>IoCallDriver</strong>, we say the component <em>sends the IRP to the device object</em> or <em>sends the IRP to the driver associated with the device object</em>. Sometimes we use the phrase <em>passes the IRP</em> or <em>forwards the IRP</em> instead of <em>sends the IRP</em>.</p>
  11500. <p>Typically an IRP is processed by several drivers that are arranged in a stack. Each driver in the stack is associated with a device object. For more information, see <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a>. When an <a href="https://msdn.microsoft.com/en-us/library/ff550694(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">IRP</strong></a> is processed by a device stack, the <strong>IRP</strong> is usually sent first to the top device object in the device stack. For example, if an <strong>IRP</strong> is processed by the device stack shown in this diagram, the IRP would be sent first to the filter device object (Filter DO) at the top of the device stack.</p><img id="ProsewareDeviceNode03" alt="Diagram of a device node and its device stack" src="./Windows Kernel Development Articles (2016-03-30)_files/IC535107.png" title="Diagram of a device node and its device stack" xmlns=""><h2><a id="Passing_an_IRP_down_the_device_stack"></a><a id="passing_an_irp_down_the_device_stack"></a><a id="PASSING_AN_IRP_DOWN_THE_DEVICE_STACK"></a>Passing an IRP down the device stack</h2>
  11501. <p>Suppose the I/O manager sends an IRP to the Filter DO in the diagram. The driver associated with the Filter DO, AfterThought.sys, processes the IRP and then passes it to the functional device object (FDO), which is the next lower device object in the device stack. When a driver passes an IRP to the next lower device object in the device stack, we say the driver <em>passes the IRP down the device stack</em>.</p>
  11502. <p>Some IRPs are passed all the way down the device stack to the physical device object (PDO). Other IRPs never reach the PDO because they are completed by one of the drivers above the PDO.</p>
  11503. <h2><a id="IRPs_are_self-contained"></a><a id="irps_are_self-contained"></a><a id="IRPS_ARE_SELF-CONTAINED"></a>IRPs are self-contained</h2>
  11504. <p>The IRP structure is self-contained in the sense that it holds all of the information that a driver needs to handle an I/0 request. Some parts of the IRP structure hold information that is common to all of the participating drivers in the stack. Other parts of the IRP hold information that is specific to a particular driver in the stack.</p>
  11505. <p>&nbsp;</p>
  11506. <p>&nbsp;</p>
  11507. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20I/O%20request%20packets%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  11508. </div>
  11509. </div>
  11510. </div>
  11511. </div>
  11512. <div class="clear"></div>
  11513. <input name="__RequestVerificationToken" type="hidden" value="LY4IxpW1pXWXDUR8NpG7eXWr2z_tMU4CHHmEUdwDqo9c9BJ746Nxf8KI6gWUkVD2nLxqx-mrssPJIcbJx3uM0bm-BOE1">
  11514. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh439638(d=printer,v=vs.85).aspx">
  11515. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh439638(d=printer,v=vs.85).aspx">
  11516. <input id="isTopicRated" type="hidden" value="false">
  11517. <div id="lib-footer" ms.pgarea="body">
  11518. <link type="text/css" rel="stylesheet">
  11519. <div id="ux-footer" class="" style="" dir="ltr">
  11520. <div id="footerSock" class="librarySock both">
  11521. <div id="footerSockInner">
  11522. <a name="feedback"></a>
  11523. <div class="rating">
  11524. <div id="ratingSection1">
  11525. <div class="title">
  11526. Was this page helpful?
  11527. </div>
  11528. <div class="description">
  11529. Your feedback about this content is important.<br>Let us know what you think.
  11530. </div>
  11531. <div class="buttons">
  11532. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  11533. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  11534. </div>
  11535. <input id="ratingValue" type="hidden" value="">
  11536. </div>
  11537. <div id="ratingSection2">
  11538. <div class="title left">
  11539. Additional feedback?
  11540. </div>
  11541. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  11542. <div class="right">
  11543. <div class="counter">
  11544. <span id="feedbackTextCounter">1500</span> characters remaining
  11545. </div>
  11546. <div class="buttons">
  11547. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  11548. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  11549. </div>
  11550. </div>
  11551. </div>
  11552. <div id="ratingSection3">
  11553. <div class="title">
  11554. Thank you!
  11555. </div>
  11556. <div class="description">
  11557. We appreciate your feedback.
  11558. </div>
  11559. </div>
  11560. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  11561. </div>
  11562. <div class="userVoice">
  11563. <div class="title">
  11564. Help us improve MSDN.
  11565. </div>
  11566. <div class="description">
  11567. Visit our UserVoice Page to submit and vote on ideas!
  11568. </div>
  11569. <div class="buttons">
  11570. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  11571. </div>
  11572. </div>
  11573. <div class="clear"></div>
  11574. </div>
  11575. </div>
  11576. <footer class="top">
  11577. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  11578. <div class="linkList">
  11579. <div class="linkListTitle">Dev centers</div>
  11580. <ul class="links">
  11581. <li>
  11582. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  11583. </li>
  11584. <li>
  11585. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  11586. </li>
  11587. <li>
  11588. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  11589. </li>
  11590. <li>
  11591. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  11592. </li>
  11593. <li>
  11594. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  11595. </li>
  11596. </ul>
  11597. </div>
  11598. </div>
  11599. <div id="rightLinks">
  11600. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  11601. <div class="linkList">
  11602. <div class="linkListTitle">Learning resources</div>
  11603. <ul class="links">
  11604. <li>
  11605. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  11606. </li>
  11607. <li>
  11608. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  11609. </li>
  11610. <li>
  11611. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  11612. </li>
  11613. </ul>
  11614. </div>
  11615. </div>
  11616. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  11617. <div class="linkList">
  11618. <div class="linkListTitle">Community</div>
  11619. <ul class="links">
  11620. <li>
  11621. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  11622. </li>
  11623. <li>
  11624. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  11625. </li>
  11626. <li>
  11627. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  11628. </li>
  11629. </ul>
  11630. </div>
  11631. </div>
  11632. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  11633. <div class="linkList">
  11634. <div class="linkListTitle">Support</div>
  11635. <ul class="links">
  11636. <li>
  11637. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  11638. </li>
  11639. </ul>
  11640. </div>
  11641. </div>
  11642. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  11643. <div class="linkList">
  11644. <div class="linkListTitle">Programs</div>
  11645. <ul class="links">
  11646. <li>
  11647. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  11648. </li>
  11649. <li>
  11650. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  11651. </li>
  11652. <li>
  11653. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  11654. </li>
  11655. </ul>
  11656. </div>
  11657. </div>
  11658. </div>
  11659. </footer>
  11660. <footer class="bottom">
  11661. <span class="localeContainer">
  11662. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  11663. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439638(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  11664. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  11665. </form>
  11666. </span>
  11667. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  11668. <div class="linkList">
  11669. <ul class="links horizontal">
  11670. <li>
  11671. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  11672. </li>
  11673. <li>
  11674. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  11675. </li>
  11676. <li>
  11677. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  11678. </li>
  11679. <li>
  11680. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  11681. </li>
  11682. </ul>
  11683. </div>
  11684. </div>
  11685. <span class="logoLegal">
  11686. <span class="logo"></span>
  11687. <span class="copyright">© 2016 Microsoft</span>
  11688. </span>
  11689. </footer>
  11690. </div>
  11691. </div>
  11692. <div class="footerPrintView">
  11693. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  11694. </div>
  11695. <input id="tocPaddingPerLevel" type="hidden" value="17">
  11696. <input id="MtpsDevice" type="hidden" value="Printer">
  11697. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  11698. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  11699. <div id="globalRequestVerification">
  11700. <input name="__RequestVerificationToken" type="hidden" value="n086H7wEOLoDBhbrgBbvkuMiUUUEynFzyQllS5F8kS38wzzIsOT0rEJ_L-NlOf_vyR6cuaNSRnf7IWcqpzNJ7tISe101">
  11701. </div>
  11702. </div>
  11703. <script type="text/javascript" class="mtps-injected">
  11704. /*<![CDATA[*/
  11705. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  11706. MTPS.injectScripts([
  11707. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  11708. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh439638(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  11709. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  11710. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  11711. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  11712. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  11713. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  11714. ]);
  11715. /*]]>*/
  11716. </script>
  11717. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  11718. <div id="page">
  11719. <link type="text/css" rel="stylesheet">
  11720. <input type="hidden" id="isHeaderBleeding" value="true">
  11721. <div id="ux-header" dir="ltr" class="ltr msdn">
  11722. <header>
  11723. <span id="singleCol"></span>
  11724. <span id="doubleCol"></span>
  11725. <span id="isMobile"></span>
  11726. <div>
  11727. <div class="row topRow">
  11728. <div class="top">
  11729. <div class="left">
  11730. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  11731. <div id="msft-logo" class="msft-logo"></div>
  11732. </a>
  11733. <div class="GrayPipe"></div>
  11734. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  11735. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  11736. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  11737. </div>
  11738. <div class="right">
  11739. <div id="signIn">
  11740. <div class="profileImage"></div>
  11741. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376419&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439632%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  11742. <div class="auxNav">
  11743. <div>
  11744. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  11745. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  11746. </div>
  11747. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  11748. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  11749. </div>
  11750. </div>
  11751. <div>
  11752. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  11753. <div class="linkList">
  11754. <ul class="links horizontal">
  11755. <li>
  11756. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  11757. </li>
  11758. <li>
  11759. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  11760. </li>
  11761. <li>
  11762. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  11763. </li>
  11764. </ul>
  11765. </div>
  11766. </div>
  11767. </div>
  11768. </div>
  11769. </div>
  11770. </div>
  11771. </div>
  11772. <div class="row middleRow">
  11773. <div class="expandTop">
  11774. <div class="left"></div>
  11775. <div class="right"></div>
  11776. </div>
  11777. </div>
  11778. </div>
  11779. <div id="buttomRowWrapper" class="bg_default">
  11780. <div class="row buttomRow bg_default">
  11781. <div class="bottom">
  11782. <div class="left">
  11783. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  11784. <div id="drawer">
  11785. <div class="toc">
  11786. <nav>
  11787. <ul class="navL1">
  11788. <li class="inactive toggle">
  11789. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  11790. <ul class="navL2">
  11791. <li class="inactive">
  11792. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  11793. </li>
  11794. <li class="inactive">
  11795. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  11796. </li>
  11797. <li class="inactive">
  11798. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  11799. </li>
  11800. <li class="inactive">
  11801. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  11802. </li>
  11803. <li class="inactive">
  11804. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  11805. </li>
  11806. <li class="inactive">
  11807. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  11808. </li>
  11809. </ul>
  11810. </li>
  11811. <li class="inactive toggle">
  11812. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  11813. <ul class="navL2">
  11814. <li class="inactive">
  11815. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  11816. </li>
  11817. <li class="inactive">
  11818. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  11819. </li>
  11820. <li class="inactive">
  11821. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  11822. </li>
  11823. <li class="inactive toggle">
  11824. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  11825. <ul class="navL3">
  11826. <li class="inactive">
  11827. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  11828. </li>
  11829. <li class="inactive">
  11830. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  11831. </li>
  11832. <li class="inactive">
  11833. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  11834. </li>
  11835. <li class="inactive">
  11836. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  11837. </li>
  11838. <li class="inactive">
  11839. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  11840. </li>
  11841. </ul>
  11842. </li>
  11843. </ul>
  11844. </li>
  11845. <li class="inactive toggle">
  11846. <a href="javascript:void(0)" title="Programs">Programs</a>
  11847. <ul class="navL2">
  11848. <li class="inactive toggle">
  11849. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  11850. <ul class="navL3">
  11851. <li class="inactive">
  11852. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  11853. </li>
  11854. <li class="inactive">
  11855. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  11856. </li>
  11857. <li class="inactive">
  11858. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  11859. </li>
  11860. </ul>
  11861. </li>
  11862. <li class="inactive toggle">
  11863. <a href="javascript:void(0)" title="Students">Students</a>
  11864. <ul class="navL3">
  11865. <li class="inactive">
  11866. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  11867. </li>
  11868. <li class="inactive">
  11869. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  11870. </li>
  11871. </ul>
  11872. </li>
  11873. <li class="inactive toggle">
  11874. <a href="javascript:void(0)" title="Architects">Architects</a>
  11875. <ul class="navL3">
  11876. <li class="inactive">
  11877. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  11878. </li>
  11879. <li class="inactive">
  11880. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  11881. </li>
  11882. <li class="inactive">
  11883. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  11884. </li>
  11885. <li class="inactive">
  11886. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  11887. </li>
  11888. <li class="inactive">
  11889. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  11890. </li>
  11891. </ul>
  11892. </li>
  11893. <li class="inactive">
  11894. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  11895. </li>
  11896. <li class="inactive">
  11897. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  11898. </li>
  11899. <li class="inactive">
  11900. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  11901. </li>
  11902. <li class="inactive">
  11903. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  11904. </li>
  11905. </ul>
  11906. </li>
  11907. <li class="inactive toggle">
  11908. <a href="javascript:void(0)" title="Community">Community</a>
  11909. <ul class="navL2">
  11910. <li class="inactive">
  11911. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  11912. </li>
  11913. <li class="inactive">
  11914. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  11915. </li>
  11916. <li class="inactive">
  11917. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  11918. </li>
  11919. <li class="inactive">
  11920. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  11921. </li>
  11922. <li class="inactive">
  11923. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  11924. </li>
  11925. </ul>
  11926. </li>
  11927. <li class="inactive current toggle">
  11928. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  11929. <ul class="navL2">
  11930. <li class="inactive current">
  11931. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  11932. </li>
  11933. <li class="inactive">
  11934. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  11935. </li>
  11936. </ul>
  11937. </li>
  11938. <li class="inactive">
  11939. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  11940. </li>
  11941. </ul>
  11942. </nav>
  11943. </div>
  11944. </div>
  11945. </div>
  11946. <div class="right">
  11947. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  11948. <div class="SearchBox">
  11949. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  11950. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  11951. <div id="search-finder" class="search-finder"></div>
  11952. </button>
  11953. <button id="HeaderSearchButton" style="display:none"></button>
  11954. <div id="searchSplitter"></div>
  11955. <div id="searchCloseIcon" class="search-clear-x"></div>
  11956. <div id="searchTextContainer" style="width: 0;">
  11957. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  11958. </div>
  11959. </form>
  11960. </div>
  11961. </div>
  11962. </div>
  11963. </div>
  11964. </div>
  11965. </div>
  11966. </header>
  11967. </div>
  11968. <div class="printExportMenus ltr">
  11969. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh439632(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  11970. Export (<span class="count">0</span>)
  11971. </a>
  11972. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh439632(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  11973. Print
  11974. </a>
  11975. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  11976. </a>
  11977. </div>
  11978. <div class="printExportMenus ltr">
  11979. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  11980. </div>
  11981. <div id="body" ms.pgarea="body">
  11982. <span id="tabletView_large"></span>
  11983. <span id="tabletView_small"></span>
  11984. <span id="mobileView"></span>
  11985. <div id="content" class="content">
  11986. <input type="hidden" id="printForPab" value="true">
  11987. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  11988. <h1 class="title">Driver stacks</h1>
  11989. <div id="mainSection">
  11990. <div class="clsServerSDKContent">
  11991. </div>
  11992. <p>
  11993. </p><p>Most of the requests that are sent to device drivers are packaged in <a href="https://msdn.microsoft.com/en-us/library/hh439638(v=vs.85).aspx">I/O request packets</a> (IRPs). Each device is represented by a device node, and each device node has a device stack. For more information, see <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a>. To send a read, write, or control request to a device, the I/O manager locates the device node for the device and then sends an IRP to the device stack of that node. Sometimes more than one device stack is involved in processing an I/O request. Regardless of how many device stacks are involved, the overall sequence of drivers that participate in an I/O request is called the <em>driver stack</em> for the request. We also use the term <em>driver stack</em> to refer to the layered set of drivers for a particular technology.</p>
  11994. <h2><a id="I_O_requests_that_are_processed_by_several_device_stacks"></a><a id="i_o_requests_that_are_processed_by_several_device_stacks"></a><a id="I_O_REQUESTS_THAT_ARE_PROCESSED_BY_SEVERAL_DEVICE_STACKS"></a>I/O requests that are processed by several device stacks</h2>
  11995. <p>In some cases, more than one device stack is involved in processing an IRP. The following diagram illustrates a case where four device stacks are involved in processing a single IRP. </p><img id="Chain01" alt="Diagram of four device nodes, each with a device stack" src="./Windows Kernel Development Articles (2016-03-30)_files/IC596026.png" title="Diagram of four device nodes, each with a device stack" xmlns=""><p>Here is how the IRP is processed at each numbered stage in the diagram:</p>
  11996. <ol>
  11997. <li>
  11998. <p>The IRP is created by Disk.sys, which is the function driver in the device stack for the My USB Storage Device node. Disk.sys passes the IRP down the device stack to Usbstor.sys.</p>
  11999. </li>
  12000. <li>Notice that Usbstor.sys is the PDO driver for the My USB Storage Device node and the FDO driver for the USB Mass Storage Device node. At this point, it is not important to decide whether the IRP is owned by the (PDO, Usbstor.sys) pair or the (FDO, Usbstor.sys) pair. The IRP is owned by the driver, Usbstor.sys, and the driver has access to both the PDO and the FDO.</li>
  12001. <li>
  12002. <p>When Usbstor.sys has finished processing the IRP, it passes the IRP to Usbhub.sys. Usbhub.sys is the PDO driver for the USB Mass Storage Device node and the FDO driver for the USB Root Hub node. It is not important to decide whether the IRP is owned by the (PDO, Usbhub.sys) pair or the (FDO, Usbhub.sys) pair. The IRP is owned by the driver, Usbhub.sys, and the driver has access to both the PDO and the FDO.</p>
  12003. </li>
  12004. <li>
  12005. <p>When Usbhub.sys has finished processing the IRP, it passes the IRP to the (Usbuhci.sys, Usbport.sys) pair.</p>
  12006. <p>Usbuhci.sys is a miniport driver, and Usbport.sys is a port driver. The (miniport, port) pair plays the role of a single driver. In this case, both the miniport driver and the port driver are written by Microsoft. The (Usbuhci.sys, Usbport.sys) pair is the PDO driver for the USB Root Hub node, and the (Usbuhci.sys, Usbport.sys) pair is also the FDO driver for the USB Host Controller node. The (Usbuhci.sys, Usbport.sys) pair does the actual communication with the host controller hardware, which in turn communicates with the physical USB storage device.</p>
  12007. </li>
  12008. </ol>
  12009. <h2><a id="The_driver_stack_for_an_I_O_request"></a><a id="the_driver_stack_for_an_i_o_request"></a><a id="THE_DRIVER_STACK_FOR_AN_I_O_REQUEST"></a>The driver stack for an I/O request</h2>
  12010. <p>Consider the sequence of four drivers that participated in the I/O request illustrated in the preceding diagram. We can get another view of the sequence by focusing on the drivers rather than on the device nodes and their individual device stacks. The following diagram shows the drivers in sequence from top to bottom. Notice that Disk.sys is associated with one device object, but each of the other three drivers is associated with two device objects.</p><img id="DriverStack01" alt="Diagram of a driver stack, showing the top driver associated with an FDO only, and the other three drivers associated with a PDO and an FDO" src="./Windows Kernel Development Articles (2016-03-30)_files/IC559047.png" title="Diagram of a driver stack, showing the top driver associated with an FDO only, and the other three drivers associated with a PDO and an FDO" xmlns=""><p>The sequence of drivers that participate in an I/O request is called the <em>driver stack for the I/O request</em>. To illustrate a driver stack for an I/O request, we draw the drivers from top to bottom in the order that they participate in the request.</p>
  12011. <p>Notice that the driver stack for an I/O request is quite different from the device stack for a device node. Also notice that the driver stack for an I/O request does not necessarily remain in one branch of the device tree.</p>
  12012. <h2><a id="Technology_driver_stacks"></a><a id="technology_driver_stacks"></a><a id="TECHNOLOGY_DRIVER_STACKS"></a>Technology driver stacks</h2>
  12013. <p>Consider the driver stack for the I/O request shown in the preceding diagram. If we give each of the drivers a friendly name and make some slight changes to the diagram, we have a block diagram that is similar to many of those that appear in the Windows Driver Kit (WDK) documentation.</p><img id="DriverStack02" alt="Diagram of a driver stack showing friendly names for the drivers: Disk Class Driver on top followed by USB Storage Port Driver, and then USB Hub Driver and (USB 2 Miniport, USB Port) Driver" src="./Windows Kernel Development Articles (2016-03-30)_files/IC559048.png" title="Diagram of a driver stack showing friendly names for the drivers: Disk Class Driver on top followed by USB Storage Port Driver, and then USB Hub Driver and (USB 2 Miniport, USB Port) Driver" xmlns=""><p> In the diagram, the driver stack is divided into three sections. We can think of each section as belonging to a particular technology or to a particular component or portion of the operating system. For example, we might say that the first section at the top of the driver stack belongs to the Volume Manager, the second section belongs to the storage component of the operating system, and the third section belongs to the core USB portion of the operating system.</p>
  12014. <p>Consider the drivers in the third section. These drivers are a subset of a larger set of core USB drivers that Microsoft provides for handling various kinds of USB requests and USB hardware. The following diagram shows what the entire USB core block diagram might look like.</p><img id="TechnologyStack01" alt="Diagram showing the technology driver stack for possible USB core block " src="./Windows Kernel Development Articles (2016-03-30)_files/IC553386.png" title="Diagram showing the technology driver stack for possible USB core block " xmlns=""><p>A block diagram that shows all of the drivers for a particular technology or a particular component or portion of the operating system is called a <em>technology driver stack</em>. Typically, technology driver stacks are given names like the USB Core Driver Stack, the Storage Stack, the 1394 Driver Stack, and the Audio Driver Stack.</p>
  12015. <div class="alert"><strong>Note</strong>&nbsp;&nbsp;The USB core block diagram in this topic shows one of several possible ways to illustrate the technology driver stacks for USB 1.0 and 2.0. For the official diagrams of the USB 1.0, 2.0, and 3.0 driver stacks, see <a href="https://msdn.microsoft.com/en-us/library/hh406256(v=vs.85).aspx">USB Driver Stack Architecture</a>.</div>
  12016. <div>&nbsp;</div>
  12017. <h2><a id="related_topics"></a>Related topics</h2>
  12018. <dl>
  12019. <dt>
  12020. <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a>
  12021. </dt>
  12022. <dt>
  12023. <a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx">Minidrivers and driver pairs</a>
  12024. </dt>
  12025. <dt>
  12026. <a href="https://msdn.microsoft.com/en-us/library/ff554731(v=vs.85).aspx">Concepts for all driver developers</a>
  12027. </dt>
  12028. </dl>
  12029. <p>&nbsp;</p>
  12030. <p>&nbsp;</p>
  12031. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Driver%20stacks%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  12032. </div>
  12033. </div>
  12034. </div>
  12035. </div>
  12036. <div class="clear"></div>
  12037. <input name="__RequestVerificationToken" type="hidden" value="2ew3xZD-jD9PVDmC6Wrb2cPbSfqYJOn5Gf905xzdxl8BLbg1NqNy2pPIrj2wWLcwHCevg2LjtwlI4a1UJp8m-qZ-G-M1">
  12038. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh439632(d=printer,v=vs.85).aspx">
  12039. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh439632(d=printer,v=vs.85).aspx">
  12040. <input id="isTopicRated" type="hidden" value="false">
  12041. <div id="lib-footer" ms.pgarea="body">
  12042. <link type="text/css" rel="stylesheet">
  12043. <div id="ux-footer" class="" style="" dir="ltr">
  12044. <div id="footerSock" class="librarySock both">
  12045. <div id="footerSockInner">
  12046. <a name="feedback"></a>
  12047. <div class="rating">
  12048. <div id="ratingSection1">
  12049. <div class="title">
  12050. Was this page helpful?
  12051. </div>
  12052. <div class="description">
  12053. Your feedback about this content is important.<br>Let us know what you think.
  12054. </div>
  12055. <div class="buttons">
  12056. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  12057. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  12058. </div>
  12059. <input id="ratingValue" type="hidden" value="">
  12060. </div>
  12061. <div id="ratingSection2">
  12062. <div class="title left">
  12063. Additional feedback?
  12064. </div>
  12065. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  12066. <div class="right">
  12067. <div class="counter">
  12068. <span id="feedbackTextCounter">1500</span> characters remaining
  12069. </div>
  12070. <div class="buttons">
  12071. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  12072. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  12073. </div>
  12074. </div>
  12075. </div>
  12076. <div id="ratingSection3">
  12077. <div class="title">
  12078. Thank you!
  12079. </div>
  12080. <div class="description">
  12081. We appreciate your feedback.
  12082. </div>
  12083. </div>
  12084. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  12085. </div>
  12086. <div class="userVoice">
  12087. <div class="title">
  12088. Help us improve MSDN.
  12089. </div>
  12090. <div class="description">
  12091. Visit our UserVoice Page to submit and vote on ideas!
  12092. </div>
  12093. <div class="buttons">
  12094. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  12095. </div>
  12096. </div>
  12097. <div class="clear"></div>
  12098. </div>
  12099. </div>
  12100. <footer class="top">
  12101. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  12102. <div class="linkList">
  12103. <div class="linkListTitle">Dev centers</div>
  12104. <ul class="links">
  12105. <li>
  12106. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  12107. </li>
  12108. <li>
  12109. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  12110. </li>
  12111. <li>
  12112. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  12113. </li>
  12114. <li>
  12115. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  12116. </li>
  12117. <li>
  12118. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  12119. </li>
  12120. </ul>
  12121. </div>
  12122. </div>
  12123. <div id="rightLinks">
  12124. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  12125. <div class="linkList">
  12126. <div class="linkListTitle">Learning resources</div>
  12127. <ul class="links">
  12128. <li>
  12129. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  12130. </li>
  12131. <li>
  12132. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  12133. </li>
  12134. <li>
  12135. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  12136. </li>
  12137. </ul>
  12138. </div>
  12139. </div>
  12140. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  12141. <div class="linkList">
  12142. <div class="linkListTitle">Community</div>
  12143. <ul class="links">
  12144. <li>
  12145. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  12146. </li>
  12147. <li>
  12148. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  12149. </li>
  12150. <li>
  12151. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  12152. </li>
  12153. </ul>
  12154. </div>
  12155. </div>
  12156. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  12157. <div class="linkList">
  12158. <div class="linkListTitle">Support</div>
  12159. <ul class="links">
  12160. <li>
  12161. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  12162. </li>
  12163. </ul>
  12164. </div>
  12165. </div>
  12166. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  12167. <div class="linkList">
  12168. <div class="linkListTitle">Programs</div>
  12169. <ul class="links">
  12170. <li>
  12171. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  12172. </li>
  12173. <li>
  12174. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  12175. </li>
  12176. <li>
  12177. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  12178. </li>
  12179. </ul>
  12180. </div>
  12181. </div>
  12182. </div>
  12183. </footer>
  12184. <footer class="bottom">
  12185. <span class="localeContainer">
  12186. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  12187. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439632(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  12188. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  12189. </form>
  12190. </span>
  12191. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  12192. <div class="linkList">
  12193. <ul class="links horizontal">
  12194. <li>
  12195. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  12196. </li>
  12197. <li>
  12198. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  12199. </li>
  12200. <li>
  12201. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  12202. </li>
  12203. <li>
  12204. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  12205. </li>
  12206. </ul>
  12207. </div>
  12208. </div>
  12209. <span class="logoLegal">
  12210. <span class="logo"></span>
  12211. <span class="copyright">© 2016 Microsoft</span>
  12212. </span>
  12213. </footer>
  12214. </div>
  12215. </div>
  12216. <div class="footerPrintView">
  12217. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  12218. </div>
  12219. <input id="tocPaddingPerLevel" type="hidden" value="17">
  12220. <input id="MtpsDevice" type="hidden" value="Printer">
  12221. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  12222. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  12223. <div id="globalRequestVerification">
  12224. <input name="__RequestVerificationToken" type="hidden" value="UcQkAKGIMZEOyqGMzvxecGZdkziiFY9PDrOshPQzDoQkC84vZkvSBzcwJGoceMtkGY9_4eS_nb0u8jx8DDQCbcy0znc1">
  12225. </div>
  12226. </div>
  12227. <script type="text/javascript" class="mtps-injected">
  12228. /*<![CDATA[*/
  12229. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  12230. MTPS.injectScripts([
  12231. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  12232. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh439632(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  12233. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  12234. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  12235. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  12236. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  12237. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  12238. ]);
  12239. /*]]>*/
  12240. </script>
  12241. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  12242. <div id="page">
  12243. <link type="text/css" rel="stylesheet">
  12244. <input type="hidden" id="isHeaderBleeding" value="true">
  12245. <div id="ux-header" dir="ltr" class="ltr msdn">
  12246. <header>
  12247. <span id="singleCol"></span>
  12248. <span id="doubleCol"></span>
  12249. <span id="isMobile"></span>
  12250. <div>
  12251. <div class="row topRow">
  12252. <div class="top">
  12253. <div class="left">
  12254. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  12255. <div id="msft-logo" class="msft-logo"></div>
  12256. </a>
  12257. <div class="GrayPipe"></div>
  12258. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  12259. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  12260. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  12261. </div>
  12262. <div class="right">
  12263. <div id="signIn">
  12264. <div class="profileImage"></div>
  12265. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376420&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439643%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  12266. <div class="auxNav">
  12267. <div>
  12268. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  12269. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  12270. </div>
  12271. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  12272. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  12273. </div>
  12274. </div>
  12275. <div>
  12276. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  12277. <div class="linkList">
  12278. <ul class="links horizontal">
  12279. <li>
  12280. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  12281. </li>
  12282. <li>
  12283. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  12284. </li>
  12285. <li>
  12286. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  12287. </li>
  12288. </ul>
  12289. </div>
  12290. </div>
  12291. </div>
  12292. </div>
  12293. </div>
  12294. </div>
  12295. </div>
  12296. <div class="row middleRow">
  12297. <div class="expandTop">
  12298. <div class="left"></div>
  12299. <div class="right"></div>
  12300. </div>
  12301. </div>
  12302. </div>
  12303. <div id="buttomRowWrapper" class="bg_default">
  12304. <div class="row buttomRow bg_default">
  12305. <div class="bottom">
  12306. <div class="left">
  12307. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  12308. <div id="drawer">
  12309. <div class="toc">
  12310. <nav>
  12311. <ul class="navL1">
  12312. <li class="inactive toggle">
  12313. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  12314. <ul class="navL2">
  12315. <li class="inactive">
  12316. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  12317. </li>
  12318. <li class="inactive">
  12319. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  12320. </li>
  12321. <li class="inactive">
  12322. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  12323. </li>
  12324. <li class="inactive">
  12325. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  12326. </li>
  12327. <li class="inactive">
  12328. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  12329. </li>
  12330. <li class="inactive">
  12331. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  12332. </li>
  12333. </ul>
  12334. </li>
  12335. <li class="inactive toggle">
  12336. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  12337. <ul class="navL2">
  12338. <li class="inactive">
  12339. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  12340. </li>
  12341. <li class="inactive">
  12342. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  12343. </li>
  12344. <li class="inactive">
  12345. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  12346. </li>
  12347. <li class="inactive toggle">
  12348. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  12349. <ul class="navL3">
  12350. <li class="inactive">
  12351. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  12352. </li>
  12353. <li class="inactive">
  12354. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  12355. </li>
  12356. <li class="inactive">
  12357. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  12358. </li>
  12359. <li class="inactive">
  12360. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  12361. </li>
  12362. <li class="inactive">
  12363. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  12364. </li>
  12365. </ul>
  12366. </li>
  12367. </ul>
  12368. </li>
  12369. <li class="inactive toggle">
  12370. <a href="javascript:void(0)" title="Programs">Programs</a>
  12371. <ul class="navL2">
  12372. <li class="inactive toggle">
  12373. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  12374. <ul class="navL3">
  12375. <li class="inactive">
  12376. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  12377. </li>
  12378. <li class="inactive">
  12379. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  12380. </li>
  12381. <li class="inactive">
  12382. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  12383. </li>
  12384. </ul>
  12385. </li>
  12386. <li class="inactive toggle">
  12387. <a href="javascript:void(0)" title="Students">Students</a>
  12388. <ul class="navL3">
  12389. <li class="inactive">
  12390. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  12391. </li>
  12392. <li class="inactive">
  12393. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  12394. </li>
  12395. </ul>
  12396. </li>
  12397. <li class="inactive toggle">
  12398. <a href="javascript:void(0)" title="Architects">Architects</a>
  12399. <ul class="navL3">
  12400. <li class="inactive">
  12401. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  12402. </li>
  12403. <li class="inactive">
  12404. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  12405. </li>
  12406. <li class="inactive">
  12407. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  12408. </li>
  12409. <li class="inactive">
  12410. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  12411. </li>
  12412. <li class="inactive">
  12413. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  12414. </li>
  12415. </ul>
  12416. </li>
  12417. <li class="inactive">
  12418. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  12419. </li>
  12420. <li class="inactive">
  12421. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  12422. </li>
  12423. <li class="inactive">
  12424. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  12425. </li>
  12426. <li class="inactive">
  12427. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  12428. </li>
  12429. </ul>
  12430. </li>
  12431. <li class="inactive toggle">
  12432. <a href="javascript:void(0)" title="Community">Community</a>
  12433. <ul class="navL2">
  12434. <li class="inactive">
  12435. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  12436. </li>
  12437. <li class="inactive">
  12438. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  12439. </li>
  12440. <li class="inactive">
  12441. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  12442. </li>
  12443. <li class="inactive">
  12444. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  12445. </li>
  12446. <li class="inactive">
  12447. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  12448. </li>
  12449. </ul>
  12450. </li>
  12451. <li class="inactive current toggle">
  12452. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  12453. <ul class="navL2">
  12454. <li class="inactive current">
  12455. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  12456. </li>
  12457. <li class="inactive">
  12458. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  12459. </li>
  12460. </ul>
  12461. </li>
  12462. <li class="inactive">
  12463. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  12464. </li>
  12465. </ul>
  12466. </nav>
  12467. </div>
  12468. </div>
  12469. </div>
  12470. <div class="right">
  12471. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  12472. <div class="SearchBox">
  12473. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  12474. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  12475. <div id="search-finder" class="search-finder"></div>
  12476. </button>
  12477. <button id="HeaderSearchButton" style="display:none"></button>
  12478. <div id="searchSplitter"></div>
  12479. <div id="searchCloseIcon" class="search-clear-x"></div>
  12480. <div id="searchTextContainer" style="width: 0;">
  12481. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  12482. </div>
  12483. </form>
  12484. </div>
  12485. </div>
  12486. </div>
  12487. </div>
  12488. </div>
  12489. </div>
  12490. </header>
  12491. </div>
  12492. <div class="printExportMenus ltr">
  12493. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh439643(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  12494. Export (<span class="count">0</span>)
  12495. </a>
  12496. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh439643(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  12497. Print
  12498. </a>
  12499. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  12500. </a>
  12501. </div>
  12502. <div class="printExportMenus ltr">
  12503. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  12504. </div>
  12505. <div id="body" ms.pgarea="body">
  12506. <span id="tabletView_large"></span>
  12507. <span id="tabletView_small"></span>
  12508. <span id="mobileView"></span>
  12509. <div id="content" class="content">
  12510. <input type="hidden" id="printForPab" value="true">
  12511. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  12512. <h1 class="title">Minidrivers, Miniport drivers, and driver pairs</h1>
  12513. <div id="mainSection">
  12514. <div class="clsServerSDKContent">
  12515. </div>
  12516. <p></p>
  12517. <p>A minidriver or a miniport driver acts as half of a driver pair. Driver pairs like (miniport, port) can make driver development easier. In a driver pair, one driver handles general tasks that are common to a whole collection of devices, while the other driver handles tasks that are specific to an individual device. The drivers that handle device-specific tasks go by a variety of names, including miniport driver, miniclass driver, and minidriver.</p>
  12518. <p>Microsoft provides the general driver, and typically an independent hardware vendor provides the specific driver. Before you read this topic, you should understand the ideas presented in <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a> and <a href="https://msdn.microsoft.com/en-us/library/hh439638(v=vs.85).aspx">I/O request packets</a>.</p>
  12519. <p>Every kernel-mode driver must implement a function named <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a>, which gets called shortly after the driver is loaded. The <strong>DriverEntry</strong> function fills in certain members of a <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a> structure with pointers to several other functions that the driver implements. For example, the <strong>DriverEntry</strong> function fills in the <strong>Unload</strong> member of the <strong>DRIVER_OBJECT</strong> structure with a pointer to the driver's <a href="https://msdn.microsoft.com/en-us/library/ff564886(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">Unload</em></a> function, as shown in the following diagram.</p><img id="DriverFunctionPointers02" alt="Diagram showing the DRIVER_OBJECT structure with the Unload member" src="./Windows Kernel Development Articles (2016-03-30)_files/IC553387.png" title="Diagram showing the DRIVER_OBJECT structure with the Unload member" xmlns=""><p>The <strong>MajorFunction</strong> member of the <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a> structure is an array of pointers to functions that handle I/O request packets (<a href="https://msdn.microsoft.com/en-us/library/ff550694(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">IRP</strong></a>s), as shown in the following diagram. Typically the driver fills in several members of the <strong>MajorFunction</strong> array with pointers to functions (implemented by the driver) that handle various kinds of IRPs. </p><img id="DriverFunctionPointers03" alt="Diagram showing the DRIVER_OBJECT structure with the MajorFunction member" src="./Windows Kernel Development Articles (2016-03-30)_files/IC553388.png" title="Diagram showing the DRIVER_OBJECT structure with the MajorFunction member" xmlns=""><p>An IRP can be categorized according to its major function code, which is identified by a constant, such as <strong>IRP_MJ_READ</strong>, <strong>IRP_MJ_WRITE</strong>, or <strong>IRP_MJ_PNP</strong>. The constants that identify major function code serve as indices in the <strong>MajorFunction</strong> array. For example, suppose the driver implements a dispatch function to handle IRPs that have the major function code <strong>IRP_MJ_WRITE</strong>. In this case, the driver must fill in the <strong>MajorFunction</strong>[IRP_MJ_WRITE] element of the array with a pointer to the dispatch function.</p>
  12520. <p>Typically the driver fills in some of the elements of the <strong>MajorFunction</strong> array and leaves the remaining elements set to default values provided by the I/O manager. The following example shows how to use the <a href="https://msdn.microsoft.com/en-us/library/ff562408(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">!drvobj</strong></a> debugger extension to inspect the function pointers for the parport driver.</p>
  12521. <div id="code-snippet-1" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  12522. <div class="codeSnippetContainerTabs">
  12523. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  12524. <a></a>
  12525. </div>
  12526. </div>
  12527. <div class="codeSnippetContainerCodeContainer">
  12528. <div class="codeSnippetToolBar"></div>
  12529. <div class="codeSnippetContainerCode" dir="ltr">
  12530. <div style="color:Black;"><pre>0: kd&gt; !drvobj parport 2
  12531. Driver object (fffffa80048d9e70) is for:
  12532. \Driver\Parport
  12533. DriverEntry: fffff880065ea070 parport!GsDriverEntry
  12534. DriverStartIo: 00000000
  12535. DriverUnload: fffff880065e131c parport!PptUnload
  12536. AddDevice: fffff880065d2008 parport!P5AddDevice
  12537. Dispatch routines:
  12538. [00] IRP_MJ_CREATE fffff880065d49d0 parport!PptDispatchCreateOpen
  12539. [01] IRP_MJ_CREATE_NAMED_PIPE fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12540. [02] IRP_MJ_CLOSE fffff880065d4a78 parport!PptDispatchClose
  12541. [03] IRP_MJ_READ fffff880065d4bac parport!PptDispatchRead
  12542. [04] IRP_MJ_WRITE fffff880065d4bac parport!PptDispatchRead
  12543. [05] IRP_MJ_QUERY_INFORMATION fffff880065d4c40 parport!PptDispatchQueryInformation
  12544. [06] IRP_MJ_SET_INFORMATION fffff880065d4ce4 parport!PptDispatchSetInformation
  12545. [07] IRP_MJ_QUERY_EA fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12546. [08] IRP_MJ_SET_EA fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12547. [09] IRP_MJ_FLUSH_BUFFERS fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12548. [0a] IRP_MJ_QUERY_VOLUME_INFORMATION fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12549. [0b] IRP_MJ_SET_VOLUME_INFORMATION fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12550. [0c] IRP_MJ_DIRECTORY_CONTROL fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12551. [0d] IRP_MJ_FILE_SYSTEM_CONTROL fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12552. [0e] IRP_MJ_DEVICE_CONTROL fffff880065d4be8 parport!PptDispatchDeviceControl
  12553. [0f] IRP_MJ_INTERNAL_DEVICE_CONTROL fffff880065d4c24 parport!PptDispatchInternalDeviceControl
  12554. [10] IRP_MJ_SHUTDOWN fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12555. [11] IRP_MJ_LOCK_CONTROL fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12556. [12] IRP_MJ_CLEANUP fffff880065d4af4 parport!PptDispatchCleanup
  12557. [13] IRP_MJ_CREATE_MAILSLOT fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12558. [14] IRP_MJ_QUERY_SECURITY fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12559. [15] IRP_MJ_SET_SECURITY fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12560. [16] IRP_MJ_POWER fffff880065d491c parport!PptDispatchPower
  12561. [17] IRP_MJ_SYSTEM_CONTROL fffff880065d4d4c parport!PptDispatchSystemControl
  12562. [18] IRP_MJ_DEVICE_CHANGE fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12563. [19] IRP_MJ_QUERY_QUOTA fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12564. [1a] IRP_MJ_SET_QUOTA fffff80001b6ecd4 nt!IopInvalidDeviceRequest
  12565. [1b] IRP_MJ_PNP fffff880065d4840 parport!PptDispatchPnp
  12566. </pre></div>
  12567. </div>
  12568. </div>
  12569. </div>
  12570. <p>In the debugger output, you can see that parport.sys implements <strong>GsDriverEntry</strong>, the entry point for the driver. <strong>GsDriverEntry</strong>, which was generated automatically when the driver was built, performs some initialization and then calls <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a>, which was implemented by the driver developer.</p>
  12571. <p>You can also see that the parport driver (in its <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a> function) provides pointers to dispatch functions for these major function codes:</p>
  12572. <ul>
  12573. <li>IRP_MJ_CREATE</li>
  12574. <li>IRP_MJ_CLOSE</li>
  12575. <li>IRP_MJ_READ</li>
  12576. <li>IRP_MJ_WRITE</li>
  12577. <li>IRP_MJ_QUERY_INFORMATION</li>
  12578. <li>IRP_MJ_SET_INFORMATION</li>
  12579. <li>IRP_MJ_DEVICE_CONTROL</li>
  12580. <li>IRP_MJ_INTERNAL_DEVICE_CONTROL</li>
  12581. <li>IRP_MJ_CLEANUP</li>
  12582. <li>IRP_MJ_POWER</li>
  12583. <li>IRP_MJ_SYSTEM_CONTROL</li>
  12584. <li>IRP_MJ_PNP</li>
  12585. </ul>
  12586. <p>The remaining elements of the <strong>MajorFunction</strong> array hold pointers to the default dispatch function <strong>nt!IopInvalidDeviceRequest</strong>.</p>
  12587. <p>In the debugger output, you can see that the parport driver provided function pointers for <a href="https://msdn.microsoft.com/en-us/library/ff564886(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">Unload</em></a> and <a href="https://msdn.microsoft.com/en-us/library/ff540521(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">AddDevice</em></a>, but did not provide a function pointer for <a href="https://msdn.microsoft.com/en-us/library/ff563858(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">StartIo</em></a>. The <em>AddDevice</em> function is unusual because its function pointer is not stored in the <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a> structure. Instead, it is stored in the <strong>AddDevice</strong> member of an extension to the <strong>DRIVER_OBJECT</strong> structure. The following diagram illustrates the function pointers that the parport driver provided in its <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a> function. The function pointers provided by parport are shaded.</p><img id="DriverFunctionPointers01" alt="Diagram of function pointers in a DRIVER_OBJECT structure" src="./Windows Kernel Development Articles (2016-03-30)_files/IC553389.png" title="Diagram of function pointers in a DRIVER_OBJECT structure" xmlns=""><h2><a id="Making_it_easier_by_using_driver_pairs"></a><a id="making_it_easier_by_using_driver_pairs"></a><a id="MAKING_IT_EASIER_BY_USING_DRIVER_PAIRS"></a>Making it easier by using driver pairs</h2>
  12588. <p>Over a period of time, as driver developers inside and outside of Microsoft gained experience with the Windows Driver Model (WDM), they realized a couple of things about dispatch functions:</p>
  12589. <ul>
  12590. <li>Dispatch functions are largely boilerplate. For example, much of the code in the dispatch function for IRP_MJ_PNP is the same for all drivers. It is only a small portion of the Plug and Play (PnP) code that is specific to an individual driver that controls an individual piece of hardware.</li>
  12591. <li>Dispatch functions are complicated and difficult to get right. Implementing features like thread synchronization, IRP queuing, and IRP cancellation is challenging and requires a deep understanding of how the operating system works.</li>
  12592. </ul>
  12593. <p>To make things easier for driver developers, Microsoft created several technology-specific driver models. At first glance, the technology-specific models seem quite different from each other, but a closer look reveals that many of them are based on this paradigm:</p>
  12594. <ul>
  12595. <li>The driver is split into two pieces: one that handles the general processing and one that handles processing specific to a particular device.</li>
  12596. <li>The general piece is written by Microsoft.</li>
  12597. <li>The specific piece may be written by Microsoft or an independent hardware vendor.</li>
  12598. </ul>
  12599. <p>Suppose that the Proseware and Contoso companies both make a toy robot that requires a WDM driver. Also suppose that Microsoft provides a General Robot Driver called GeneralRobot.sys. Proseware and Contoso can each write small drivers that handle the requirements of their specific robots. For example, Proseware could write ProsewareRobot.sys, and the pair of drivers (ProsewareRobot.sys, GeneralRobot.sys) could be combined to form a single WDM driver. Likewise, the pair of drivers (ContosoRobot.sys, GeneralRobot.sys) could combine to form a single WDM driver. In its most general form, the idea is that you can create drivers by using (specific.sys, general.sys) pairs.</p>
  12600. <h2><a id="Function_pointers_in_driver_pairs"></a><a id="function_pointers_in_driver_pairs"></a><a id="FUNCTION_POINTERS_IN_DRIVER_PAIRS"></a>Function pointers in driver pairs</h2>
  12601. <p> In a (specific.sys, general.sys) pair, Windows loads specific.sys and calls its <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a> function. The <strong>DriverEntry</strong> function of specific.sys receives a pointer to a <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a> structure. Normally you would expect <strong>DriverEntry</strong> to fill in several elements of the <strong>MajorFunction</strong> array with pointers to dispatch functions. Also you would expect <strong>DriverEntry</strong> to fill in the <strong>Unload</strong> member (and possibly the <strong>StartIo</strong> member) of the <strong>DRIVER_OBJECT</strong> structure and the <strong>AddDevice</strong> member of the driver object extension. However, in a driver pair model, <strong>DriverEntry</strong> does not necessarily do this. Instead the <strong>DriverEntry</strong> function of specific.sys passes the <strong>DRIVER_OBJECT</strong> structure along to an initialization function implemented by general.sys. The following code example shows how the initialization function might be called in the (ProsewareRobot.sys, GeneralRobot.sys) pair.</p>
  12602. <div id="code-snippet-2" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  12603. <div class="codeSnippetContainerTabs">
  12604. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  12605. <a>C++</a>
  12606. </div>
  12607. </div>
  12608. <div class="codeSnippetContainerCodeContainer">
  12609. <div class="codeSnippetToolBar"></div>
  12610. <div class="codeSnippetContainerCode" dir="ltr">
  12611. <div style="color:Black;"><pre>
  12612. PVOID g_ProsewareRobottCallbacks[3] = {DeviceControlCallback, PnpCallback, PowerCallback};
  12613. <span style="color:Green;">// DriverEntry function in ProsewareRobot.sys</span>
  12614. NTSTATUS DriverEntry (DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath)
  12615. {
  12616. <span style="color:Green;">// Call the initialization function implemented by GeneralRobot.sys.</span>
  12617. <span style="color:Blue;">return</span> GeneralRobotInit(DriverObject, RegistryPath, g_ProsewareRobottCallbacks);
  12618. }
  12619. </pre></div>
  12620. </div>
  12621. </div>
  12622. </div>
  12623. <p>The initialization function in GeneralRobot.sys writes function pointers to the appropriate members of the <a href="https://msdn.microsoft.com/en-us/library/ff544174(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DRIVER_OBJECT</strong></a> structure (and its extension) and the appropriate elements of the <strong>MajorFunction</strong> array. The idea is that when the I/O manager sends an IRP to the driver pair, the IRP goes first to a dispatch function implemented by GeneralRobot.sys. If GeneralRobot.sys can handle the IRP on its own, then the specific driver, ProsewareRobot.sys, does not have to be involved. If GeneralRobot.sys can handle some, but not all, of the IRP processing, it gets help from one of the callback functions implemented by ProsewareRobot.sys. GeneralRobot.sys receives pointers to the ProsewareRobot callbacks in the GeneralRobotInit call.</p>
  12624. <p>At some point after <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a> returns, a device stack gets constructed for the Proseware Robot device node. The device stack might look like this.</p><img id="driverpairs01" alt="Diagram of the Proseware Robot device node, showing three device objects in the device stack: AfterThought.sys (Filter DO), ProsewareRobot.sys, GeneralRobot.sys (FDO), and Pci.sys (PDO)" src="./Windows Kernel Development Articles (2016-03-30)_files/IC553390.png" title="Diagram of the Proseware Robot device node, showing three device objects in the device stack: AfterThought.sys (Filter DO), ProsewareRobot.sys, GeneralRobot.sys (FDO), and Pci.sys (PDO)" xmlns=""><p>As shown in the preceding diagram, the device stack for Proseware Robot has three device objects. The top device object is a filter device object (Filter DO) associated with the filter driver AfterThought.sys. The middle device object is a functional device object (FDO) associated with the driver pair (ProsewareRobot.sys, GeneralRobot.sys). The driver pair serves as the function driver for the device stack. The bottom device object is a physical device object (PDO) associated with Pci.sys.</p>
  12625. <p>Notice that the driver pair occupies only one level in the device stack and is associated with only one device object: the FDO. When GeneralRobot.sys processes an IRP, it might call ProsewareRobot.sys for assistance, but that is not the same as passing the request down the device stack. The driver pair forms a single WDM driver that is at one level in the device stack. The driver pair either completes the IRP or passes it down the device stack to the PDO, which is associated with Pci.sys.</p>
  12626. <h2><a id="Example_of_a_driver_pair"></a><a id="example_of_a_driver_pair"></a><a id="EXAMPLE_OF_A_DRIVER_PAIR"></a>Example of a driver pair</h2>
  12627. <p>Suppose you have a wireless network card in your laptop computer, and by looking in Device Manager, you determine that netwlv64.sys is the driver for the network card. You can use the <a href="https://msdn.microsoft.com/en-us/library/ff562408(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">!drvobj</strong></a> debugger extension to inspect the function pointers for netwlv64.sys.</p>
  12628. <div id="code-snippet-3" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  12629. <div class="codeSnippetContainerTabs">
  12630. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  12631. <a></a>
  12632. </div>
  12633. </div>
  12634. <div class="codeSnippetContainerCodeContainer">
  12635. <div class="codeSnippetToolBar"></div>
  12636. <div class="codeSnippetContainerCode" dir="ltr">
  12637. <div style="color:Black;"><pre>1: kd&gt; !drvobj netwlv64 2
  12638. Driver object (fffffa8002e5f420) is for:
  12639. \Driver\netwlv64
  12640. DriverEntry: fffff8800482f064 netwlv64!GsDriverEntry
  12641. DriverStartIo: 00000000
  12642. DriverUnload: fffff8800195c5f4 ndis!ndisMUnloadEx
  12643. AddDevice: fffff88001940d30 ndis!ndisPnPAddDevice
  12644. Dispatch routines:
  12645. [00] IRP_MJ_CREATE fffff880018b5530 ndis!ndisCreateIrpHandler
  12646. [01] IRP_MJ_CREATE_NAMED_PIPE fffff88001936f00 ndis!ndisDummyIrpHandler
  12647. [02] IRP_MJ_CLOSE fffff880018b5870 ndis!ndisCloseIrpHandler
  12648. [03] IRP_MJ_READ fffff88001936f00 ndis!ndisDummyIrpHandler
  12649. [04] IRP_MJ_WRITE fffff88001936f00 ndis!ndisDummyIrpHandler
  12650. [05] IRP_MJ_QUERY_INFORMATION fffff88001936f00 ndis!ndisDummyIrpHandler
  12651. [06] IRP_MJ_SET_INFORMATION fffff88001936f00 ndis!ndisDummyIrpHandler
  12652. [07] IRP_MJ_QUERY_EA fffff88001936f00 ndis!ndisDummyIrpHandler
  12653. [08] IRP_MJ_SET_EA fffff88001936f00 ndis!ndisDummyIrpHandler
  12654. [09] IRP_MJ_FLUSH_BUFFERS fffff88001936f00 ndis!ndisDummyIrpHandler
  12655. [0a] IRP_MJ_QUERY_VOLUME_INFORMATION fffff88001936f00 ndis!ndisDummyIrpHandler
  12656. [0b] IRP_MJ_SET_VOLUME_INFORMATION fffff88001936f00 ndis!ndisDummyIrpHandler
  12657. [0c] IRP_MJ_DIRECTORY_CONTROL fffff88001936f00 ndis!ndisDummyIrpHandler
  12658. [0d] IRP_MJ_FILE_SYSTEM_CONTROL fffff88001936f00 ndis!ndisDummyIrpHandler
  12659. [0e] IRP_MJ_DEVICE_CONTROL fffff8800193696c ndis!ndisDeviceControlIrpHandler
  12660. [0f] IRP_MJ_INTERNAL_DEVICE_CONTROL fffff880018f9114 ndis!ndisDeviceInternalIrpDispatch
  12661. [10] IRP_MJ_SHUTDOWN fffff88001936f00 ndis!ndisDummyIrpHandler
  12662. [11] IRP_MJ_LOCK_CONTROL fffff88001936f00 ndis!ndisDummyIrpHandler
  12663. [12] IRP_MJ_CLEANUP fffff88001936f00 ndis!ndisDummyIrpHandler
  12664. [13] IRP_MJ_CREATE_MAILSLOT fffff88001936f00 ndis!ndisDummyIrpHandler
  12665. [14] IRP_MJ_QUERY_SECURITY fffff88001936f00 ndis!ndisDummyIrpHandler
  12666. [15] IRP_MJ_SET_SECURITY fffff88001936f00 ndis!ndisDummyIrpHandler
  12667. [16] IRP_MJ_POWER fffff880018c35e8 ndis!ndisPowerDispatch
  12668. [17] IRP_MJ_SYSTEM_CONTROL fffff880019392c8 ndis!ndisWMIDispatch
  12669. [18] IRP_MJ_DEVICE_CHANGE fffff88001936f00 ndis!ndisDummyIrpHandler
  12670. [19] IRP_MJ_QUERY_QUOTA fffff88001936f00 ndis!ndisDummyIrpHandler
  12671. [1a] IRP_MJ_SET_QUOTA fffff88001936f00 ndis!ndisDummyIrpHandler
  12672. [1b] IRP_MJ_PNP fffff8800193e518 ndis!ndisPnPDispatch
  12673. </pre></div>
  12674. </div>
  12675. </div>
  12676. </div>
  12677. <p>In the debugger output, you can see that netwlv64.sys implements <strong>GsDriverEntry</strong>, the entry point for the driver. <strong>GsDriverEntry</strong>, which was automatically generated when the driver was built, performs some initialization and then calls <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a>, which was written by the driver developer.</p>
  12678. <p>In this example, netwlv64.sys implements <a href="https://msdn.microsoft.com/en-us/library/ff544113(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">DriverEntry</strong></a>, but ndis.sys implements <a href="https://msdn.microsoft.com/en-us/library/ff540521(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">AddDevice</em></a>, <a href="https://msdn.microsoft.com/en-us/library/ff564886(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">Unload</em></a>, and several dispatch functions. Netwlv64.sys is called an NDIS miniport driver, and ndis.sys is called the NDIS Library. Together, the two modules form an (NDIS miniport, NDIS Library) pair.</p>
  12679. <p>This diagram shows the device stack for the wireless network card. Notice that the driver pair (netwlv64.sys, ndis.sys) occupies only one level in the device stack and is associated with only one device object: the FDO.</p><img id="DriverPairs02A" alt="Diagram of the Wireless network card device stack, showing Netwlv64.sys, ndis.sys as the driver pair associated with the FDO and Pci.sys associated with the PDO " src="./Windows Kernel Development Articles (2016-03-30)_files/IC559049.png" title="Diagram of the Wireless network card device stack, showing Netwlv64.sys, ndis.sys as the driver pair associated with the FDO and Pci.sys associated with the PDO " xmlns=""><h2><a id="Available_driver_pairs"></a><a id="available_driver_pairs"></a><a id="AVAILABLE_DRIVER_PAIRS"></a>Available driver pairs</h2>
  12680. <p>The different technology-specific driver models use a variety of names for the specific and general pieces of a driver pair. In many cases, the specific portion of the pair has the prefix "mini." Here are some of (specific, general) pairs that are available:</p><ul>
  12681. <li>(display miniport driver, display port driver)</li>
  12682. <li>(audio miniport driver, audio port driver)</li>
  12683. <li>(storage miniport driver, storage port driver)</li>
  12684. <li>(battery miniclass driver, battery class driver)</li>
  12685. <li>(HID minidriver, HID class driver)</li>
  12686. <li>(changer miniclass driver, changer port driver)</li>
  12687. <li>(NDIS miniport driver, NDIS library)</li>
  12688. </ul>
  12689. <div class="alert"><strong>Note</strong>&nbsp;&nbsp;As you can see in the list, several of the models use the term <em>class driver</em> for the general portion of a driver pair. This kind of class driver is different from a standalone class driver and different from a class filter driver.</div>
  12690. <div>&nbsp;</div>
  12691. <h2><a id="related_topics"></a>Related topics</h2>
  12692. <dl>
  12693. <dt>
  12694. <a href="https://msdn.microsoft.com/en-us/library/ff554731(v=vs.85).aspx">Concepts for all driver developers</a>
  12695. </dt>
  12696. <dt>
  12697. <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a>
  12698. </dt>
  12699. <dt>
  12700. <a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx">Driver stacks</a>
  12701. </dt>
  12702. </dl>
  12703. <p>&nbsp;</p>
  12704. <p>&nbsp;</p>
  12705. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Minidrivers,%20Miniport%20drivers,%20and%20driver%20pairs%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  12706. </div>
  12707. </div>
  12708. </div>
  12709. </div>
  12710. <div class="clear"></div>
  12711. <input name="__RequestVerificationToken" type="hidden" value="eNww8qJ7BN5NFgQqwVE-mt2pS3RHPxGr7WTykowvQUo3DQicFiNb0BfsZFXOx2-U1S7RY6Pi-r6cQmjfmIWj4oGVs0E1">
  12712. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh439643(d=printer,v=vs.85).aspx">
  12713. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh439643(d=printer,v=vs.85).aspx">
  12714. <input id="isTopicRated" type="hidden" value="false">
  12715. <div id="lib-footer" ms.pgarea="body">
  12716. <link type="text/css" rel="stylesheet">
  12717. <div id="ux-footer" class="" style="" dir="ltr">
  12718. <div id="footerSock" class="librarySock both">
  12719. <div id="footerSockInner">
  12720. <a name="feedback"></a>
  12721. <div class="rating">
  12722. <div id="ratingSection1">
  12723. <div class="title">
  12724. Was this page helpful?
  12725. </div>
  12726. <div class="description">
  12727. Your feedback about this content is important.<br>Let us know what you think.
  12728. </div>
  12729. <div class="buttons">
  12730. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  12731. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  12732. </div>
  12733. <input id="ratingValue" type="hidden" value="">
  12734. </div>
  12735. <div id="ratingSection2">
  12736. <div class="title left">
  12737. Additional feedback?
  12738. </div>
  12739. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  12740. <div class="right">
  12741. <div class="counter">
  12742. <span id="feedbackTextCounter">1500</span> characters remaining
  12743. </div>
  12744. <div class="buttons">
  12745. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  12746. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  12747. </div>
  12748. </div>
  12749. </div>
  12750. <div id="ratingSection3">
  12751. <div class="title">
  12752. Thank you!
  12753. </div>
  12754. <div class="description">
  12755. We appreciate your feedback.
  12756. </div>
  12757. </div>
  12758. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  12759. </div>
  12760. <div class="userVoice">
  12761. <div class="title">
  12762. Help us improve MSDN.
  12763. </div>
  12764. <div class="description">
  12765. Visit our UserVoice Page to submit and vote on ideas!
  12766. </div>
  12767. <div class="buttons">
  12768. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  12769. </div>
  12770. </div>
  12771. <div class="clear"></div>
  12772. </div>
  12773. </div>
  12774. <footer class="top">
  12775. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  12776. <div class="linkList">
  12777. <div class="linkListTitle">Dev centers</div>
  12778. <ul class="links">
  12779. <li>
  12780. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  12781. </li>
  12782. <li>
  12783. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  12784. </li>
  12785. <li>
  12786. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  12787. </li>
  12788. <li>
  12789. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  12790. </li>
  12791. <li>
  12792. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  12793. </li>
  12794. </ul>
  12795. </div>
  12796. </div>
  12797. <div id="rightLinks">
  12798. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  12799. <div class="linkList">
  12800. <div class="linkListTitle">Learning resources</div>
  12801. <ul class="links">
  12802. <li>
  12803. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  12804. </li>
  12805. <li>
  12806. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  12807. </li>
  12808. <li>
  12809. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  12810. </li>
  12811. </ul>
  12812. </div>
  12813. </div>
  12814. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  12815. <div class="linkList">
  12816. <div class="linkListTitle">Community</div>
  12817. <ul class="links">
  12818. <li>
  12819. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  12820. </li>
  12821. <li>
  12822. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  12823. </li>
  12824. <li>
  12825. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  12826. </li>
  12827. </ul>
  12828. </div>
  12829. </div>
  12830. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  12831. <div class="linkList">
  12832. <div class="linkListTitle">Support</div>
  12833. <ul class="links">
  12834. <li>
  12835. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  12836. </li>
  12837. </ul>
  12838. </div>
  12839. </div>
  12840. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  12841. <div class="linkList">
  12842. <div class="linkListTitle">Programs</div>
  12843. <ul class="links">
  12844. <li>
  12845. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  12846. </li>
  12847. <li>
  12848. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  12849. </li>
  12850. <li>
  12851. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  12852. </li>
  12853. </ul>
  12854. </div>
  12855. </div>
  12856. </div>
  12857. </footer>
  12858. <footer class="bottom">
  12859. <span class="localeContainer">
  12860. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  12861. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh439643(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  12862. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  12863. </form>
  12864. </span>
  12865. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  12866. <div class="linkList">
  12867. <ul class="links horizontal">
  12868. <li>
  12869. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  12870. </li>
  12871. <li>
  12872. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  12873. </li>
  12874. <li>
  12875. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  12876. </li>
  12877. <li>
  12878. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  12879. </li>
  12880. </ul>
  12881. </div>
  12882. </div>
  12883. <span class="logoLegal">
  12884. <span class="logo"></span>
  12885. <span class="copyright">© 2016 Microsoft</span>
  12886. </span>
  12887. </footer>
  12888. </div>
  12889. </div>
  12890. <div class="footerPrintView">
  12891. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  12892. </div>
  12893. <input id="tocPaddingPerLevel" type="hidden" value="17">
  12894. <input id="MtpsDevice" type="hidden" value="Printer">
  12895. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  12896. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  12897. <div id="globalRequestVerification">
  12898. <input name="__RequestVerificationToken" type="hidden" value="B7B4KE1u9EB0CZGVIHJUVX-cgY6GLPyhKnM6U3-QvD2UQ1F7KqckdXsd2_Weu3yWuifgyn0Mam79T7HEPAM9dycouf01">
  12899. </div>
  12900. </div>
  12901. <script type="text/javascript" class="mtps-injected">
  12902. /*<![CDATA[*/
  12903. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  12904. MTPS.injectScripts([
  12905. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  12906. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh439643(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  12907. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  12908. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  12909. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  12910. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  12911. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  12912. ]);
  12913. /*]]>*/
  12914. </script>
  12915. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  12916. <div id="page">
  12917. <link type="text/css" rel="stylesheet">
  12918. <input type="hidden" id="isHeaderBleeding" value="true">
  12919. <div id="ux-header" dir="ltr" class="ltr msdn">
  12920. <header>
  12921. <span id="singleCol"></span>
  12922. <span id="doubleCol"></span>
  12923. <span id="isMobile"></span>
  12924. <div>
  12925. <div class="row topRow">
  12926. <div class="top">
  12927. <div class="left">
  12928. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  12929. <div id="msft-logo" class="msft-logo"></div>
  12930. </a>
  12931. <div class="GrayPipe"></div>
  12932. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  12933. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  12934. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  12935. </div>
  12936. <div class="right">
  12937. <div id="signIn">
  12938. <div class="profileImage"></div>
  12939. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376420&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706279%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  12940. <div class="auxNav">
  12941. <div>
  12942. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  12943. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  12944. </div>
  12945. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  12946. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  12947. </div>
  12948. </div>
  12949. <div>
  12950. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  12951. <div class="linkList">
  12952. <ul class="links horizontal">
  12953. <li>
  12954. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  12955. </li>
  12956. <li>
  12957. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  12958. </li>
  12959. <li>
  12960. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  12961. </li>
  12962. </ul>
  12963. </div>
  12964. </div>
  12965. </div>
  12966. </div>
  12967. </div>
  12968. </div>
  12969. </div>
  12970. <div class="row middleRow">
  12971. <div class="expandTop">
  12972. <div class="left"></div>
  12973. <div class="right"></div>
  12974. </div>
  12975. </div>
  12976. </div>
  12977. <div id="buttomRowWrapper" class="bg_default">
  12978. <div class="row buttomRow bg_default">
  12979. <div class="bottom">
  12980. <div class="left">
  12981. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  12982. <div id="drawer">
  12983. <div class="toc">
  12984. <nav>
  12985. <ul class="navL1">
  12986. <li class="inactive toggle">
  12987. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  12988. <ul class="navL2">
  12989. <li class="inactive">
  12990. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  12991. </li>
  12992. <li class="inactive">
  12993. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  12994. </li>
  12995. <li class="inactive">
  12996. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  12997. </li>
  12998. <li class="inactive">
  12999. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  13000. </li>
  13001. <li class="inactive">
  13002. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  13003. </li>
  13004. <li class="inactive">
  13005. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  13006. </li>
  13007. </ul>
  13008. </li>
  13009. <li class="inactive toggle">
  13010. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  13011. <ul class="navL2">
  13012. <li class="inactive">
  13013. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  13014. </li>
  13015. <li class="inactive">
  13016. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  13017. </li>
  13018. <li class="inactive">
  13019. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  13020. </li>
  13021. <li class="inactive toggle">
  13022. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  13023. <ul class="navL3">
  13024. <li class="inactive">
  13025. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  13026. </li>
  13027. <li class="inactive">
  13028. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  13029. </li>
  13030. <li class="inactive">
  13031. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  13032. </li>
  13033. <li class="inactive">
  13034. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  13035. </li>
  13036. <li class="inactive">
  13037. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  13038. </li>
  13039. </ul>
  13040. </li>
  13041. </ul>
  13042. </li>
  13043. <li class="inactive toggle">
  13044. <a href="javascript:void(0)" title="Programs">Programs</a>
  13045. <ul class="navL2">
  13046. <li class="inactive toggle">
  13047. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  13048. <ul class="navL3">
  13049. <li class="inactive">
  13050. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  13051. </li>
  13052. <li class="inactive">
  13053. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  13054. </li>
  13055. <li class="inactive">
  13056. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  13057. </li>
  13058. </ul>
  13059. </li>
  13060. <li class="inactive toggle">
  13061. <a href="javascript:void(0)" title="Students">Students</a>
  13062. <ul class="navL3">
  13063. <li class="inactive">
  13064. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  13065. </li>
  13066. <li class="inactive">
  13067. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  13068. </li>
  13069. </ul>
  13070. </li>
  13071. <li class="inactive toggle">
  13072. <a href="javascript:void(0)" title="Architects">Architects</a>
  13073. <ul class="navL3">
  13074. <li class="inactive">
  13075. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  13076. </li>
  13077. <li class="inactive">
  13078. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  13079. </li>
  13080. <li class="inactive">
  13081. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  13082. </li>
  13083. <li class="inactive">
  13084. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  13085. </li>
  13086. <li class="inactive">
  13087. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  13088. </li>
  13089. </ul>
  13090. </li>
  13091. <li class="inactive">
  13092. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  13093. </li>
  13094. <li class="inactive">
  13095. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  13096. </li>
  13097. <li class="inactive">
  13098. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  13099. </li>
  13100. <li class="inactive">
  13101. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  13102. </li>
  13103. </ul>
  13104. </li>
  13105. <li class="inactive toggle">
  13106. <a href="javascript:void(0)" title="Community">Community</a>
  13107. <ul class="navL2">
  13108. <li class="inactive">
  13109. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  13110. </li>
  13111. <li class="inactive">
  13112. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  13113. </li>
  13114. <li class="inactive">
  13115. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  13116. </li>
  13117. <li class="inactive">
  13118. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  13119. </li>
  13120. <li class="inactive">
  13121. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  13122. </li>
  13123. </ul>
  13124. </li>
  13125. <li class="inactive current toggle">
  13126. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  13127. <ul class="navL2">
  13128. <li class="inactive current">
  13129. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  13130. </li>
  13131. <li class="inactive">
  13132. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  13133. </li>
  13134. </ul>
  13135. </li>
  13136. <li class="inactive">
  13137. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  13138. </li>
  13139. </ul>
  13140. </nav>
  13141. </div>
  13142. </div>
  13143. </div>
  13144. <div class="right">
  13145. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  13146. <div class="SearchBox">
  13147. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  13148. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  13149. <div id="search-finder" class="search-finder"></div>
  13150. </button>
  13151. <button id="HeaderSearchButton" style="display:none"></button>
  13152. <div id="searchSplitter"></div>
  13153. <div id="searchCloseIcon" class="search-clear-x"></div>
  13154. <div id="searchTextContainer" style="width: 0;">
  13155. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  13156. </div>
  13157. </form>
  13158. </div>
  13159. </div>
  13160. </div>
  13161. </div>
  13162. </div>
  13163. </div>
  13164. </header>
  13165. </div>
  13166. <div class="printExportMenus ltr">
  13167. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh706279(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  13168. Export (<span class="count">0</span>)
  13169. </a>
  13170. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh706279(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  13171. Print
  13172. </a>
  13173. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  13174. </a>
  13175. </div>
  13176. <div class="printExportMenus ltr">
  13177. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  13178. </div>
  13179. <div id="body" ms.pgarea="body">
  13180. <span id="tabletView_large"></span>
  13181. <span id="tabletView_small"></span>
  13182. <span id="mobileView"></span>
  13183. <div id="content" class="content">
  13184. <input type="hidden" id="printForPab" value="true">
  13185. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  13186. <h1 class="title">KMDF as a generic driver pair model</h1>
  13187. <div id="mainSection">
  13188. <div class="clsServerSDKContent">
  13189. </div>
  13190. <p>In this topic, we discuss the idea that the Kernel Mode Driver Framework can be viewed as a generic driver pair model. Before you read this topic, you should understand the ideas presented in <a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx">Minidrivers and driver pairs</a>.</p>
  13191. <p>Over the years, Microsoft has created several technology-specific driver models that use this paradigm:</p>
  13192. <ul>
  13193. <li>The driver is split into two pieces: one that handles general processing and one that handles processing that is specific to a particular device.</li>
  13194. <li>The general piece, called the Framework, is written by Microsoft.</li>
  13195. <li>The specific piece, called the KMDF driver, may be written by Microsoft or an independent hardware vendor.</li>
  13196. </ul><img id="kmdfdriverpair" alt="Diagram of KMDF as a Generic Driver Pair" src="./Windows Kernel Development Articles (2016-03-30)_files/IC831360.png" title="Diagram of KMDF as a Generic Driver Pair" xmlns=""><p>The Framework portion of the driver pair performs general tasks that are common to a wide variety of drivers. For example, the Framework can handle I/O request queues, thread synchronization, and a large portion of the power management duties.</p>
  13197. <p>The Framework owns the dispatch table for the KMDF driver, so when someone sends an I/O request packet (IRP) to the (KMDF driver, Framework) pair, the IRP goes to Framework. If the Framework can handle the IRP by itself, the KMDF driver is not involved. If the Framework cannot handle the IRP by itself, it gets help by calling event handlers implemented by the KMDF driver. Here are some examples of event handlers that might be implemented by a KMDF driver.</p>
  13198. <ul>
  13199. <li>
  13200. <a href="https://msdn.microsoft.com/en-us/library/ff540880(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtDevicePrepareHardware</em></a>
  13201. </li>
  13202. <li>
  13203. <a href="https://msdn.microsoft.com/en-us/library/ff541776(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtIoRead</em></a>
  13204. </li>
  13205. <li>
  13206. <a href="https://msdn.microsoft.com/en-us/library/ff541758(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtIoDeviceControl</em></a>
  13207. </li>
  13208. <li>
  13209. <a href="https://msdn.microsoft.com/en-us/library/ff541735(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtInterruptIsr</em></a>
  13210. </li>
  13211. <li>
  13212. <a href="https://msdn.microsoft.com/en-us/library/ff541721(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtInterruptDpc</em></a>
  13213. </li>
  13214. <li>
  13215. <a href="https://msdn.microsoft.com/en-us/library/ff540874(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">EvtDevicePnpStateChange</em></a>
  13216. </li>
  13217. </ul>
  13218. <p>For example, a USB 2.0 host controller driver has a specific piece named usbehci.sys and a general piece named usbport.sys. Usbehci.sys, which is called the USB 2.0 Miniport driver, has code that is specific to USB 2.0 host controllers. Usbport.sys, which is called the USB Port driver, has general code that applies to both USB 2.0 and USB 1.0. The pair of drivers (usbehci.sys, usbport.sys) combine to form a single WDM driver for a USB 2.0 host controller.</p>
  13219. <p> The (specific, general) driver pairs have a variety of names across different device technologies. Most of the device-specific drivers have the prefix <em>mini</em>. The general drivers are often called port or class drivers. Here are some examples of (specific, general) pairs:</p>
  13220. <ul>
  13221. <li>(display miniport driver, display port driver)</li>
  13222. <li>(USB miniport driver, USB port driver)</li>
  13223. <li>(battery miniclass driver, battery class driver)</li>
  13224. <li>(HID minidriver, HID class driver)</li>
  13225. <li>(storage miniport driver, storage port driver)</li>
  13226. </ul>
  13227. <p>As more and more driver pair models were developed, it became difficult to keep track of all the different ways to write a driver. Each model has it's own interface for communication between the device-specific driver and the general driver. The body of knowledge required to develop drivers for one device technology (for example, Audio) can be quite different from the body of knowledge required to develop drivers for another device technology (for example, Storage).</p>
  13228. <p>Over time, developers realized that it would be good to have a single unified model for kernel-mode driver pairs. The Kernel Mode Driver Framework (KMDF), which was first available in Windows Vista, fulfills that need. A driver based on KMDF uses a paradigm that is similar to many of the technology-specific driver pair models.</p>
  13229. <ul>
  13230. <li>The driver is split into two pieces: one that handles general processing and one that handles processing that is specific to a particular device.</li>
  13231. <li>The general piece, which is written by Microsoft, is called the Framework.</li>
  13232. <li>The specific piece, which is written by Microsoft or an independent hardware vendor, is called the KMDF driver.</li>
  13233. </ul>
  13234. <p>The USB 3.0 host controller driver is an example of a driver based on KMDF. In this example, both drivers in the pair are written by Microsoft. The general driver is the Framework, and the device-specific driver is the USB 3.0 Host Controller Driver. This diagram illustrates the device node and device stack for a USB 3.0 host controller.</p><img id="KmdfAsPair01" alt="Diagram of device stack for USB 3 host controller" src="./Windows Kernel Development Articles (2016-03-30)_files/IC554550.png" title="Diagram of device stack for USB 3 host controller" xmlns=""><p>In the diagram, Usbxhci.sys is the USB 3.0 host controller driver. It is paired with Wdf01000.sys, which is the Framework. The (usbxhci.sys, wdf01000.sys) pair forms a single WDM driver that serves as the function driver for the USB 3.0 host controller. Notice that the driver pair occupies one level in the device stack and is represented by single device object. The single device object that represents the (usbxhci.sys, wdf01000.sys) pair is the functional device object (FDO) for the USB 3.0 host controller. </p>
  13235. <p>In a (KMDF driver, Framework) pair, the Framework handles tasks that are common to a wide variety of kernel-mode drivers. For example, the Framework can handle queuing of I/O requests, thread synchronization, most of the Plug and Play tasks, and most of the power management tasks. The KMDF driver handles tasks that require interaction with a specific device. The KMDF driver participates in processing requests by registering event handlers that the Framework calls as needed.</p>
  13236. <h2><a id="related_topics"></a>Related topics</h2>
  13237. <dl>
  13238. <dt>
  13239. <a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx">Minidrivers and driver pairs</a>
  13240. </dt>
  13241. <dt>
  13242. <a href="https://msdn.microsoft.com/en-us/library/ff544396(v=vs.85).aspx">Kernel-Mode Driver Framework</a>
  13243. </dt>
  13244. </dl>
  13245. <p>&nbsp;</p>
  13246. <p>&nbsp;</p>
  13247. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20KMDF%20as%20a%20generic%20driver%20pair%20model%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  13248. </div>
  13249. </div>
  13250. </div>
  13251. </div>
  13252. <div class="clear"></div>
  13253. <input name="__RequestVerificationToken" type="hidden" value="vqpb_ePFce_gqaGhRlYFC089bA4cLLWO3ggyM1AjukNO7ZM7sVMg4MXPw8Jtllo8pYojkZBFliwDknTcQnMlXvG4w0k1">
  13254. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh706279(d=printer,v=vs.85).aspx">
  13255. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh706279(d=printer,v=vs.85).aspx">
  13256. <input id="isTopicRated" type="hidden" value="false">
  13257. <div id="lib-footer" ms.pgarea="body">
  13258. <link type="text/css" rel="stylesheet">
  13259. <div id="ux-footer" class="" style="" dir="ltr">
  13260. <div id="footerSock" class="librarySock both">
  13261. <div id="footerSockInner">
  13262. <a name="feedback"></a>
  13263. <div class="rating">
  13264. <div id="ratingSection1">
  13265. <div class="title">
  13266. Was this page helpful?
  13267. </div>
  13268. <div class="description">
  13269. Your feedback about this content is important.<br>Let us know what you think.
  13270. </div>
  13271. <div class="buttons">
  13272. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  13273. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  13274. </div>
  13275. <input id="ratingValue" type="hidden" value="">
  13276. </div>
  13277. <div id="ratingSection2">
  13278. <div class="title left">
  13279. Additional feedback?
  13280. </div>
  13281. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  13282. <div class="right">
  13283. <div class="counter">
  13284. <span id="feedbackTextCounter">1500</span> characters remaining
  13285. </div>
  13286. <div class="buttons">
  13287. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  13288. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  13289. </div>
  13290. </div>
  13291. </div>
  13292. <div id="ratingSection3">
  13293. <div class="title">
  13294. Thank you!
  13295. </div>
  13296. <div class="description">
  13297. We appreciate your feedback.
  13298. </div>
  13299. </div>
  13300. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  13301. </div>
  13302. <div class="userVoice">
  13303. <div class="title">
  13304. Help us improve MSDN.
  13305. </div>
  13306. <div class="description">
  13307. Visit our UserVoice Page to submit and vote on ideas!
  13308. </div>
  13309. <div class="buttons">
  13310. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  13311. </div>
  13312. </div>
  13313. <div class="clear"></div>
  13314. </div>
  13315. </div>
  13316. <footer class="top">
  13317. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  13318. <div class="linkList">
  13319. <div class="linkListTitle">Dev centers</div>
  13320. <ul class="links">
  13321. <li>
  13322. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  13323. </li>
  13324. <li>
  13325. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  13326. </li>
  13327. <li>
  13328. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  13329. </li>
  13330. <li>
  13331. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  13332. </li>
  13333. <li>
  13334. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  13335. </li>
  13336. </ul>
  13337. </div>
  13338. </div>
  13339. <div id="rightLinks">
  13340. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  13341. <div class="linkList">
  13342. <div class="linkListTitle">Learning resources</div>
  13343. <ul class="links">
  13344. <li>
  13345. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  13346. </li>
  13347. <li>
  13348. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  13349. </li>
  13350. <li>
  13351. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  13352. </li>
  13353. </ul>
  13354. </div>
  13355. </div>
  13356. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  13357. <div class="linkList">
  13358. <div class="linkListTitle">Community</div>
  13359. <ul class="links">
  13360. <li>
  13361. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  13362. </li>
  13363. <li>
  13364. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  13365. </li>
  13366. <li>
  13367. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  13368. </li>
  13369. </ul>
  13370. </div>
  13371. </div>
  13372. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  13373. <div class="linkList">
  13374. <div class="linkListTitle">Support</div>
  13375. <ul class="links">
  13376. <li>
  13377. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  13378. </li>
  13379. </ul>
  13380. </div>
  13381. </div>
  13382. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  13383. <div class="linkList">
  13384. <div class="linkListTitle">Programs</div>
  13385. <ul class="links">
  13386. <li>
  13387. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  13388. </li>
  13389. <li>
  13390. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  13391. </li>
  13392. <li>
  13393. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  13394. </li>
  13395. </ul>
  13396. </div>
  13397. </div>
  13398. </div>
  13399. </footer>
  13400. <footer class="bottom">
  13401. <span class="localeContainer">
  13402. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  13403. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706279(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  13404. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  13405. </form>
  13406. </span>
  13407. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  13408. <div class="linkList">
  13409. <ul class="links horizontal">
  13410. <li>
  13411. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  13412. </li>
  13413. <li>
  13414. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  13415. </li>
  13416. <li>
  13417. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  13418. </li>
  13419. <li>
  13420. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  13421. </li>
  13422. </ul>
  13423. </div>
  13424. </div>
  13425. <span class="logoLegal">
  13426. <span class="logo"></span>
  13427. <span class="copyright">© 2016 Microsoft</span>
  13428. </span>
  13429. </footer>
  13430. </div>
  13431. </div>
  13432. <div class="footerPrintView">
  13433. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  13434. </div>
  13435. <input id="tocPaddingPerLevel" type="hidden" value="17">
  13436. <input id="MtpsDevice" type="hidden" value="Printer">
  13437. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  13438. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  13439. <div id="globalRequestVerification">
  13440. <input name="__RequestVerificationToken" type="hidden" value="RNt1vz-tqj7psDH9eFA7CHnC8SMUnoMR4c1bJEZbZtL6tI2jXP21VmkTZ0wIMiikyyzHe6qIBfPBAwWF8u77sHsxiDE1">
  13441. </div>
  13442. </div>
  13443. <script type="text/javascript" class="mtps-injected">
  13444. /*<![CDATA[*/
  13445. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  13446. MTPS.injectScripts([
  13447. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  13448. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh706279(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  13449. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  13450. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  13451. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  13452. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  13453. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  13454. ]);
  13455. /*]]>*/
  13456. </script>
  13457. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  13458. <div id="page">
  13459. <link type="text/css" rel="stylesheet">
  13460. <input type="hidden" id="isHeaderBleeding" value="true">
  13461. <div id="ux-header" dir="ltr" class="ltr msdn">
  13462. <header>
  13463. <span id="singleCol"></span>
  13464. <span id="doubleCol"></span>
  13465. <span id="isMobile"></span>
  13466. <div>
  13467. <div class="row topRow">
  13468. <div class="top">
  13469. <div class="left">
  13470. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  13471. <div id="msft-logo" class="msft-logo"></div>
  13472. </a>
  13473. <div class="GrayPipe"></div>
  13474. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  13475. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  13476. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  13477. </div>
  13478. <div class="right">
  13479. <div id="signIn">
  13480. <div class="profileImage"></div>
  13481. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376422&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706278%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  13482. <div class="auxNav">
  13483. <div>
  13484. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  13485. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  13486. </div>
  13487. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  13488. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  13489. </div>
  13490. </div>
  13491. <div>
  13492. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  13493. <div class="linkList">
  13494. <ul class="links horizontal">
  13495. <li>
  13496. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  13497. </li>
  13498. <li>
  13499. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  13500. </li>
  13501. <li>
  13502. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  13503. </li>
  13504. </ul>
  13505. </div>
  13506. </div>
  13507. </div>
  13508. </div>
  13509. </div>
  13510. </div>
  13511. </div>
  13512. <div class="row middleRow">
  13513. <div class="expandTop">
  13514. <div class="left"></div>
  13515. <div class="right"></div>
  13516. </div>
  13517. </div>
  13518. </div>
  13519. <div id="buttomRowWrapper" class="bg_default">
  13520. <div class="row buttomRow bg_default">
  13521. <div class="bottom">
  13522. <div class="left">
  13523. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  13524. <div id="drawer">
  13525. <div class="toc">
  13526. <nav>
  13527. <ul class="navL1">
  13528. <li class="inactive toggle">
  13529. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  13530. <ul class="navL2">
  13531. <li class="inactive">
  13532. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  13533. </li>
  13534. <li class="inactive">
  13535. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  13536. </li>
  13537. <li class="inactive">
  13538. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  13539. </li>
  13540. <li class="inactive">
  13541. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  13542. </li>
  13543. <li class="inactive">
  13544. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  13545. </li>
  13546. <li class="inactive">
  13547. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  13548. </li>
  13549. </ul>
  13550. </li>
  13551. <li class="inactive toggle">
  13552. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  13553. <ul class="navL2">
  13554. <li class="inactive">
  13555. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  13556. </li>
  13557. <li class="inactive">
  13558. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  13559. </li>
  13560. <li class="inactive">
  13561. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  13562. </li>
  13563. <li class="inactive toggle">
  13564. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  13565. <ul class="navL3">
  13566. <li class="inactive">
  13567. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  13568. </li>
  13569. <li class="inactive">
  13570. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  13571. </li>
  13572. <li class="inactive">
  13573. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  13574. </li>
  13575. <li class="inactive">
  13576. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  13577. </li>
  13578. <li class="inactive">
  13579. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  13580. </li>
  13581. </ul>
  13582. </li>
  13583. </ul>
  13584. </li>
  13585. <li class="inactive toggle">
  13586. <a href="javascript:void(0)" title="Programs">Programs</a>
  13587. <ul class="navL2">
  13588. <li class="inactive toggle">
  13589. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  13590. <ul class="navL3">
  13591. <li class="inactive">
  13592. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  13593. </li>
  13594. <li class="inactive">
  13595. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  13596. </li>
  13597. <li class="inactive">
  13598. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  13599. </li>
  13600. </ul>
  13601. </li>
  13602. <li class="inactive toggle">
  13603. <a href="javascript:void(0)" title="Students">Students</a>
  13604. <ul class="navL3">
  13605. <li class="inactive">
  13606. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  13607. </li>
  13608. <li class="inactive">
  13609. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  13610. </li>
  13611. </ul>
  13612. </li>
  13613. <li class="inactive toggle">
  13614. <a href="javascript:void(0)" title="Architects">Architects</a>
  13615. <ul class="navL3">
  13616. <li class="inactive">
  13617. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  13618. </li>
  13619. <li class="inactive">
  13620. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  13621. </li>
  13622. <li class="inactive">
  13623. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  13624. </li>
  13625. <li class="inactive">
  13626. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  13627. </li>
  13628. <li class="inactive">
  13629. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  13630. </li>
  13631. </ul>
  13632. </li>
  13633. <li class="inactive">
  13634. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  13635. </li>
  13636. <li class="inactive">
  13637. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  13638. </li>
  13639. <li class="inactive">
  13640. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  13641. </li>
  13642. <li class="inactive">
  13643. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  13644. </li>
  13645. </ul>
  13646. </li>
  13647. <li class="inactive toggle">
  13648. <a href="javascript:void(0)" title="Community">Community</a>
  13649. <ul class="navL2">
  13650. <li class="inactive">
  13651. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  13652. </li>
  13653. <li class="inactive">
  13654. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  13655. </li>
  13656. <li class="inactive">
  13657. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  13658. </li>
  13659. <li class="inactive">
  13660. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  13661. </li>
  13662. <li class="inactive">
  13663. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  13664. </li>
  13665. </ul>
  13666. </li>
  13667. <li class="inactive current toggle">
  13668. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  13669. <ul class="navL2">
  13670. <li class="inactive current">
  13671. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  13672. </li>
  13673. <li class="inactive">
  13674. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  13675. </li>
  13676. </ul>
  13677. </li>
  13678. <li class="inactive">
  13679. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  13680. </li>
  13681. </ul>
  13682. </nav>
  13683. </div>
  13684. </div>
  13685. </div>
  13686. <div class="right">
  13687. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  13688. <div class="SearchBox">
  13689. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  13690. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  13691. <div id="search-finder" class="search-finder"></div>
  13692. </button>
  13693. <button id="HeaderSearchButton" style="display:none"></button>
  13694. <div id="searchSplitter"></div>
  13695. <div id="searchCloseIcon" class="search-clear-x"></div>
  13696. <div id="searchTextContainer" style="width: 0;">
  13697. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  13698. </div>
  13699. </form>
  13700. </div>
  13701. </div>
  13702. </div>
  13703. </div>
  13704. </div>
  13705. </div>
  13706. </header>
  13707. </div>
  13708. <div class="printExportMenus ltr">
  13709. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh706278(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  13710. Export (<span class="count">0</span>)
  13711. </a>
  13712. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh706278(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  13713. Print
  13714. </a>
  13715. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  13716. </a>
  13717. </div>
  13718. <div class="printExportMenus ltr">
  13719. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  13720. </div>
  13721. <div id="body" ms.pgarea="body">
  13722. <span id="tabletView_large"></span>
  13723. <span id="tabletView_small"></span>
  13724. <span id="mobileView"></span>
  13725. <div id="content" class="content">
  13726. <input type="hidden" id="printForPab" value="true">
  13727. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  13728. <h1 class="title">KMDF extensions and driver triples</h1>
  13729. <div id="mainSection">
  13730. <div class="clsServerSDKContent">
  13731. </div>
  13732. <p>In this topic, we discuss class-based extensions to the Kernel Mode Driver Framework (KMDF). Before you read this topic, you should understand the ideas presented in <a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx">Minidrivers and driver pairs</a> and <a href="https://msdn.microsoft.com/en-us/library/hh706279(v=vs.85).aspx">KMDF as a Generic Driver Pair Model</a>.</p>
  13733. <p>For some device classes, Microsoft provides KMDF extensions that further reduce the amount of processing that must be performed by KMDF drivers. A driver that uses a class-based KMDF extension has these three pieces, which we call a <em>driver triple</em>.</p>
  13734. <ul>
  13735. <li>The Framework, which handles tasks common to most all drivers</li>
  13736. <li>The class-based framework extension, which handles tasks that are specific to a particular class of devices</li>
  13737. <li>The KMDF driver, which handles tasks that are specific to a particular device.</li>
  13738. </ul>
  13739. <p>The three drivers in a driver triple (KMDF driver, device-class KMDF extension, Framework) combine to form a single WDM driver.</p>
  13740. <p>An example of a device-class KMDF extension is SpbCx.sys, which is the KMDF extension for the Simple Peripheral Bus (SPB) device class. The SPB class includes synchronous serial buses such as I2C and SPI. A driver triple for an I2C bus controller would look like this:</p>
  13741. <ul>
  13742. <li>The Framework handles general tasks that are common to most all drivers.</li>
  13743. <li>SpbCx.sys handles tasks that are specific to the SPB bus class. These are tasks that are common to all SPB busses.</li>
  13744. <li>The KMDF driver handles tasks that are specific to an I2C bus. Let's call this driver MyI2CBusDriver.sys.</li>
  13745. </ul><img id="kmdfdrivertriple" alt="KMDF Driver Triple Extension" src="./Windows Kernel Development Articles (2016-03-30)_files/IC831359.png" title="KMDF Driver Triple Extension" xmlns=""><p>The three drivers in the driver triple (MyI2CBusDriver.sys, SpbCx.sys, Wdf01000.sys) combine to form a single WDM driver that serves as the function driver for the I2C bus controller. Wdf01000.sys (the Framework) owns the dispatch table for this driver, so when someone sends an IRP to the driver triple, it goes to the wdf01000.sys. If the wdf01000.sys can handle the IRP by itself, SpbCx.sys and MyI2CBusDriver.sys are not involved. If wdf01000.sys cannot handle the IRP by itself, it gets help by calling an event handler in SbpCx.sys.</p>
  13746. <p></p>
  13747. <p>Here are some examples of event handlers that might be implemented by MyI2CBusDriver.sys:</p>
  13748. <ul>
  13749. <li>EvtSpbControllerLock</li>
  13750. <li>EvtSpbIoRead</li>
  13751. <li>EvtSpbIoSequence</li>
  13752. </ul>
  13753. <p>Here are some examples of event handlers that are implemented by SpbCx.sys</p>
  13754. <ul>
  13755. <li>EvtIoRead</li>
  13756. </ul>
  13757. <p>&nbsp;</p>
  13758. <p>&nbsp;</p>
  13759. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20KMDF%20extensions%20and%20driver%20triples%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  13760. </div>
  13761. </div>
  13762. </div>
  13763. </div>
  13764. <div class="clear"></div>
  13765. <input name="__RequestVerificationToken" type="hidden" value="j_myNCShbY91GYbpu6iC7z2w1tNLZPUMovJORjFTvRGbH8MxtKUcChxB50AgjQB157RA4Dc_yAly8kbhTf--RNnuH4U1">
  13766. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh706278(d=printer,v=vs.85).aspx">
  13767. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh706278(d=printer,v=vs.85).aspx">
  13768. <input id="isTopicRated" type="hidden" value="false">
  13769. <div id="lib-footer" ms.pgarea="body">
  13770. <link type="text/css" rel="stylesheet">
  13771. <div id="ux-footer" class="" style="" dir="ltr">
  13772. <div id="footerSock" class="librarySock both">
  13773. <div id="footerSockInner">
  13774. <a name="feedback"></a>
  13775. <div class="rating">
  13776. <div id="ratingSection1">
  13777. <div class="title">
  13778. Was this page helpful?
  13779. </div>
  13780. <div class="description">
  13781. Your feedback about this content is important.<br>Let us know what you think.
  13782. </div>
  13783. <div class="buttons">
  13784. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  13785. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  13786. </div>
  13787. <input id="ratingValue" type="hidden" value="">
  13788. </div>
  13789. <div id="ratingSection2">
  13790. <div class="title left">
  13791. Additional feedback?
  13792. </div>
  13793. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  13794. <div class="right">
  13795. <div class="counter">
  13796. <span id="feedbackTextCounter">1500</span> characters remaining
  13797. </div>
  13798. <div class="buttons">
  13799. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  13800. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  13801. </div>
  13802. </div>
  13803. </div>
  13804. <div id="ratingSection3">
  13805. <div class="title">
  13806. Thank you!
  13807. </div>
  13808. <div class="description">
  13809. We appreciate your feedback.
  13810. </div>
  13811. </div>
  13812. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  13813. </div>
  13814. <div class="userVoice">
  13815. <div class="title">
  13816. Help us improve MSDN.
  13817. </div>
  13818. <div class="description">
  13819. Visit our UserVoice Page to submit and vote on ideas!
  13820. </div>
  13821. <div class="buttons">
  13822. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  13823. </div>
  13824. </div>
  13825. <div class="clear"></div>
  13826. </div>
  13827. </div>
  13828. <footer class="top">
  13829. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  13830. <div class="linkList">
  13831. <div class="linkListTitle">Dev centers</div>
  13832. <ul class="links">
  13833. <li>
  13834. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  13835. </li>
  13836. <li>
  13837. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  13838. </li>
  13839. <li>
  13840. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  13841. </li>
  13842. <li>
  13843. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  13844. </li>
  13845. <li>
  13846. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  13847. </li>
  13848. </ul>
  13849. </div>
  13850. </div>
  13851. <div id="rightLinks">
  13852. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  13853. <div class="linkList">
  13854. <div class="linkListTitle">Learning resources</div>
  13855. <ul class="links">
  13856. <li>
  13857. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  13858. </li>
  13859. <li>
  13860. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  13861. </li>
  13862. <li>
  13863. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  13864. </li>
  13865. </ul>
  13866. </div>
  13867. </div>
  13868. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  13869. <div class="linkList">
  13870. <div class="linkListTitle">Community</div>
  13871. <ul class="links">
  13872. <li>
  13873. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  13874. </li>
  13875. <li>
  13876. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  13877. </li>
  13878. <li>
  13879. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  13880. </li>
  13881. </ul>
  13882. </div>
  13883. </div>
  13884. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  13885. <div class="linkList">
  13886. <div class="linkListTitle">Support</div>
  13887. <ul class="links">
  13888. <li>
  13889. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  13890. </li>
  13891. </ul>
  13892. </div>
  13893. </div>
  13894. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  13895. <div class="linkList">
  13896. <div class="linkListTitle">Programs</div>
  13897. <ul class="links">
  13898. <li>
  13899. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  13900. </li>
  13901. <li>
  13902. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  13903. </li>
  13904. <li>
  13905. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  13906. </li>
  13907. </ul>
  13908. </div>
  13909. </div>
  13910. </div>
  13911. </footer>
  13912. <footer class="bottom">
  13913. <span class="localeContainer">
  13914. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  13915. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706278(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  13916. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  13917. </form>
  13918. </span>
  13919. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  13920. <div class="linkList">
  13921. <ul class="links horizontal">
  13922. <li>
  13923. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  13924. </li>
  13925. <li>
  13926. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  13927. </li>
  13928. <li>
  13929. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  13930. </li>
  13931. <li>
  13932. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  13933. </li>
  13934. </ul>
  13935. </div>
  13936. </div>
  13937. <span class="logoLegal">
  13938. <span class="logo"></span>
  13939. <span class="copyright">© 2016 Microsoft</span>
  13940. </span>
  13941. </footer>
  13942. </div>
  13943. </div>
  13944. <div class="footerPrintView">
  13945. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  13946. </div>
  13947. <input id="tocPaddingPerLevel" type="hidden" value="17">
  13948. <input id="MtpsDevice" type="hidden" value="Printer">
  13949. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  13950. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  13951. <div id="globalRequestVerification">
  13952. <input name="__RequestVerificationToken" type="hidden" value="yL38rwj5d46EiQaoL2PNFId2uSPnBSPsWLCXa03VLDditXmsN4Ok-ZG1XxShgYE3SqFYCM2GUZFam0DYWh2VkZDM3vs1">
  13953. </div>
  13954. </div>
  13955. <script type="text/javascript" class="mtps-injected">
  13956. /*<![CDATA[*/
  13957. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  13958. MTPS.injectScripts([
  13959. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  13960. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh706278(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  13961. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  13962. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  13963. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  13964. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  13965. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  13966. ]);
  13967. /*]]>*/
  13968. </script>
  13969. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  13970. <div id="page">
  13971. <link type="text/css" rel="stylesheet">
  13972. <input type="hidden" id="isHeaderBleeding" value="true">
  13973. <div id="ux-header" dir="ltr" class="ltr msdn">
  13974. <header>
  13975. <span id="singleCol"></span>
  13976. <span id="doubleCol"></span>
  13977. <span id="isMobile"></span>
  13978. <div>
  13979. <div class="row topRow">
  13980. <div class="top">
  13981. <div class="left">
  13982. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  13983. <div id="msft-logo" class="msft-logo"></div>
  13984. </a>
  13985. <div class="GrayPipe"></div>
  13986. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  13987. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  13988. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  13989. </div>
  13990. <div class="right">
  13991. <div id="signIn">
  13992. <div class="profileImage"></div>
  13993. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376424&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706280%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  13994. <div class="auxNav">
  13995. <div>
  13996. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  13997. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  13998. </div>
  13999. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  14000. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  14001. </div>
  14002. </div>
  14003. <div>
  14004. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  14005. <div class="linkList">
  14006. <ul class="links horizontal">
  14007. <li>
  14008. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  14009. </li>
  14010. <li>
  14011. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  14012. </li>
  14013. <li>
  14014. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  14015. </li>
  14016. </ul>
  14017. </div>
  14018. </div>
  14019. </div>
  14020. </div>
  14021. </div>
  14022. </div>
  14023. </div>
  14024. <div class="row middleRow">
  14025. <div class="expandTop">
  14026. <div class="left"></div>
  14027. <div class="right"></div>
  14028. </div>
  14029. </div>
  14030. </div>
  14031. <div id="buttomRowWrapper" class="bg_default">
  14032. <div class="row buttomRow bg_default">
  14033. <div class="bottom">
  14034. <div class="left">
  14035. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  14036. <div id="drawer">
  14037. <div class="toc">
  14038. <nav>
  14039. <ul class="navL1">
  14040. <li class="inactive toggle">
  14041. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  14042. <ul class="navL2">
  14043. <li class="inactive">
  14044. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  14045. </li>
  14046. <li class="inactive">
  14047. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  14048. </li>
  14049. <li class="inactive">
  14050. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  14051. </li>
  14052. <li class="inactive">
  14053. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  14054. </li>
  14055. <li class="inactive">
  14056. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  14057. </li>
  14058. <li class="inactive">
  14059. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  14060. </li>
  14061. </ul>
  14062. </li>
  14063. <li class="inactive toggle">
  14064. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  14065. <ul class="navL2">
  14066. <li class="inactive">
  14067. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  14068. </li>
  14069. <li class="inactive">
  14070. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  14071. </li>
  14072. <li class="inactive">
  14073. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  14074. </li>
  14075. <li class="inactive toggle">
  14076. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  14077. <ul class="navL3">
  14078. <li class="inactive">
  14079. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  14080. </li>
  14081. <li class="inactive">
  14082. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  14083. </li>
  14084. <li class="inactive">
  14085. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  14086. </li>
  14087. <li class="inactive">
  14088. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  14089. </li>
  14090. <li class="inactive">
  14091. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  14092. </li>
  14093. </ul>
  14094. </li>
  14095. </ul>
  14096. </li>
  14097. <li class="inactive toggle">
  14098. <a href="javascript:void(0)" title="Programs">Programs</a>
  14099. <ul class="navL2">
  14100. <li class="inactive toggle">
  14101. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  14102. <ul class="navL3">
  14103. <li class="inactive">
  14104. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  14105. </li>
  14106. <li class="inactive">
  14107. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  14108. </li>
  14109. <li class="inactive">
  14110. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  14111. </li>
  14112. </ul>
  14113. </li>
  14114. <li class="inactive toggle">
  14115. <a href="javascript:void(0)" title="Students">Students</a>
  14116. <ul class="navL3">
  14117. <li class="inactive">
  14118. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  14119. </li>
  14120. <li class="inactive">
  14121. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  14122. </li>
  14123. </ul>
  14124. </li>
  14125. <li class="inactive toggle">
  14126. <a href="javascript:void(0)" title="Architects">Architects</a>
  14127. <ul class="navL3">
  14128. <li class="inactive">
  14129. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  14130. </li>
  14131. <li class="inactive">
  14132. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  14133. </li>
  14134. <li class="inactive">
  14135. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  14136. </li>
  14137. <li class="inactive">
  14138. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  14139. </li>
  14140. <li class="inactive">
  14141. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  14142. </li>
  14143. </ul>
  14144. </li>
  14145. <li class="inactive">
  14146. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  14147. </li>
  14148. <li class="inactive">
  14149. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  14150. </li>
  14151. <li class="inactive">
  14152. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  14153. </li>
  14154. <li class="inactive">
  14155. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  14156. </li>
  14157. </ul>
  14158. </li>
  14159. <li class="inactive toggle">
  14160. <a href="javascript:void(0)" title="Community">Community</a>
  14161. <ul class="navL2">
  14162. <li class="inactive">
  14163. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  14164. </li>
  14165. <li class="inactive">
  14166. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  14167. </li>
  14168. <li class="inactive">
  14169. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  14170. </li>
  14171. <li class="inactive">
  14172. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  14173. </li>
  14174. <li class="inactive">
  14175. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  14176. </li>
  14177. </ul>
  14178. </li>
  14179. <li class="inactive current toggle">
  14180. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  14181. <ul class="navL2">
  14182. <li class="inactive current">
  14183. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  14184. </li>
  14185. <li class="inactive">
  14186. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  14187. </li>
  14188. </ul>
  14189. </li>
  14190. <li class="inactive">
  14191. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  14192. </li>
  14193. </ul>
  14194. </nav>
  14195. </div>
  14196. </div>
  14197. </div>
  14198. <div class="right">
  14199. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  14200. <div class="SearchBox">
  14201. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  14202. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  14203. <div id="search-finder" class="search-finder"></div>
  14204. </button>
  14205. <button id="HeaderSearchButton" style="display:none"></button>
  14206. <div id="searchSplitter"></div>
  14207. <div id="searchCloseIcon" class="search-clear-x"></div>
  14208. <div id="searchTextContainer" style="width: 0;">
  14209. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  14210. </div>
  14211. </form>
  14212. </div>
  14213. </div>
  14214. </div>
  14215. </div>
  14216. </div>
  14217. </div>
  14218. </header>
  14219. </div>
  14220. <div class="printExportMenus ltr">
  14221. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fhh706280(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  14222. Export (<span class="count">0</span>)
  14223. </a>
  14224. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/hh706280(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  14225. Print
  14226. </a>
  14227. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  14228. </a>
  14229. </div>
  14230. <div class="printExportMenus ltr">
  14231. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  14232. </div>
  14233. <div id="body" ms.pgarea="body">
  14234. <span id="tabletView_large"></span>
  14235. <span id="tabletView_small"></span>
  14236. <span id="mobileView"></span>
  14237. <div id="content" class="content">
  14238. <input type="hidden" id="printForPab" value="true">
  14239. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  14240. <h1 class="title">Upper and lower edges of drivers</h1>
  14241. <div id="mainSection">
  14242. <div class="clsServerSDKContent">
  14243. </div>
  14244. <p>The sequence of drivers that participate in an I/O request is called the driver stack for the request. A driver can call into the upper edge of a lower driver in the stack. A driver can also call into the lower edge of a higher driver in the stack.</p>
  14245. <p>Before you read this topic, you should understand the ideas presented in <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a> and <a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx">Driver stacks</a>.</p>
  14246. <p> I/O requests are processed first by the top driver in the driver stack, then by the next lower driver, and so on until the request is fully processed. </p>
  14247. <p>When a driver implements a set of functions that a higher driver can call, that set of functions is called the <em>upper edge</em> of the driver or the <em>upper-edge interface</em> of the driver.</p>
  14248. <p>When a driver implements a set of functions that a lower driver can call, that set of functions is called the <em>lower edge</em> of the driver or the <em>lower-edge interface</em> of the driver.</p>
  14249. <h3><a id="Audio_example"></a><a id="audio_example"></a><a id="AUDIO_EXAMPLE"></a>Audio example</h3>
  14250. <p>We can think of an audio miniport driver sitting below an audio port driver in a driver stack. The port driver makes calls to the miniport driver's upper edge. The miniport driver makes calls to the port driver's lower edge.</p><img id="AudioDrvStack" alt="Diagram of audio port driver above miniport driver" src="./Windows Kernel Development Articles (2016-03-30)_files/IC534970.png" title="Diagram of audio port driver above miniport driver" xmlns=""><p>The preceding diagram illustrates that it is sometimes useful to think of a port driver sitting above a miniport driver in a driver stack. Because I/O requests are processed first by the port driver and then by the miniport driver, it is reasonable to think of the port driver as being above the miniport driver. Keep in mind, however, that a (miniport, port) driver pair usually sits at a single level in a device stack, as shown here.</p><img id="upperloweredge01" alt="Diagram of device stack with (miniport/port) pair" src="./Windows Kernel Development Articles (2016-03-30)_files/IC554551.png" title="Diagram of device stack with (miniport/port) pair" xmlns=""><p>Note that a <em>device stack</em> is not the same thing as a <em>driver stack</em>. For definitions of these terms, and for a discussion of how a pair of drivers can form a single WDM driver that occupies one level in a device stack, see <a href="https://msdn.microsoft.com/en-us/library/hh439643(v=vs.85).aspx">Minidrivers and driver pairs</a>. </p>
  14251. <p>Here's another way to draw a diagram of the same device node and device stack:</p><img id="upperloweredge02" alt="Diagram of device stack with port driver above miniport" src="./Windows Kernel Development Articles (2016-03-30)_files/IC554552.png" title="Diagram of device stack with port driver above miniport" xmlns=""><p>In the preceding diagram, we see that the (miniport, port) pair forms a single WDM driver that is associated with a single device object (the FDO) in the device stack; that is, the (miniport, port) pair occupies only one level in the device stack. But we also see a vertical relationship between the miniport and port drivers. The port driver is shown above the miniport driver to indicate that the port driver processes I/O requests first and then calls into the miniport driver for additional processing.</p>
  14252. <p>The key point is that when the port driver calls into the miniport driver's upper-edge interface, that is not the same as passing an I/O request down the device stack. In a driver stack (not device stack) you can choose to draw a port driver above a miniport driver, but that does not mean that the port driver is above the miniport driver in the device stack.</p>
  14253. <h3><a id="NDIS_example"></a><a id="ndis_example"></a><a id="NDIS_EXAMPLE"></a>NDIS example</h3>
  14254. <p>Sometimes a driver calls the upper edge of a lower driver indirectly. For example, suppose a <a href="https://msdn.microsoft.com/en-us/library/ff556929(v=vs.85).aspx">TCP/IP protocol driver</a> sits above an <a href="https://msdn.microsoft.com/en-us/library/ff565448(v=vs.85).aspx">NDIS</a> miniport driver in a driver stack. The miniport driver implements a set of <em>MiniportXxx</em> functions that form the miniport driver's upper edge. We say that the TCP/IP protocol driver <em>binds</em> to the upper edge of the NDIS miniport driver. But the TCP/IP driver does not call the <em>MiniportXxx</em> functions directly. Instead, it calls functions in the NDIS library, which then call the <em>MiniportXxx</em> functions.</p><img id="UpperLowerEdge03" alt="Diagram of TCP/IP and NDIS miniport stack" src="./Windows Kernel Development Articles (2016-03-30)_files/IC686629.png" title="Diagram of TCP/IP and NDIS miniport stack" xmlns=""><p>The preceding diagram shows a driver stack. Here's another view of the same drivers.</p><img id="UpperLowerEdge04" alt="Diagram of device stack for a network card" src="./Windows Kernel Development Articles (2016-03-30)_files/IC686630.png" title="Diagram of device stack for a network card" xmlns=""><p>The preceding diagram shows the device node for a network interface card (NIC). The device node has a position in the Plug and Play (PnP) device tree. The device node for the NIC has a device stack with three device objects. Notice that the NDIS miniport driver and the NDIS library work as a pair. The pair (MyMiniport.sys, Ndis.sys) forms a single WDM driver that is represented by the functional device object (FDO).</p>
  14255. <p>Also notice that the protocol driver Tcpip.sys is not part of the device stack for the NIC. In fact, Tcpip.sys is not part of the PnP device tree at all.</p>
  14256. <h2><a id="Summary"></a><a id="summary"></a><a id="SUMMARY"></a>Summary</h2>
  14257. <p>The terms <em>upper edge</em> and <em>lower edge</em> are used to describe the interfaces that drivers in a stack use to communicate with each other. A <a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">driver stack</em></a> is not the same thing as <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx"><em xmlns="http://www.w3.org/1999/xhtml">device stack</em></a>. Two drivers that are shown vertically in a driver stack might form a driver pair that sits at a single level in a device stack. Some drivers are not part of the PnP device tree.</p>
  14258. <h2><a id="related_topics"></a>Related topics</h2>
  14259. <dl>
  14260. <dt>
  14261. <a href="https://msdn.microsoft.com/en-us/library/ff554731(v=vs.85).aspx">Concepts for all driver developers</a>
  14262. </dt>
  14263. <dt>
  14264. <a href="https://msdn.microsoft.com/en-us/library/ff554721(v=vs.85).aspx">Device nodes and device stacks</a>
  14265. </dt>
  14266. <dt>
  14267. <a href="https://msdn.microsoft.com/en-us/library/hh439632(v=vs.85).aspx">Driver stacks</a>
  14268. </dt>
  14269. <dt>
  14270. <a href="https://msdn.microsoft.com/en-us/library/ff537760(v=vs.85).aspx">Audio Devices</a>
  14271. </dt>
  14272. <dt>
  14273. <a href="https://msdn.microsoft.com/en-us/library/ff570021(v=vs.85).aspx">Network Drivers Starting with Windows Vista</a>
  14274. </dt>
  14275. </dl>
  14276. <p>&nbsp;</p>
  14277. <p>&nbsp;</p>
  14278. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Upper%20and%20lower%20edges%20of%20drivers%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  14279. </div>
  14280. </div>
  14281. </div>
  14282. </div>
  14283. <div class="clear"></div>
  14284. <input name="__RequestVerificationToken" type="hidden" value="SDi3NEs0Ttio3gIIxosJTqw0UU61jQzns5TorVsx3Hx0IiOW57tePFlBg0iNDsklKikv8hntrop62m_RlWXQdqtqbjE1">
  14285. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/hh706280(d=printer,v=vs.85).aspx">
  14286. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/hh706280(d=printer,v=vs.85).aspx">
  14287. <input id="isTopicRated" type="hidden" value="false">
  14288. <div id="lib-footer" ms.pgarea="body">
  14289. <link type="text/css" rel="stylesheet">
  14290. <div id="ux-footer" class="" style="" dir="ltr">
  14291. <div id="footerSock" class="librarySock both">
  14292. <div id="footerSockInner">
  14293. <a name="feedback"></a>
  14294. <div class="rating">
  14295. <div id="ratingSection1">
  14296. <div class="title">
  14297. Was this page helpful?
  14298. </div>
  14299. <div class="description">
  14300. Your feedback about this content is important.<br>Let us know what you think.
  14301. </div>
  14302. <div class="buttons">
  14303. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  14304. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  14305. </div>
  14306. <input id="ratingValue" type="hidden" value="">
  14307. </div>
  14308. <div id="ratingSection2">
  14309. <div class="title left">
  14310. Additional feedback?
  14311. </div>
  14312. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  14313. <div class="right">
  14314. <div class="counter">
  14315. <span id="feedbackTextCounter">1500</span> characters remaining
  14316. </div>
  14317. <div class="buttons">
  14318. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  14319. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  14320. </div>
  14321. </div>
  14322. </div>
  14323. <div id="ratingSection3">
  14324. <div class="title">
  14325. Thank you!
  14326. </div>
  14327. <div class="description">
  14328. We appreciate your feedback.
  14329. </div>
  14330. </div>
  14331. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  14332. </div>
  14333. <div class="userVoice">
  14334. <div class="title">
  14335. Help us improve MSDN.
  14336. </div>
  14337. <div class="description">
  14338. Visit our UserVoice Page to submit and vote on ideas!
  14339. </div>
  14340. <div class="buttons">
  14341. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  14342. </div>
  14343. </div>
  14344. <div class="clear"></div>
  14345. </div>
  14346. </div>
  14347. <footer class="top">
  14348. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  14349. <div class="linkList">
  14350. <div class="linkListTitle">Dev centers</div>
  14351. <ul class="links">
  14352. <li>
  14353. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  14354. </li>
  14355. <li>
  14356. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  14357. </li>
  14358. <li>
  14359. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  14360. </li>
  14361. <li>
  14362. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  14363. </li>
  14364. <li>
  14365. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  14366. </li>
  14367. </ul>
  14368. </div>
  14369. </div>
  14370. <div id="rightLinks">
  14371. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  14372. <div class="linkList">
  14373. <div class="linkListTitle">Learning resources</div>
  14374. <ul class="links">
  14375. <li>
  14376. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  14377. </li>
  14378. <li>
  14379. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  14380. </li>
  14381. <li>
  14382. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  14383. </li>
  14384. </ul>
  14385. </div>
  14386. </div>
  14387. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  14388. <div class="linkList">
  14389. <div class="linkListTitle">Community</div>
  14390. <ul class="links">
  14391. <li>
  14392. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  14393. </li>
  14394. <li>
  14395. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  14396. </li>
  14397. <li>
  14398. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  14399. </li>
  14400. </ul>
  14401. </div>
  14402. </div>
  14403. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  14404. <div class="linkList">
  14405. <div class="linkListTitle">Support</div>
  14406. <ul class="links">
  14407. <li>
  14408. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  14409. </li>
  14410. </ul>
  14411. </div>
  14412. </div>
  14413. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  14414. <div class="linkList">
  14415. <div class="linkListTitle">Programs</div>
  14416. <ul class="links">
  14417. <li>
  14418. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  14419. </li>
  14420. <li>
  14421. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  14422. </li>
  14423. <li>
  14424. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  14425. </li>
  14426. </ul>
  14427. </div>
  14428. </div>
  14429. </div>
  14430. </footer>
  14431. <footer class="bottom">
  14432. <span class="localeContainer">
  14433. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  14434. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhh706280(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  14435. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  14436. </form>
  14437. </span>
  14438. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  14439. <div class="linkList">
  14440. <ul class="links horizontal">
  14441. <li>
  14442. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  14443. </li>
  14444. <li>
  14445. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  14446. </li>
  14447. <li>
  14448. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  14449. </li>
  14450. <li>
  14451. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  14452. </li>
  14453. </ul>
  14454. </div>
  14455. </div>
  14456. <span class="logoLegal">
  14457. <span class="logo"></span>
  14458. <span class="copyright">© 2016 Microsoft</span>
  14459. </span>
  14460. </footer>
  14461. </div>
  14462. </div>
  14463. <div class="footerPrintView">
  14464. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  14465. </div>
  14466. <input id="tocPaddingPerLevel" type="hidden" value="17">
  14467. <input id="MtpsDevice" type="hidden" value="Printer">
  14468. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  14469. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  14470. <div id="globalRequestVerification">
  14471. <input name="__RequestVerificationToken" type="hidden" value="vAi_s2dp4YfQo7a52UO_dFqAse7Opkhnlyp7jaIakhRcDP5uHq79QE2hVSDkPAj80BqwaSW_2MMQjJocsVopF76vH2A1">
  14472. </div>
  14473. </div>
  14474. <script type="text/javascript" class="mtps-injected">
  14475. /*<![CDATA[*/
  14476. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  14477. MTPS.injectScripts([
  14478. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  14479. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/hh706280(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  14480. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  14481. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  14482. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  14483. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  14484. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  14485. ]);
  14486. /*]]>*/
  14487. </script>
  14488. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  14489. <div id="page">
  14490. <link type="text/css" rel="stylesheet">
  14491. <input type="hidden" id="isHeaderBleeding" value="true">
  14492. <div id="ux-header" dir="ltr" class="ltr msdn">
  14493. <header>
  14494. <span id="singleCol"></span>
  14495. <span id="doubleCol"></span>
  14496. <span id="isMobile"></span>
  14497. <div>
  14498. <div class="row topRow">
  14499. <div class="top">
  14500. <div class="left">
  14501. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  14502. <div id="msft-logo" class="msft-logo"></div>
  14503. </a>
  14504. <div class="GrayPipe"></div>
  14505. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  14506. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  14507. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  14508. </div>
  14509. <div class="right">
  14510. <div id="signIn">
  14511. <div class="profileImage"></div>
  14512. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376424&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554695%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  14513. <div class="auxNav">
  14514. <div>
  14515. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  14516. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  14517. </div>
  14518. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  14519. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  14520. </div>
  14521. </div>
  14522. <div>
  14523. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  14524. <div class="linkList">
  14525. <ul class="links horizontal">
  14526. <li>
  14527. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  14528. </li>
  14529. <li>
  14530. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  14531. </li>
  14532. <li>
  14533. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  14534. </li>
  14535. </ul>
  14536. </div>
  14537. </div>
  14538. </div>
  14539. </div>
  14540. </div>
  14541. </div>
  14542. </div>
  14543. <div class="row middleRow">
  14544. <div class="expandTop">
  14545. <div class="left"></div>
  14546. <div class="right"></div>
  14547. </div>
  14548. </div>
  14549. </div>
  14550. <div id="buttomRowWrapper" class="bg_default">
  14551. <div class="row buttomRow bg_default">
  14552. <div class="bottom">
  14553. <div class="left">
  14554. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  14555. <div id="drawer">
  14556. <div class="toc">
  14557. <nav>
  14558. <ul class="navL1">
  14559. <li class="inactive toggle">
  14560. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  14561. <ul class="navL2">
  14562. <li class="inactive">
  14563. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  14564. </li>
  14565. <li class="inactive">
  14566. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  14567. </li>
  14568. <li class="inactive">
  14569. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  14570. </li>
  14571. <li class="inactive">
  14572. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  14573. </li>
  14574. <li class="inactive">
  14575. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  14576. </li>
  14577. <li class="inactive">
  14578. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  14579. </li>
  14580. </ul>
  14581. </li>
  14582. <li class="inactive toggle">
  14583. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  14584. <ul class="navL2">
  14585. <li class="inactive">
  14586. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  14587. </li>
  14588. <li class="inactive">
  14589. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  14590. </li>
  14591. <li class="inactive">
  14592. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  14593. </li>
  14594. <li class="inactive toggle">
  14595. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  14596. <ul class="navL3">
  14597. <li class="inactive">
  14598. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  14599. </li>
  14600. <li class="inactive">
  14601. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  14602. </li>
  14603. <li class="inactive">
  14604. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  14605. </li>
  14606. <li class="inactive">
  14607. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  14608. </li>
  14609. <li class="inactive">
  14610. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  14611. </li>
  14612. </ul>
  14613. </li>
  14614. </ul>
  14615. </li>
  14616. <li class="inactive toggle">
  14617. <a href="javascript:void(0)" title="Programs">Programs</a>
  14618. <ul class="navL2">
  14619. <li class="inactive toggle">
  14620. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  14621. <ul class="navL3">
  14622. <li class="inactive">
  14623. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  14624. </li>
  14625. <li class="inactive">
  14626. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  14627. </li>
  14628. <li class="inactive">
  14629. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  14630. </li>
  14631. </ul>
  14632. </li>
  14633. <li class="inactive toggle">
  14634. <a href="javascript:void(0)" title="Students">Students</a>
  14635. <ul class="navL3">
  14636. <li class="inactive">
  14637. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  14638. </li>
  14639. <li class="inactive">
  14640. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  14641. </li>
  14642. </ul>
  14643. </li>
  14644. <li class="inactive toggle">
  14645. <a href="javascript:void(0)" title="Architects">Architects</a>
  14646. <ul class="navL3">
  14647. <li class="inactive">
  14648. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  14649. </li>
  14650. <li class="inactive">
  14651. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  14652. </li>
  14653. <li class="inactive">
  14654. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  14655. </li>
  14656. <li class="inactive">
  14657. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  14658. </li>
  14659. <li class="inactive">
  14660. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  14661. </li>
  14662. </ul>
  14663. </li>
  14664. <li class="inactive">
  14665. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  14666. </li>
  14667. <li class="inactive">
  14668. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  14669. </li>
  14670. <li class="inactive">
  14671. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  14672. </li>
  14673. <li class="inactive">
  14674. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  14675. </li>
  14676. </ul>
  14677. </li>
  14678. <li class="inactive toggle">
  14679. <a href="javascript:void(0)" title="Community">Community</a>
  14680. <ul class="navL2">
  14681. <li class="inactive">
  14682. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  14683. </li>
  14684. <li class="inactive">
  14685. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  14686. </li>
  14687. <li class="inactive">
  14688. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  14689. </li>
  14690. <li class="inactive">
  14691. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  14692. </li>
  14693. <li class="inactive">
  14694. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  14695. </li>
  14696. </ul>
  14697. </li>
  14698. <li class="inactive current toggle">
  14699. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  14700. <ul class="navL2">
  14701. <li class="inactive current">
  14702. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  14703. </li>
  14704. <li class="inactive">
  14705. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  14706. </li>
  14707. </ul>
  14708. </li>
  14709. <li class="inactive">
  14710. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  14711. </li>
  14712. </ul>
  14713. </nav>
  14714. </div>
  14715. </div>
  14716. </div>
  14717. <div class="right">
  14718. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  14719. <div class="SearchBox">
  14720. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  14721. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  14722. <div id="search-finder" class="search-finder"></div>
  14723. </button>
  14724. <button id="HeaderSearchButton" style="display:none"></button>
  14725. <div id="searchSplitter"></div>
  14726. <div id="searchCloseIcon" class="search-clear-x"></div>
  14727. <div id="searchTextContainer" style="width: 0;">
  14728. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  14729. </div>
  14730. </form>
  14731. </div>
  14732. </div>
  14733. </div>
  14734. </div>
  14735. </div>
  14736. </div>
  14737. </header>
  14738. </div>
  14739. <div class="printExportMenus ltr">
  14740. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fff554695(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  14741. Export (<span class="count">0</span>)
  14742. </a>
  14743. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/ff554695(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  14744. Print
  14745. </a>
  14746. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  14747. </a>
  14748. </div>
  14749. <div class="printExportMenus ltr">
  14750. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  14751. </div>
  14752. <div id="body" ms.pgarea="body">
  14753. <span id="tabletView_large"></span>
  14754. <span id="tabletView_small"></span>
  14755. <span id="mobileView"></span>
  14756. <div id="content" class="content">
  14757. <input type="hidden" id="printForPab" value="true">
  14758. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  14759. <h1 class="title">Header files in the Windows Driver Kit</h1>
  14760. <div id="mainSection">
  14761. <div class="clsServerSDKContent">
  14762. </div>
  14763. <p>The <a href="https://msdn.microsoft.com/en-us/library/ff557573(v=vs.85).aspx">Windows Driver Kit (WDK)</a> contains all the header files (.h files) that you need to build kernel-mode and user-mode drivers. Header files are in the Include folder in your WDK installation folder. Example: C:\Program Files (x86)\Windows Kits\10\Include.</p>
  14764. <p>The header files contain version information so that you can use the same set of header files regardless of which version of Windows your driver will run on.</p>
  14765. <h2><a id="Constants_that_represent_Windows_versions"></a><a id="constants_that_represent_windows_versions"></a><a id="CONSTANTS_THAT_REPRESENT_WINDOWS_VERSIONS"></a>Constants that represent Windows versions</h2>
  14766. <p>Header files in the WDK contain conditional statements that specify programming elements that are available only in certain versions of the Windows operating system. The versioned elements include functions, enumerations, structures, and structure members.</p>
  14767. <p>To specify the programming elements that are available in each operating system version, the header files contain preprocessor conditionals that compare the value of NTDDI_VERSION with a set of predefined constant values that are defined in Sdkddkver.h.</p>
  14768. <p>Here are the predefined constant values that represent versions of the Microsoft Windows operating system. </p>
  14769. <table responsive="true">
  14770. <tbody><tr responsive="true"><th>Constant</th><th>Operating system version</th></tr>
  14771. <tr><td data-th="Constant">
  14772. <p>NTDDI_WIN10</p>
  14773. </td><td data-th="Operating system version">
  14774. <p>Windows&nbsp;10</p>
  14775. </td></tr>
  14776. <tr><td data-th="Constant">
  14777. <p>NTDDI_WINBLUE</p>
  14778. </td><td data-th="Operating system version">
  14779. <p>Windows&nbsp;8.1</p>
  14780. </td></tr>
  14781. <tr><td data-th="Constant">
  14782. <p>NTDDI_WIN8</p>
  14783. </td><td data-th="Operating system version">
  14784. <p>Windows&nbsp;8</p>
  14785. </td></tr>
  14786. <tr><td data-th="Constant">
  14787. <p>NTDDI_WIN7</p>
  14788. </td><td data-th="Operating system version">
  14789. <p>Windows 7</p>
  14790. </td></tr>
  14791. <tr><td data-th="Constant">
  14792. <p>NTDDI_WS08SP4</p>
  14793. </td><td data-th="Operating system version">
  14794. <p>Windows Server 2008 with SP4</p>
  14795. </td></tr>
  14796. <tr><td data-th="Constant">
  14797. <p>NTDDI_WS08SP3</p>
  14798. </td><td data-th="Operating system version">
  14799. <p>Windows Server 2008 with SP3</p>
  14800. </td></tr>
  14801. <tr><td data-th="Constant">
  14802. <p>NTDDI_WS08SP2</p>
  14803. </td><td data-th="Operating system version">
  14804. <p>Windows Server 2008 with SP2</p>
  14805. </td></tr>
  14806. <tr><td data-th="Constant">
  14807. <p>NTDDI_WS08</p>
  14808. </td><td data-th="Operating system version">
  14809. <p>Windows Server 2008</p>
  14810. </td></tr>
  14811. </tbody></table>
  14812. <p>&nbsp;</p>
  14813. <p>You can see many examples of version-specific DDI elements in the WDK header files. This conditional declaration appears in Wdm.h, which is a header file that might be included by a kernel-mode driver.</p>
  14814. <div id="code-snippet-1" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  14815. <div class="codeSnippetContainerTabs">
  14816. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  14817. <a></a>
  14818. </div>
  14819. </div>
  14820. <div class="codeSnippetContainerCodeContainer">
  14821. <div class="codeSnippetToolBar"></div>
  14822. <div class="codeSnippetContainerCode" dir="ltr">
  14823. <div style="color:Black;"><pre>
  14824. #if (NTDDI_VERSION &gt;= NTDDI_WIN7)
  14825. _Must_inspect_result_
  14826. NTKERNELAPI
  14827. NTSTATUS
  14828. KeSetTargetProcessorDpcEx (
  14829. _Inout_ PKDPC Dpc,
  14830. _In_ PPROCESSOR_NUMBER ProcNumber
  14831. );
  14832. #endif
  14833. </pre></div>
  14834. </div>
  14835. </div>
  14836. </div>
  14837. <p>In the example you can see that the <a href="https://msdn.microsoft.com/en-us/library/ff553279(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeSetTargetProcessorDpcEx</strong></a> function is available only in Windows 7 and later versions of Windows. </p>
  14838. <p>This conditional declaration appears in Winspool.h, which is a header file that might be included by a user-mode driver. </p>
  14839. <div id="code-snippet-2" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  14840. <div class="codeSnippetContainerTabs">
  14841. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  14842. <a>C++</a>
  14843. </div>
  14844. </div>
  14845. <div class="codeSnippetContainerCodeContainer">
  14846. <div class="codeSnippetToolBar"></div>
  14847. <div class="codeSnippetContainerCode" dir="ltr">
  14848. <div style="color:Black;"><pre>
  14849. #<span style="color:Blue;">if</span> (NTDDI_VERSION &gt;= NTDDI_WIN7)
  14850. ...
  14851. BOOL
  14852. WINAPI
  14853. GetPrintExecutionData(
  14854. _Out_ PRINT_EXECUTION_DATA *pData
  14855. );
  14856. #endif <span style="color:Green;">// (NTDDI_VERSION &gt;= NTDDI_WIN7)</span>
  14857. </pre></div>
  14858. </div>
  14859. </div>
  14860. </div>
  14861. <p>In the example can see that the <a href="https://msdn.microsoft.com/en-us/library/ee264322(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">GetPrintExecutionData</strong></a> function is available only in Windows 7 and later versions of Windows. </p>
  14862. <h2><a id="Header_files_for_the_Kernel_Mode_Driver_Framework"></a><a id="header_files_for_the_kernel_mode_driver_framework"></a><a id="HEADER_FILES_FOR_THE_KERNEL_MODE_DRIVER_FRAMEWORK"></a>Header files for the Kernel Mode Driver Framework</h2>
  14863. <p>The WDK supports several versions of Windows, and it also supports several versions of the Kernel Mode Driver Framework (KMDF) and User Mode Driver Framework (UMDF). The versioning information in the WDK header files pertains to Windows versions, but not to KMDF or UMDF versions. Header files for different versions of KMDF and UMDF are placed in separate directories.</p>
  14864. <p>&nbsp;</p>
  14865. <p>&nbsp;</p>
  14866. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Header%20files%20in%20the%20Windows%20Driver%20Kit%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  14867. </div>
  14868. </div>
  14869. </div>
  14870. </div>
  14871. <div class="clear"></div>
  14872. <input name="__RequestVerificationToken" type="hidden" value="RVJg7wyDF6W9g5E5Jh4tFmqUZBZOboyQ5yxvxGXMTCYYUn3UZlNRVbCN86vEKfyGiBA5TJ-iuQmJH7CKydqkI1VYdOA1">
  14873. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/ff554695(d=printer,v=vs.85).aspx">
  14874. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/ff554695(d=printer,v=vs.85).aspx">
  14875. <input id="isTopicRated" type="hidden" value="false">
  14876. <div id="lib-footer" ms.pgarea="body">
  14877. <link type="text/css" rel="stylesheet">
  14878. <div id="ux-footer" class="" style="" dir="ltr">
  14879. <div id="footerSock" class="librarySock both">
  14880. <div id="footerSockInner">
  14881. <a name="feedback"></a>
  14882. <div class="rating">
  14883. <div id="ratingSection1">
  14884. <div class="title">
  14885. Was this page helpful?
  14886. </div>
  14887. <div class="description">
  14888. Your feedback about this content is important.<br>Let us know what you think.
  14889. </div>
  14890. <div class="buttons">
  14891. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  14892. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  14893. </div>
  14894. <input id="ratingValue" type="hidden" value="">
  14895. </div>
  14896. <div id="ratingSection2">
  14897. <div class="title left">
  14898. Additional feedback?
  14899. </div>
  14900. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  14901. <div class="right">
  14902. <div class="counter">
  14903. <span id="feedbackTextCounter">1500</span> characters remaining
  14904. </div>
  14905. <div class="buttons">
  14906. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  14907. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  14908. </div>
  14909. </div>
  14910. </div>
  14911. <div id="ratingSection3">
  14912. <div class="title">
  14913. Thank you!
  14914. </div>
  14915. <div class="description">
  14916. We appreciate your feedback.
  14917. </div>
  14918. </div>
  14919. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  14920. </div>
  14921. <div class="userVoice">
  14922. <div class="title">
  14923. Help us improve MSDN.
  14924. </div>
  14925. <div class="description">
  14926. Visit our UserVoice Page to submit and vote on ideas!
  14927. </div>
  14928. <div class="buttons">
  14929. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  14930. </div>
  14931. </div>
  14932. <div class="clear"></div>
  14933. </div>
  14934. </div>
  14935. <footer class="top">
  14936. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  14937. <div class="linkList">
  14938. <div class="linkListTitle">Dev centers</div>
  14939. <ul class="links">
  14940. <li>
  14941. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  14942. </li>
  14943. <li>
  14944. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  14945. </li>
  14946. <li>
  14947. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  14948. </li>
  14949. <li>
  14950. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  14951. </li>
  14952. <li>
  14953. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  14954. </li>
  14955. </ul>
  14956. </div>
  14957. </div>
  14958. <div id="rightLinks">
  14959. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  14960. <div class="linkList">
  14961. <div class="linkListTitle">Learning resources</div>
  14962. <ul class="links">
  14963. <li>
  14964. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  14965. </li>
  14966. <li>
  14967. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  14968. </li>
  14969. <li>
  14970. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  14971. </li>
  14972. </ul>
  14973. </div>
  14974. </div>
  14975. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  14976. <div class="linkList">
  14977. <div class="linkListTitle">Community</div>
  14978. <ul class="links">
  14979. <li>
  14980. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  14981. </li>
  14982. <li>
  14983. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  14984. </li>
  14985. <li>
  14986. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  14987. </li>
  14988. </ul>
  14989. </div>
  14990. </div>
  14991. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  14992. <div class="linkList">
  14993. <div class="linkListTitle">Support</div>
  14994. <ul class="links">
  14995. <li>
  14996. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  14997. </li>
  14998. </ul>
  14999. </div>
  15000. </div>
  15001. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  15002. <div class="linkList">
  15003. <div class="linkListTitle">Programs</div>
  15004. <ul class="links">
  15005. <li>
  15006. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  15007. </li>
  15008. <li>
  15009. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  15010. </li>
  15011. <li>
  15012. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  15013. </li>
  15014. </ul>
  15015. </div>
  15016. </div>
  15017. </div>
  15018. </footer>
  15019. <footer class="bottom">
  15020. <span class="localeContainer">
  15021. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  15022. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554695(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  15023. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  15024. </form>
  15025. </span>
  15026. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  15027. <div class="linkList">
  15028. <ul class="links horizontal">
  15029. <li>
  15030. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  15031. </li>
  15032. <li>
  15033. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  15034. </li>
  15035. <li>
  15036. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  15037. </li>
  15038. <li>
  15039. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  15040. </li>
  15041. </ul>
  15042. </div>
  15043. </div>
  15044. <span class="logoLegal">
  15045. <span class="logo"></span>
  15046. <span class="copyright">© 2016 Microsoft</span>
  15047. </span>
  15048. </footer>
  15049. </div>
  15050. </div>
  15051. <div class="footerPrintView">
  15052. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  15053. </div>
  15054. <input id="tocPaddingPerLevel" type="hidden" value="17">
  15055. <input id="MtpsDevice" type="hidden" value="Printer">
  15056. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  15057. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  15058. <div id="globalRequestVerification">
  15059. <input name="__RequestVerificationToken" type="hidden" value="Y1wTVs9PoWeJ6NCjt9TJ06BcTYiGpZg2KiAgREVat586xVONgdN8mQcF93AusPg1Xv8bxuAmGBHdCIWbJ0-b8N0VY-s1">
  15060. </div>
  15061. </div>
  15062. <script type="text/javascript" class="mtps-injected">
  15063. /*<![CDATA[*/
  15064. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  15065. MTPS.injectScripts([
  15066. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  15067. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/ff554695(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  15068. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  15069. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  15070. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  15071. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  15072. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  15073. ]);
  15074. /*]]>*/
  15075. </script>
  15076. <link rel="stylesheet" type="text/css" href="./Windows Kernel Development Articles (2016-03-30)_files/Combined.css">
  15077. <div id="page">
  15078. <link type="text/css" rel="stylesheet">
  15079. <input type="hidden" id="isHeaderBleeding" value="true">
  15080. <div id="ux-header" dir="ltr" class="ltr msdn">
  15081. <header>
  15082. <span id="singleCol"></span>
  15083. <span id="doubleCol"></span>
  15084. <span id="isMobile"></span>
  15085. <div>
  15086. <div class="row topRow">
  15087. <div class="top">
  15088. <div class="left">
  15089. <a class="msdnLogoImg" href="https://msdn.microsoft.com/en-us" title="MSDN home">
  15090. <div id="msft-logo" class="msft-logo"></div>
  15091. </a>
  15092. <div class="GrayPipe"></div>
  15093. <a class="DevCenterFullNameNonMegaBlade" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  15094. <a class="DevCenterFullName" href="https://msdn.microsoft.com/en-us">Developer Network</a>
  15095. <a class="DevCenterShortName" href="https://msdn.microsoft.com/en-us">Developer</a>
  15096. </div>
  15097. <div class="right">
  15098. <div id="signIn">
  15099. <div class="profileImage"></div>
  15100. <a class="scarabLink" href="https://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=12&amp;ct=1459376425&amp;rver=6.0.5276.0&amp;wp=mcmbi&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554887%2528d%3dprinter%2cv%3dvs.85%2529.aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook&amp;lc=1033&amp;id=254354&amp;mkt=en-us" title="Sign in">Sign in</a></div>
  15101. <div class="auxNav">
  15102. <div>
  15103. <div data-fragmentname="Subscriptions" id="Fragment_Subscriptions" xmlns="http://www.w3.org/1999/xhtml">
  15104. <a href="https://msdn.microsoft.com/subscriptions/manage/hh442900" id="Subscriptions_2153_1" xmlns="http://www.w3.org/1999/xhtml">MSDN subscriptions</a>
  15105. </div>
  15106. <div data-fragmentname="GetTools" id="Fragment_GetTools" xmlns="http://www.w3.org/1999/xhtml">
  15107. <a href="http://go.microsoft.com/fwlink/?LinkId=309297&amp;clcid=0x409&amp;slcid=0x409&amp;campaign=o~msft~msdn~gettools-header~dn308572" id="GetTools_2153_3" xmlns="http://www.w3.org/1999/xhtml">Get tools</a>
  15108. </div>
  15109. </div>
  15110. <div>
  15111. <div data-fragmentname="SocialLinks" id="Fragment_SocialLinks" xmlns="http://www.w3.org/1999/xhtml">
  15112. <div class="linkList">
  15113. <ul class="links horizontal">
  15114. <li>
  15115. <a href="http://www.facebook.com/microsoftdeveloper" target="_blank" id="SocialLinks_2152_4" class="facebook" xmlns="http://www.w3.org/1999/xhtml">http://www.facebook.com/microsoftdeveloper</a>
  15116. </li>
  15117. <li>
  15118. <a href="https://twitter.com/msdev" target="_blank" id="SocialLinks_2152_5" class="twitter" xmlns="http://www.w3.org/1999/xhtml">https://twitter.com/msdev</a>
  15119. </li>
  15120. <li>
  15121. <a href="http://plus.google.com/111221966647232053570/" target="_blank" id="SocialLinks_2152_6" class="googlePlus" xmlns="http://www.w3.org/1999/xhtml">http://plus.google.com/111221966647232053570/</a>
  15122. </li>
  15123. </ul>
  15124. </div>
  15125. </div>
  15126. </div>
  15127. </div>
  15128. </div>
  15129. </div>
  15130. </div>
  15131. <div class="row middleRow">
  15132. <div class="expandTop">
  15133. <div class="left"></div>
  15134. <div class="right"></div>
  15135. </div>
  15136. </div>
  15137. </div>
  15138. <div id="buttomRowWrapper" class="bg_default">
  15139. <div class="row buttomRow bg_default">
  15140. <div class="bottom">
  15141. <div class="left">
  15142. <a id="grip" class="menu-icon" href="javascript:void(0)"></a>
  15143. <div id="drawer">
  15144. <div class="toc">
  15145. <nav>
  15146. <ul class="navL1">
  15147. <li class="inactive toggle">
  15148. <a href="javascript:void(0)" title="Technologies">Technologies</a>
  15149. <ul class="navL2">
  15150. <li class="inactive">
  15151. <a href="https://msdn.microsoft.com/cloud-app-development-msdn" title="Cloud">Cloud</a>
  15152. </li>
  15153. <li class="inactive">
  15154. <a href="https://msdn.microsoft.com/app-development-msdn" title="App Development">App Development</a>
  15155. </li>
  15156. <li class="inactive">
  15157. <a href="https://msdn.microsoft.com/web-app-development-msdn" title="Web">Web</a>
  15158. </li>
  15159. <li class="inactive">
  15160. <a href="https://msdn.microsoft.com/big-data-development-msdn" title="Data">Data</a>
  15161. </li>
  15162. <li class="inactive">
  15163. <a href="https://msdn.microsoft.com/games-development-msdn" title="Gaming">Gaming</a>
  15164. </li>
  15165. <li class="inactive">
  15166. <a href="https://msdn.microsoft.com/internetofthings" title="Internet of Things">Internet of Things</a>
  15167. </li>
  15168. </ul>
  15169. </li>
  15170. <li class="inactive toggle">
  15171. <a href="javascript:void(0)" title="Downloads">Downloads</a>
  15172. <ul class="navL2">
  15173. <li class="inactive">
  15174. <a href="https://www.visualstudio.com/downloads/download-visual-studio-vs" title="Visual Studio">Visual Studio</a>
  15175. </li>
  15176. <li class="inactive">
  15177. <a href="https://msdn.microsoft.com/subscriptions" title="MSDN subscription access">MSDN subscription access</a>
  15178. </li>
  15179. <li class="inactive">
  15180. <a href="https://msdn.microsoft.com/microsoft-sdks-msdn" title="SDKs">SDKs</a>
  15181. </li>
  15182. <li class="inactive toggle">
  15183. <a href="javascript:void(0)" title="Trial software">Trial software</a>
  15184. <ul class="navL3">
  15185. <li class="inactive">
  15186. <a href="https://msdn.microsoft.com/evalcenter" title="Free downloads">Free downloads</a>
  15187. </li>
  15188. <li class="inactive">
  15189. <a href="https://msdn.microsoft.com/officeevaluationresources" title="Office resources">Office resources</a>
  15190. </li>
  15191. <li class="inactive">
  15192. <a href="https://msdn.microsoft.com/sharepoint2013resources" title="SharePoint Server 2013 resources">SharePoint Server 2013 resources</a>
  15193. </li>
  15194. <li class="inactive">
  15195. <a href="https://msdn.microsoft.com/sqlserver2014expressresources" title="SQL Server 2014 Express resources">SQL Server 2014 Express resources</a>
  15196. </li>
  15197. <li class="inactive">
  15198. <a href="https://msdn.microsoft.com/windowsserver2012r2resources" title="Windows Server 2012 resources">Windows Server 2012 resources</a>
  15199. </li>
  15200. </ul>
  15201. </li>
  15202. </ul>
  15203. </li>
  15204. <li class="inactive toggle">
  15205. <a href="javascript:void(0)" title="Programs">Programs</a>
  15206. <ul class="navL2">
  15207. <li class="inactive toggle">
  15208. <a href="javascript:void(0)" title="Visual Studio subscriptions">Visual Studio subscriptions</a>
  15209. <ul class="navL3">
  15210. <li class="inactive">
  15211. <a href="https://msdn.microsoft.com/msdn-subscriptions-overview" title="Overview">Overview</a>
  15212. </li>
  15213. <li class="inactive">
  15214. <a href="https://msdn.microsoft.com/benefits-overview" title="Benefits">Benefits</a>
  15215. </li>
  15216. <li class="inactive">
  15217. <a href="https://msdn.microsoft.com/msdn-subscriptions-administration" title="Administrators">Administrators</a>
  15218. </li>
  15219. </ul>
  15220. </li>
  15221. <li class="inactive toggle">
  15222. <a href="javascript:void(0)" title="Students">Students</a>
  15223. <ul class="navL3">
  15224. <li class="inactive">
  15225. <a href="https://msdn.microsoft.com/imagine/imagine-home" title="Microsoft Imagine">Microsoft Imagine</a>
  15226. </li>
  15227. <li class="inactive">
  15228. <a href="https://msdn.microsoft.com/microsoftstudentpartners" title="Microsoft Student Partners">Microsoft Student Partners</a>
  15229. </li>
  15230. </ul>
  15231. </li>
  15232. <li class="inactive toggle">
  15233. <a href="javascript:void(0)" title="Architects">Architects</a>
  15234. <ul class="navL3">
  15235. <li class="inactive">
  15236. <a href="https://msdn.microsoft.com/architects-overview-msdn" title="Overview">Overview</a>
  15237. </li>
  15238. <li class="inactive">
  15239. <a href="https://msdn.microsoft.com/architects-case-studies-msdn" title="Case studies">Case studies</a>
  15240. </li>
  15241. <li class="inactive">
  15242. <a href="https://msdn.microsoft.com/architects-blueprints-msdn" title="Blueprints">Blueprints</a>
  15243. </li>
  15244. <li class="inactive">
  15245. <a href="http://blogs.msdn.com/b/msarchitecture/" title="Blog">Blog</a>
  15246. </li>
  15247. <li class="inactive">
  15248. <a href="http://social.msdn.microsoft.com/forums/en-us/home?brandignore=true&amp;sort=relevancedesc&amp;searchterm=architecture+or+architect" title="Forums">Forums</a>
  15249. </li>
  15250. </ul>
  15251. </li>
  15252. <li class="inactive">
  15253. <a href="https://msdn.microsoft.com/applicationbuilder" title="ISV">ISV</a>
  15254. </li>
  15255. <li class="inactive">
  15256. <a href="https://www.microsoft.com/bizspark" title="Startups">Startups</a>
  15257. </li>
  15258. <li class="inactive">
  15259. <a href="https://rewards.msdn.microsoft.com/" title="TechRewards">TechRewards</a>
  15260. </li>
  15261. <li class="inactive">
  15262. <a href="http://events.msdn.microsoft.com/" title="Events">Events</a>
  15263. </li>
  15264. </ul>
  15265. </li>
  15266. <li class="inactive toggle">
  15267. <a href="javascript:void(0)" title="Community">Community</a>
  15268. <ul class="navL2">
  15269. <li class="inactive">
  15270. <a href="https://msdn.microsoft.com/magazine/dd767791" title="Magazine">Magazine</a>
  15271. </li>
  15272. <li class="inactive">
  15273. <a href="https://social.msdn.microsoft.com/forums/" title="Forums">Forums</a>
  15274. </li>
  15275. <li class="inactive">
  15276. <a href="http://blogs.msdn.com/b/developer-tools/" title="Blogs">Blogs</a>
  15277. </li>
  15278. <li class="inactive">
  15279. <a href="http://tech-advisors.msdn.microsoft.com/en-us" title="Tech Advisors">Tech Advisors</a>
  15280. </li>
  15281. <li class="inactive">
  15282. <a href="http://channel9.msdn.com/" title="Channel 9">Channel 9</a>
  15283. </li>
  15284. </ul>
  15285. </li>
  15286. <li class="inactive current toggle">
  15287. <a href="javascript:void(0)" title="Documentation">Documentation</a>
  15288. <ul class="navL2">
  15289. <li class="inactive current">
  15290. <a href="https://msdn.microsoft.com/library" title="APIs and reference">APIs and reference</a>
  15291. </li>
  15292. <li class="inactive">
  15293. <a href="https://msdn.microsoft.com/developer-centers-msdn" title="Dev centers">Dev centers</a>
  15294. </li>
  15295. </ul>
  15296. </li>
  15297. <li class="inactive">
  15298. <a href="https://code.msdn.microsoft.com/" title="Samples">Samples</a>
  15299. </li>
  15300. </ul>
  15301. </nav>
  15302. </div>
  15303. </div>
  15304. </div>
  15305. <div class="right">
  15306. <div data-fragmentname="SearchBox" id="Fragment_SearchBox" xmlns="http://www.w3.org/1999/xhtml">
  15307. <div class="SearchBox">
  15308. <form id="HeaderSearchForm" name="HeaderSearchForm" method="get">
  15309. <button id="FakeHeaderSearchButton" value="Search" type="submit" class="header-search-button">
  15310. <div id="search-finder" class="search-finder"></div>
  15311. </button>
  15312. <button id="HeaderSearchButton" style="display:none"></button>
  15313. <div id="searchSplitter"></div>
  15314. <div id="searchCloseIcon" class="search-clear-x"></div>
  15315. <div id="searchTextContainer" style="width: 0;">
  15316. <input id="HeaderSearchTextBox" name="query" type="text" maxlength="200" onfocus="Epx.Controls.SearchBox.watermarkFocus(event, this.title)" onblur="Epx.Controls.SearchBox.watermarkBlur(event, this.title)">
  15317. </div>
  15318. </form>
  15319. </div>
  15320. </div>
  15321. </div>
  15322. </div>
  15323. </div>
  15324. </div>
  15325. </header>
  15326. </div>
  15327. <div class="printExportMenus ltr">
  15328. <a id="isd_printABook" href="http://msdn.microsoft.com/en-us/library/export/help/(d=printer)?returnurl=%2fen-us%2flibrary%2fff554887(d%3dprinter,v%3dvs.85).aspx%3flan%3dcsharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  15329. Export (<span class="count">0</span>)
  15330. </a>
  15331. <a id="isd_print" href="https://msdn.microsoft.com/en-us/library/ff554887(d=printer,v=vs.85).aspx?lan=csharp&amp;cc=n&amp;trm=tra&amp;view=book" rel="nofollow">
  15332. Print
  15333. </a>
  15334. <a id="isd_archiveControl" style="display:none;" data-include-archive="Include Previous Version" data-exclude-archive="Exclude Previous Version">
  15335. </a>
  15336. </div>
  15337. <div class="printExportMenus ltr">
  15338. <a id="expandCollapseAll" accesskey="e" href="javascript:void(0)" title="Expand/Collapse all sections by pressing Ctrl + Shift + e">Expand All</a>
  15339. </div>
  15340. <div id="body" ms.pgarea="body">
  15341. <span id="tabletView_large"></span>
  15342. <span id="tabletView_small"></span>
  15343. <span id="mobileView"></span>
  15344. <div id="content" class="content">
  15345. <input type="hidden" id="printForPab" value="true">
  15346. <div class="topic" xmlns="http://www.w3.org/1999/xhtml">
  15347. <h1 class="title">Writing drivers for different versions of Windows</h1>
  15348. <div id="mainSection">
  15349. <div class="clsServerSDKContent">
  15350. </div>
  15351. <p>When you create a driver project, you specify the minimum target operating system, which is the minimum version of Windows that your driver will run on. For example, you could specify that Windows 7 is the minimum target operating system. In that case, your driver would run on Windows 7 and later versions of Windows.</p>
  15352. <div class="alert"><strong>Note</strong>&nbsp;&nbsp;If you develop a driver for a particular minimum version of Windows and you want your driver to work on later versions of Windows, you must not use any undocumented functions, and you must not use documented functions in any way other than how it is described in the documentation. Otherwise your driver might fail to run on the later versions of Windows. Even if you have been careful to use only documented functions, you should test your driver on the new version of Windows each time one is released.</div>
  15353. <div>&nbsp;</div>
  15354. <h2><a id="Writing_a_multiversion_driver_using_only_common_features"></a><a id="writing_a_multiversion_driver_using_only_common_features"></a><a id="WRITING_A_MULTIVERSION_DRIVER_USING_ONLY_COMMON_FEATURES"></a>Writing a multiversion driver using only common features</h2>
  15355. <p>When you design a driver that will run on multiple versions of Windows, the simplest approach is to allow the driver to use only DDI functions and structures that are common to all versions of Windows that the driver will run on. In this situation, you set the minimum target operating system to the earliest version of Windows that the driver will support.</p>
  15356. <p>For example, to support all versions of Windows, starting with Windows 7, you should:</p>
  15357. <ol>
  15358. <li>
  15359. <p>Design and implement the driver so that it uses only those features that are present in Windows 7. </p>
  15360. </li>
  15361. <li>
  15362. <p>When you build your driver, specify Windows 7 as the minimum target operating system.</p>
  15363. </li>
  15364. </ol>
  15365. <p>While this process is simple, it might restrict the driver to use only a subset of the functionality that is available on later versions of Windows. </p>
  15366. <h2><a id="Writing_a_multiversion_driver_that_uses_version-dependent_features"></a><a id="writing_a_multiversion_driver_that_uses_version-dependent_features"></a><a id="WRITING_A_MULTIVERSION_DRIVER_THAT_USES_VERSION-DEPENDENT_FEATURES"></a>Writing a multiversion driver that uses version-dependent features</h2>
  15367. <p>A kernel-mode driver can dynamically determine which version of Windows it is running on and choose to use features that are available in that version. For example, a driver that must support all versions of Windows, starting with Windows 7, can determine, at run time, the version of Windows that it is running on. If the driver is running on Windows 7, it must use only the DDI functions that Windows 7 supports. However, the same driver can use additional DDI functions that are unique to Windows&nbsp;8, for example, when its run-time check determines that it is running on Windows&nbsp;8.</p>
  15368. <h3><a id="determining_the_windows_version"></a><a id="DETERMINING_THE_WINDOWS_VERSION"></a>Determining the Windows version</h3>
  15369. <p>
  15370. <a href="https://msdn.microsoft.com/en-us/library/ff561954(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">RtlIsNtDdiVersionAvailable</strong></a> is a function that drivers can use to determine, at run time, if the features that are provided by a particular version of Windows are available. The prototype for this function is as follows:</p>
  15371. <div id="code-snippet-1" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  15372. <div class="codeSnippetContainerTabs">
  15373. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  15374. <a></a>
  15375. </div>
  15376. </div>
  15377. <div class="codeSnippetContainerCodeContainer">
  15378. <div class="codeSnippetToolBar"></div>
  15379. <div class="codeSnippetContainerCode" dir="ltr">
  15380. <div style="color:Black;"><pre>
  15381. BOOLEAN RtlIsNtDdiVersionAvailable(IN ULONG Version)
  15382. </pre></div>
  15383. </div>
  15384. </div>
  15385. </div>
  15386. <p>In this prototype, <em>Version</em> is a value that indicates the required version of the Windows DDI. This value must be one of the DDI version constants, defined in sdkddkver.h, such as NTDDI_WIN8 or NTDDI_WIN7.</p>
  15387. <p>
  15388. <a href="https://msdn.microsoft.com/en-us/library/ff561954(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">RtlIsNtDdiVersionAvailable</strong></a> returns TRUE when the caller is running on a version of Windows that is the same as, or later than, the one that is specified by <em>Version.</em></p>
  15389. <p>Your driver can also check for a specific service pack by calling the <a href="https://msdn.microsoft.com/en-us/library/ff561956(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">RtlIsServicePackVersionInstalled</strong></a> function. The prototype for this function is as follows:</p>
  15390. <div id="code-snippet-2" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  15391. <div class="codeSnippetContainerTabs">
  15392. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  15393. <a></a>
  15394. </div>
  15395. </div>
  15396. <div class="codeSnippetContainerCodeContainer">
  15397. <div class="codeSnippetToolBar"></div>
  15398. <div class="codeSnippetContainerCode" dir="ltr">
  15399. <div style="color:Black;"><pre>
  15400. BOOLEAN RtlIsServicePackVersionInstalled(IN ULONG Version)
  15401. </pre></div>
  15402. </div>
  15403. </div>
  15404. </div>
  15405. <p>In this prototype, <em>Version</em> is a value that indicates the required Windows version and service pack. This value must be one of the DDI version constants, defined in sdkddkver.h, such as NTDDI_WS08SP3.</p>
  15406. <p>Note that <a href="https://msdn.microsoft.com/en-us/library/ff561956(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">RtlIsServicePackVersionInstalled</strong></a> returns TRUE only when the operating system version exactly matches the specified version. Thus, a call to <strong>RtlIsServicePackVersionInstalled</strong> with <em>Version</em> set to NTDDI_WS08SP3 will fail if the driver is not running on Windows Server 2008 with SP4.</p>
  15407. <h3><a id="conditionally_calling_windows_version_dependent_functions"></a><a id="CONDITIONALLY_CALLING_WINDOWS_VERSION_DEPENDENT_FUNCTIONS"></a>Conditionally calling Windows version-dependent functions</h3>
  15408. <p>After a driver determines that a specific operating system version is available on the computer, the driver can use the <a href="https://msdn.microsoft.com/en-us/library/ff554563(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">MmGetSystemRoutineAddress</strong></a> function to dynamically locate the routine and call it through a pointer. This function is available in Windows 7 and later operating system versions.</p>
  15409. <div class="alert"><strong>Note</strong>&nbsp;&nbsp;To help preserve type checking and prevent unintentional errors, you should create a typedef that mirrors the original function type. </div>
  15410. <div>&nbsp;</div>
  15411. <h3><a id="example__determining_the_windows_version_and_conditionally_calling_a_v"></a><a id="EXAMPLE__DETERMINING_THE_WINDOWS_VERSION_AND_CONDITIONALLY_CALLING_A_V"></a>Example: Determining the Windows version and conditionally calling a version-dependent function</h3>
  15412. <p>This code example, which is from a driver's header file, defines the PAISQSL type as a pointer to the <a href="https://msdn.microsoft.com/en-us/library/ff551899(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeAcquireInStackQueuedSpinLock</strong></a> function. The example then declares a <code>AcquireInStackQueuedSpinLock</code> variable with this type.</p>
  15413. <div id="code-snippet-3" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  15414. <div class="codeSnippetContainerTabs">
  15415. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  15416. <a></a>
  15417. </div>
  15418. </div>
  15419. <div class="codeSnippetContainerCodeContainer">
  15420. <div class="codeSnippetToolBar"></div>
  15421. <div class="codeSnippetContainerCode" dir="ltr">
  15422. <div style="color:Black;"><pre>
  15423. ...
  15424. //
  15425. // Pointer to the ordered spin lock function.
  15426. // This function is only available on Windows 7 and
  15427. // later systems
  15428. typedef (* PAISQSL) (KeAcquireInStackQueuedSpinLock);
  15429. PAISQSL AcquireInStackQueued = NULL;
  15430. ...
  15431. </pre></div>
  15432. </div>
  15433. </div>
  15434. </div>
  15435. <p>This code example, which is from the driver's initialization code, determines whether the driver is running on Windows 7 or a later operating system. If it is, the code retrieves a pointer to <a href="https://msdn.microsoft.com/en-us/library/ff551899(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeAcquireInStackQueuedSpinLock</strong></a>. </p>
  15436. <div id="code-snippet-4" class="codeSnippetContainer" xmlns="http://www.w3.org/1999/xhtml">
  15437. <div class="codeSnippetContainerTabs">
  15438. <div class="codeSnippetContainerTab codeSnippetContainerTabActive" dir="ltr">
  15439. <a></a>
  15440. </div>
  15441. </div>
  15442. <div class="codeSnippetContainerCodeContainer">
  15443. <div class="codeSnippetToolBar"></div>
  15444. <div class="codeSnippetContainerCode" dir="ltr">
  15445. <div style="color:Black;"><pre>
  15446. ...
  15447. //
  15448. // Are we running on Windows 7 or later?
  15449. //
  15450. if (RtlIsNtDdiVersionAvailable(NTDDI_WIN7) ) {
  15451. //
  15452. // Yes... Windows 7 or later it is!
  15453. //
  15454. RtlInitUnicodeString(&amp;funcName,
  15455. L"KeAcquireInStackQueuedSpinLock");
  15456. //
  15457. // Get a pointer to Windows implementation
  15458. // of KeAcquireInStackQueuedSpinLock into our
  15459. // variable "AcquireInStackQueued"
  15460. AcquireInStackQueued = (PAISQSL)
  15461. MmGetSystemRoutineAddress(&amp;funcName);
  15462. }
  15463. ...
  15464. // Acquire a spin lock.
  15465. if( NULL != AcquireInStackQueued) {
  15466. (AcquireInStackQueued)(&amp;SpinLock, &amp;lockHandle);
  15467. } else {
  15468. KeAcquireSpinLock(&amp;SpinLock);
  15469. }
  15470. </pre></div>
  15471. </div>
  15472. </div>
  15473. </div>
  15474. <p>In the example the driver calls <a href="https://msdn.microsoft.com/en-us/library/ff561954(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">RtlIsNtDdiVersionAvailable</strong></a> to determine whether the driver is running on Windows 7 or later. If the version is Windows 7 or later, the driver calls <a href="https://msdn.microsoft.com/en-us/library/ff554563(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">MmGetSystemRoutineAddress</strong></a> to get a pointer to the <a href="https://msdn.microsoft.com/en-us/library/ff551899(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeAcquireInStackQueuedSpinLock</strong></a> function and stores this pointer in the variable named <code>AcquireInStackQueued</code> (which was declared as a PAISQSL type).</p>
  15475. <p>Later, when the driver must acquire a spin lock, it checks to see whether it has received a pointer to the <a href="https://msdn.microsoft.com/en-us/library/ff551899(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeAcquireInStackQueuedSpinLock</strong></a> function. If the driver has received this pointer, the driver uses the pointer to call <strong>KeAcquireInStackQueuedSpinLock</strong>. If the pointer to <strong>KeAcquireInStackQueuedSpinLock</strong> is null, the driver uses <a href="https://msdn.microsoft.com/en-us/library/ff551917(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">KeAcquireSpinLock</strong></a> to acquire the spin lock.</p>
  15476. <p>&nbsp;</p>
  15477. <p>&nbsp;</p>
  15478. <p><a href="mailto:wsddocfb@microsoft.com?subject=Documentation%20feedback%20[wdkgetstart\wdkgetstart]:%20Writing%20drivers%20for%20different%20versions%20of%20Windows%20%20RELEASE:%20(3/4/2016)&amp;body=%0A%0APRIVACY%20STATEMENT%0A%0AWe%20use%20your%20feedback%20to%20improve%20the%20documentation.%20We%20don%27t%20use%20your%20email%20address%20for%20any%20other%20purpose,%20and%20we%27ll%20remove%20your%20email%20address%20from%20our%20system%20after%20the%20issue%20that%20you%27re%20reporting%20is%20fixed.%20While%20we%27re%20working%20to%20fix%20this%20issue,%20we%20might%20send%20you%20an%20email%20message%20to%20ask%20for%20more%20info.%20Later,%20we%20might%20also%20send%20you%20an%20email%20message%20to%20let%20you%20know%20that%20we%27ve%20addressed%20your%20feedback.%0A%0AFor%20more%20info%20about%20Microsoft%27s%20privacy%20policy,%20see%20http://privacy.microsoft.com/en-us/default.aspx." title="Send comments about this topic to Microsoft">Send comments about this topic to Microsoft</a></p>
  15479. </div>
  15480. </div>
  15481. </div>
  15482. </div>
  15483. <div class="clear"></div>
  15484. <input name="__RequestVerificationToken" type="hidden" value="JptfarzzsqmAcEj8i7r-GuOsOjryrVn1xtKGqVeRsq3Lg9fuDow3XWWeMaDMUESY7kv3bafp5-XXRH5iPPAWMR5Bqp01">
  15485. <input id="ratingValueSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/rate/ff554887(d=printer,v=vs.85).aspx">
  15486. <input id="ratingAdditionalSubmitUrl" type="hidden" value="https://msdn.microsoft.com/en-us/library/feedback/additional/ff554887(d=printer,v=vs.85).aspx">
  15487. <input id="isTopicRated" type="hidden" value="false">
  15488. <div id="lib-footer" ms.pgarea="body">
  15489. <link type="text/css" rel="stylesheet">
  15490. <div id="ux-footer" class="" style="" dir="ltr">
  15491. <div id="footerSock" class="librarySock both">
  15492. <div id="footerSockInner">
  15493. <a name="feedback"></a>
  15494. <div class="rating">
  15495. <div id="ratingSection1">
  15496. <div class="title">
  15497. Was this page helpful?
  15498. </div>
  15499. <div class="description">
  15500. Your feedback about this content is important.<br>Let us know what you think.
  15501. </div>
  15502. <div class="buttons">
  15503. <button class="button" id="ratingYes" aria-label="Yes, this page was helpful">Yes</button>
  15504. <button class="button" id="ratingNo" aria-label="No, this page was not helpful">No</button>
  15505. </div>
  15506. <input id="ratingValue" type="hidden" value="">
  15507. </div>
  15508. <div id="ratingSection2">
  15509. <div class="title left">
  15510. Additional feedback?
  15511. </div>
  15512. <textarea id="ratingText" rows="6" cols="" maxlength="1500"></textarea>
  15513. <div class="right">
  15514. <div class="counter">
  15515. <span id="feedbackTextCounter">1500</span> characters remaining
  15516. </div>
  15517. <div class="buttons">
  15518. <button class="button" id="ratingSubmit" aria-label="Submit my additional feedback">Submit</button>
  15519. <button class="button" id="ratingSkipThis" aria-label="Skip additional feedback">Skip this</button>
  15520. </div>
  15521. </div>
  15522. </div>
  15523. <div id="ratingSection3">
  15524. <div class="title">
  15525. Thank you!
  15526. </div>
  15527. <div class="description">
  15528. We appreciate your feedback.
  15529. </div>
  15530. </div>
  15531. <div id="contentFeedbackQAContainer" style="display: none;"></div>
  15532. </div>
  15533. <div class="userVoice">
  15534. <div class="title">
  15535. Help us improve MSDN.
  15536. </div>
  15537. <div class="description">
  15538. Visit our UserVoice Page to submit and vote on ideas!
  15539. </div>
  15540. <div class="buttons">
  15541. <a class="button" id="userVoiceButton" href="http://feedback.msdn.com/forums/257782-msdn-feature-suggestions/category/83975" target="_blank">Make a suggestion</a>
  15542. </div>
  15543. </div>
  15544. <div class="clear"></div>
  15545. </div>
  15546. </div>
  15547. <footer class="top">
  15548. <div data-fragmentname="LeftLinks" id="Fragment_LeftLinks" xmlns="http://www.w3.org/1999/xhtml">
  15549. <div class="linkList">
  15550. <div class="linkListTitle">Dev centers</div>
  15551. <ul class="links">
  15552. <li>
  15553. <a href="https://dev.windows.com/" id="LeftLinks_2148_1" class="windowsBlue" xmlns="http://www.w3.org/1999/xhtml">Windows</a>
  15554. </li>
  15555. <li>
  15556. <a href="http://dev.office.com/" id="LeftLinks_2148_3" class="office" xmlns="http://www.w3.org/1999/xhtml">Office</a>
  15557. </li>
  15558. <li>
  15559. <a href="https://msdn.microsoft.com/vstudio" id="LeftLinks_2148_4" class="visualStudio" xmlns="http://www.w3.org/1999/xhtml">Visual Studio</a>
  15560. </li>
  15561. <li>
  15562. <a href="http://azure.microsoft.com/en-us/documentation/" target="_blank" id="LeftLinks_2148_12" xmlns="http://www.w3.org/1999/xhtml">Microsoft Azure</a>
  15563. </li>
  15564. <li>
  15565. <a href="https://msdn.microsoft.com/developer-centers-msdn" id="LeftLinks_2148_5" xmlns="http://www.w3.org/1999/xhtml">More...</a>
  15566. </li>
  15567. </ul>
  15568. </div>
  15569. </div>
  15570. <div id="rightLinks">
  15571. <div data-fragmentname="CenterLinks1" id="Fragment_CenterLinks1" xmlns="http://www.w3.org/1999/xhtml">
  15572. <div class="linkList">
  15573. <div class="linkListTitle">Learning resources</div>
  15574. <ul class="links">
  15575. <li>
  15576. <a href="http://www.microsoftvirtualacademy.com/" id="CenterLinks1_2151_4" xmlns="http://www.w3.org/1999/xhtml">Microsoft Virtual Academy</a>
  15577. </li>
  15578. <li>
  15579. <a href="http://channel9.msdn.com/" id="CenterLinks1_2151_5" xmlns="http://www.w3.org/1999/xhtml">Channel 9</a>
  15580. </li>
  15581. <li>
  15582. <a href="https://msdn.microsoft.com/magazine/" id="CenterLinks1_2151_7" xmlns="http://www.w3.org/1999/xhtml">MSDN Magazine</a>
  15583. </li>
  15584. </ul>
  15585. </div>
  15586. </div>
  15587. <div data-fragmentname="CenterLinks2" id="Fragment_CenterLinks2" xmlns="http://www.w3.org/1999/xhtml">
  15588. <div class="linkList">
  15589. <div class="linkListTitle">Community</div>
  15590. <ul class="links">
  15591. <li>
  15592. <a href="https://social.msdn.microsoft.com/forums/en-us/home" id="CenterLinks2_2151_8" xmlns="http://www.w3.org/1999/xhtml">Forums</a>
  15593. </li>
  15594. <li>
  15595. <a href="http://blogs.msdn.com/b/developer-tools/" id="CenterLinks2_2151_9" xmlns="http://www.w3.org/1999/xhtml">Blogs</a>
  15596. </li>
  15597. <li>
  15598. <a href="http://www.codeplex.com/" id="CenterLinks2_2151_10" xmlns="http://www.w3.org/1999/xhtml">Codeplex</a>
  15599. </li>
  15600. </ul>
  15601. </div>
  15602. </div>
  15603. <div data-fragmentname="CenterLinks3" id="Fragment_CenterLinks3" xmlns="http://www.w3.org/1999/xhtml">
  15604. <div class="linkList">
  15605. <div class="linkListTitle">Support</div>
  15606. <ul class="links">
  15607. <li>
  15608. <a href="https://msdn.microsoft.com/hh361695" id="CenterLinks3_2151_11" xmlns="http://www.w3.org/1999/xhtml">Self support</a>
  15609. </li>
  15610. </ul>
  15611. </div>
  15612. </div>
  15613. <div data-fragmentname="CenterLinks4" id="Fragment_CenterLinks4" xmlns="http://www.w3.org/1999/xhtml">
  15614. <div class="linkList">
  15615. <div class="linkListTitle">Programs</div>
  15616. <ul class="links">
  15617. <li>
  15618. <a href="https://www.microsoft.com/bizspark/" id="CenterLinks4_2151_13" xmlns="http://www.w3.org/1999/xhtml">BizSpark (for startups)</a>
  15619. </li>
  15620. <li>
  15621. <a href="https://www.dreamspark.com/" id="CenterLinks4_2151_14" xmlns="http://www.w3.org/1999/xhtml">DreamSpark</a>
  15622. </li>
  15623. <li>
  15624. <a href="http://www.imaginecup.com/" id="CenterLinks4_2151_17" xmlns="http://www.w3.org/1999/xhtml">Imagine Cup</a>
  15625. </li>
  15626. </ul>
  15627. </div>
  15628. </div>
  15629. </div>
  15630. </footer>
  15631. <footer class="bottom">
  15632. <span class="localeContainer">
  15633. <form class="selectLocale" id="selectLocaleForm" action="https://msdn.microsoft.com/en-us/selectlocale-dmc">
  15634. <input type="hidden" name="fromPage" value="https%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fff554887(d%3dprinter%2cv%3dvs.85).aspx%3flan%3dCSharp%26cc%3dn%26trm%3dtra%26view%3dbook">
  15635. <a href="http://msdn.microsoft.com/#" onclick="$(&#39;#selectLocaleForm&#39;).submit();return false;" title="Change your language">United States (English)</a>
  15636. </form>
  15637. </span>
  15638. <div data-fragmentname="BottomLinks" id="Fragment_BottomLinks" xmlns="http://www.w3.org/1999/xhtml">
  15639. <div class="linkList">
  15640. <ul class="links horizontal">
  15641. <li>
  15642. <a href="https://msdn.microsoft.com/newsletter.aspx" id="BottomLinks_2148_7" xmlns="http://www.w3.org/1999/xhtml">Newsletter</a>
  15643. </li>
  15644. <li>
  15645. <a href="https://msdn.microsoft.com/dn529288" id="BottomLinks_2148_8" xmlns="http://www.w3.org/1999/xhtml">Privacy &amp; cookies</a>
  15646. </li>
  15647. <li>
  15648. <a href="https://msdn.microsoft.com/cc300389" id="BottomLinks_2148_9" xmlns="http://www.w3.org/1999/xhtml">Terms of use</a>
  15649. </li>
  15650. <li>
  15651. <a href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" id="BottomLinks_2148_10" xmlns="http://www.w3.org/1999/xhtml">Trademarks</a>
  15652. </li>
  15653. </ul>
  15654. </div>
  15655. </div>
  15656. <span class="logoLegal">
  15657. <span class="logo"></span>
  15658. <span class="copyright">© 2016 Microsoft</span>
  15659. </span>
  15660. </footer>
  15661. </div>
  15662. </div>
  15663. <div class="footerPrintView">
  15664. <div class="footerCopyrightPrintView">© 2016 Microsoft</div>
  15665. </div>
  15666. <input id="tocPaddingPerLevel" type="hidden" value="17">
  15667. <input id="MtpsDevice" type="hidden" value="Printer">
  15668. <!--[CDATA[ Third party scripts and code linked to or referenced from this website are licensed to you by the parties that own such code, not by Microsoft. See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]-->
  15669. <noscript>&lt;div&gt;&lt;img alt="DCSIMG" id="Img1" width="1" height="1" src="https://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;amp;WT.js=No" /&gt;&lt;/div&gt;</noscript>
  15670. <div id="globalRequestVerification">
  15671. <input name="__RequestVerificationToken" type="hidden" value="F3UvdPo5EosJimvWSZG06N1SN0PiydqJYUaPgOTLdO1DspN2nBCNSOq3Y_M0WX14oRtwAqI6ZEAkAdgwqJ8kksrWdkk1">
  15672. </div>
  15673. </div>
  15674. <script type="text/javascript" class="mtps-injected">
  15675. /*<![CDATA[*/
  15676. (function(window,document){"use strict";function preload(scripts){for(var result=[],script,e,i=0;i<scripts.length;i++)script=scripts[i],script.hasOwnProperty("url")&&(e=document.createElement("script"),e.src=script.url,script.throwaway=e),result.push(script);return result}function inject(scripts,index){var script,elem;if(index>=scripts.length){delete mtps.injectScripts;return}script=scripts[index];elem=document.createElement("script");elem.className="mtps-injected";elem.async=!1;var isLoaded=!1,timeoutId=0,injectNextFnName="",injectNext=elem.onerror=function(){isLoaded||(isLoaded=!0,inject(scripts,index+1),window.clearTimeout(timeoutId),elem.onload=elem.onerror=elem.onreadystatechange=null,injectNextFnName&&delete mtps[injectNextFnName],elem.removeEventListener&&elem.removeEventListener("load",injectNext,!1))};elem.addEventListener?elem.addEventListener("load",injectNext,!1):elem.readyState==="uninitialized"?elem.onreadystatechange=function(){(this.readyState==="loaded"||this.readyState==="complete")&&injectNext()}:elem.onload=injectNext;script.hasOwnProperty("url")?(timeoutId=window.setTimeout(injectNext,12e4),elem.src=script.url):(injectNextFnName="_injectNextScript_"+index,mtps[injectNextFnName]=injectNext,timeoutId=window.setTimeout(injectNext,2e3),elem.text="try {\n"+script.txt+"\n} finally { MTPS."+injectNextFnName+" && MTPS."+injectNextFnName+"(); }");parent.appendChild(elem)}var mtps=window.MTPS||(window.MTPS={}),parent=document.getElementsByTagName("head")[0];mtps.injectScripts=function(scripts){inject(preload(scripts),0)}})(window,document);
  15677. MTPS.injectScripts([
  15678. { txt: "/**/\r\n(window.MTPS || (window.MTPS = {})).cdnDomains || (window.MTPS.cdnDomains = { \r\n\t\"image\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"js\": \"https://i2-msdn.sec.s-msft.com\", \r\n\t\"css\": \"https://i-msdn.sec.s-msft.com\", \r\n\t\"ttf\": \"https://i-msdn.sec.s-msft.com\"\r\n});\r\n/**/" },
  15679. { txt: "//\n var literalNormalizedUrl = \u0027/en-us/library/ff554887(d=printer,l=en-us,v=vs.85).aspx\u0027;\n var wt_nvr_ru = \u0027WT_NVR_RU\u0027;\n var wt_fpcdom = \u0027.microsoft.com\u0027;\n var wt_domlist = \u0027msdn.microsoft.com\u0027;\n var wt_pathlist = \u0027\u0027;\n var wt_paramlist = \u0027DCSext.mtps_devcenter\u0027;\n var wt_siteid = \u0027MSDN\u0027;\n var gDomain = \u0027m.webtrends.com\u0027;\n var gDcsId = \u0027dcsmgru7m99k7mqmgrhudo0k8_8c6m\u0027;\n var gFpc = \u0027WT_FPC\u0027;\n\n\n\n if (document.cookie.indexOf(gFpc + \"=\") == -1) {\n var wtidJs = document.createElement(\"script\");\n wtidJs.src = \"//\" + gDomain + \"/\" + gDcsId + \"/wtid.js\";\n document.getElementsByTagName(\"head\")[0].appendChild(wtidJs);\n }\n\n\n\n var detectedLocale = \u0027en-us\u0027;\n var wtsp = \u0027msdnlib_w32_com\u0027;\n var gTrackEvents = \u00270\u0027;\n/**/" },
  15680. { txt: "//\n\n window.appInsightsId = \u00275eb1b2eb-c47a-497a-a7ac-a1c230b2882f\u0027;\n //" },
  15681. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:Utilities,1:Layout,2:Header,1:Rating,2:Footer,0:Topic,3:PabTopic,4:webtrendsscript,0:AppInsightsPerf,0:ABTestControl,5:WEDCS,3:CmpgrpForHeader,0:livefyre,0:Comment,1:SearchBox;/Areas/Epx/Content/Scripts:0,/Areas/Epx/Themes/Base/Content:1,/Areas/Centers/Themes/StandardDevCenter/Content:2,/Areas/Library/Content:3,/Areas/Global/Content/Webtrends/resources:4,/Areas/Library/Themes/Base/Content:5\u0026amp;hashKey=30CEE944AABFEA2C5A338BDB9E000732\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  15682. { url: "https://i1.services.social.microsoft.com/search/Widgets/SearchBox.jss?boxid=HeaderSearchTextBox\u0026btnid=HeaderSearchButton\u0026pgArea=header\u0026brand=Msdn\u0026loc=en-us\u0026focusOnInit=false\u0026emptyWatermark=true\u0026searchButtonTooltip=Search MSDN" },
  15683. { url: "https://i2-msdn.sec.s-msft.com/Combined.js?resources=0:PrintExportButton,1:Toc_Fixed,1:CodeSnippet,1:TopicNotInScope,1:CollapsibleArea,1:VersionSelector,1:SurveyBroker;/Areas/Library/Themes/Base/Content:0,/Areas/Epx/Content/Scripts:1\u0026amp;hashKey=80F30894E3FB8A3295C923AEC7019CFE\u0026amp;v=AE608271C0243AAA0449D3BC0FAD8EB4" },
  15684. { txt: "$(document).ready(function() {\n try {\n var token = $(\"#globalRequestVerification input[name=\u0027__RequestVerificationToken\u0027]\").clone();\n $(\"#siteFeedbackForm\").append(token);\n } catch(err) {\n \n }\n });" }
  15685. ]);
  15686. /*]]>*/
  15687. </script>
  15688. </body></html>